結果

問題 No.871 かえるのうた
ユーザー cureskol
提出日時 2019-08-30 21:49:40
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 504 bytes
コンパイル時間 1,744 ms
コンパイル使用メモリ 169,896 KB
実行使用メモリ 6,824 KB
最終ジャッジ日時 2024-11-21 22:38:15
合計ジャッジ時間 4,697 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 19 WA * 30
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
const int MOD=1e9+7;
const int INF=1e9;
//const int MOD=998244353;
const long long LINF=1e18;
#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;
}
0