結果
問題 | No.2401 Dirty Shoes and Stairs |
ユーザー |
![]() |
提出日時 | 2023-10-10 00:19:31 |
言語 | C++17(gcc12) (gcc 12.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 45 ms / 2,000 ms |
コード長 | 688 bytes |
コンパイル時間 | 2,226 ms |
コンパイル使用メモリ | 202,912 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-09-12 22:47:31 |
合計ジャッジ時間 | 3,870 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 30 |
ソースコード
#include <bits/stdc++.h> using namespace std; #ifdef LOCAL #include "settings/debug.cpp" #define _GLIBCXX_DEBUG #else #define Debug(...) void(0) #endif #define rep(i, n) for (int i = 0; i < (n); ++i) using ll = long long; using ull = unsigned long long; int main() { int n; cin >> n; vector<bool> dirty(n + 1, false); dirty[0] = dirty[n] = true; int m; cin >> m; int now = 0; rep(i, m) { int a; cin >> a; now += a; dirty[now] = true; } cin >> m; assert(now == n); rep(i, m) { int a; cin >> a; now -= a; dirty[now] = true; } int ans = 0; rep(i, n + 1) { if (!dirty[i]) ans++; } cout << ans << endl; return 0; }