Submission #616065
Source Code Expand
#include <iostream> #include <vector> #include <queue> #include <stack> #include <map> #include <set> #include <cmath> #include <cstdio> #include <cstring> #include <cstdlib> #include <functional> #include <string> #include <algorithm> #include <climits> #include <utility> #define PRINT(STR) cout << STR << endl; #define REP(i, n) for (int (i) = 0; (i) < (int)(n); (i)++) #define REG(i, a, b) for (int (i) = ((int)(a)); (i) < ((int)(b)); i++) #define ALL(V) (V).begin(), (V).end() #define SPACE " " typedef long long ll; using namespace std; int nextInt() { int n = -1; cin >> n; return n; } double nextDouble() { double d = -1; cin >> d; return d; } ll nextll() { ll n = -1; cin >> n; return n; } string nextString() { string str; cin >> str; return str; } // BEGIN ////////////////////////////////////////////////////////////// int main() { int N = nextInt(); ll K[100001]; ll L[100003]; REP(i, N - 1) { K[i] = nextll(); } L[0] = 1; L[N-1] = K[N-2]; for (int i = 1; i < N - 1; i++) { if (L[i - 1] < K[i - 1]) { L[i] = K[i-1]; } else { L[i] = 1; } } REP(i, N) { cout << L[i]; if (i < N - 1) { cout << SPACE; } } cout << endl; return 0; } // END //////////////////////////////////////////////////////////////
Submission Info
Submission Time | |
---|---|
Task | B - 積み鉛筆 |
User | renkonuma |
Language | C++ (GCC 4.9.2) |
Score | 0 |
Code Size | 1348 Byte |
Status | WA |
Exec Time | 113 ms |
Memory | 2344 KB |
Judge Result
Set Name | Sample | All | ||||||
---|---|---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 0 / 80 | ||||||
Status |
|
|
Set Name | Test Cases |
---|---|
Sample | sample1.txt, sample2.txt, sample3.txt |
All | subtask0_0.txt, subtask0_1.txt, subtask0_10.txt, subtask0_11.txt, subtask0_12.txt, subtask0_13.txt, subtask0_14.txt, subtask0_2.txt, subtask0_3.txt, subtask0_4.txt, subtask0_5.txt, subtask0_6.txt, subtask0_7.txt, subtask0_8.txt, subtask0_9.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
sample1.txt | AC | 26 ms | 920 KB |
sample2.txt | AC | 25 ms | 924 KB |
sample3.txt | AC | 25 ms | 916 KB |
subtask0_0.txt | WA | 105 ms | 2076 KB |
subtask0_1.txt | AC | 92 ms | 2344 KB |
subtask0_10.txt | AC | 87 ms | 2208 KB |
subtask0_11.txt | WA | 96 ms | 2300 KB |
subtask0_12.txt | WA | 102 ms | 2088 KB |
subtask0_13.txt | AC | 90 ms | 2212 KB |
subtask0_14.txt | WA | 99 ms | 2300 KB |
subtask0_2.txt | WA | 85 ms | 1952 KB |
subtask0_3.txt | WA | 100 ms | 2076 KB |
subtask0_4.txt | AC | 91 ms | 2212 KB |
subtask0_5.txt | WA | 89 ms | 2076 KB |
subtask0_6.txt | WA | 99 ms | 2084 KB |
subtask0_7.txt | AC | 79 ms | 1964 KB |
subtask0_8.txt | WA | 96 ms | 2212 KB |
subtask0_9.txt | WA | 113 ms | 2212 KB |