結果
問題 |
No.796 well known
|
ユーザー |
|
提出日時 | 2023-05-03 19:11:40 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 36 ms / 2,000 ms |
コード長 | 514 bytes |
コンパイル時間 | 2,035 ms |
コンパイル使用メモリ | 173,904 KB |
実行使用メモリ | 8,448 KB |
最終ジャッジ日時 | 2024-11-21 20:26:54 |
合計ジャッジ時間 | 4,152 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 15 |
コンパイルメッセージ
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) { | ^
ソースコード
#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; }