# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
855069 | 2023-09-30T03:51:08 Z | vjudge1 | Type Printer (IOI08_printer) | C++17 | 24 ms | 3096 KB |
#include <iostream> #include <sstream> #include <string> #include <vector> #include <algorithm> using namespace std; typedef long long LL; #define fi first #define se second #define _for(ccc, sss, eee) for (int ccc=(sss);ccc<=(eee);ccc++) #define __for(ccc, sss, eee) for (int ccc=(sss);ccc>=(eee);ccc--) #define N 25000 #define INF 0x7f7f7f7f stringstream ss; int n, same_ind; bool first=true; string cur, in[N+10], _="-", P="P"; int main(){ ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);//如果写freopen()删掉cout.tie() cin>>n; _for (i, 0, n-1)cin>>in[i]; sort(in, in+n); _for (i, 0, n-1){ if (first){ same_ind=0; first=false; } else{ for (same_ind=0;same_ind<min(cur.size(), in[i].size()) && cur[same_ind]==in[i][same_ind];same_ind++); _for (j, 1, max(cur.size(), in[i].size())-same_ind-1)ss<<_; } _for (j, same_ind, in[i].size()-1)ss<<in[i][j]; ss<<P; cur=in[i]; } string out; ss>>out; cout<<out.size()<<"\n"; for (auto &cur:out)cout<<cur<<"\n"; return 0; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 1112 KB | Output is correct |
2 | Incorrect | 1 ms | 1116 KB | printed invalid word |
3 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 1116 KB | printed invalid word |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 1116 KB | printed invalid word |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 1116 KB | printed invalid word |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 1112 KB | printed invalid word |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 2 ms | 1116 KB | too many deletions |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 4 ms | 1368 KB | too many deletions |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 10 ms | 1924 KB | too many deletions |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 24 ms | 3096 KB | too many deletions |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 22 ms | 2524 KB | too many deletions |
2 | Halted | 0 ms | 0 KB | - |