| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 312459 | neki | Lozinke (COCI17_lozinke) | C++14 | 515 ms | 17016 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
#define loop(i, a, b) for(long long i=a;i<b;i++)
#define pool(i, a, b) for(long long i=a-1;i>=b;i--)
#define fore(i, a) for(auto&& i:a)
#define fi first
#define se second
#define ps(a) push_back(a)
#define pb(a) pop_back(a)
#define sc scanf
#define vc vector
#define pa pair<ll, ll>
#define ll long long
#define lb lower_bound
#define ub upper_bound
#define all(a) a.begin(), a.end()
#define llmax LLONG_MAX/2
#define llmin -LLONG_MAX/2
using namespace std;
#define mn 26000
#define pa pair<ll, ll>
#define ld long double
map<string, ll> dp;
string arr[mn];
int main(){
ll n, ans=0;cin >> n;
loop(i, 0, n){
string a;cin >> a;
arr[i]=a;
map<string, ll>temp;
loop(x, 0, a.length()+1) loop(y, x+1, a.length()+1) temp[a.substr(x, y-x)]=1;
fore(v, temp) dp[v.fi]++;
}
loop(i, 0, n) ans+=dp[arr[i]]-1;
cout << ans<<endl;
}
컴파일 시 표준 에러 (stderr) 메시지
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
