Submission #38604708


Source Code Expand

#include<bits/stdc++.h>
using namespace std;
const int MAXN=100005;
inline int read() {
	static int x=0,c=getchar(),f=1;
	for(f=1; c<48||c>57; c=getchar())f=f&&c^45;
	for(x=0; c>47&&c<58; c=getchar())x=(x<<3)+(x<<1)+(c&15);
	return f?x:-x;
}
int n,k;
string s[MAXN];
int main() {
	scanf("%d%d",&n,&k);
	for(int i=1; i<=n; ++i) cin>>s[i];
	sort(s+1,s+k+1);
	for(int i=1; i<=k; ++i) cout<<s[i]<<endl;
	return 0;
}

Submission Info

Submission Time
Task B - Qualification Contest
User mod998244353
Language C++ (GCC 9.2.1)
Score 200
Code Size 428 Byte
Status AC
Exec Time 12 ms
Memory 6880 KiB

Compile Error

./Main.cpp: In function ‘int main()’:
./Main.cpp:13:7: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
   13 |  scanf("%d%d",&n,&k);
      |  ~~~~~^~~~~~~~~~~~~~

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 200 / 200
Status AC
AC × 19
Set Name Test Cases
Sample
All sample00.txt, sample01.txt, sample02.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, testcase13.txt, testcase14.txt, testcase15.txt
Case Name Status Exec Time Memory
sample00.txt AC 10 ms 6612 KiB
sample01.txt AC 8 ms 6764 KiB
sample02.txt AC 11 ms 6724 KiB
testcase00.txt AC 8 ms 6628 KiB
testcase01.txt AC 7 ms 6756 KiB
testcase02.txt AC 7 ms 6728 KiB
testcase03.txt AC 7 ms 6748 KiB
testcase04.txt AC 6 ms 6620 KiB
testcase05.txt AC 5 ms 6760 KiB
testcase06.txt AC 4 ms 6604 KiB
testcase07.txt AC 6 ms 6620 KiB
testcase08.txt AC 9 ms 6760 KiB
testcase09.txt AC 6 ms 6632 KiB
testcase10.txt AC 9 ms 6676 KiB
testcase11.txt AC 5 ms 6880 KiB
testcase12.txt AC 8 ms 6700 KiB
testcase13.txt AC 6 ms 6756 KiB
testcase14.txt AC 12 ms 6748 KiB
testcase15.txt AC 8 ms 6684 KiB