Submission #2554344
Source Code Expand
#include <cstdio> using namespace std; const int N = 3e5 + 10; int n, K, top, a[N]; template <class T> inline void in(T &x) { x = 0; int f = 1; char ch = getchar(); for (; ch<'0' || ch>'9';) {if (ch=='-') f=-1; ch = getchar();} for (; ch>='0' && ch<='9';) x = x*10 + ch-'0', ch = getchar(); x *= f; } int main() { in(K), in(n), top = n; if (K & 1) { for (int i = 1; i <= n; ++i) a[i] = K + 1 >> 1; for (int i = 1; i <= n/2; ++i) if (a[top] == 1) --a[top]; else { --a[top]; for (int j = top + 1; j <= n; ++top) a[j] = K; top = n; } } else { a[1] = K >> 1; for (int i = 2; i <= n; ++i) a[i] = K; } for (int i = 1; i < top; ++i) printf("%d ", a[i]); printf("%d\n", a[top]); return 0; }
Submission Info
Submission Time | |
---|---|
Task | E - Finite Encyclopedia of Integer Sequences |
User | annoyrain |
Language | C++14 (GCC 5.4.1) |
Score | 0 |
Code Size | 754 Byte |
Status | WA |
Exec Time | 27 ms |
Memory | 3328 KB |
Judge Result
Set Name | Sample | All | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 0 / 800 | ||||||||
Status |
|
|
Set Name | Test Cases |
---|---|
Sample | s1.txt, s2.txt, s3.txt |
All | 01.txt, 02.txt, 03.txt, 04.txt, 05.txt, 06.txt, 07.txt, 08.txt, 09.txt, 10.txt, 11.txt, 12.txt, 13.txt, 14.txt, 15.txt, 16.txt, 17.txt, 18.txt, 19.txt, 20.txt, 21.txt, 22.txt, 23.txt, 24.txt, 25.txt, 26.txt, 27.txt, 28.txt, s1.txt, s2.txt, s3.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
01.txt | WA | 24 ms | 1920 KB |
02.txt | AC | 1 ms | 128 KB |
03.txt | WA | 1 ms | 128 KB |
04.txt | WA | 1 ms | 128 KB |
05.txt | WA | 1 ms | 128 KB |
06.txt | WA | 24 ms | 1920 KB |
07.txt | AC | 19 ms | 1536 KB |
08.txt | AC | 24 ms | 1920 KB |
09.txt | WA | 19 ms | 1536 KB |
10.txt | AC | 27 ms | 3328 KB |
11.txt | WA | 27 ms | 3328 KB |
12.txt | AC | 7 ms | 896 KB |
13.txt | AC | 12 ms | 1536 KB |
14.txt | AC | 4 ms | 640 KB |
15.txt | AC | 1 ms | 128 KB |
16.txt | AC | 1 ms | 128 KB |
17.txt | AC | 1 ms | 128 KB |
18.txt | AC | 1 ms | 128 KB |
19.txt | AC | 1 ms | 128 KB |
20.txt | AC | 21 ms | 2688 KB |
21.txt | AC | 1 ms | 256 KB |
22.txt | AC | 1 ms | 256 KB |
23.txt | AC | 19 ms | 2432 KB |
24.txt | AC | 9 ms | 1152 KB |
25.txt | WA | 24 ms | 1920 KB |
26.txt | AC | 7 ms | 640 KB |
27.txt | WA | 10 ms | 896 KB |
28.txt | WA | 10 ms | 768 KB |
s1.txt | AC | 1 ms | 128 KB |
s2.txt | AC | 1 ms | 128 KB |
s3.txt | WA | 1 ms | 128 KB |