結果

問題 No.1619 Coccinellidae
ユーザー 夜
提出日時 2021-07-23 19:01:51
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 917 bytes
コンパイル時間 982 ms
コンパイル使用メモリ 92,072 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-09-25 17:51:46
合計ジャッジ時間 5,393 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,380 KB
testcase_01 AC 100 ms
4,376 KB
testcase_02 WA -
testcase_03 AC 2 ms
4,376 KB
testcase_04 AC 129 ms
4,384 KB
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 80 ms
4,380 KB
testcase_08 WA -
testcase_09 AC 1 ms
4,380 KB
testcase_10 AC 65 ms
4,380 KB
testcase_11 WA -
testcase_12 WA -
testcase_13 AC 126 ms
4,376 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 AC 1 ms
4,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <iomanip>
#include <cmath>
#include <stdio.h>
#include <queue>
#include <deque>
#include <cstdio>
#include <set>
#include <map>
#include <bitset>
#include <stack>
#include <cctype>
using namespace std;
long long a[100010];
int main() {
	long long n, m, k;
	cin >> n >> m >> k;
	for (int i = 0; i < n; i++) {
		a[i] = -1;
	}
	for (int i = n - 2; i >= 0; i--) {
		if (k > n - i - 1) {
			k -= n - i - 1;
		}
		else {
			a[i + k] = i;
			bool bo = false;
			for (int j = i - 1; j >= 0; j--) {
				if (a[i - j - 1] != -1) {
					bo = true;
				}
				a[i - j - 1 + bo] = j;
			}
			for (int j = i + 1; j < n; j++) {
				if (a[n - j + i] != -1) {
					bo = true;
				}
				a[n - j + i - bo] = j;
			}
			break;
		}
	}
	for (int i = 0; i < n; i++) {
		if (a[i] == n - 1) {
			a[i] += m - n * (n - 1) / 2;
		}
		cout << a[i] << endl;
	}
}
0