結果

問題 No.2401 Dirty Shoes and Stairs
ユーザー achapiachapi
提出日時 2023-08-04 21:25:44
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
RE  
実行時間 -
コード長 497 bytes
コンパイル時間 2,064 ms
コンパイル使用メモリ 198,264 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-04-22 19:45:39
合計ジャッジ時間 5,114 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

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

int main() {
	int N;
	cin >> N;
	int M1;
	cin >> M1;
	vector<int> A(M1);
	for (int i = 0; i < M1; i++){
		cin >> A[i];
	}
	int M2;
	cin >> M2;
	vector<int> B(M2);
	for (int i = 0; i < M2; i++){
		cin >> B[i];
	}
	vector<bool> flg(N + 1);
	flg[0] = true;
	int c = 0;
	for (int i = 0; i < M1; i++){
		c += A[i];
		flg[c] = true;
	}
	for (int i = 0; i < M1; i++){
		c -= B[i];
		flg[c] = true;
	}
	cout << count(flg.begin(), flg.end(), false) << '\n';
}
0