結果
| 問題 |
No.139 交差点
|
| コンテスト | |
| ユーザー |
h_noson
|
| 提出日時 | 2016-03-15 14:11:20 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 656 bytes |
| コンパイル時間 | 726 ms |
| コンパイル使用メモリ | 59,752 KB |
| 実行使用メモリ | 6,824 KB |
| 最終ジャッジ日時 | 2024-10-01 06:35:07 |
| 合計ジャッジ時間 | 1,365 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 20 WA * 8 |
ソースコード
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
#define RREP(i,s,e) for (i = e-1; i >= s; i--)
#define rrep(i,n) RREP(i,0,n)
#define REP(i,s,e) for (i = s; i < e; i++)
#define rep(i,n) REP(i,0,n)
#define INF 1e8
typedef long long ll;
int main() {
int i, n, l, t, pos, ans;
cin >> n >> l;
ans = pos = 0;
rep (i,n) {
int x, w, t;
cin >> x >> w >> t;
ans += x - pos;
if (ans/t%2 == 1 || ans < ans/t*t || (ans/t+1)*t < ans+w)
ans = ((ans-1)/t+2-ans/t%2) * t;
ans += w;
pos = x + w;
}
ans += l - pos;
cout << ans << endl;
return 0;
}
h_noson