Submission #1071566
Source Code Expand
#include <bits/stdc++.h> using namespace std; #define int long long // <-----!!!!!!!!!!!!!!!!!!! #define rep(i,n) for (int i=0;i<(n);i++) #define rep2(i,a,b) for (int i=(a);i<(b);i++) #define rrep(i,n) for (int i=(n)-1;i>=0;i--) #define rrep2(i,a,b) for (int i=(a)-1;i>=b;i--) #define chmin(a,b) (a)=min((a),(b)); #define chmax(a,b) (a)=max((a),(b)); #define all(a) (a).begin(),(a).end() #define rall(a) (a).rbegin(),(a).rend() #define printV(v) cerr<<(#v)<<":";for(auto(x):(v)){cerr<<" "<<(x);}cerr<<endl; #define printVS(vs) cerr<<(#vs)<<":"<<endl;for(auto(s):(vs)){cerr<<(s)<< endl;} #define printVV(vv) cerr<<(#vv)<<":"<<endl;for(auto(v):(vv)){for(auto(x):(v)){cerr<<" "<<(x);}cerr<<endl;} #define printP(p) cerr<<(#p)<<(p).first<<" "<<(p).second<<endl; #define printVP(vp) cerr<<(#vp)<<":"<<endl;for(auto(p):(vp)){cerr<<(p).first<<" "<<(p).second<<endl;} inline void output(){ cerr << endl; } template<typename First, typename... Rest> inline void output(const First& first, const Rest&... rest) { cerr << first << " "; output(rest...); } using ll = long long; using Pii = pair<int, int>; using TUPLE = tuple<int, int, int>; using vi = vector<int>; using vvi = vector<vi>; using vvvi = vector<vvi>; const int inf = 1ll << 60; const int mod = 1e9 + 7; using Graph = vector<vector<int>>; signed main() { std::ios::sync_with_stdio(false); std::cin.tie(0); int n; cin >> n; vi K(n - 1); rep(i, n - 1) cin >> K[i]; vi a(n); a[0] = 1; rep(i, n - 1) a[i + 1] = K[i]; rep(i, n - 1) { if (K[i] < a[i]) { a[i] = K[i]; } } rep(i, n) { cout << (i ? " " : "") << a[i]; } cout << endl; }
Submission Info
Submission Time | |
---|---|
Task | B - 積み鉛筆 |
User | yurahuna |
Language | C++11 (GCC 4.9.2) |
Score | 0 |
Code Size | 1743 Byte |
Status | WA |
Exec Time | 43 ms |
Memory | 2460 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 | 19 ms | 800 KB |
sample2.txt | AC | 19 ms | 928 KB |
sample3.txt | AC | 17 ms | 916 KB |
subtask0_0.txt | AC | 41 ms | 2164 KB |
subtask0_1.txt | AC | 41 ms | 2340 KB |
subtask0_10.txt | AC | 38 ms | 2212 KB |
subtask0_11.txt | WA | 38 ms | 2212 KB |
subtask0_12.txt | WA | 40 ms | 2156 KB |
subtask0_13.txt | AC | 40 ms | 2332 KB |
subtask0_14.txt | AC | 41 ms | 2460 KB |
subtask0_2.txt | AC | 37 ms | 2092 KB |
subtask0_3.txt | AC | 40 ms | 2036 KB |
subtask0_4.txt | AC | 39 ms | 2288 KB |
subtask0_5.txt | AC | 38 ms | 2080 KB |
subtask0_6.txt | AC | 40 ms | 2084 KB |
subtask0_7.txt | AC | 37 ms | 2204 KB |
subtask0_8.txt | AC | 39 ms | 2292 KB |
subtask0_9.txt | AC | 43 ms | 2332 KB |