Submission #472174

#TimeUsernameProblemLanguageResultExecution timeMemory
472174morasha3Political Development (BOI17_politicaldevelopment)C++17
0 / 100
1870 ms524292 KiB
#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 (stderr)

politicaldevelopment.cpp: In function 'int main()':
politicaldevelopment.cpp:34:20: warning: unused variable 'y' [-Wunused-variable]
   34 |                 ll y=v[i][h],t=i;
      |                    ^
politicaldevelopment.cpp:34:30: warning: unused variable 't' [-Wunused-variable]
   34 |                 ll y=v[i][h],t=i;
      |                              ^
politicaldevelopment.cpp:50:27: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   50 |             for(int h=0; h<e.size(); h++)
      |                          ~^~~~~~~~~
politicaldevelopment.cpp:47:16: warning: unused variable 'c' [-Wunused-variable]
   47 |             ll c=e.size();
      |                ^
politicaldevelopment.cpp:48:16: warning: variable 'y' set but not used [-Wunused-but-set-variable]
   48 |             ll y=v[i][j],t=0;
      |                ^
politicaldevelopment.cpp:48:26: warning: variable 't' set but not used [-Wunused-but-set-variable]
   48 |             ll y=v[i][j],t=0;
      |                          ^
#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...