結果

問題 No.982 Add
ユーザー square1001square1001
提出日時 2020-03-01 23:01:15
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 351 bytes
コンパイル時間 588 ms
コンパイル使用メモリ 68,104 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-04-21 22:27:16
合計ジャッジ時間 1,802 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
5,248 KB
testcase_01 WA -
testcase_02 AC 2 ms
5,376 KB
testcase_03 AC 2 ms
5,376 KB
testcase_04 WA -
testcase_05 AC 7 ms
5,376 KB
testcase_06 AC 3 ms
5,376 KB
testcase_07 AC 4 ms
5,376 KB
testcase_08 AC 2 ms
5,376 KB
testcase_09 AC 54 ms
5,376 KB
testcase_10 AC 23 ms
5,376 KB
testcase_11 AC 2 ms
5,376 KB
testcase_12 AC 2 ms
5,376 KB
testcase_13 AC 2 ms
5,376 KB
testcase_14 AC 2 ms
5,376 KB
testcase_15 AC 2 ms
5,376 KB
testcase_16 AC 10 ms
5,376 KB
testcase_17 AC 3 ms
5,376 KB
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 AC 87 ms
5,376 KB
testcase_25 AC 83 ms
5,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <vector>
#include <iostream>
using namespace std;
int main() {
	int A, B;
	cin >> A >> B;
	int ans = 0;
	for (int i = 1; i <= A * B; ++i) {
		bool ok = false;
		for (int j = 0; j <= B; ++j) {
			for (int k = 0; k <= A; ++k) {
				if (j * A + k * B == i) {
					ok = true;
				}
			}
		}
		if (!ok) ++ans;
	}
	cout << ans << endl;
	return 0;
}
0