版本比较
浅谈 Baka's Trick
正文
增加 11 行删除 11 行
211 行未改动全部展开21221321421521621621721821922069 行未改动29029129229329429529429529629729829922 行未改动32232332432532632632732832933012 行未改动34334434534634734734834935035135235335435535635735735835936036176 行未改动43843944044144244244344444544635 行未改动482483484485486487486487488489490491492493493494495495496497498499143 行未改动全部展开211 行未改动全部展开 } for(int i = 1; i <= tp2; i++) { g[++cnt].w = stk2[i].w; g[cnt].v = stk2[i].v; g[cnt].v = stk2[i].v; } stk1.clear(); stk2.clear(); stk1.push_back(initb);69 行未改动 tp1--; stk1.pop_back(); continue; } tp2--; stk2.pop_back(); tp2--; stk2.pop_back(); } else { cin >> x >> y;22 行未改动typedef unsigned long long ull;typedef long double ldb;using pi = pair<int, int>;class Crypto {public: public: Crypto() { sm = cnt = 0; seed(); }12 行未改动 cnt++; sm = ((sm * B % MD + z) % MD + MD) % MD; seed(); }private: private: long long sm; int cnt;
uint8_t data[256]; int I, J;
void swap_data(int i, int j) { uint8_t tmp = data[i]; data[i] = data[j]; data[j] = tmp; data[j] = tmp; }
void seed() { uint8_t key[8];76 行未改动 } for(int i = 1; i <= tp2; i++) { g[++cnt].w = stk2[i].w; g[cnt].v = stk2[i].v; g[cnt].v = stk2[i].v; } stk1.clear(); stk2.clear(); stk1.push_back(initb);35 行未改动 op = rndc.decode(op); x = rndc.decode(x); y = rndc.decode(y); xx = rndc.decode(xx); yy = rndc.decode(yy); ll ans = -1; yy = rndc.decode(yy); ll ans = -1; if(op == 1) { x %= m; Backpack tmp = update(stk2[tp2], x, y); tp2++; stk2.push_back(tmp); stk2.push_back(tmp); ans = combine(stk1[tp1], stk2[tp2], xx, yy); } } else if(op == 2) { if(tp1 == 0) rebuild(); if(tp1 == 0)143 行未改动全部展开