結果

問題 No.2401 Dirty Shoes and Stairs
ユーザー nystnyst
提出日時 2023-08-04 21:32:45
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
RE  
実行時間 -
コード長 1,137 bytes
コンパイル時間 3,478 ms
コンパイル使用メモリ 188,008 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-04-22 19:54:35
合計ジャッジ時間 6,581 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
5,248 KB
testcase_01 AC 2 ms
5,376 KB
testcase_02 AC 2 ms
5,376 KB
testcase_03 RE -
testcase_04 WA -
testcase_05 RE -
testcase_06 RE -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 RE -
testcase_13 RE -
testcase_14 RE -
testcase_15 WA -
testcase_16 RE -
testcase_17 WA -
testcase_18 RE -
testcase_19 RE -
testcase_20 RE -
testcase_21 RE -
testcase_22 RE -
testcase_23 WA -
testcase_24 RE -
testcase_25 WA -
testcase_26 RE -
testcase_27 WA -
testcase_28 AC 2 ms
5,376 KB
testcase_29 RE -
testcase_30 RE -
testcase_31 RE -
testcase_32 RE -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>
#include <iomanip>
#include <algorithm>
#include <map>
#include <cmath>
#include <bitset>
#include <string>
#include <queue>
#include <stack>
#include <set>
#include <tuple>
#include <atcoder/all>
#include <sstream> // std::stringstream
#include <regex>
#include <fstream>
using namespace atcoder;
using mint = modint998244353;
//using mint = modint1000000007;
using namespace std;
using ll = long long;
static const double pi = 3.141592653589793;
const int INF = (1 << 29);
const ll mod = 998244353;
// ifstream ifs(""); ファイルはワークスペースのトップにおく

int main() {

    int n,m1;
    cin >> n >> m1;
    vector<int> a(m1);
    for(int i=0;i<m1;i++) cin >> a[i];
    int m2;
    cin >> m2;
    vector<int> b(m2);
    for(int i=0;i<m2;i++) cin >> b[i];
    vector<bool> v(n+1,false);
    v[0] = true;
    int now = 0;
    for(int i=0;i<m1;i++){
        now +=a[i];
        v[now] = true;
    }
    for(int i=0;i<m1;i++){
        now -= b[i];
        v[now] = true;    
    }
    int ans = 0;
    for(auto x:v){
        if(x==false) ans++;
    }
    cout << ans << endl;
} 
0