結果
| 問題 | No.2608 Divide into two |
| コンテスト | |
| ユーザー |
shisidor
|
| 提出日時 | 2024-01-19 21:33:05 |
| 言語 | C++14 (gcc 15.3.0 + boost 1.92.0 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 1 ms / 1,000 ms |
| + 583µs | |
| コード長 | 613 bytes |
| 記録 | |
| コンパイル時間 | 887 ms |
| コンパイル使用メモリ | 180,584 KB |
| 実行使用メモリ | 6,272 KB |
| 最終ジャッジ日時 | 2026-09-05 12:00:12 |
| 合計ジャッジ時間 | 1,879 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 2 |
ソースコード
#include<bits/stdc++.h>
using namespace std;
int main() {
int t;
cin >> t;
for (int j = 0; j < t; j++) {
int n;
cin >> n;
if ((n * (n + 1) / 2 % 2) == 1) cout << -1 << endl;
else {
int x = (n + 1) * n / 4;
vector<int> res(n + 1, 0);
for (int i = n; i >= 1; i--) {
if (x >= i) {
res[i]++;
x -= i;
}
}
for (int i = 1; i <= n; i++) {
cout << res[i];
if (i == n) cout << endl;
}
}
}
}
shisidor