結果

問題 No.139 交差点
ユーザー kotatsugame
提出日時 2019-07-21 05:27:40
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 215 bytes
コンパイル時間 538 ms
コンパイル使用メモリ 60,160 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2025-01-02 23:06:26
合計ジャッジ時間 1,698 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 28
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp:4:1: warning: ISO C++ forbids declaration of ‘main’ with no type [-Wreturn-type]
    4 | main()
      | ^~~~

ソースコード

diff #

#include<iostream>
using namespace std;
int N,L,t,p;
main()
{
	cin>>N>>L;
	for(int i=0;i<N;i++)
	{
		int x,w,T;cin>>x>>w>>T;
		t+=x-p;
		if(T<t%(2*T)+w)t=(t+2*T-1)/2/T*2*T;
		t+=w;
		p=x+w;
	}
	cout<<t+L-p<<endl;
}
0