제출 #512767

#제출 시각아이디문제언어결과실행 시간메모리
512767algorithm16Languages (IOI10_languages)C++14
컴파일 에러
0 ms0 KiB
#include<iostream> #include<set> #include<algorithm> #include "grader.h" #include "lang.h" using namespace std; typedef long long int llint; set <llint> s[65],s1; llint e[105],cnt1[70005],c[65]; void excerpt(int *E) { s1.clear(); int mx1=0,a=0; for(int i=0;i<100;i++) { e[i]=E[i]; cnt[e[i]]+=1; if(cnt[e[i]]>mx1) { mx1=cnt[e[i]]; a=e[i]; } s1.insert(e[i]); if(i>=50) s1.insert(e[i-1]*1e5+e[i]); //if(i && i%4) s1.insert(e[i-1]*1e5+e[i]); //if(i>1 && i%4==0) s1.insert(e[i-2]*1e10+e[i-1]*1e5+e[i]); } for(int i=0;i<100;i++) { cnt[e[i]]-=1; } for(int i=1;i<100;i+=e[i]%2+1) { s1.insert(e[i-1]*1e5+e[i]); } for(int i=2;i<100;i+=e[i]%2+1) { s1.insert(e[i-2]*1e10+e[i-1]*1e5+e[i]); } int mx=0,idx=0; for(int i=0;i<56;i++) { if(s[i].size()<=mx) continue; int cnt=0; for(set <llint>::iterator it=s1.begin();it!=s1.end();it++) { cnt+=(s[i].find(*it)!=s[i].end()); } if(a==c[i]) cnt+=30; if(cnt>mx) { mx=cnt; idx=i; } } int l=language(idx); c[l]=a; for(set <llint>::iterator it=s1.begin();it!=s1.end();it++) { s[l].insert(*it); } }

컴파일 시 표준 에러 (stderr) 메시지

lang.cpp: In function 'void excerpt(int*)':
lang.cpp:15:3: error: 'cnt' was not declared in this scope; did you mean 'cnt1'?
   15 |   cnt[e[i]]+=1;
      |   ^~~
      |   cnt1
lang.cpp:26:3: error: 'cnt' was not declared in this scope; did you mean 'cnt1'?
   26 |   cnt[e[i]]-=1;
      |   ^~~
      |   cnt1
lang.cpp:36:17: warning: comparison of integer expressions of different signedness: 'std::set<long long int>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   36 |   if(s[i].size()<=mx) continue;
      |      ~~~~~~~~~~~^~~~