#include <bits/stdc++.h>
#define MP make_pair
#define PB push_back
#define st first
#define nd second
#define rd third
#define FOR(i, a, b) for(int i =(a); i <=(b); ++i)
#define RE(i, n) FOR(i, 1, n)
#define FORD(i, a, b) for(int i = (a); i >= (b); --i)
#define REP(i, n) for(int i = 0;i <(n); ++i)
#define VAR(v, i) __typeof(i) v=(i)
#define FORE(i, c) for(VAR(i, (c).begin()); i != (c).end(); ++i)
#define ALL(x) (x).begin(), (x).end()
#define SZ(x) ((int)(x).size())
#define __builtin_ctz __builtin_ctzll
#define __builtin_clz __builtin_clzll
#define __builtin_popcount __builtin_popcountll
using namespace std;
#ifdef LOCAL
#define debug(...) _dbg(#__VA_ARGS__, __VA_ARGS__)
#define debugv(x) {{cerr <<#x <<" = "; FORE(itt, (x)) cerr <<*itt <<", "; cerr <<"\n"; }}
#else
#define debug(...) (__VA_ARGS__)
#define debugv(x)
#define cerr if(0)cout
#endif
#define next ____next
#define prev ____prev
#define left ____left
#define hash ____hash
typedef long long ll;
typedef long double LD;
typedef pair<int, int> PII;
typedef pair<ll, ll> PLL;
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<ll> VLL;
typedef vector<pair<int, int> > VPII;
typedef vector<pair<ll, ll> > VPLL;
template<class T> ostream& operator<<(ostream& out, vector<T> vec);
template<class T> ostream& operator<<(ostream& out, set<T> vec);
template<class L, class R> ostream& operator<<(ostream& out, map<L, R> vec);
template<class C> void mini(C&a4, C b4){a4=min(a4, b4); }
template<class C> void maxi(C&a4, C b4){a4=max(a4, b4); }
template<class T1, class T2>
ostream& operator<< (ostream &out, pair<T1, T2> pair) { return out << "(" << pair.first << ", " << pair.second << ")";}
template<class A, class B, class C> struct Triple { A first; B second; C third;
bool operator<(const Triple& t) const { if (st != t.st) return st < t.st; if (nd != t.nd) return nd < t.nd; return rd < t.rd; } };
template<class T> void ResizeVec(T&, vector<int>) {}
template<class T> void ResizeVec(vector<T>& vec, vector<int> sz) {
vec.resize(sz[0]); sz.erase(sz.begin()); if (sz.empty()) { return; }
for (T& v : vec) { ResizeVec(v, sz); }
}
typedef Triple<int, int, int> TIII;
template<class A, class B, class C>
ostream& operator<< (ostream &out, Triple<A, B, C> t) { return out << "(" << t.st << ", " << t.nd << ", " << t.rd << ")"; }
template<class T> ostream& operator<<(ostream& out, vector<T> vec) { out<<"("; for (auto& v: vec) out<<v<<", "; return out<<")"; }
template<class T> ostream& operator<<(ostream& out, set<T> vec) { out<<"("; for (auto& v: vec) out<<v<<", "; return out<<")"; }
template<class L, class R> ostream& operator<<(ostream& out, map<L, R> vec) { out<<"("; for (auto& v: vec) out<<v<<", "; return out<<")"; }
ostream& operator<<(ostream& out, __int128_t x) {
if (x < 0) { out<<"-"; x = -x; }
if (x == 0) { return out<<"0"; }
VI digs;
while (x) {
digs.PB(x % 10);
x /= 10;
}
reverse(ALL(digs));
for (auto d : digs) { out<<d; }
return out;
}
template<typename TH> void _dbg(const char* sdbg, TH h) { cerr<<sdbg<<"="<<h<<"\n"; }
template<typename TH, typename... TA> void _dbg(const char* sdbg, TH h, TA... t) {
while(*sdbg != ',') { cerr<<*sdbg++; } cerr<<"="<<h<<","; _dbg(sdbg+1, t...);
}
const int N = 1e7 + 5;
#ifdef BRUT
const int T = 1;
#else
const int T = 220;
#endif
int sito[N];
int nxt[N];
void InitSieve(int n) {
FOR (i, 2, n) {
if (sito[i] == 0) {
for (int j = 1; i * j <= n; j++) {
sito[i * j] = i;
if (j % i == 0) {
nxt[i * j] = nxt[j];
} else {
nxt[i * j] = j;
}
}
}
}
};
int cur[N];
int small_cnts[T + 5][T + 5];
int group_by_small_cnt[N];
VI S;
int where_on_S[N];
// int last_checked[N];
// const int kToCheck = 50;
// int last_vis[N];
// int by_large[N];
// int last_included[N];
// VI good_remainders[N];
// int last_vis_rems[N];
LD Timestamp() {
#ifdef LOCAL
return 1. * clock() / CLOCKS_PER_SEC;
#else
return 0;
#endif
}
const int kSmallSCutoff = 100;
VPII large_cands;
VI large_cnts;
int mam_spokoj;
int praca_small_preproc;
int cnt_parki;
void SmallPreproc() {
REP (i, SZ(S)) {
FORD (j, i - 1, 0) {
if (j / 3 != i / 3) { break; }
int diff = abs(S[i] - S[j]);
while (sito[diff] > T) {
int p = sito[diff];
int r = S[i] % p;
int was = 0;
for (auto cand : large_cands) {
if (cand.st == p && cand.nd == r) {
was = 1;
break;
}
}
if (!was) {
praca_small_preproc += SZ(S);
int cnt = 0;
for (auto x : S) {
if (x % p == r) {
cnt++;
}
}
if (cnt * 3 >= SZ(S)) {
large_cands.PB({p, r});
large_cnts.PB(cnt);
}
}
diff = nxt[diff];
}
}
}
}
const int kTrials = 320;
const int kMinSignificant = 10;
VI remainders_cands[N];
VI remainders_cnts[N];
int last_checked[N];
int obrot;
void LargePreproc() {
VPII parki;
REP (trial, kTrials) {
int i = rand() % SZ(S);
int j = i;
while (j == i) {
j = rand() % SZ(S);
}
int diff = abs(S[i] - S[j]);
while (sito[diff] > T) {
int p = sito[diff];
int r = S[i] % p;
parki.PB({p, r});
diff = nxt[diff];
}
}
obrot++;
for (auto [p, r] : parki) {
int ind = -1;
REP (i, SZ(remainders_cands[p])) {
if (remainders_cands[p][i] == r) {
ind = i;
break;
}
}
if (ind == -1) {
remainders_cands[p].PB(r);
remainders_cnts[p].PB(1);
} else {
remainders_cnts[p][ind]++;
}
}
for (auto [p, _] : parki) {
if (last_checked[p] == obrot) { continue; }
last_checked[p] = obrot;
REP (i, SZ(remainders_cands[p])) {
int r = remainders_cands[p][i];
if (remainders_cnts[p][i] >= kMinSignificant) {
int cnt = 0;
for (auto x : S) {
if (x % p == r) {
cnt++;
}
}
if (3 * cnt >= SZ(S)) {
large_cands.PB({p, r});
large_cnts.PB(cnt);
}
}
}
remainders_cands[p].clear();
remainders_cnts[p].clear();
}
}
inline int FastRead() {
int x = 0;
int c = getchar_unlocked();
while (c >= '0' && c <= '9') {
x = 10 * x + (c - '0');
c = getchar_unlocked();
}
return x;
}
char s[10];
inline void FastWrite(int x) {
if (x == 0) {
putchar_unlocked('0');
return;
}
int ind = 0;
while (x) {
s[ind] = '0' + x % 10;
ind++;
x /= 10;
}
FORD (i, ind - 1, 0) {
putchar_unlocked(s[i]);
}
}
int32_t main() {
ios_base::sync_with_stdio(0);
cout << fixed << setprecision(10);
cerr << fixed << setprecision(10);
cin.tie(0);
//double beg_clock = 1.0 * clock() / CLOCKS_PER_SEC;
int max_small = 0;
int n = FastRead();
int q = FastRead();
InitSieve(n);
VI small_primes;
FOR (p, 2, T) {
if (sito[p] == p) {
small_primes.PB(p);
}
}
debug(SZ(small_primes));
RE (i, n) {
where_on_S[i] = -1;
}
//set<PII> large_cands_set;
int obrot = 0;
LD small_tm = 0, between_tm = 0, preproc_tm = 0;
int cnt_inner = 0;
int cnt_very_inner = 0;
int cnt_los = 0;
RE (i, q) {
//int x = 1 + rand() % n;
int x = FastRead();
if (cur[x]) {
int last = S.back();
swap(S[where_on_S[x]], S.back());
S.pop_back();
where_on_S[last] = where_on_S[x];
where_on_S[x] = -1;
} else {
S.PB(x);
where_on_S[x] = SZ(S) - 1;
}
int delta = -cur[x];
cur[x] ^= 1;
delta += cur[x];
small_tm -= Timestamp();
for (auto p : small_primes) {
int& small_cnt = small_cnts[p][x % p];
group_by_small_cnt[small_cnt]--;
if (group_by_small_cnt[small_cnt] == 0 && max_small == small_cnt) { max_small--; }
small_cnt += delta;
group_by_small_cnt[small_cnt]++;
if (small_cnt > max_small) { max_small = small_cnt; }
}
small_tm += Timestamp();
// if (2 * max_small < SZ(S)) {
// debug(max_small, SZ(S), S);
// }
//assert(2 * max_small >= SZ(S));
if (i <= mam_spokoj) {
between_tm -= Timestamp();
REP (j, SZ(large_cands)) {
if (x % large_cands[j].st == large_cands[j].nd) {
large_cnts[j] += delta;
}
}
between_tm += Timestamp();
} else {
preproc_tm -= Timestamp();
large_cands.clear();
//large_cands_set.clear();
large_cnts.clear();
if (SZ(S) <= kSmallSCutoff) {
SmallPreproc();
} else {
LargePreproc();
}
preproc_tm += Timestamp();
mam_spokoj = i + (SZ(S) + 4) / 3 - 2;
// preproc_tm -= Timestamp();
// int to_check = min(SZ(S), kToCheck);
// int checked = 0;
// VPII added_here;
// int praca = -cnt_inner;
// while (checked < to_check) {
// int ind = rand() % SZ(S);
// int v = S[ind];
// cnt_los++;
// if (last_checked[v] == i) { continue; }
// checked++;
// last_checked[v] = i;
// obrot++;
// added_here.clear();
// for (int j = 0; j < SZ(S); j++) {
// if (j == ind) { continue; }
// int diff = abs(S[j] - v);
// while (sito[diff] > T) {
// cnt_inner++;
// int p = sito[diff];
// if (last_vis[p] != obrot) {
// by_large[p] = 2;
// last_vis[p] = obrot;
// } else {
// by_large[p]++;
// }
// if (3 * by_large[p] >= SZ(S) && last_included[p] != obrot) {
// last_included[p] = obrot;
// if (last_vis_rems[p] != i) {
// good_remainders[p].clear();
// last_vis_rems[p] = i;
// }
// int was = 0;
// for (auto r : good_remainders[p]) {
// cnt_very_inner++;
// if (r == v % p) { was = 1; break; }
// }
// if (was == 0) {
// good_remainders[p].PB(v % p);
// added_here.PB({p, v % p});
// }
// }
// diff = nxt[diff];
// }
// }
// //debug(v, added_here);
// for (auto parka : added_here) {
// large_cands.PB(parka);
// large_cnts.PB(by_large[parka.st]);
// }
// }
// praca += cnt_inner;
// mam_spokoj = i + SZ(S) / 3;
// debug(SZ(S), praca);
// preproc_tm += Timestamp();
}
int res = 0;
if (!S.empty()) {
res = 1;
}
maxi(res, max_small);
int small_res = res;
for (auto l : large_cnts) {
maxi(res, l);
}
//assert(small_res == res);
FastWrite(res);
puts("");
///cout<<res<<"\n";
}
debug(praca_small_preproc, cnt_parki);
debug(cnt_inner, cnt_very_inner, cnt_los);
debug(small_tm, between_tm, preproc_tm);
return 0;
}
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 | #include <bits/stdc++.h> #define MP make_pair #define PB push_back #define st first #define nd second #define rd third #define FOR(i, a, b) for(int i =(a); i <=(b); ++i) #define RE(i, n) FOR(i, 1, n) #define FORD(i, a, b) for(int i = (a); i >= (b); --i) #define REP(i, n) for(int i = 0;i <(n); ++i) #define VAR(v, i) __typeof(i) v=(i) #define FORE(i, c) for(VAR(i, (c).begin()); i != (c).end(); ++i) #define ALL(x) (x).begin(), (x).end() #define SZ(x) ((int)(x).size()) #define __builtin_ctz __builtin_ctzll #define __builtin_clz __builtin_clzll #define __builtin_popcount __builtin_popcountll using namespace std; #ifdef LOCAL #define debug(...) _dbg(#__VA_ARGS__, __VA_ARGS__) #define debugv(x) {{cerr <<#x <<" = "; FORE(itt, (x)) cerr <<*itt <<", "; cerr <<"\n"; }} #else #define debug(...) (__VA_ARGS__) #define debugv(x) #define cerr if(0)cout #endif #define next ____next #define prev ____prev #define left ____left #define hash ____hash typedef long long ll; typedef long double LD; typedef pair<int, int> PII; typedef pair<ll, ll> PLL; typedef vector<int> VI; typedef vector<VI> VVI; typedef vector<ll> VLL; typedef vector<pair<int, int> > VPII; typedef vector<pair<ll, ll> > VPLL; template<class T> ostream& operator<<(ostream& out, vector<T> vec); template<class T> ostream& operator<<(ostream& out, set<T> vec); template<class L, class R> ostream& operator<<(ostream& out, map<L, R> vec); template<class C> void mini(C&a4, C b4){a4=min(a4, b4); } template<class C> void maxi(C&a4, C b4){a4=max(a4, b4); } template<class T1, class T2> ostream& operator<< (ostream &out, pair<T1, T2> pair) { return out << "(" << pair.first << ", " << pair.second << ")";} template<class A, class B, class C> struct Triple { A first; B second; C third; bool operator<(const Triple& t) const { if (st != t.st) return st < t.st; if (nd != t.nd) return nd < t.nd; return rd < t.rd; } }; template<class T> void ResizeVec(T&, vector<int>) {} template<class T> void ResizeVec(vector<T>& vec, vector<int> sz) { vec.resize(sz[0]); sz.erase(sz.begin()); if (sz.empty()) { return; } for (T& v : vec) { ResizeVec(v, sz); } } typedef Triple<int, int, int> TIII; template<class A, class B, class C> ostream& operator<< (ostream &out, Triple<A, B, C> t) { return out << "(" << t.st << ", " << t.nd << ", " << t.rd << ")"; } template<class T> ostream& operator<<(ostream& out, vector<T> vec) { out<<"("; for (auto& v: vec) out<<v<<", "; return out<<")"; } template<class T> ostream& operator<<(ostream& out, set<T> vec) { out<<"("; for (auto& v: vec) out<<v<<", "; return out<<")"; } template<class L, class R> ostream& operator<<(ostream& out, map<L, R> vec) { out<<"("; for (auto& v: vec) out<<v<<", "; return out<<")"; } ostream& operator<<(ostream& out, __int128_t x) { if (x < 0) { out<<"-"; x = -x; } if (x == 0) { return out<<"0"; } VI digs; while (x) { digs.PB(x % 10); x /= 10; } reverse(ALL(digs)); for (auto d : digs) { out<<d; } return out; } template<typename TH> void _dbg(const char* sdbg, TH h) { cerr<<sdbg<<"="<<h<<"\n"; } template<typename TH, typename... TA> void _dbg(const char* sdbg, TH h, TA... t) { while(*sdbg != ',') { cerr<<*sdbg++; } cerr<<"="<<h<<","; _dbg(sdbg+1, t...); } const int N = 1e7 + 5; #ifdef BRUT const int T = 1; #else const int T = 220; #endif int sito[N]; int nxt[N]; void InitSieve(int n) { FOR (i, 2, n) { if (sito[i] == 0) { for (int j = 1; i * j <= n; j++) { sito[i * j] = i; if (j % i == 0) { nxt[i * j] = nxt[j]; } else { nxt[i * j] = j; } } } } }; int cur[N]; int small_cnts[T + 5][T + 5]; int group_by_small_cnt[N]; VI S; int where_on_S[N]; // int last_checked[N]; // const int kToCheck = 50; // int last_vis[N]; // int by_large[N]; // int last_included[N]; // VI good_remainders[N]; // int last_vis_rems[N]; LD Timestamp() { #ifdef LOCAL return 1. * clock() / CLOCKS_PER_SEC; #else return 0; #endif } const int kSmallSCutoff = 100; VPII large_cands; VI large_cnts; int mam_spokoj; int praca_small_preproc; int cnt_parki; void SmallPreproc() { REP (i, SZ(S)) { FORD (j, i - 1, 0) { if (j / 3 != i / 3) { break; } int diff = abs(S[i] - S[j]); while (sito[diff] > T) { int p = sito[diff]; int r = S[i] % p; int was = 0; for (auto cand : large_cands) { if (cand.st == p && cand.nd == r) { was = 1; break; } } if (!was) { praca_small_preproc += SZ(S); int cnt = 0; for (auto x : S) { if (x % p == r) { cnt++; } } if (cnt * 3 >= SZ(S)) { large_cands.PB({p, r}); large_cnts.PB(cnt); } } diff = nxt[diff]; } } } } const int kTrials = 320; const int kMinSignificant = 10; VI remainders_cands[N]; VI remainders_cnts[N]; int last_checked[N]; int obrot; void LargePreproc() { VPII parki; REP (trial, kTrials) { int i = rand() % SZ(S); int j = i; while (j == i) { j = rand() % SZ(S); } int diff = abs(S[i] - S[j]); while (sito[diff] > T) { int p = sito[diff]; int r = S[i] % p; parki.PB({p, r}); diff = nxt[diff]; } } obrot++; for (auto [p, r] : parki) { int ind = -1; REP (i, SZ(remainders_cands[p])) { if (remainders_cands[p][i] == r) { ind = i; break; } } if (ind == -1) { remainders_cands[p].PB(r); remainders_cnts[p].PB(1); } else { remainders_cnts[p][ind]++; } } for (auto [p, _] : parki) { if (last_checked[p] == obrot) { continue; } last_checked[p] = obrot; REP (i, SZ(remainders_cands[p])) { int r = remainders_cands[p][i]; if (remainders_cnts[p][i] >= kMinSignificant) { int cnt = 0; for (auto x : S) { if (x % p == r) { cnt++; } } if (3 * cnt >= SZ(S)) { large_cands.PB({p, r}); large_cnts.PB(cnt); } } } remainders_cands[p].clear(); remainders_cnts[p].clear(); } } inline int FastRead() { int x = 0; int c = getchar_unlocked(); while (c >= '0' && c <= '9') { x = 10 * x + (c - '0'); c = getchar_unlocked(); } return x; } char s[10]; inline void FastWrite(int x) { if (x == 0) { putchar_unlocked('0'); return; } int ind = 0; while (x) { s[ind] = '0' + x % 10; ind++; x /= 10; } FORD (i, ind - 1, 0) { putchar_unlocked(s[i]); } } int32_t main() { ios_base::sync_with_stdio(0); cout << fixed << setprecision(10); cerr << fixed << setprecision(10); cin.tie(0); //double beg_clock = 1.0 * clock() / CLOCKS_PER_SEC; int max_small = 0; int n = FastRead(); int q = FastRead(); InitSieve(n); VI small_primes; FOR (p, 2, T) { if (sito[p] == p) { small_primes.PB(p); } } debug(SZ(small_primes)); RE (i, n) { where_on_S[i] = -1; } //set<PII> large_cands_set; int obrot = 0; LD small_tm = 0, between_tm = 0, preproc_tm = 0; int cnt_inner = 0; int cnt_very_inner = 0; int cnt_los = 0; RE (i, q) { //int x = 1 + rand() % n; int x = FastRead(); if (cur[x]) { int last = S.back(); swap(S[where_on_S[x]], S.back()); S.pop_back(); where_on_S[last] = where_on_S[x]; where_on_S[x] = -1; } else { S.PB(x); where_on_S[x] = SZ(S) - 1; } int delta = -cur[x]; cur[x] ^= 1; delta += cur[x]; small_tm -= Timestamp(); for (auto p : small_primes) { int& small_cnt = small_cnts[p][x % p]; group_by_small_cnt[small_cnt]--; if (group_by_small_cnt[small_cnt] == 0 && max_small == small_cnt) { max_small--; } small_cnt += delta; group_by_small_cnt[small_cnt]++; if (small_cnt > max_small) { max_small = small_cnt; } } small_tm += Timestamp(); // if (2 * max_small < SZ(S)) { // debug(max_small, SZ(S), S); // } //assert(2 * max_small >= SZ(S)); if (i <= mam_spokoj) { between_tm -= Timestamp(); REP (j, SZ(large_cands)) { if (x % large_cands[j].st == large_cands[j].nd) { large_cnts[j] += delta; } } between_tm += Timestamp(); } else { preproc_tm -= Timestamp(); large_cands.clear(); //large_cands_set.clear(); large_cnts.clear(); if (SZ(S) <= kSmallSCutoff) { SmallPreproc(); } else { LargePreproc(); } preproc_tm += Timestamp(); mam_spokoj = i + (SZ(S) + 4) / 3 - 2; // preproc_tm -= Timestamp(); // int to_check = min(SZ(S), kToCheck); // int checked = 0; // VPII added_here; // int praca = -cnt_inner; // while (checked < to_check) { // int ind = rand() % SZ(S); // int v = S[ind]; // cnt_los++; // if (last_checked[v] == i) { continue; } // checked++; // last_checked[v] = i; // obrot++; // added_here.clear(); // for (int j = 0; j < SZ(S); j++) { // if (j == ind) { continue; } // int diff = abs(S[j] - v); // while (sito[diff] > T) { // cnt_inner++; // int p = sito[diff]; // if (last_vis[p] != obrot) { // by_large[p] = 2; // last_vis[p] = obrot; // } else { // by_large[p]++; // } // if (3 * by_large[p] >= SZ(S) && last_included[p] != obrot) { // last_included[p] = obrot; // if (last_vis_rems[p] != i) { // good_remainders[p].clear(); // last_vis_rems[p] = i; // } // int was = 0; // for (auto r : good_remainders[p]) { // cnt_very_inner++; // if (r == v % p) { was = 1; break; } // } // if (was == 0) { // good_remainders[p].PB(v % p); // added_here.PB({p, v % p}); // } // } // diff = nxt[diff]; // } // } // //debug(v, added_here); // for (auto parka : added_here) { // large_cands.PB(parka); // large_cnts.PB(by_large[parka.st]); // } // } // praca += cnt_inner; // mam_spokoj = i + SZ(S) / 3; // debug(SZ(S), praca); // preproc_tm += Timestamp(); } int res = 0; if (!S.empty()) { res = 1; } maxi(res, max_small); int small_res = res; for (auto l : large_cnts) { maxi(res, l); } //assert(small_res == res); FastWrite(res); puts(""); ///cout<<res<<"\n"; } debug(praca_small_preproc, cnt_parki); debug(cnt_inner, cnt_very_inner, cnt_los); debug(small_tm, between_tm, preproc_tm); return 0; } |
English