結果
| 問題 |
No.2401 Dirty Shoes and Stairs
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2023-08-04 21:45:09 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 17 ms / 2,000 ms |
| コード長 | 498 bytes |
| コンパイル時間 | 1,421 ms |
| コンパイル使用メモリ | 165,904 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-10-14 19:42:20 |
| 合計ジャッジ時間 | 2,387 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 30 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
#define REP(i,n) for(int i=0;i<int(n);i++)
int s[200010];
int main(void){
cin.tie(nullptr); ios_base::sync_with_stdio(false);
int i,j,k;
int N,M1,M2;
cin >> N >> M1;
s[0]=1;
int x=0;
REP(i,M1){
int a;
cin >> a;
x+=a;
s[x]=1;
}
cin >> M2;
x=N;
REP(i,M2){
int a;
cin >> a;
x-=a;
s[x]=1;
}
int ans=0;
REP(i,N+1) if(s[i]==0) ans++;
cout << ans <<endl;
return 0;
}