- 同余方程
- 2016-09-12 19:53:19 @
评测结果
编译成功
测试数据 #0: Accepted, time = 0 ms, mem = 504 KiB, score = 10
测试数据 #1: Accepted, time = 0 ms, mem = 508 KiB, score = 10
测试数据 #2: Accepted, time = 15 ms, mem = 508 KiB, score = 10
测试数据 #3: Accepted, time = 0 ms, mem = 508 KiB, score = 10
测试数据 #4: Accepted, time = 281 ms, mem = 508 KiB, score = 10
测试数据 #5: Accepted, time = 93 ms, mem = 508 KiB, score = 10
测试数据 #6: TimeLimitExceeded, time = 1031 ms, mem = 496 KiB, score = 0
测试数据 #7: TimeLimitExceeded, time = 1015 ms, mem = 500 KiB, score = 0
测试数据 #8: TimeLimitExceeded, time = 1203 ms, mem = 500 KiB, score = 0
测试数据 #9: Accepted, time = 890 ms, mem = 508 KiB, score = 10
TimeLimitExceeded, time = 4528 ms, mem = 508 KiB, score = 70
代码
#include <cstdio>
int main() {
long long a,b;
scanf("%I64d%I64d",&a,&b);
for (long long x = 1;;x++)
if (a*x%b == 1) {
printf("%I64d",x);
return 0;
}
}
1 条评论
-
唐复之 LV 8 @ 2016-09-15 08:27:32
爆搜大法好
- 1