結果

問題 No.2401 Dirty Shoes and Stairs
ユーザー rinrion
提出日時 2023-08-11 14:09:44
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 38 ms / 2,000 ms
コード長 479 bytes
コンパイル時間 2,982 ms
コンパイル使用メモリ 229,248 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-11-18 07:37:44
合計ジャッジ時間 4,313 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 30
権限があれば一括ダウンロードができます

ソースコード

diff #

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

int main(){
	
	int n;
	cin >> n;

	bitset <300000> bit;
	
	int m1;
	cin >> m1;
	int now = 0;

	for(int i = 0; i < m1; ++i){
		int a;
		cin >> a;
		now += a;
		bit[now] = 1; 
	}

	int m2;
	cin >> m2;
	for(int i = 0; i < m2; ++i){
		int a;
		cin >> a;
		now -= a;
		bit[now] = 1; 
	}
	
	int ans = 0;
	for(int i = 0; i < n + 1; ++i){
		if(!bit[i]) ans ++;
	}
	
	cout << ans << endl;
	
}
0