Submission #63016084
Source Code Expand
Copy
#include<bits/stdc++.h>using namespace std;const int N = 107;int n;string s[N];bool cmp(string a,string b){return a.size() < b.size();}int main(){scanf("%d",&n);for(int i = 1;i <= n;i++) cin >> s[i];sort(s+1,s+n+1,cmp);for(int i = 1;i <= n;i++) cout << s[i];puts("");return 0;}
#include<bits/stdc++.h> using namespace std; const int N = 107; int n; string s[N]; bool cmp(string a,string b){return a.size() < b.size();} int main(){ scanf("%d",&n); for(int i = 1;i <= n;i++) cin >> s[i]; sort(s+1,s+n+1,cmp); for(int i = 1;i <= n;i++) cout << s[i]; puts(""); return 0; }
Submission Info
Submission Time | |
---|---|
Task | B - cat |
User | juruo_114 |
Language | C++ 20 (gcc 12.2) |
Score | 200 |
Code Size | 309 Byte |
Status | AC |
Exec Time | 1 ms |
Memory | 3880 KB |
Compile Error
Main.cpp: In function ‘int main()’: Main.cpp:8:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 8 | scanf("%d",&n); | ~~~~~^~~~~~~~~
Judge Result
Set Name | Sample | All | ||||
---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 200 / 200 | ||||
Status |
|
|
Set Name | Test Cases |
---|---|
Sample | sample00.txt, sample01.txt |
All | sample00.txt, sample01.txt, testcase00.txt, testcase01.txt, testcase02.txt, testcase03.txt, testcase04.txt, testcase05.txt, testcase06.txt, testcase07.txt, testcase08.txt, testcase09.txt, testcase10.txt, testcase11.txt, testcase12.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
sample00.txt | AC | 1 ms | 3876 KB |
sample01.txt | AC | 1 ms | 3500 KB |
testcase00.txt | AC | 1 ms | 3560 KB |
testcase01.txt | AC | 1 ms | 3880 KB |
testcase02.txt | AC | 1 ms | 3764 KB |
testcase03.txt | AC | 1 ms | 3764 KB |
testcase04.txt | AC | 1 ms | 3692 KB |
testcase05.txt | AC | 1 ms | 3616 KB |
testcase06.txt | AC | 1 ms | 3688 KB |
testcase07.txt | AC | 1 ms | 3692 KB |
testcase08.txt | AC | 1 ms | 3572 KB |
testcase09.txt | AC | 1 ms | 3564 KB |
testcase10.txt | AC | 1 ms | 3696 KB |
testcase11.txt | AC | 1 ms | 3880 KB |
testcase12.txt | AC | 1 ms | 3760 KB |