結果
| 問題 |
No.689 E869120 and Constructing Array 3
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-10-27 12:10:58 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 792 bytes |
| コンパイル時間 | 754 ms |
| コンパイル使用メモリ | 93,220 KB |
| 実行使用メモリ | 6,944 KB |
| 最終ジャッジ日時 | 2024-07-21 21:53:31 |
| 合計ジャッジ時間 | 2,765 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 7 WA * 6 |
ソースコード
#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;
int main() {
long long k;
cin >> k;
for (long long i = 1; i <= 250; i++) {
long long co = i * (i - 1) / 2;
if (k >= co && (k - co) % i == 0 && (k - co) / i <= 250 - i) {
long long now = i + (k - co) / i;
cout << now << endl;
for (int j = 0; j < (k - co) / i; j++) {
cout << 2;
if (j != now - 1) {
cout << " ";
}
}
for (int j = 0; j < i; j++) {
cout << 1;
if (j + (k - co) / i != now - 1) {
cout << " ";
}
}
cout << endl;
return 0;
}
}
}