結果
問題 |
No.2608 Divide into two
|
ユーザー |
|
提出日時 | 2024-01-19 22:03:08 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 855 bytes |
コンパイル時間 | 616 ms |
コンパイル使用メモリ | 64,256 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-09-28 04:28:28 |
合計ジャッジ時間 | 1,257 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | WA * 1 |
other | WA * 2 |
ソースコード
#include <iostream> using namespace std; int main() { int T; cin >> T; while (T--) { int N; cin >> N; int n = 0; for (int i = 1; i <= N; i++) { n += i; } if (n % 2 == 0) { if (n / 2 <= N) { for (int i = 0; i < n / 2; i++) { cout << 0; } for (int i = 0; i < N - n / 2; i++) { cout << 1; } cout << endl; } else { for (int i = 0; i < N; i++) { cout << 0; } cout << endl; } } else { cout << -1 << endl; } } }