用户输出
-1
Special Judge 信息
Files user_out and answer differ
系统信息
Exited with return code 0
编号 | 题目 | 状态 | 分数 | 总时间 | 内存 | 代码 / 答案文件 | 提交者 | 提交时间 |
---|---|---|---|---|---|---|---|---|
#20921 | #1070. 脸盲的zzy和jwp | Wrong Answer | 33 | 36 ms | 356 K | C++ 17 / 480 B | Diorvh | 2019-08-20 10:57:14 |
#include <bits/stdc++.h>
using namespace std;
#define ll long long
const int N = 100000 + 10;
ll exgcd(ll a, ll b, ll &x, ll &y) {
if (b == 0) {
x = 1, y = 0;
return a;
}
ll ret = exgcd(b, a % b, y, x);
y -= (a / b) * x;
return ret;
}
int main() {
ll x, a, y, b, l;
scanf("%lld%lld%lld%lld%lld", &x, &a, &y, &b, &l);
ll t, c;
ll g = exgcd(a - b, l, t, c);
if ((y - x) % g)
printf("-1\n");
else
printf("%lld\n", (y - x) / g * t % l);
return 0;
}
用户输出
-1
Special Judge 信息
Files user_out and answer differ
系统信息
Exited with return code 0
用户输出
-169536169
Special Judge 信息
Files user_out and answer differ
系统信息
Exited with return code 0
用户输出
91595156
系统信息
Exited with return code 0
用户输出
-19645563
Special Judge 信息
Files user_out and answer differ
系统信息
Exited with return code 0
用户输出
-6424680
Special Judge 信息
Files user_out and answer differ
系统信息
Exited with return code 0
用户输出
-63269813
Special Judge 信息
Files user_out and answer differ
系统信息
Exited with return code 0
用户输出
-64052885
Special Judge 信息
Files user_out and answer differ
系统信息
Exited with return code 0
用户输出
-61841504
Special Judge 信息
Files user_out and answer differ
系统信息
Exited with return code 0
用户输出
-110843317
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