用户输出
4
系统信息
Exited with return code 0
编号 | 题目 | 状态 | 分数 | 总时间 | 内存 | 代码 / 答案文件 | 提交者 | 提交时间 |
---|---|---|---|---|---|---|---|---|
#24125 | #1070. 脸盲的zzy和jwp | Wrong Answer | 33 | 32 ms | 380 K | C++ / 668 B | iNx | 2020-03-29 21:40:45 |
#include <iostream>
#include <cstdio>
namespace iNx {
int x, y;
int ex_gcd(int a, int b) {
if (b == 0) {
x = 1;
y = 0;
return a;
}
int p, q, res;
res = ex_gcd(b, a % b);
p = y;
q = x - (a / b) * y;
x = p;
y = q;
return res;
}
void work() {
int A, B, X, Y, L;
scanf("%d%d%d%d%d", &X, &A, &Y, &B, &L);
int a = ((A - B) % L + L) % L;
int b = ((Y - X) % L + L) % L;
A = ex_gcd(a, L);
if (b % A) {
printf("-1\n");
return;
}
printf("%d\n", b / A * x);
}
} // namespace iNx
int main() {
iNx::work();
return 0;
}
用户输出
54591217
Special Judge 信息
Files user_out and answer differ
系统信息
Exited with return code 0
用户输出
-1784617717
Special Judge 信息
Files user_out and answer differ
系统信息
Exited with return code 0
用户输出
851018864
Special Judge 信息
Files user_out and answer differ
系统信息
Exited with return code 0
用户输出
1296456546
Special Judge 信息
Files user_out and answer differ
系统信息
Exited with return code 0
用户输出
883214444
Special Judge 信息
Files user_out and answer differ
系统信息
Exited with return code 0
用户输出
-1822224010
Special Judge 信息
Files user_out and answer differ
系统信息
Exited with return code 0
用户输出
519244062
Special Judge 信息
Files user_out and answer differ
系统信息
Exited with return code 0
用户输出
-285995580
Special Judge 信息
Files user_out and answer differ
系统信息
Exited with return code 0
用户输出
-1
系统信息
Exited with return code 0
用户输出
-1
系统信息
Exited with return code 0