| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 843684 | nihaddhuseynli | Lozinke (COCI17_lozinke) | C++14 | 119 ms | 16256 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <algorithm>
#include <cassert>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <unordered_map>
#include <unordered_set>
#include <stack>
#include <string>
#include <vector>
#include <queue>
using namespace std;
#define TRACE(x) cerr << #x << " " << x << endl
#define FOR(i, a, b) for (int i = (a); i < int(b); ++i)
#define REP(i, n) FOR(i, 0, n)
#define _ << " " <<
#define fst first
#define snd second
typedef long long llint;
typedef pair<int, int> pii;
const int MAXN = 2e4 + 10;
int n;
string l[MAXN];
unordered_set<string> s;
unordered_map<string, int> cnt;
int main(void) {
cin >> n;
for (int i = 0; i < n; ++i) {
cin >> l[i];
s.clear();
for (int j = 0; j < (int) l[i].size(); ++j) {
string curr;
for (int k = j; k < (int) l[i].size(); ++k) {
curr.push_back(l[i][k]);
s.insert(curr);
}
}
for (auto &x : s)
cnt[x]++;
}
int sol = 0;
for (auto &x : l)
sol += cnt[x];
cout << sol - n << endl;
return 0;
}
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
