結果

問題 No.542 1円玉と5円玉
コンテスト
ユーザー nCk_cv
提出日時 2017-09-01 02:18:54
言語 C++14
(gcc 15.3.0 + boost 1.92.0 + ACL)
コンパイル:
g++-15 -O2 -lm -std=c++14 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
AC  
実行時間 1 ms / 2,000 ms
+ 520µs
コード長 561 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 352 ms
コンパイル使用メモリ 95,012 KB
実行使用メモリ 9,920 KB
最終ジャッジ日時 2026-09-19 18:53:52
合計ジャッジ時間 1,675 ms
ジャッジサーバーID
(参考情報)
judge2_0 / judge4_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 10
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#include <iostream>
#include <algorithm>
#include <cstring>
#include <string>
#include <vector>
#include <queue>
#include <deque>
#include <cmath>

#define AS(a) (sizeof(a)/sizeof(a[0]))
using namespace std;
long long int MOD = 1000000007;
long long int INF = 1000000007;


int main() {
  int a,b;
  cin >> a >> b;
  bool ok[601];
  for(int i = 0; i < 601; i++) {
    ok[i] = false;
  }
  for(int i = 0; i <= a; i++) {
    for(int j = 0; j <= b; j++) {
      ok[i + j*5] = true;
    }
  }
  for(int i = 1; i < 601; i++) {
    if(ok[i]) cout << i << endl;
  }
}
0