Submission #10232707
Source Code Expand
#include <bits/stdc++.h> using namespace std; typedef long long LL; typedef unsigned long long ULL; typedef pair<int, int> PII; const int N = 510; const double eps = 1e-6; int n; int c[N], s[N], f[N]; int main() { cin >> n; for(int i = 1; i < n; i++) cin >> c[i] >> s[i] >> f[i]; for(int i = 1; i <= n; i++) { int sum = 0; for(int j = i; j < n; j++) { sum = max(sum, s[j]); sum = sum + sum % f[j] + c[j]; } cout << sum << endl; } return 0; }
Submission Info
Submission Time | |
---|---|
Task | C - Special Trains |
User | Daniel_y |
Language | C++14 (GCC 5.4.1) |
Score | 0 |
Code Size | 567 Byte |
Status | WA |
Exec Time | 3 ms |
Memory | 256 KB |
Judge Result
Set Name | Sample | All | ||||||
---|---|---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 0 / 300 | ||||||
Status |
|
|
Set Name | Test Cases |
---|---|
Sample | sample_01.txt, sample_02.txt, sample_03.txt |
All | 01.txt, 02.txt, 03.txt, 04.txt, 05.txt, 06.txt, 07.txt, 08.txt, 09.txt, 10.txt, 11.txt, 12.txt, sample_01.txt, sample_02.txt, sample_03.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
01.txt | WA | 3 ms | 256 KB |
02.txt | WA | 3 ms | 256 KB |
03.txt | WA | 3 ms | 256 KB |
04.txt | WA | 3 ms | 256 KB |
05.txt | WA | 3 ms | 256 KB |
06.txt | AC | 3 ms | 256 KB |
07.txt | WA | 3 ms | 256 KB |
08.txt | WA | 3 ms | 256 KB |
09.txt | AC | 1 ms | 256 KB |
10.txt | WA | 2 ms | 256 KB |
11.txt | WA | 3 ms | 256 KB |
12.txt | WA | 1 ms | 256 KB |
sample_01.txt | AC | 1 ms | 256 KB |
sample_02.txt | AC | 1 ms | 256 KB |
sample_03.txt | AC | 1 ms | 256 KB |