結果
問題 |
No.139 交差点
|
ユーザー |
|
提出日時 | 2018-11-04 16:42:31 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 506 bytes |
コンパイル時間 | 1,614 ms |
コンパイル使用メモリ | 158,616 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-11-20 19:59:15 |
合計ジャッジ時間 | 3,009 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 22 WA * 6 |
ソースコード
#include <bits/stdc++.h> using namespace std; int main() { #ifdef DEBUG std::ifstream in("/home/share/inputf.in"); std::cin.rdbuf(in.rdbuf()); #endif int N, L; cin >> N >> L; int delay = 0, t = 0; int X, W, T; for(int i = 0; i < N; i++) { cin >> X >> W >> T; t = X + delay; int f = (((t + W) / T) | (t / T)) & 1; T *= 2; if(f) { delay += (T + (-t % T))%T; } } cout << delay + L << endl; return 0; }