結果

問題 No.542 1円玉と5円玉
ユーザー kyabaria
提出日時 2018-09-11 18:44:05
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 3 ms / 2,000 ms
コード長 514 bytes
コンパイル時間 1,710 ms
コンパイル使用メモリ 164,924 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-06-23 19:47:39
合計ジャッジ時間 2,513 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 10
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
typedef long long ll;
#define INF 1000000000
#define MOD 1000000007
using namespace std;
int main(void){
    int a,b;
    cin>>a>>b;
    vector<int>res;
    for(int i=0;i<=a;i++){
        for(int j=0;j<=b;j++){
            int sum=i+j*5;
            if(sum!=0){
                res.push_back(sum);
            }
        }
    }
    sort(res.begin(),res.end());
    res.erase(unique(res.begin(), res.end()), res.end());
    for(int i=0;i<res.size();i++){
        cout<<res[i]<<endl;
    }
}
0