# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
472273 | 2021-09-13T10:54:10 Z | morasha3 | Political Development (BOI17_politicaldevelopment) | C++17 | 3000 ms | 279516 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; vector<vector<ll>>v(n); map<pair<ll,ll>,ll>m; for(int i=0; i<n; i++) { ll a; cin>>a; for(int j=0; j<a; j++) { ll b; cin>>b; v[i].push_back(b); m[ {i,b}]=1; m[ {b,i}]=1; ans=2; } } for(int i=0; i<n; i++) { vector<ll>e; for(int j=0; j<v[i].size(); j++) { ll cnt=1; bool f=1; for(int h=0; h<e.size(); h++) { if(m[ {v[i][j],e[h]}]==1||m[ {e[h],v[i][j]}]==1) { if(f) { cnt++; f=0; } cnt++; } } e.push_back(v[i][j]); ans=max(ans,cnt); } } if(ans>k)ans=k; cout<<ans; }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 204 KB | Output is correct |
2 | Correct | 0 ms | 204 KB | Output is correct |
3 | Correct | 14 ms | 2484 KB | Output is correct |
4 | Execution timed out | 3073 ms | 279516 KB | Time limit exceeded |
5 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 204 KB | Output is correct |
2 | Correct | 0 ms | 204 KB | Output is correct |
3 | Correct | 14 ms | 2484 KB | Output is correct |
4 | Execution timed out | 3073 ms | 279516 KB | Time limit exceeded |
5 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 332 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 204 KB | Output is correct |
2 | Correct | 0 ms | 204 KB | Output is correct |
3 | Correct | 14 ms | 2484 KB | Output is correct |
4 | Execution timed out | 3073 ms | 279516 KB | Time limit exceeded |
5 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 204 KB | Output is correct |
2 | Correct | 0 ms | 204 KB | Output is correct |
3 | Correct | 14 ms | 2484 KB | Output is correct |
4 | Execution timed out | 3073 ms | 279516 KB | Time limit exceeded |
5 | Halted | 0 ms | 0 KB | - |