結果

問題 No.542 1円玉と5円玉
ユーザー zaichuzaichu
提出日時 2017-10-14 19:53:35
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 515 bytes
コンパイル時間 1,556 ms
コンパイル使用メモリ 165,860 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-04-28 19:42:57
合計ジャッジ時間 2,203 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

long long gcd(long long x, long long y)
{
    if (y == 0)
        return x;
    return gcd(y, x % y);
}

long long lcm(long long x, long long y)
{
    if (x == 0 || y == 0)
        return 0;
    return x / gcd(x, y) * y;
}

int main()
{
    int A, B;
    cin >> A >> B;
    for (int i = 0; i <= B; i++)
    {
        if (i != 0)
            cout << i * 5 << endl;

        for (int j = 1; j <= A; j++)
        {
            cout << j + i * 5 << endl;
        }
    }
}
0