結果
| 問題 | No.690 E869120 and Constructing Array 4 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2026-08-25 16:19:49 |
| 言語 | C++14 (gcc 15.3.0 + boost 1.92.0 + ACL) |
| 結果 |
WA
不安定
|
| 実行時間 | - |
| コード長 | 684 bytes |
| 記録 | |
| コンパイル時間 | 669 ms |
| コンパイル使用メモリ | 80,256 KB |
| 実行使用メモリ | 6,272 KB |
| 最終ジャッジ日時 | 2026-08-25 16:19:53 |
| 合計ジャッジ時間 | 3,702 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | WA * 3 |
| other | AC * 2 WA * 17 |
コンパイルメッセージ
main.cpp: In function 'int main()':
main.cpp:36:15: warning: structured bindings only available with '-std=c++17' or '-std=gnu++17' [-Wc++17-extensions]
36 | for (auto [i, j] : sides) printf("%d %d\n", i, j);
| ^
ソースコード
#include <iostream>
#include <cstdio>
#include <vector>
using namespace std;
typedef pair<int, int> PII;
const int N = 30;
int k, n, m;
vector<PII> sides;
int main() {
// freopen("path.in", "r", stdin);
// freopen("path.out", "w", stdout);
scanf("%d", &k);
n = 32;
for (int i = 2; i < 32; ++i) {
for (int j = i + 1; j <= 32; ++j) {
sides.push_back({ i, j });
++m;
}
}
for (int i = 30; i >= 0; --i) {
if (k >> i & 1) {
sides.push_back({ 1, n - i });
++m;
}
}
printf("%d %d\n", n, m);
for (auto [i, j] : sides) printf("%d %d\n", i, j);
return 0;
}