# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
929135 | Zena_Hossam | Lozinke (COCI17_lozinke) | C++14 | 1072 ms | 1372 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
#define fi ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
//#define ll double
#define ll long long
#define F first
#define S second
#define sz size()
#define all(s) s.begin(),s.end()
#define all1(s) s.rbegin(),s.rend()
int main()
{
// freopen("maxcross.in","r",stdin);freopen("maxcross.out","w",stdout);
ll T=1;
//cin>>T;ll oo=0;
while(T--)
{
ll n;
cin>>n;
pair<ll,string>a[n];
for(ll i=0;i<n;i++){
cin>>a[i].second;
a[i].first=a[i].second.size();
}
sort(a,a+n);ll c=0;
for(ll i=0;i<n;i++){
for(ll j=i+1;j<n;j++){string x="";
for(ll e=0;e<a[j].first;e++){
if(x.size()>=a[i].first){
reverse(all(x));
x.pop_back();
reverse(all(x));
}x+=a[j].second[e];//cout<<x<<" ";
if(x==a[i].second){
c++;//cout<<i<<" "<<j<<" "<<x<<" "<<a[i].second<<" "<<a[j].second;
break;
}
}//cout<<"\n";
}
}cout<<c;
}
}
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |