제출 #522205

#제출 시각아이디문제언어결과실행 시간메모리
522205sean617Languages (IOI10_languages)C++98
81 / 100
3192 ms4784 KiB
#include "grader.h" #include "lang.h" //#include <unordered_map> //#include <vector> //#include <cstring> #include <algorithm> #include <set> using namespace std; typedef unsigned long long ll; ll l, M = (1 << 16), M2 = (1 << 32), e[10005], v[58][100000]; set<ll> v2[58]; ll fnum(ll p) { ll t1, t2, t; t1 = e[p - 3] * M + e[p - 2]; t2 = e[p - 1] * M + e[p]; t = t1 * M2 + t2; return t; } void excerpt(int *E) { ll i, j, t, num, ans = 0, x, mx = 0, mx2 = 0, cnt, cnt2; l = 100; for (i = 0; i < l; i++) e[i] = E[i]; //sort(E, E + l); for (x =0; x < 56; x++) { cnt = 0; cnt2 = 0; for (i = 3; i < l; i++) { if (v2[x].count(fnum(i)) == 1) cnt++; // cnt2 += v[x][e[i]]; } // if (cnt > mx || cnt == mx && cnt2 > mx2) { if (cnt > mx) { mx = cnt; //mx2 = cnt2; ans = x; } } ans = language(ans); for (i = 3; i < l; i++) { v2[ans].insert(fnum(i)); // v[ans][e[i]] = 1; } }

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

lang.cpp:11:30: warning: left shift count >= width of type [-Wshift-count-overflow]
   11 | ll l, M = (1 << 16), M2 = (1 << 32), e[10005], v[58][100000];
      |                            ~~^~~~~
lang.cpp: In function 'void excerpt(int*)':
lang.cpp:23:8: warning: unused variable 'j' [-Wunused-variable]
   23 |  ll i, j, t, num, ans = 0, x, mx = 0, mx2 = 0, cnt, cnt2;
      |        ^
lang.cpp:23:11: warning: unused variable 't' [-Wunused-variable]
   23 |  ll i, j, t, num, ans = 0, x, mx = 0, mx2 = 0, cnt, cnt2;
      |           ^
lang.cpp:23:14: warning: unused variable 'num' [-Wunused-variable]
   23 |  ll i, j, t, num, ans = 0, x, mx = 0, mx2 = 0, cnt, cnt2;
      |              ^~~
lang.cpp:23:39: warning: unused variable 'mx2' [-Wunused-variable]
   23 |  ll i, j, t, num, ans = 0, x, mx = 0, mx2 = 0, cnt, cnt2;
      |                                       ^~~
lang.cpp:23:53: warning: variable 'cnt2' set but not used [-Wunused-but-set-variable]
   23 |  ll i, j, t, num, ans = 0, x, mx = 0, mx2 = 0, cnt, cnt2;
      |                                                     ^~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...