結果

問題 No.542 1円玉と5円玉
ユーザー GB
提出日時 2018-10-25 17:32:15
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 3 ms / 2,000 ms
コード長 441 bytes
コンパイル時間 573 ms
コンパイル使用メモリ 65,408 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-11-19 05:44:05
合計ジャッジ時間 1,206 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 10
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
#include<vector>
#include<algorithm>

using namespace std;

int main() {

	int num1, num5;
	cin >> num1 >> num5;
	vector<int> array;

	for (int i = 0;i < num1+1;++i) {
		for (int j = 0;j < num5+1;++j) {
			int buff= i + 5 * j;
			array.push_back(buff);
		}
	}

	sort(array.begin(), array.end());

	for (int i = 1; i< array.size();i++) {
		if (array[i - 1] == array[i])continue;
		cout << array[i] << endl;
	}

	return 0;
}
0