# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
985638 | Rux007 | Lozinke (COCI17_lozinke) | C++14 | 290 ms | 16836 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <iostream>
#include <string>
#include <map>
using namespace std;
int n;
map<string, int> fr;
string a[20005];
int main()
{
cin >> n;
for(int i = 1; i <= n; i ++)
{
cin >> a[i];
map<string, int> ok;
for(int j = 0; j < a[i].size(); j ++)
for(int t = j; t < a[i].size(); t ++)
{
string aux;
for(int p = j; p <= t; p ++)
aux += a[i][p];
ok[aux] = 1;
}
for(auto x : ok)
fr[x.first] ++;
}
int sol = 0;
for(int i = 1; i <= n; i ++)
sol += fr[a[i]] - 1;
cout << sol;
return 0;
}
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |