結果

問題 No.542 1円玉と5円玉
ユーザー alumina_8alumina_8
提出日時 2018-03-28 22:17:01
言語 C++17(clang)
(17.0.6 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 904 bytes
コンパイル時間 1,390 ms
コンパイル使用メモリ 85,772 KB
実行使用メモリ 4,504 KB
最終ジャッジ日時 2023-08-20 10:36:25
合計ジャッジ時間 2,260 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,376 KB
testcase_01 WA -
testcase_02 WA -
testcase_03 AC 2 ms
4,380 KB
testcase_04 WA -
testcase_05 AC 2 ms
4,380 KB
testcase_06 AC 2 ms
4,376 KB
testcase_07 AC 2 ms
4,504 KB
testcase_08 WA -
testcase_09 AC 2 ms
4,376 KB
testcase_10 WA -
testcase_11 AC 1 ms
4,376 KB
testcase_12 AC 3 ms
4,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>
#include <string>
using namespace std;
//変数デバッグ
#define DEB(variable) cout << #variable << '=' << variable << endl

//for簡易表記(引数ミス防止)
#define FOR(LoopVariable,numberOFbegin,numberOFend) for (int LoopVariable = (numberOFbegin); (LoopVariable) < (numberOFend); (LoopVariable)++)
#define REP(LoopVariable,numberOFend) for(int LoopVariable = 0;(LoopVariable)<(numberOFend);LoopVariable++)

int main(){

    int oneyen, fiveyen;
    bool f=false;
    cin >> oneyen >> fiveyen;

    fiveyen += oneyen / 5;

    if(0==oneyen%5){
        f = true;
    }
    
    if(4<oneyen){
        oneyen = 4;
        fiveyen--;
    }
    

    REP(i,fiveyen+1){
        REP(j,oneyen+1){
            if(i||j){
                cout << j + 5*i << endl;
            }
        }
    }
    if(f){
        cout << 5 * (++fiveyen) << endl;
    }

    return 0;
}
0