Submission #36599132


Source Code Expand

#include <bits/stdc++.h>
#define st first
#define nd second
#define db double
#define re register
#define pb push_back
#define mk make_pair
#define int long long
#define ldb long double
#define pii pair<int, int>
#define ull unsigned long long
#define mst(a, b) memset(a, b, sizeof(a))
using namespace std;
inline int read()
{
  int s = 0, w = 1;
  char ch = getchar();
  while(ch < '0' || ch > '9') { if(ch == '-') w *= -1; ch = getchar(); }
  while(ch >= '0' && ch <= '9') s = s * 10 + ch - '0', ch = getchar();
  return s * w;
}
int n, k;
queue<int> q;
signed main()
{
  n = read(), k = read();
  for(re int i = 1, x; i <= n; i++) x = read(), q.push(x);
  while(k--) q.pop(), q.push(0);
  for(re int i = 1; i <= n; i++)
	printf("%lld ", q.front()), q.pop();
  return 0;
}

Submission Info

Submission Time
Task A - Shift
User Booksnow
Language C++ (GCC 9.2.1)
Score 100
Code Size 805 Byte
Status AC
Exec Time 5 ms
Memory 3596 KiB

Compile Error

./Main.cpp: In function ‘int main()’:
./Main.cpp:27:14: warning: ISO C++17 does not allow ‘register’ storage class specifier [-Wregister]
   27 |   for(re int i = 1, x; i <= n; i++) x = read(), q.push(x);
      |              ^
./Main.cpp:27:21: warning: ISO C++17 does not allow ‘register’ storage class specifier [-Wregister]
   27 |   for(re int i = 1, x; i <= n; i++) x = read(), q.push(x);
      |                     ^
./Main.cpp:27:57: warning: address requested for ‘x’, which is declared ‘register’ [-Wextra]
   27 |   for(re int i = 1, x; i <= n; i++) x = read(), q.push(x);
      |                                                         ^
./Main.cpp:29:14: warning: ISO C++17 does not allow ‘register’ storage class specifier [-Wregister]
   29 |   for(re int i = 1; i <= n; i++)
      |              ^

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 100 / 100
Status
AC × 3
AC × 14
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 5 ms 3504 KiB
00_sample_01.txt AC 2 ms 3576 KiB
00_sample_02.txt AC 2 ms 3576 KiB
01_random_00.txt AC 1 ms 3448 KiB
01_random_01.txt AC 2 ms 3516 KiB
01_random_02.txt AC 2 ms 3504 KiB
01_random_03.txt AC 2 ms 3520 KiB
01_random_04.txt AC 2 ms 3448 KiB
01_random_05.txt AC 2 ms 3508 KiB
02_min_00.txt AC 2 ms 3480 KiB
02_min_01.txt AC 2 ms 3596 KiB
02_min_02.txt AC 2 ms 3420 KiB
03_max_00.txt AC 2 ms 3516 KiB
03_max_01.txt AC 2 ms 3576 KiB