Submission #522204

#TimeUsernameProblemLanguageResultExecution timeMemory
522204sean617Languages (IOI10_languages)C++98
81 / 100
3173 ms8528 KiB
#include "grader.h" #include "lang.h" //#include <unordered_map> //#include <vector> //#include <cstring> #include <algorithm> #include <set> using namespace std; typedef long long ll; ll l, M = (1 << 16), e[10005], v[58][100000]; set<ll> v2[58]; 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 =1; i < l; i++) { t = e[i - 1] * M + e[i]; if (v2[x].count(t) == 1) cnt++; cnt2 += v[x][e[i]]; } if (cnt > mx || cnt == mx && cnt2 > mx2) { mx = cnt; mx2 = cnt2; ans = x; } } ans = language(ans); for (i = 1; i < l; i++) { t = e[i - 1] * M + e[i]; v2[ans].insert(t); v[ans][e[i]] = 1; } }

Compilation message (stderr)

lang.cpp: In function 'void excerpt(int*)':
lang.cpp:27:29: warning: suggest parentheses around '&&' within '||' [-Wparentheses]
   27 |   if (cnt > mx || cnt == mx && cnt2 > mx2) {
      |                   ~~~~~~~~~~^~~~~~~~~~~~~
lang.cpp:14:8: warning: unused variable 'j' [-Wunused-variable]
   14 |  ll i, j, t, num, ans = 0, x, mx = 0, mx2 = 0, cnt, cnt2;
      |        ^
lang.cpp:14:14: warning: unused variable 'num' [-Wunused-variable]
   14 |  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...