結果

問題 No.2401 Dirty Shoes and Stairs
ユーザー ochiaigawaochiaigawa
提出日時 2023-08-04 21:58:38
言語 C++17(gcc12)
(gcc 12.3.0 + boost 1.87.0)
結果
AC  
実行時間 43 ms / 2,000 ms
コード長 378 bytes
コンパイル時間 1,858 ms
コンパイル使用メモリ 201,740 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-10-14 19:54:52
合計ジャッジ時間 3,109 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 30
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  vector<bool> d(N + 1, true);
  int M1;
  cin >> M1;
  int now = 0;
  while(M1--) {
    int A;
    cin >> A;
    d[now += A] = false;
  }
  int M2;
  cin >> M2;
  while(M2--) {
    int B;
    cin >> B;
    d[now -= B] = false;
  }
  cout << accumulate(d.begin(), d.end(), 0) << '\n';
  return 0;
}
0