結果

問題 No.1880 Many Ways
ユーザー SSRSSSRS
提出日時 2022-03-18 22:17:02
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 810 bytes
コンパイル時間 1,899 ms
コンパイル使用メモリ 200,648 KB
実行使用メモリ 4,388 KB
最終ジャッジ日時 2023-07-26 20:42:57
合計ジャッジ時間 13,663 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ(β)

テストケース

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

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
const int L = 40;
int main(){
  long long A;
  cin >> A;
  int N = L * 3 + 1;
  vector<int> a, b;
  int M = 0;
  a.push_back(0);
  b.push_back(1);
  M++;
  a.push_back(0);
  b.push_back(2);
  M++;
  for (int i = 0; i < L - 1; i++){
    for (int j = 0; j < 2; j++){
      for (int k = 0; k < 2; k++){
        int x = i * 3 + 1 + j;
        int y = i * 3 + 4 + k;
        a.push_back(x);
        b.push_back(y);
        M++;
      }
    }
    a.push_back(i * 3 + 3);
    b.push_back(i * 3 + 6);
    M++;
  }
  for (int i = 0; i < L; i++){
    if ((A >> i & 1) == 1){
      a.push_back(i * 3 + 2);
      b.push_back(i * 3 + 3);
      M++;
    }
  }
  cout << N << ' ' << M << endl;
  for (int i = 0; i < M; i++){
    cout << a[i] + 1 << ' ' << b[i] + 1 << endl;
  }
}
0