結果

問題 No.808 Kaiten Sushi?
ユーザー noshi91noshi91
提出日時 2019-03-22 23:51:03
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
RE  
実行時間 -
コード長 306 bytes
コンパイル時間 535 ms
コンパイル使用メモリ 63,232 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-09-19 07:08:50
合計ジャッジ時間 10,517 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1 WA * 1 RE * 1
other WA * 1 RE * 55
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
using namespace std;
long N,L,a,s,t,c,i,x[100001],y[100001],*p=&x[0],*q=&y[0];
int main(){cin>>N>>L;for(i=0;i!=N;++i)cin>>x[i];for(i=0;i!=N;++i)cin>>y[i];x[N]=L;y[N]=L;for(i=0;i!=N*2;++i){if(*p<*q){++c;if(s<=c)s=c,i=*q;++p;}else{--c;if(c<=t)t=c;++q;}}cout<<(s?L*(s-t)-L+i:L*(s-t)+y[0]);}
0