結果
問題 | No.139 交差点 |
ユーザー |
![]() |
提出日時 | 2015-01-29 23:37:52 |
言語 | C++11 (gcc 4.8.5) |
結果 |
AC
|
実行時間 | 4 ms |
コード長 | 1,014 Byte |
コンパイル時間 | 559 ms |
使用メモリ | 3,016 KB |
最終ジャッジ日時 | 2019-02-06 23:26:02 |
テストケース
テストケース表示入力 | 結果 | 実行時間 使用メモリ |
---|---|---|
sample1.txt | AC | 2 ms
3,012 KB |
sample2.txt | AC | 3 ms
3,008 KB |
sample3.txt | AC | 3 ms
3,012 KB |
testcase01.txt | AC | 3 ms
3,012 KB |
testcase02.txt | AC | 3 ms
3,008 KB |
testcase03.txt | AC | 4 ms
3,008 KB |
testcase04.txt | AC | 2 ms
3,008 KB |
testcase05.txt | AC | 4 ms
3,012 KB |
testcase06.txt | AC | 4 ms
3,012 KB |
testcase07.txt | AC | 2 ms
3,012 KB |
testcase08.txt | AC | 3 ms
3,008 KB |
testcase09.txt | AC | 3 ms
3,012 KB |
testcase10.txt | AC | 3 ms
3,012 KB |
testcase11.txt | AC | 2 ms
3,012 KB |
testcase12.txt | AC | 3 ms
3,008 KB |
testcase13.txt | AC | 2 ms
3,008 KB |
testcase14.txt | AC | 2 ms
3,016 KB |
testcase15.txt | AC | 3 ms
3,008 KB |
testcase16.txt | AC | 2 ms
3,012 KB |
testcase17.txt | AC | 3 ms
3,012 KB |
testcase18.txt | AC | 3 ms
3,008 KB |
testcase19.txt | AC | 2 ms
3,008 KB |
testcase20.txt | AC | 4 ms
3,012 KB |
testcase21.txt | AC | 3 ms
3,012 KB |
testcase22.txt | AC | 3 ms
3,008 KB |
testcase23.txt | AC | 3 ms
3,008 KB |
testcase24.txt | AC | 4 ms
3,012 KB |
testcase25.txt | AC | 2 ms
3,012 KB |
testcase26.txt | AC | 3 ms
3,012 KB |
testcase27.txt | AC | 3 ms
3,012 KB |
testcase28.txt | AC | 2 ms
3,012 KB |
ソースコード
#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 * 2, T * 2) || !blue(t * 2 + W, T * 2) || !blue(t * 2 + W * 2, T * 2)) t++; } t += L - x; cout << t << endl; }