結果

問題 No.1880 Many Ways
ユーザー 👑 NachiaNachia
提出日時 2022-03-18 21:58:27
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 839 bytes
コンパイル時間 876 ms
コンパイル使用メモリ 82,704 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-04-14 09:48:15
合計ジャッジ時間 15,432 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,812 KB
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 AC 2 ms
6,940 KB
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>
#include <algorithm>
#include <atcoder/modint>
using namespace std;
using i64 = long long;
using m32 = atcoder::static_modint<998244353>;
#define rep(i,n) for(int i=0; i<(int)(n); i++)

int D = 39;

int main(){
    i64 A; cin >> A;
    vector<pair<int,int>> ans;
    rep(s,2) rep(t,2) rep(i,D) ans.push_back({ 2+3*i+s, 2+3*(i+1)+t });
    rep(s,2) ans.push_back({ 1, 2+s });
    rep(i,D) ans.push_back({ 2+3*i+2, 2+3*(i+1)+2 });
    int N = 1 + (D+1) * 3;
    rep(d,D+1) if((A>>(D-d)) & 1) ans.push_back({ 2+3*d+0, 2+3*d+2 });
    cout << N << ' ' << ans.size() << '\n';
    for(auto [u,v] : ans) cout << u << ' ' << v << '\n';
    return 0;
}


struct ios_do_not_sync{
    ios_do_not_sync(){
        std::ios::sync_with_stdio(false);
        std::cin.tie(nullptr);
    }
} ios_do_not_sync_instance;
0