結果
| 問題 |
No.689 E869120 and Constructing Array 3
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2018-05-18 23:09:04 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 438 bytes |
| コンパイル時間 | 1,506 ms |
| コンパイル使用メモリ | 165,588 KB |
| 実行使用メモリ | 6,948 KB |
| 最終ジャッジ日時 | 2024-06-28 13:59:08 |
| 合計ジャッジ時間 | 4,212 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 7 RE * 6 |
ソースコード
#include <bits/stdc++.h>
using std::cout;
using std::endl;
using std::cin;
int main(){
int n; cin >> n;
for(int i = 1; i <= 250; i++){
int A = i * (i - 1) / 2;
int X = n - A;
if(X % i) continue;
int Z = X / i;
if(i + Z > 250) continue;
cout << i + Z << endl;
for(int j = 0; j < i; j++) cout << 1 << " ";
for(int j = 0; j < Z; j++) cout << 2 << " ";
cout << endl;
return 0;
}
assert(false);
return 0;
}