結果

問題 No.542 1円玉と5円玉
ユーザー d_seid_sei
提出日時 2019-09-22 21:37:05
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 660 bytes
コンパイル時間 852 ms
コンパイル使用メモリ 87,684 KB
実行使用メモリ 4,348 KB
最終ジャッジ日時 2023-10-19 07:23:56
合計ジャッジ時間 1,605 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include<iostream>
#include<algorithm>
#include <vector>
#include<cmath>
#include<iomanip>
#include<queue>
using namespace std;
typedef long long int lint;
int main() {
	int A, B;
	cin >> A >> B;
	int cnt = 0;
	int C = (A + 1) * (B + 1)+1;
	vector<int>vec(C);
	for (int ia = 0; ia <= A; ia++) {
		for (int ib = 0; ib <= B; ib++) {
			vec.at(cnt) = ia + ib * 5;
			cnt++;
		}
	}
	vec.at(C - 1) = 100000000;
	sort(vec.begin(), vec.end());
	/*for (int ic = 0; ic < C; ic++) {
		cout << vec.at(ic) << ' ';
	}*/
	for (int id = 1; id < C - 1; id++) {
		if (vec.at(id - 1) != vec.at(id) && vec.at(id) != vec.at(id + 1)) {
			cout << vec.at(id) << endl;
		}
	}
}



	
0