Submission #57040046
Source Code Expand
Copy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#include<bits/stdc++.h>
using namespace std;
const int M = 105;
int a[M], n, k;
int main() {
scanf("%d %d", &n, &k);
for (int i = 1; i <= n; i++) {
scanf("%d", &a[i]);
}
for (int i = n - k + 1; i <= n; i++) {
printf("%d ", a[i]);
}
for (int i = 1; i <= n - k; i++) {
printf("%d ", a[i]);
}
return 0;
}
Submission Info
Submission Time
2024-08-24 12:07:40
Task
A - Cut
User
ybc2027_sunshiyi
Language
C++ 20 (gcc 12.2)
Score
100
Code Size
331 Byte
Status
AC
Exec Time
1 ms
Memory
3876 KB
Compile Error
Main.cpp: In function ‘int main()’:
Main.cpp:6:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
6 | scanf("%d %d", &n, &k);
| ~~~~~^~~~~~~~~~~~~~~~~
Main.cpp:8:22: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
8 | scanf("%d", &a[i]);
| ~~~~~^~~~~~~~~~~~~
Judge Result
Set Name
Sample
All
Score / Max Score
0 / 0
100 / 100
Status
Set Name
Test Cases
Sample
sample_01.txt, sample_02.txt
All
random_01.txt, random_02.txt, random_03.txt, random_04.txt, random_05.txt, random_06.txt, random_07.txt, random_08.txt, sample_01.txt, sample_02.txt
Case Name
Status
Exec Time
Memory
random_01.txt
AC
1 ms
3876 KB
random_02.txt
AC
1 ms
3576 KB
random_03.txt
AC
1 ms
3876 KB
random_04.txt
AC
1 ms
3620 KB
random_05.txt
AC
1 ms
3748 KB
random_06.txt
AC
1 ms
3816 KB
random_07.txt
AC
1 ms
3756 KB
random_08.txt
AC
1 ms
3744 KB
sample_01.txt
AC
1 ms
3764 KB
sample_02.txt
AC
1 ms
3756 KB