QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#590437 | #6607. Rise of Shadows | Yurily | WA | 0ms | 3544kb | C++14 | 379b | 2024-09-26 00:07:17 | 2024-09-26 00:07:17 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
long long H,M,A;
long long get_gcd(long long x,long long y){
long long c=x%y;
while(c){
x=y;
y=c;
c=x%y;
}
return y;
}
int main(){
cin>>H>>M>>A;//cout<<(long long)628383665*981360590/2<<endl;
long long G=get_gcd(H*M,H-1);
long long ans=G*(2*A/G+1);
ans-=max((long long)0,(H*M-A)/G-A/G+1);
cout<<ans;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer
time: 0ms
memory: 3544kb
input:
5 5 4
output:
-9
result:
wrong answer 1st numbers differ - expected: '9', found: '-9'