結果

問題 No.3468 あるジャッジサーバー
コンテスト
ユーザー Mage
提出日時 2026-06-12 22:28:39
言語 C++23
(gcc 15.2.0 + boost 1.89.0)
コンパイル:
g++-15 -O2 -lm -std=c++23 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 2,138 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 2,284 ms
コンパイル使用メモリ 333,856 KB
実行使用メモリ 6,400 KB
最終ジャッジ日時 2026-06-12 22:28:43
合計ジャッジ時間 3,383 ms
ジャッジサーバーID
(参考情報)
judge1_0 / judge2_1
純コード判定待ち
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 16
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#include <bits/stdc++.h>
using namespace std;

// ================== MACROS ==================
#define ll long long
#define ull unsigned long long
#define ld long double
#define endl '\n'

#define vi vector<int>
#define vll vector<ll>
#define pii pair<int, int>
#define pll pair<ll, ll>

#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define pb push_back
#define ff first
#define ss second

// ================== CONSTANTS ==================
const ll INF = 1e18;
// const int MOD = 1e9 + 7; // leetcode
const int MOD = 998244353;  // atcoder, codeforces
const int N = 2e5 + 5;
string v = "aeiou";
string V = "AEIOU";

// ================== FAST IO ==================
void fast_io() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
}

// ================== DEBUG ==================
#ifndef ONLINE_JUDGE
#define debug(x)       \
  cerr << #x << " = "; \
  _print(x);           \
  cerr << endl;
#else
#define debug(x)
#endif

void _print(int x) { cerr << x; }
void _print(ll x) { cerr << x; }
void _print(string x) { cerr << x; }
void _print(char x) { cerr << x; }

template <class T>
void _print(vector<T> v) {
  cerr << "[ ";
  for (T i : v) {
    _print(i);
    cerr << " ";
  }
  cerr << "]";
}

// ================== MATH ==================
ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; }
ll lcm(ll a, ll b) { return a / gcd(a, b) * b; }

ll mod_add(ll a, ll b) { return (a % MOD + b % MOD) % MOD; }
ll mod_mul(ll a, ll b) { return (a % MOD * b % MOD) % MOD; }
ll mod_pow(ll a, ll b) {
  ll res = 1;
  while (b) {
    if (b & 1) res = mod_mul(res, a);
    a = mod_mul(a, a);
    b >>= 1;
  }
  return res;
}

void solve() {
  int n;
  cin >> n;
  vector<long long> t(n), s(n);
  for (auto& x : t) cin >> x;
  for (auto& x : s) cin >> x;

  long long cur = 0;
  int ans = 0;

  for (int i = 0; i < n; i++) {
    long long st = s[i] * 10;
    long long en = st + t[i] * 10 - 1;

    if (st >= cur) {
      ans++;
      cur = en;
    }
  }

  cout << ans;
}

int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);

  int t = 1;
  // cin >> t;
  while (t--) {
    solve();
  }

  return 0;
}
0