Submission #1865346
Source Code Expand
#include <cstdio> #include <algorithm> #define REP(i, n) for(int i = 0; i < (int)(n); ++i) using namespace std; typedef long long ll; ll vs[55]; int main(void) { ll k; scanf("%lld", &k); int n = 50; REP(i, n) { vs[i] = n-1; // 終状態 } REP(i, n) { vs[i] += k / n; } k %= n; REP(i, k) { vs[i] += n; REP(j, n) { if(i != j) { vs[j]--; } } } printf("%d\n", n); REP(i, n) { printf("%lld%c", vs[i], i == n-1 ? '\n' : ' '); } return 0; }
Submission Info
Submission Time | |
---|---|
Task | D - Decrease (Contestant ver.) |
User | ush |
Language | C++14 (GCC 5.4.1) |
Score | 600 |
Code Size | 557 Byte |
Status | AC |
Exec Time | 1 ms |
Memory | 128 KB |
Compile Error
./Main.cpp: In function ‘int main()’: ./Main.cpp:13:20: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result] scanf("%lld", &k); ^
Judge Result
Set Name | Sample | All | ||||
---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 600 / 600 | ||||
Status |
|
|
Set Name | Test Cases |
---|---|
Sample | example0, example1, example2, example3, example4 |
All | corner0, corner1, corner2, corner3, corner4, corner5, corner6, corner7, corner8, corner9, example0, example1, example2, example3, example4, rand0, rand1, rand2, rand3, rand4, rand5, rand6, rand7, rand8, rand9 |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
corner0 | AC | 1 ms | 128 KB |
corner1 | AC | 1 ms | 128 KB |
corner2 | AC | 1 ms | 128 KB |
corner3 | AC | 1 ms | 128 KB |
corner4 | AC | 1 ms | 128 KB |
corner5 | AC | 1 ms | 128 KB |
corner6 | AC | 1 ms | 128 KB |
corner7 | AC | 1 ms | 128 KB |
corner8 | AC | 1 ms | 128 KB |
corner9 | AC | 1 ms | 128 KB |
example0 | AC | 1 ms | 128 KB |
example1 | AC | 1 ms | 128 KB |
example2 | AC | 1 ms | 128 KB |
example3 | AC | 1 ms | 128 KB |
example4 | AC | 1 ms | 128 KB |
rand0 | AC | 1 ms | 128 KB |
rand1 | AC | 1 ms | 128 KB |
rand2 | AC | 1 ms | 128 KB |
rand3 | AC | 1 ms | 128 KB |
rand4 | AC | 1 ms | 128 KB |
rand5 | AC | 1 ms | 128 KB |
rand6 | AC | 1 ms | 128 KB |
rand7 | AC | 1 ms | 128 KB |
rand8 | AC | 1 ms | 128 KB |
rand9 | AC | 1 ms | 128 KB |