Submission #36602199
Source Code Expand
Copy
#include<bits/stdc++.h>using namespace std;#define int long longconst int N = 1e5 + 10;int a[N];void solve() {int n, k;cin >> n >> k;for (int i = 1; i <= n; i++) cin >> a[i];if (k > n) {for (int i = 1; i <= n; i++) cout << 0 << " ";cout << endl;return;}for (int i = k + 1; i <= n; i++) cout << a[i] << " ";for (int i = 1; i <= k; i++) cout << 0 << " ";cout << endl;
#include<bits/stdc++.h> using namespace std; #define int long long const int N = 1e5 + 10; int a[N]; void solve() { int n, k; cin >> n >> k; for (int i = 1; i <= n; i++) cin >> a[i]; if (k > n) { for (int i = 1; i <= n; i++) cout << 0 << " "; cout << endl; return; } for (int i = k + 1; i <= n; i++) cout << a[i] << " "; for (int i = 1; i <= k; i++) cout << 0 << " "; cout << endl; } signed main() { int tt=1; while (tt--) { solve(); } }
Submission Info
Submission Time | |
---|---|
Task | A - Shift |
User | dabossdu |
Language | C++ (GCC 9.2.1) |
Score | 100 |
Code Size | 504 Byte |
Status | AC |
Exec Time | 7 ms |
Memory | 3572 KB |
Judge Result
Set Name | Sample | All | ||||
---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 100 / 100 | ||||
Status |
|
|
Set Name | Test Cases |
---|---|
Sample | 00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt |
All | 00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt, 01_random_00.txt, 01_random_01.txt, 01_random_02.txt, 01_random_03.txt, 01_random_04.txt, 01_random_05.txt, 02_min_00.txt, 02_min_01.txt, 02_min_02.txt, 03_max_00.txt, 03_max_01.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
00_sample_00.txt | AC | 7 ms | 3568 KB |
00_sample_01.txt | AC | 2 ms | 3456 KB |
00_sample_02.txt | AC | 3 ms | 3388 KB |
01_random_00.txt | AC | 2 ms | 3448 KB |
01_random_01.txt | AC | 2 ms | 3516 KB |
01_random_02.txt | AC | 2 ms | 3572 KB |
01_random_03.txt | AC | 2 ms | 3460 KB |
01_random_04.txt | AC | 2 ms | 3324 KB |
01_random_05.txt | AC | 3 ms | 3512 KB |
02_min_00.txt | AC | 2 ms | 3404 KB |
02_min_01.txt | AC | 2 ms | 3516 KB |
02_min_02.txt | AC | 2 ms | 3456 KB |
03_max_00.txt | AC | 3 ms | 3452 KB |
03_max_01.txt | AC | 3 ms | 3452 KB |