結果
| 問題 | No.542 1円玉と5円玉 | 
| コンテスト | |
| ユーザー |  Elk | 
| 提出日時 | 2018-07-22 18:21:14 | 
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 4 ms / 2,000 ms | 
| コード長 | 884 bytes | 
| コンパイル時間 | 1,997 ms | 
| コンパイル使用メモリ | 166,344 KB | 
| 実行使用メモリ | 5,248 KB | 
| 最終ジャッジ日時 | 2024-12-26 05:16:13 | 
| 合計ジャッジ時間 | 2,736 ms | 
| ジャッジサーバーID (参考情報) | judge2 / judge5 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 10 | 
ソースコード
#include <bits/stdc++.h>
using namespace std;
int main(){
    int one, five;
    int i, j, ans = 0;
    cin >> one >> five;
    if(one == 0){
        for(i = 0; i < five; i++){
            ans += 5;
            cout << ans << endl;
        }
    }else if(five == 0){
        for(i = 0; i < one; i++){
            ans += 1;
            cout << ans << endl;
        }
    }else if(one < 4){
        for(i = 0; i < five + 1; i++){
            for(j = 0; j < one; j++){
                ans += 1;
                cout << ans << endl;
            }
            if(ans == one + 5*five){
                break;
            }
            ans += 5 - one;
            cout << ans << endl;
            if(ans == one + 5*five){
                break;
            }
        }
    }else{
        for(i = 1; i <= one + 5*five; i++){
            cout << i << endl;
        }
    }
    return 0;
}
            
            
            
        