# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
37464 | 2017-12-25T15:24:17 Z | IvanC | Lozinke (COCI17_lozinke) | C++14 | 629 ms | 18608 KB |
#include <bits/stdc++.h> using namespace std; map<string,int> mapa; int resposta,n; string entradas[20010]; int main(){ cin.tie(0);ios_base::sync_with_stdio(0); cin >> n; for(int idx = 1;idx<=n;idx++){ cin >> entradas[idx]; vector<string> subs; for(int ini = 0;ini<entradas[idx].size();ini++){ string davez; for(int i = ini;i<entradas[idx].size();i++){ davez.push_back(entradas[idx][i]); subs.push_back(davez); } } sort(subs.begin(),subs.end()); subs.erase(unique(subs.begin(),subs.end()),subs.end()); for(string s : subs) mapa[s]++; } for(int idx = 1;idx<=n;idx++){ resposta += mapa[entradas[idx]]; } cout << resposta - n << endl; return 0; }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 2812 KB | Output is correct |
2 | Correct | 0 ms | 2812 KB | Output is correct |
3 | Correct | 0 ms | 2812 KB | Output is correct |
4 | Correct | 0 ms | 2812 KB | Output is correct |
5 | Correct | 9 ms | 3200 KB | Output is correct |
6 | Correct | 16 ms | 3200 KB | Output is correct |
7 | Correct | 23 ms | 3840 KB | Output is correct |
8 | Correct | 33 ms | 4768 KB | Output is correct |
9 | Correct | 99 ms | 4608 KB | Output is correct |
10 | Correct | 253 ms | 9652 KB | Output is correct |
11 | Correct | 186 ms | 6272 KB | Output is correct |
12 | Correct | 606 ms | 18608 KB | Output is correct |
13 | Correct | 369 ms | 4480 KB | Output is correct |
14 | Correct | 443 ms | 16796 KB | Output is correct |
15 | Correct | 629 ms | 18312 KB | Output is correct |
16 | Correct | 329 ms | 2944 KB | Output is correct |
17 | Correct | 136 ms | 2812 KB | Output is correct |
18 | Correct | 99 ms | 2812 KB | Output is correct |
19 | Correct | 373 ms | 10372 KB | Output is correct |
20 | Correct | 163 ms | 2944 KB | Output is correct |