| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 80283 | Genezio | Lozinke (COCI17_lozinke) | C++14 | 1016 ms | 66560 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include<bits/stdc++.h>
using namespace std;
#define pii pair<int,int>
#define mp make_pair
#define F first
#define S second
#define pb push_back
#define ll long long
const int N = 100010;
const int INF = 0x3f3f3f3f;
const ll mod = 1e9+7;
string s;
map< string,set<int> > m;
map< string,set<int> > subs;
map< string,set<int> > f;
string x;
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
int n;
cin>>n;
int ans=0;
for(int i=0;i<n;i++) {
cin>>s;
ans+=subs[s].size();
//ans+=f[s].size();
//cout<<i<<" "<<ans<<"\n";
//f[s].insert(i);
for(int k=0;k<s.size();k++) {
string p=x;
for(int j=k;j<s.size();j++) {
p+=s[j];
ans+=m[p].size();
//if(k==0&&j==s.size()-1) continue;
subs[p].insert(i);
//ans+=f[p].size();
//cout<<i<<" "<<k<<" "<<j<<" "<<ans<<"\n";
}
}
m[s].insert(i);
}
cout<<ans<<"\n";
return 0;
}
컴파일 시 표준 에러 (stderr) 메시지
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
