Submission #632317

#TimeUsernameProblemLanguageResultExecution timeMemory
632317ggohLanguages (IOI10_languages)C++14
0 / 100
9588 ms3104 KiB
#include<bits/stdc++.h> #include "grader.h" using namespace std; int V[56][65536]; void excerpt(int *E) { int l=0,maxi=-1; for(int j=0;j<56;j++) { int kind=0; int v[65536]={}; for(int i=0;i<100;i++) { if(V[j][E[i]] && v[E[i]]==0) { kind++; v[E[i]]=1; } } if(kind>maxi) { maxi=kind; } } vector<int>N; for(int j=0;j<56;j++) { int v[65536]={}; int kind=0; for(int i=0;i<100;i++) { if(V[j][E[i]] && v[E[i]]==0) { kind++; v[E[i]]=1; } } if(kind==maxi) { N.push_back(j); } } maxi=-1; int maxind,secondind; int e[65536]={}; for(int i=0;i<100;i++) { e[E[i]]++; if(e[E[i]]>maxi) { maxi=e[E[i]]; maxind=E[i]; } } maxi=-1; for(int i=0;i<100;i++) { if(E[i]!=maxind && e[E[i]]>maxi) { maxi=e[E[i]]; secondind=E[i]; } } for(auto &j:N) { maxi=-1; int maxj,secondj; for(int i=1;i<65536;i++) { if(V[j][i]>maxi) { maxi=V[j][i]; maxj=i; } } maxi=-1; for(int i=1;i<65536;i++) { if(i!=maxj && V[j][i]>maxi) { maxi=V[j][i]; secondj=i; } } if(secondj==secondind) { l=j; break; } } int L=language(l); for(int i=0;i<100;i++) { V[L][E[i]]++; } }

Compilation message (stderr)

lang.cpp: In function 'void excerpt(int*)':
lang.cpp:87:5: warning: 'secondj' may be used uninitialized in this function [-Wmaybe-uninitialized]
   87 |     if(secondj==secondind)
      |     ^~
lang.cpp:81:7: warning: 'maxj' may be used uninitialized in this function [-Wmaybe-uninitialized]
   81 |       if(i!=maxj && V[j][i]>maxi)
      |       ^~
lang.cpp:87:5: warning: 'secondind' may be used uninitialized in this function [-Wmaybe-uninitialized]
   87 |     if(secondj==secondind)
      |     ^~
lang.cpp:60:5: warning: 'maxind' may be used uninitialized in this function [-Wmaybe-uninitialized]
   60 |     if(E[i]!=maxind && e[E[i]]>maxi)
      |     ^~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...