結果
| 問題 | No.542 1円玉と5円玉 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2023-05-22 14:36:40 |
| 言語 | C++14 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 430 bytes |
| 記録 | |
| コンパイル時間 | 1,236 ms |
| コンパイル使用メモリ | 188,760 KB |
| 実行使用メモリ | 6,400 KB |
| 最終ジャッジ日時 | 2026-05-28 17:36:08 |
| 合計ジャッジ時間 | 2,070 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 10 |
コンパイルメッセージ
main.cpp: In function 'int main()':
main.cpp:17:20: warning: structured bindings only available with '-std=c++17' or '-std=gnu++17' [-Wc++17-extensions]
17 | for (const auto& [key, value] : ans) {
| ^
ソースコード
#include <bits/stdc++.h>
using namespace std;
using Graph = vector<vector<int>>;
using ll = long long;
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};
int main() {
int A,B; cin >> A >> B;
map<int,int> ans;
for(int i = 0; i <= A; i++) {
for(int j = 0; j <= B; j++) {
int x = (i * 1) + (j * 5);
ans[x] = 1;
}
}
ans.erase(0);
for (const auto& [key, value] : ans) {
cout << key << endl;
}
}