# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
291800 | penguinhacker | Trener (COCI20_trener) | C++17 | 130 ms | 7684 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ar array
const int MOD=1e9+7, M[2]={(int)1e9+9, (int)1e9+7}, P[2]={37, 41};
ar<int, 2> getHash(string s) {
ar<int, 2> res;
for (int i=0; i<2; ++i) {
ll pp=1, hsh=0;
for (char c : s) {
hsh=(hsh+(c-'a'+1)*pp)%M[i];
pp=pp*P[i]%MOD;
}
res[i]=hsh;
}
return res;
}
int n, k;
string name[50][1500];
map<ar<int, 2>, int> dp, last;
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
cin >> n >> k;
for (int i=0; i<n; ++i) for (int j=0; j<k; ++j) cin >> name[i][j];
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |