結果
| 問題 | No.139 交差点 |
| コンテスト | |
| ユーザー |
naimonon77
|
| 提出日時 | 2015-09-18 22:34:47 |
| 言語 | C++11 (gcc 15.3.0 + boost 1.92.0) |
| 結果 |
WA
不安定
|
| 実行時間 | - |
| コード長 | 708 bytes |
| 記録 | |
| コンパイル時間 | 324 ms |
| コンパイル使用メモリ | 76,260 KB |
| 実行使用メモリ | 7,336 KB |
| 最終ジャッジ日時 | 2026-08-18 05:24:36 |
| 合計ジャッジ時間 | 2,309 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 7 WA * 21 |
ソースコード
#include <iostream>
using namespace std;
#include <cstdio>
#include <string.h>
#include <stdlib.h>
#include <math.h>
typedef long long ll;
typedef long double lb;
int l[3];
int main(void)
{
int i,j,k;
int memory[2];
int n,l;
int x;
int w;
int t;
int now_time = 0;
int now_location;
cin >> n >> l;
now_location = 0;
for(i=0;i<n;i++) {
cin >> x >> w >> t;
now_time += x - now_location;
if(now_time % (2*t) <= t && now_time+w % (2*t) <= t) {
now_time += w;
}
else {
now_time += 2*t - now_time % (2*t) + w;
}
now_location = x+w;
}
now_time += l - now_location;
printf("%d\n",now_time);
return 0;
}
naimonon77