結果
問題 | No.542 1円玉と5円玉 |
ユーザー | aaa |
提出日時 | 2018-10-11 11:32:00 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 842 bytes |
コンパイル時間 | 945 ms |
コンパイル使用メモリ | 100,128 KB |
実行使用メモリ | 6,824 KB |
最終ジャッジ日時 | 2024-10-12 17:36:03 |
合計ジャッジ時間 | 1,626 ms |
ジャッジサーバーID (参考情報) |
judge / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 10 |
ソースコード
#include <stdio.h> #include <algorithm> #include <iostream> #include <string> #include <vector> #include <functional> #include <map> #include <iomanip> #include <math.h> #include <stack> #include <queue> #include <bitset> #include <cstdlib> #include <tuple> #include <cctype> #include <ctype.h> #include <set> #include <sstream> using namespace std; int main() { int i, j, k; int a, b; map<int, int>mp; cin >> a >> b; if (a == 0 && b == 0) { cout << 0 << endl; return 0; } for (i = 1; i <= a; i++) { //cout << i << endl; mp.insert(make_pair(i, 0)); } for (i = 1; i <= b; i++) { for (j = 0; j <= a; j++) { //cout << i*5+j << endl; mp.insert(make_pair(i * 5 + j, 0)); } } for (auto itr = mp.begin(); itr != mp.end(); itr++) { cout << (*itr).first << endl; } getchar(); getchar(); return 0; }