Submission #146373

#TimeUsernameProblemLanguageResultExecution timeMemory
146373popovicirobertLanguages (IOI10_languages)C++14
0 / 100
483 ms98188 KiB
#include <bits/stdc++.h> #define ll long long #define ull unsigned long long using namespace std; #include "grader.h" #include "lang.h" #define SZ 100 const int B = (int) 1e5; unordered_map <ll, bool> ok[60]; bool vis[60]; inline ll myrand() { return (1LL * rand() << 15) + rand(); } void excerpt(int *E) { int i, j; unordered_map <ll, bool> mp; for(i = 0; i + 4 <= 100; i++) { ll cur = 0; for(j = i; j < i + 4; j++) { cur = cur * B + E[j]; } mp[cur]++; } vector <int> arr(56); int id = -1; for(auto it : mp) { for(i = 0; i < 56; i++) { if(ok[i][it.first]) { arr[i]++; } } } id = max_element(arr.begin(), arr.end()) - arr.begin(); if(arr[id] == 0) { id = -1; } if(id == -1) { vector <int> ids; for(i = 0; i < 56; i++) { if(vis[i] == 0) ids.push_back(i); } int sz = ids.size(); id = ids[myrand() % sz]; } id = language(id); for(i = 0; i + 4 <= 100; i++) { ll cur = 0; for(j = i; j < i + 4; j++) { cur = cur * B + E[j]; } ok[id][cur]++; } vis[id] = 1; }

Compilation message (stderr)

lang.cpp: In function 'void excerpt(int*)':
lang.cpp:29:16: warning: use of an operand of type 'bool' in 'operator++' is deprecated [-Wdeprecated]
         mp[cur]++;
                ^~
lang.cpp:61:20: warning: use of an operand of type 'bool' in 'operator++' is deprecated [-Wdeprecated]
         ok[id][cur]++;
                    ^~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...