QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#676893 | #4867. So Easy! | hasan_mahin | WA | 2ms | 3716kb | C++20 | 494b | 2024-10-26 02:45:55 | 2024-10-26 02:45:56 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
#define int long long
int a , b , n , m;
int power(int p , int p1)
{
int ans = 1;
while(p1 > 0)
{
if(p1 & 1)
{
ans = (1LL * ans * p) % m;
}
p = (1LL * p * p) % m;
p1 >>= 1;
}
return ans;
}
int32_t main()
{
ios_base::sync_with_stdio(0);
cin.tie(0);
while(cin >> a >> b >> n >> m)
{
int o = ceil(a + sqrt(b));
int ans = power(o , n) % m;
cout << ans << '\n';
}
}
详细
Test #1:
score: 0
Wrong Answer
time: 2ms
memory: 3716kb
input:
2 3 1 2012 2 3 2 2012 2 2 1 2012 31603 998691525 860250282 20381 4062 16491843 2741468 17921 26061 679145378 8235021 22991 16225 263237214 865378598 7182 18902 357253267 137732528 3407 25414 645847050 674769818 7114 6903 47648125 254957745 1556 16577 274779382 158233677 1099 939 880815 990631973 610...
output:
4 16 4 4377 5584 9749 3616 1870 4446 972 946 4038 256 1144 3711 5331 20848 5776 14126 652 5985 2256 4495 17648 27652 739 9038 526 7471 5502 315 5320 24894 4986 2149 2409 67 5972 384 9452 1886 8310 4247 5624 1750 13936 582 26216 2272 0 11004 512 3653 5994 3960 8724 3688 21380 3716 9648 3304 9728 9142...
result:
wrong answer 2nd lines differ - expected: '14', found: '16'