# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
97756 | dalgerok | Lozinke (COCI17_lozinke) | C++17 | 1031 ms | 15544 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include<bits/stdc++.h>
using namespace std;
struct super_hash{
size_t operator()(string x)const{
unsigned long long cur = 0, p = 1;
for(auto it : x){
cur += p * it;
p *= 59;
}
return cur;
}
};
unordered_map < string, int, super_hash > q;
inline void add(string &s){
unordered_map < string, int, super_hash > used;
for(int i = 0; i < (int)s.size(); i++){
string t;
for(int j = i; j < (int)s.size(); j++){
t += s[j];
if(used.find(t) == used.end()){
q[t] += 1;
used[t] = true;
}
}
}
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |