QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#590437#6607. Rise of ShadowsYurilyWA 0ms3544kbC++14379b2024-09-26 00:07:172024-09-26 00:07:17

Judging History

你现在查看的是最新测评结果

  • [2024-09-26 00:07:17]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3544kb
  • [2024-09-26 00:07:17]
  • 提交

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'