結果
問題 |
No.139 交差点
|
ユーザー |
|
提出日時 | 2025-07-23 07:17:23 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 404 bytes |
コンパイル時間 | 2,152 ms |
コンパイル使用メモリ | 194,884 KB |
実行使用メモリ | 7,720 KB |
最終ジャッジ日時 | 2025-07-23 07:17:27 |
合計ジャッジ時間 | 3,562 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 21 WA * 7 |
ソースコード
#include <bits/stdc++.h> using namespace std; int main(){ ios_base::sync_with_stdio(false); cin.tie(nullptr); int N,L; cin >> N >> L; int time = 0,x = 0; while(N--){ int X,W,T; cin >> X >> W >> T; int move = X-x; time += move; if(T-time%(2*T) <= W) time += 2*T-time%(2*T); x = X+W,time += W; } time += L-x; cout << time << endl; }