用户输出
4
系统信息
Exited with return code 0
编号 | 题目 | 状态 | 分数 | 总时间 | 内存 | 代码 / 答案文件 | 提交者 | 提交时间 |
---|---|---|---|---|---|---|---|---|
#10518 | #1070. 脸盲的zzy和jwp | Wrong Answer | 50 | 54 ms | 348 K | C++ 11 / 536 B | Akatsuki | 2019-07-04 13:21:18 |
#include <iostream>
using namespace std;
long long exgcd(long long a, long long b, long long &x, long long &y) {
if (b == 0) {
x = 1;
y = 0;
return a;
}
long long r = exgcd(b, a % b, x, y);
long long t = x;
x = y;
y = t - a / b * x;
return r;
}
int main() {
long long a, b, x, y, l, x1, y1, g;
cin >> x1 >> a >> y1 >> b >> l;
g = exgcd(b - a, l, x, y); //公约数
if ((x1 - y1) % g != 0)
cout << -1 << endl;
else {
x = (x * (x1 - y1) / g + l / g) % (l / g);
if (x < 0)
x = x - l / g;
cout << x << endl;
}
return 0;
}
用户输出
-514183924
Special Judge 信息
Files user_out and answer differ
系统信息
Exited with return code 0
用户输出
91595156
系统信息
Exited with return code 0
用户输出
-45877924
Special Judge 信息
Files user_out and answer differ
系统信息
Exited with return code 0
用户输出
83740797
系统信息
Exited with return code 0
用户输出
-242583288
Special Judge 信息
Files user_out and answer differ
系统信息
Exited with return code 0
用户输出
-170869702
Special Judge 信息
Files user_out and answer differ
系统信息
Exited with return code 0
用户输出
-569634177
Special Judge 信息
Files user_out and answer differ
系统信息
Exited with return code 0
用户输出
-391278474
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