Submission #1071583
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); rep(i, n) cin >> K[i]; K.back() = inf; cout << K[0]; rep2(i, 1, n) { cout << " " << min(K[i - 1], K[i]); } cout << endl; }
Submission Info
Submission Time | |
---|---|
Task | B - 積み鉛筆 |
User | yurahuna |
Language | C++11 (GCC 4.9.2) |
Score | 80 |
Code Size | 1623 Byte |
Status | AC |
Exec Time | 44 ms |
Memory | 1784 KB |
Judge Result
Set Name | Sample | All | ||||
---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 80 / 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 | 30 ms | 904 KB |
sample2.txt | AC | 20 ms | 1016 KB |
sample3.txt | AC | 19 ms | 1016 KB |
subtask0_0.txt | AC | 40 ms | 1660 KB |
subtask0_1.txt | AC | 38 ms | 1744 KB |
subtask0_10.txt | AC | 37 ms | 1616 KB |
subtask0_11.txt | AC | 39 ms | 1780 KB |
subtask0_12.txt | AC | 39 ms | 1616 KB |
subtask0_13.txt | AC | 38 ms | 1656 KB |
subtask0_14.txt | AC | 41 ms | 1740 KB |
subtask0_2.txt | AC | 36 ms | 1660 KB |
subtask0_3.txt | AC | 40 ms | 1656 KB |
subtask0_4.txt | AC | 38 ms | 1784 KB |
subtask0_5.txt | AC | 37 ms | 1660 KB |
subtask0_6.txt | AC | 39 ms | 1656 KB |
subtask0_7.txt | AC | 36 ms | 1656 KB |
subtask0_8.txt | AC | 39 ms | 1748 KB |
subtask0_9.txt | AC | 44 ms | 1744 KB |