結果
問題 |
No.949 飲酒プログラミングコンテスト
|
ユーザー |
![]() |
提出日時 | 2019-12-13 23:28:54 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 806 bytes |
コンパイル時間 | 2,243 ms |
コンパイル使用メモリ | 160,444 KB |
実行使用メモリ | 6,948 KB |
最終ジャッジ日時 | 2024-06-27 21:13:02 |
合計ジャッジ時間 | 2,375 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 WA * 1 |
other | AC * 1 WA * 28 |
コンパイルメッセージ
main.cpp:1:9: warning: #pragma once in main file 1 | #pragma once | ^~~~
ソースコード
#pragma once #include <bits/stdc++.h> #define M_PI 3.14159265358979323846 // pi using namespace std; typedef long long ll; typedef unsigned long long ull; typedef vector<int> VI; typedef pair<ll, ll> P; typedef tuple<ll, ll, ll> t3; #define rep(a,n) for(int a = 0;a < n;a++) #define repi(a,b,n) for(int a = b;a < n;a++) const ull mod = 1000000007; int main(void) { ll n; cin >> n; vector<ll> as(n+1); vector<ll> bs(n+1); vector<ll> ds(n); rep(i, n + 1) cin >> as[i]; rep(i, n + 1) cin >> bs[i]; rep(i, n) cin >> ds[i]; vector<ll> p(n); int a = 0; int b = 0; rep(i, n) { if (as[a + 1] + bs[b] < as[a] + bs[b + 1]) { b++; } else { a++; } p[i] = as[a] + bs[b]; } int sum = 0; rep(i, n) { if (p[i] >= ds[i]) { sum++; } } cout << sum << endl; return 0; }