# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
472174 | 2021-09-13T08:51:51 Z | morasha3 | Political Development (BOI17_politicaldevelopment) | C++17 | 1870 ms | 524292 KB |
#include<bits/stdc++.h> typedef long long ll; const ll mod = (ll) 1e9 + 7; const ll mx = (ll) 1e5 +7; using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); ll n,k,ans=0; cin>>n>>k; ll arr[n]; vector<vector<ll>>v(n); for(int i=0; i<n; i++) { ll a; cin>>a; arr[i]=a; for(int j=0; j<a; j++) { ll b; cin>>b; v[i].push_back(b); ans=2; } } map<pair<ll,ll>,ll>m; for(int i=0; i<n; i++) { for(int h=0; h<arr[i]; h++) { ll y=v[i][h],t=i; m[ {v[i][h],i}]=1; } } for(int i=0; i<n; i++) { vector<ll>e; for(int j=0; j<arr[i]; j++) { ll cnt=1; bool f=1; ll c=e.size(); ll y=v[i][j],t=0; for(int h=0; h<e.size(); h++) { y=v[i][j],t=e[h]; if(m[ {v[i][j],e[h]}]==1) { if(f) { cnt++; f=0; } cnt++; } } e.push_back(v[i][j]); ans=max(ans,cnt); } } cout<<ans; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 204 KB | Output is correct |
2 | Correct | 1 ms | 204 KB | Output is correct |
3 | Correct | 13 ms | 1904 KB | Output is correct |
4 | Runtime error | 1870 ms | 524292 KB | Execution killed with signal 9 |
5 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 204 KB | Output is correct |
2 | Correct | 1 ms | 204 KB | Output is correct |
3 | Correct | 13 ms | 1904 KB | Output is correct |
4 | Runtime error | 1870 ms | 524292 KB | Execution killed with signal 9 |
5 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 460 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 204 KB | Output is correct |
2 | Correct | 1 ms | 204 KB | Output is correct |
3 | Correct | 13 ms | 1904 KB | Output is correct |
4 | Runtime error | 1870 ms | 524292 KB | Execution killed with signal 9 |
5 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 204 KB | Output is correct |
2 | Correct | 1 ms | 204 KB | Output is correct |
3 | Correct | 13 ms | 1904 KB | Output is correct |
4 | Runtime error | 1870 ms | 524292 KB | Execution killed with signal 9 |
5 | Halted | 0 ms | 0 KB | - |