結果
| 問題 |
No.139 交差点
|
| コンテスト | |
| ユーザー |
sugim48
|
| 提出日時 | 2015-01-29 23:34:35 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 967 bytes |
| コンパイル時間 | 562 ms |
| コンパイル使用メモリ | 84,332 KB |
| 実行使用メモリ | 6,948 KB |
| 最終ジャッジ日時 | 2024-06-23 04:10:12 |
| 合計ジャッジ時間 | 1,349 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 WA * 1 |
| other | AC * 24 WA * 4 |
ソースコード
#define _USE_MATH_DEFINES
#include <algorithm>
#include <cstdio>
#include <functional>
#include <iostream>
#include <cfloat>
#include <climits>
#include <cstring>
#include <cmath>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <time.h>
#include <unordered_map>
#include <vector>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> i_i;
typedef pair<ll, int> ll_i;
typedef pair<double, int> d_i;
typedef pair<ll, ll> ll_ll;
typedef pair<double, double> d_d;
struct edge { ll B, T, F, P; };
ll MOD = 1234567891;
ll _MOD = 1000000009;
double EPS = 1e-10;
int INF = INT_MAX / 10;
bool blue(int t, int T) {
return t % T == 0 || t / T % 2 == 0;
}
int main() {
int N, L; cin >> N >> L;
int x = 0, t = 0;
while (N--) {
int X, W, T; cin >> X >> W >> T;
t += X - x; x = X;
while (!blue(t, T) || !blue(t + W, T)) t++;
}
t += L - x;
cout << t << endl;
}
sugim48