結果
問題 | No.139 交差点 |
ユーザー |
![]() |
提出日時 | 2017-07-12 01:40:25 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 360 bytes |
コンパイル時間 | 1,626 ms |
コンパイル使用メモリ | 167,400 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-10-07 15:11:40 |
合計ジャッジ時間 | 2,767 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 21 WA * 7 |
ソースコード
#include <bits/stdc++.h>#define REP(i,n,N) for(int i=(n);i<(int) N;i++)#define p(s) cout<<(s)<<endlusing namespace std;int X[110];int W[110];int T[110];int main(){int N,L;cin>>N>>L;REP(i,0,N) cin>>X[i]>>W[i]>>T[i];X[N]=L;int now=X[0];REP(i,0,N){if(now%(2*T[i])>=T[i]-W[i])now+=2*T[i]-(now%(2*T[i]));now+=X[i+1]-X[i];}p(now);}