# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
870281 | Essa2006 | Type Printer (IOI08_printer) | C++14 | 19 ms | 2140 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define endl '\n'
#define FF first
#define SS second
#define all(a) a.begin(), a.end()
#define mod (ll)(1000000007)
int main(){
ios_base::sync_with_stdio(0);cin.tie(0);
int n;
cin>>n;
vector<string>A(n);
for(int i=0;i<n;i++){
cin>>A[i];
}
sort(all(A));
vector<int>Same(n, -1);
for(int i=1;i<n;i++){
for(int j=0;j<min(A[i].size(), A[i-1].size());j++){
if(A[i][j]==A[i-1][j])
Same[i]=j;
else
break;
}
}
int cur=-1;
for(int i=0;i<n;i++){
while(cur>Same[i])
cur--, cout<<'-'<<endl;
for(int j=Same[i]+1;j<A[i].size();j++){
cout<<A[i][j]<<endl;
cur++;
}
cout<<'P'<<endl;
}
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |