Submission #4640710


Source Code Expand

#include <bits/stdc++.h>
using namespace std;

using VS = vector<string>;    using LL = long long;
using VI = vector<int>;       using VVI = vector<VI>;
using PII = pair<int, int>;   using PLL = pair<LL, LL>;
using VL = vector<LL>;        using VVL = vector<VL>;

#define ALL(a)  begin((a)),end((a))
#define RALL(a) (a).rbegin(), (a).rend()
#define SZ(a) int((a).size())
#define SORT(c) sort(ALL((c)))
#define RSORT(c) sort(RALL((c)))
#define UNIQ(c) (c).erase(unique(ALL((c))), end((c)))
#define FOR(i, s, e) for (int(i) = (s); (i) < (e); (i)++)
#define FORR(i, s, e) for (int(i) = (s); (i) > (e); (i)--)
//#pragma GCC optimize ("-O3") 
#ifdef YANG33
#include "mydebug.hpp"
#else
#define DD(x) 
#endif
const int INF = 1e9;                          const LL LINF = 1e16;
const LL MOD = 1000000007;                    const double PI = acos(-1.0);
int DX[8] = { 0, 0, 1, -1, 1, 1, -1, -1 };    int DY[8] = { 1, -1, 0, 0, 1, -1, 1, -1 };

/* -----  __MAKE_TIME__  Problem: __PROBLEM__ / Link: __CONTEST_URL__  ----- */
/* ------問題------



-----問題ここまで----- */
/* -----解説等-----



----解説ここまで---- */



int main() {
	cin.tie(0);
	ios_base::sync_with_stdio(false);

	LL K; cin >> K;
	LL N = 50;
	VL a(N, 49);
	FOR(i, 0, N) {
		a[i] += K / N;
	}
	FOR(i, 0, N) {
		if (i < K%N)a[i]++;
		else a[i] -= K % N;
	}

	DD(De(a));

	if(0){
		LL cnt = 0;
		while (1) {
			int id = max_element(ALL(a)) - a.begin();
			if (a[id] < 50)break;
			FOR(i, 0, N) {
				if (i == id)a[id] -= 50;
				else a[i]++;
			}
			cnt++;

		}
		DD(de(cnt));
	}
	cout << N << endl;
	FOR(i, 0, N) {
		cout << a[i] << " \n"[i == N - 1];
	}

	return 0;
}

Submission Info

Submission Time
Task D - Decrease (Contestant ver.)
User Yang33
Language C++14 (GCC 5.4.1)
Score 600
Code Size 1727 Byte
Status AC
Exec Time 1 ms
Memory 256 KiB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 600 / 600
Status
AC × 5
AC × 25
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 256 KiB
corner1 AC 1 ms 256 KiB
corner2 AC 1 ms 256 KiB
corner3 AC 1 ms 256 KiB
corner4 AC 1 ms 256 KiB
corner5 AC 1 ms 256 KiB
corner6 AC 1 ms 256 KiB
corner7 AC 1 ms 256 KiB
corner8 AC 1 ms 256 KiB
corner9 AC 1 ms 256 KiB
example0 AC 1 ms 256 KiB
example1 AC 1 ms 256 KiB
example2 AC 1 ms 256 KiB
example3 AC 1 ms 256 KiB
example4 AC 1 ms 256 KiB
rand0 AC 1 ms 256 KiB
rand1 AC 1 ms 256 KiB
rand2 AC 1 ms 256 KiB
rand3 AC 1 ms 256 KiB
rand4 AC 1 ms 256 KiB
rand5 AC 1 ms 256 KiB
rand6 AC 1 ms 256 KiB
rand7 AC 1 ms 256 KiB
rand8 AC 1 ms 256 KiB
rand9 AC 1 ms 256 KiB