結果
| 問題 |
No.2401 Dirty Shoes and Stairs
|
| コンテスト | |
| ユーザー |
forest3
|
| 提出日時 | 2023-09-30 09:49:54 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 46 ms / 2,000 ms |
| コード長 | 424 bytes |
| コンパイル時間 | 1,665 ms |
| コンパイル使用メモリ | 169,252 KB |
| 実行使用メモリ | 6,944 KB |
| 最終ジャッジ日時 | 2024-07-23 03:55:06 |
| 合計ジャッジ時間 | 3,311 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 30 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
int main() {
int N, M1, M2;
cin >> N >> M1;
vector<int> v( N + 1 );
int now = 0;
v[now] = 1;
for( int i = 0; i < M1; i++ ) {
int a;
cin >> a;
now += a;
v[now] = 1;
}
cin >> M2;
for( int i = 0; i < M2; i++ ) {
int b;
cin >> b;
now -= b;
v[now] = 1;
}
int ans = 0;
for( int i = 0; i < N + 1; i++ ) {
if( v[i] == 0 ) ans++;
}
cout << ans << endl;
}
forest3