Submission #972150

#TimeUsernameProblemLanguageResultExecution timeMemory
972150grafffDigital Circuit (IOI22_circuit)C++17
0 / 100
1217 ms3388 KiB
#include <bits/stdc++.h> #include "circuit.h" #define ll int #define all(x) x.begin(), x.end() #define x_c first #define y_c second using namespace std; ll n, m, MOD = 1000002022; vector <ll> p, a; vector <bool> flag(9); vector <vector <ll>> gr; int group_1(int l, int r) { for(int i = l; i <= r; i++) { a[i] = 1 - a[i]; } ll col = 0; for(int i = 0; i < m; i++) { col += a[i]; } return col; } int count_ways(int L, int R) { return group_1(L, R); } void init(int N, int M, vector <int> P, vector <int> A) { n = N; m = M; p = P; a = A; gr.resize(n); ll mx = 0; for(int i = 1; i < n + m; i++) { gr[p[i]].push_back(i); ll h = gr[p[i]].size(); mx = max(mx, h); } if(n == 1) { flag[1] = true; } else if(n <= 1000 && mx <= 2) { flag[2] = true; } else if(mx <= 2) { flag[6] = true; } else if(n <= 1000 && m <= 1000) { flag[3] = true; } else if(n <= 5000 && m <= 5000) { flag[7] = true; } }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...