結果
| 問題 |
No.871 かえるのうた
|
| コンテスト | |
| ユーザー |
cureskol
|
| 提出日時 | 2019-08-30 21:54:08 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 504 bytes |
| コンパイル時間 | 1,591 ms |
| コンパイル使用メモリ | 168,320 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-11-21 23:03:01 |
| 合計ジャッジ時間 | 4,786 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 19 WA * 30 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
const int MOD=1e9+7;
const int INF=1e9;
//const int MOD=998244353;
const long long LINF=3e17;
#define int long long
//template
//main
signed main(){
int N,K;cin>>N>>K;
std::vector<int> x(N+2),a(N+2);
for(int i=0;i<N;i++)cin>>x[i+1];
for(int i=0;i<N;i++)cin>>a[i+1];
x[0]=-LINF;x[N+1]=LINF;a[0]=a[N+1]=0;
int now=K;
while(x[now]-x[now-1]<=a[now])now--;
int left=now;
now=K;
while(x[now+1]-x[now]<=a[now])now++;
cout<<now-left+1<<endl;
}
cureskol