ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#207835 | #3755. 六 | kevin777 | 100 | 14ms | 1200kb | C++ | 298b | 2024-08-01 08:43:21 | 2024-08-01 12:01:56 |
answer
#include<bits/stdc++.h>
#pragma GCC optimize(2)
using namespace std;
int main(){
int n;
long long cnt = 0;
cin>>n;
if(n % 5==0||n%4==0){
cout<<-1;
return 0;
}
int num = 6;
while(num%n != 0){
cnt++;
num%=n;
num*=10;
num+=6;
}
cnt++;
cout<<cnt;
return 0;
}
Details
小提示:点击横条可展开更详细的信息
Test #1:
score: 10
Accepted
time: 0ms
memory: 1196kb
input:
97
output:
96
result:
ok single line: '96'
Test #2:
score: 10
Accepted
time: 0ms
memory: 1200kb
input:
35
output:
-1
result:
ok single line: '-1'
Test #3:
score: 10
Accepted
time: 0ms
memory: 1196kb
input:
877
output:
438
result:
ok single line: '438'
Test #4:
score: 10
Accepted
time: 0ms
memory: 1196kb
input:
3447
output:
1146
result:
ok single line: '1146'
Test #5:
score: 10
Accepted
time: 0ms
memory: 1196kb
input:
4889
output:
2444
result:
ok single line: '2444'
Test #6:
score: 10
Accepted
time: 0ms
memory: 1192kb
input:
999999
output:
18
result:
ok single line: '18'
Test #7:
score: 10
Accepted
time: 0ms
memory: 1196kb
input:
982374
output:
81864
result:
ok single line: '81864'
Test #8:
score: 10
Accepted
time: 11ms
memory: 1192kb
input:
981221
output:
981220
result:
ok single line: '981220'
Test #9:
score: 10
Accepted
time: 0ms
memory: 1196kb
input:
732873
output:
81430
result:
ok single line: '81430'
Test #10:
score: 10
Accepted
time: 3ms
memory: 1196kb
input:
993821
output:
198764
result:
ok single line: '198764'
Extra Test:
score: 0
Extra Test Passed