QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#166921 | #6607. Rise of Shadows | LFCode# | WA | 0ms | 1884kb | C++14 | 398b | 2023-09-06 20:58:09 | 2023-09-06 20:58:09 |
Judging History
answer
#include<cstdio>
#define int long long
int H,M,A;
int gcd(int a,int b){return b==0?a:gcd(b,a%b);}
int read(){
char ch=getchar();int nn=0,ssss=1;
while(ch<'0'||ch>'9'){if(ch=='-')ssss*=-1;ch=getchar();}
while(ch>='0'&&ch<='9'){nn=nn*10+(ch-'0');ch=getchar();}
return nn*ssss;
}
signed main(){
int H=read();int M=read();int A=read();
printf("%lld",A/gcd(H*M,H-1)*2+gcd(H*M,H-1));
}
詳細信息
Test #1:
score: 100
Accepted
time: 0ms
memory: 1512kb
input:
5 5 4
output:
9
result:
ok 1 number(s): "9"
Test #2:
score: 0
Accepted
time: 0ms
memory: 1884kb
input:
3 5 1
output:
3
result:
ok 1 number(s): "3"
Test #3:
score: 0
Accepted
time: 0ms
memory: 1560kb
input:
5 5 0
output:
1
result:
ok 1 number(s): "1"
Test #4:
score: 0
Accepted
time: 0ms
memory: 1592kb
input:
5 5 1
output:
3
result:
ok 1 number(s): "3"
Test #5:
score: 0
Accepted
time: 0ms
memory: 1520kb
input:
5 5 2
output:
5
result:
ok 1 number(s): "5"
Test #6:
score: 0
Accepted
time: 0ms
memory: 1556kb
input:
5 5 3
output:
7
result:
ok 1 number(s): "7"
Test #7:
score: 0
Accepted
time: 0ms
memory: 1556kb
input:
5 5 5
output:
11
result:
ok 1 number(s): "11"
Test #8:
score: 0
Accepted
time: 0ms
memory: 1880kb
input:
5 5 6
output:
13
result:
ok 1 number(s): "13"
Test #9:
score: 0
Accepted
time: 0ms
memory: 1756kb
input:
5 5 7
output:
15
result:
ok 1 number(s): "15"
Test #10:
score: 0
Accepted
time: 0ms
memory: 1748kb
input:
5 5 8
output:
17
result:
ok 1 number(s): "17"
Test #11:
score: 0
Accepted
time: 0ms
memory: 1756kb
input:
5 5 9
output:
19
result:
ok 1 number(s): "19"
Test #12:
score: 0
Accepted
time: 0ms
memory: 1724kb
input:
5 5 10
output:
21
result:
ok 1 number(s): "21"
Test #13:
score: 0
Accepted
time: 0ms
memory: 1884kb
input:
5 5 11
output:
23
result:
ok 1 number(s): "23"
Test #14:
score: -100
Wrong Answer
time: 0ms
memory: 1756kb
input:
628383665 981360590 38277030565242771
output:
38277030565242772
result:
wrong answer 1st numbers differ - expected: '76554061130485542', found: '38277030565242772'