代码1:来自JS-J00001的expr.cpp:
#include <bits/stdc++.h>
using namespace std;
int main()
{
freopen("expr.in","r",stdin);
freopen("expr.out","w",stdout);
cout << 1 << endl << 43 << " " << 21;
return 0;
}
摆烂了
代码2:仍然来自JS-J00001,pow.cpp:
#include <bits/stdc++.h>
using namespace std;
typedef unsigned long long ull;
ull a,b,ans;
bool flag = false;
inline ull qpow(ull x,ull y)
{
ull base = x,ans = 1;
while (y)
{
if (y & 1)
ans *= base;
base *= base, y >>= 1;
if (ans > (ull)1e9)
{
flag = true;
return 0;
}
}
return ans;
}
我看不懂但我很震撼
代码3:来自JS-J00002,pow.cpp:
for(int i=1;i<=b;i++){
res*=a;
if(res>N||res<0){
flag=false;
break;
}
}