QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#795805 | #4867. So Easy! | JEdward | TL | 0ms | 0kb | C++20 | 1.7kb | 2024-12-01 01:17:48 | 2024-12-01 01:17:48 |
answer
#include <bits/stdc++.h>
#define IOS ios::sync_with_stdio(0), cin.tie(0)
#define int long long
#define endl '\n'
#define lowbit(x) (x & -x)
#define all(s) s.begin(), s.end()
#define pii pair<int,int>
#define ls(x) (x<<1)
#define rs(x) (x<<1|1)
#define here system("pause")
using namespace std;
template <class T>
inline void read(T &x){
x = 0;
char c = getchar();
bool f = 0;
for (; !isdigit(c); c = getchar()) f ^= (c == '-');
for (; isdigit(c); c = getchar()) x = (x << 3) + (x << 1) + (c ^ 48);
x = f ? -x : x;
}
template <class T>
inline void write(T x){
if (x < 0) putchar('-'), x = -x;
if (x < 10) putchar(x + 48);
else write(x / 10), putchar(x % 10 + 48);
}
template<typename T> void chkmin(T& lhs, const T& rhs) { lhs = lhs > rhs ? rhs : lhs; }
template<typename T> void chkmax(T& lhs, const T& rhs) { lhs = lhs < rhs ? rhs : lhs; }
const int N = 2e5 + 5;
const int mod = 998244353;
const int INF = 8e18 + 9;
const double eps = 1e-9;
const double Pi = acos(-1);
inline int pow(int a, int b, int p){ int res = 1%p; while(b){ if(b&1) res=res*a%p; a=a*a%p, b>>=1;} return res;}
inline int inv(int a, int p){ return pow(a,p-2,p)%p;}
mt19937 rnd(chrono::duration_cast<chrono::nanoseconds>(chrono::system_clock::now().time_since_epoch()).count());
int randint(int L, int R) {
uniform_int_distribution<int> dist(L, R);
return dist(rnd);
}
int a, b, c, d;
void sol(){
while(cin >> a >> b >> c >> d){
long double t = sqrt(b) + (long double)1.0 * a;
t = pow(t, c);
int tmp = t;
while(tmp < t){
tmp++;
}
cout << tmp % d << endl;
}
}
signed main(){
IOS;
int tc = 1;
// cin >> tc;
while(tc--){
sol();
}
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Time Limit Exceeded
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...