結果

問題 No.796 well known
ユーザー yicodeyicode
提出日時 2023-05-03 19:11:40
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 33 ms / 2,000 ms
コード長 514 bytes
コンパイル時間 1,615 ms
コンパイル使用メモリ 175,052 KB
実行使用メモリ 8,320 KB
最終ジャッジ日時 2024-05-01 15:27:39
合計ジャッジ時間 2,958 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 23 ms
8,320 KB
testcase_01 AC 24 ms
8,320 KB
testcase_02 AC 24 ms
8,320 KB
testcase_03 AC 25 ms
8,320 KB
testcase_04 AC 32 ms
8,192 KB
testcase_05 AC 32 ms
8,320 KB
testcase_06 AC 32 ms
8,320 KB
testcase_07 AC 26 ms
8,320 KB
testcase_08 AC 31 ms
8,192 KB
testcase_09 AC 28 ms
8,320 KB
testcase_10 AC 33 ms
8,320 KB
testcase_11 AC 25 ms
8,320 KB
testcase_12 AC 27 ms
8,320 KB
testcase_13 AC 29 ms
8,320 KB
testcase_14 AC 27 ms
8,320 KB
testcase_15 AC 26 ms
8,320 KB
testcase_16 AC 31 ms
8,192 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function 'int main()':
main.cpp:22:20: warning: structured bindings only available with '-std=c++17' or '-std=gnu++17' [-Wc++17-extensions]
   22 |   for (const auto& [key, value] : X) {
      |                    ^

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using Graph = vector<vector<int>>;
int main() {
  long long N; cin >> N;
  bool fire = false;
  map<int,int> X;
  for(int i = 1; i <= 312456; i++) {
    if(i % 3 == 1) {
      X[i] = 1;
    }
  }
  int x = 0;
  for(int i = 0; i < N - 2; i++){
    cout << 1 << " ";
    x += 1;
  }
  cout << 3 << " ";
  x += 3;
  int z = 0;
  for (const auto& [key, value] : X) {
    if(x < key) {
      z = key - x;
      break;
    }
  }
  cout << z << endl;
}
0