結果

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

ソースコード

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);
            }
        }
    }
    res.erase(unique(res.begin(), res.end()), res.end());
    sort(res.begin(),res.end());
    for(int i=0;i<res.size();i++){
        cout<<res[i]<<endl;
    }
}
0