QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#590441#6607. Rise of ShadowsYurilyWA 0ms3672kbC++14379b2024-09-26 00:08:202024-09-26 00:08:20

Judging History

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

  • [2024-09-26 00:08:20]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3672kb
  • [2024-09-26 00:08:20]
  • 提交

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,A/G-(H*M-A)/G+1);
	cout<<ans;
}

详细

Test #1:

score: 100
Accepted
time: 0ms
memory: 3664kb

input:

5 5 4

output:

9

result:

ok 1 number(s): "9"

Test #2:

score: 0
Accepted
time: 0ms
memory: 3672kb

input:

3 5 1

output:

3

result:

ok 1 number(s): "3"

Test #3:

score: 0
Accepted
time: 0ms
memory: 3560kb

input:

5 5 0

output:

1

result:

ok 1 number(s): "1"

Test #4:

score: 0
Accepted
time: 0ms
memory: 3560kb

input:

5 5 1

output:

3

result:

ok 1 number(s): "3"

Test #5:

score: 0
Accepted
time: 0ms
memory: 3508kb

input:

5 5 2

output:

5

result:

ok 1 number(s): "5"

Test #6:

score: 0
Accepted
time: 0ms
memory: 3576kb

input:

5 5 3

output:

7

result:

ok 1 number(s): "7"

Test #7:

score: 0
Accepted
time: 0ms
memory: 3548kb

input:

5 5 5

output:

11

result:

ok 1 number(s): "11"

Test #8:

score: 0
Accepted
time: 0ms
memory: 3660kb

input:

5 5 6

output:

13

result:

ok 1 number(s): "13"

Test #9:

score: 0
Accepted
time: 0ms
memory: 3620kb

input:

5 5 7

output:

15

result:

ok 1 number(s): "15"

Test #10:

score: 0
Accepted
time: 0ms
memory: 3548kb

input:

5 5 8

output:

17

result:

ok 1 number(s): "17"

Test #11:

score: 0
Accepted
time: 0ms
memory: 3620kb

input:

5 5 9

output:

19

result:

ok 1 number(s): "19"

Test #12:

score: 0
Accepted
time: 0ms
memory: 3672kb

input:

5 5 10

output:

21

result:

ok 1 number(s): "21"

Test #13:

score: 0
Accepted
time: 0ms
memory: 3532kb

input:

5 5 11

output:

23

result:

ok 1 number(s): "23"

Test #14:

score: -100
Wrong Answer
time: 0ms
memory: 3576kb

input:

628383665 981360590 38277030565242771

output:

76554061130485544

result:

wrong answer 1st numbers differ - expected: '76554061130485542', found: '76554061130485544'