結果
| 問題 |
No.139 交差点
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2019-07-21 05:26:50 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 216 bytes |
| コンパイル時間 | 724 ms |
| コンパイル使用メモリ | 60,592 KB |
| 実行使用メモリ | 6,820 KB |
| 最終ジャッジ日時 | 2025-01-02 23:04:02 |
| 合計ジャッジ時間 | 1,789 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 22 WA * 6 |
コンパイルメッセージ
main.cpp:4:1: warning: ISO C++ forbids declaration of ‘main’ with no type [-Wreturn-type]
4 | main()
| ^~~~
ソースコード
#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;
}