結果

問題 No.690 E869120 and Constructing Array 4
コンテスト
ユーザー zelda_master
提出日時 2026-08-25 16:17:49
言語 C++14
(gcc 15.3.0 + boost 1.92.0 + ACL)
コンパイル:
g++-15 -O2 -lm -std=c++14 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
WA  
実行時間 -
コード長 687 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 348 ms
コンパイル使用メモリ 80,256 KB
実行使用メモリ 6,272 KB
最終ジャッジ日時 2026-08-25 16:17:54
合計ジャッジ時間 3,896 ms
ジャッジサーバーID
(参考情報)
judge2_0 / judge1_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample WA * 3
other AC * 1 WA * 18
権限があれば一括ダウンロードができます
コンパイルメッセージ
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);
      |               ^

ソースコード

diff #
raw source code

#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 = N - 1; i >= 1; --i) {
        if (k >> i & 1) {
            sides.push_back({ 1, i + 1 });
            ++m;
        }
    }

    printf("%d %d\n", n, m);
    for (auto [i, j] : sides) printf("%d %d\n", i, j);

    return 0;
}
0