結果

問題 No.690 E869120 and Constructing Array 4
コンテスト
ユーザー zelda_master
提出日時 2026-08-25 16:18:50
言語 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  
実行時間 -
コード長 684 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 1,401 ms
コンパイル使用メモリ 80,000 KB
実行使用メモリ 6,272 KB
最終ジャッジ日時 2026-08-25 16:18:56
合計ジャッジ時間 4,212 ms
ジャッジサーバーID
(参考情報)
judge2_0 / judge1_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
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);
      |               ^

ソースコード

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 = 29; 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;
}
0