版本比较
比赛题解
正文
增加 16 行删除 16 行
32 行未改动33343536373738394041182 行未改动全部展开2242252262272282292282292302312322335 行未改动239240241242243243244245246247241 行未改动全部展开4894904914924934944934944954964974984995005015025035035045055065077 行未改动51551651751851951952052152252337 行未改动56156256356456556556656756856956957057157257354 行未改动628629630631632632633634635636179 行未改动全部展开816817818819820820821822823824123 行未改动全部展开948949950951952952953954955956202 行未改动全部展开115911601161116211631163116411651166116766 行未改动123412351236123712381238123912401241124249 行未改动129212931294129512961296129712981299130010 行未改动32 行未改动{ ll result = 1; for (short i=0;i<n2;++i) result*=n1; return result; return result;}char isSelf_Power(ll n,short w){ ll m=n,sum=0;182 行未改动全部展开using namespace std;#define int long long#define ios ios::sync_with_stdio(false),cin.tie(0),cout.tie(0)// #define MAXN 1000010const double eps=1e-6; //随机数生成 const double eps=1e-6;//随机数生成std::mt19937 rng(std::chrono::steady_clock::now().time_since_epoch().count());int rand(int l, int r) { std::uniform_int_distribution<int> distribution(l, r); return distribution(rng);5 行未改动 if(b&1)ans=ans*a; a=a*a; b>>=1; } return ans; return ans;}// string q[MAXN];struct node{ int x;241 行未改动全部展开using namespace std;#define int long long#define ios ios::sync_with_stdio(false),cin.tie(0),cout.tie(0) #define MAXN 1000010const double eps=1e-6; //随机数生成 const double eps=1e-6;//随机数生成int primes[MAXN],cnt;bool st[MAXN];void gprimes(int n){ for(int i=2;i<=n;i++){ if(!st[i])primes[cnt++]=i; for(int j=0;primes[j]*i<=n;j++){ st[i*primes[j]]=1; if(i%primes[j]==0)break; } } }}std::mt19937 rng(std::chrono::steady_clock::now().time_since_epoch().count());int rand(int l, int r) {7 行未改动 if(b&1)ans=ans*a; a=a*a; b>>=1; } return ans; return ans;}unordered_map<int,int> mp;int f[MAXN];vector<__int128> v;37 行未改动 bool flag=0; int cn=0; for(int i=0;i<v.size();i++) if(l<=v[i]&&v[i]<=r){ cn++; cn++; if(flag)cout<<","; flag=1; print(v[i]); } } if(cn)cout<<"。"; else cout<<"NO";}
54 行未改动int main(){ int count,a,b; cin>>a>>b; isComposite[1]=1; isComposite[1]=1; for(int i=3;i*i<=b;i+=2) { while(!isComposite[i]) {179 行未改动全部展开 if(1ll*pri[j]*pri[j]<=i)g[i][j]=g[i][j-1]-g[i/pri[j]][j-1]+pi[pri[j-1]]; else g[i][j]=g[i][j-1]; } } ans=getpi(r)-getpi(l-1); ans=getpi(r)-getpi(l-1); } if(ans==0) cout<<"NO"; else cout<<ans; return 0;123 行未改动全部展开 { if(b&1) ans=ans*a%p; a=a*a%p; b>>=1; b>>=1; } return ans;}inline __int128 power(__int128 a,__int128 b,__int128 c)202 行未改动全部展开 for (int line = 1; line <= 12; line++) { string s; getline(cin, s); s = s.substr(0, s.size() - 2); // remove "=?"
if (line <= 6) { // 前6个操作使用有符号版本 __int128 result = 0; if (line == 1) { // addition int pos = 0;66 行未改动 } } } }
string output = int_to_string(result); if (line < 12) { cout << output << "," << endl; } else {49 行未改动 pos += 2; // skip '>>' unsigned __int128 b = parse_unsigned_number(s, pos); result = a >> b; }
string output = uint_to_string(result); if (line < 12) { cout << output << "," << endl; } else {10 行未改动