結果

問題 No.2401 Dirty Shoes and Stairs
ユーザー charmychachacha
提出日時 2023-08-04 21:31:11
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 21 ms / 2,000 ms
コード長 458 bytes
コンパイル時間 2,363 ms
コンパイル使用メモリ 193,268 KB
最終ジャッジ日時 2025-02-15 22:24:08
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 30
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
int main(){
	ios::sync_with_stdio(0);
	cin.tie(0); cout.tie(0);
	int N; cin >> N;
	bool A[200010] = {};
	int now = 0;
	int M1; cin >> M1;
	for(int i = 0; i < M1; i++){
		int a; cin >> a; now += a; A[now] = true;
	}
	now = N;
	int M2; cin >> M2;
	for(int i = 0; i < M2; i++){
		int a; cin >> a; now -= a; A[now] = true;
	}
	int ans = 0;
	for(int i = 0; i <= N; i++){
		if(!A[i]) ans ++;
	}
	cout << ans << "\n";
}
0