Submission #616145
Source Code Expand
// tsukasa_diary's programing contest code template
#include <bits/stdc++.h>
using namespace std;
#define TSUKASA_DIARY_S_TEMPLATE
// define
#define for_(i,a,b) for(int i=(a);i<(b);++i)
#define for_rev(i,a,b) for(int i=(a);i>=(b);--i)
#define allof(a) (a).begin(),(a).end()
#define minit(a,b) memset(a,b,sizeof(a))
#define size_of(a) int((a).size())
#define cauto const auto
// typedef
typedef long long lint;
typedef double Double;
typedef pair< int, int > pii;
template< typename T > using Vec = vector< T >;
template< typename T > using Matrix = Vec< Vec< T > >;
template< typename T > using USet = unordered_set< T >;
template< typename T, class C > using MyUSet = unordered_set< T, C >;
template< typename T, typename F > using UMap = unordered_map< T, F >;
template< typename T, typename F, class C > using MyUMap = unordered_map< T, F, C >;
// hash
class PiiHash { public: size_t operator () (const pii& p) const { return (p.first << 16) | p.second; } };
// popcount
inline int POPCNT(int x) { return __builtin_popcount(x); }
inline int POPCNT(lint x) { return __builtin_popcount(x); }
// inf
const int iINF = 1L << 30;
const lint lINF = 1LL << 60;
// eps
const Double EPS = 1e-9;
const Double PI = acos(-1);
// inrange
template< typename T >
inline bool in_range(T v, T mi, T mx) { return mi <= v && v < mx; }
template< typename T >
inline bool in_range(T x, T y, T W, T H) { return in_range(x,0,W) && in_range(y,0,H); }
// neighbor clockwise
const int DX[4] = {0,1,0,-1}, DY[4] = {-1,0,1,0};
const int DX_[8] = {0,1,1,1,0,-1,-1,-1}, DY_[8] = {-1,-1,0,1,1,1,0,-1};
// variable update
template< typename T > inline void modAdd(T& a, T b, T mod) { a = (a + b) % mod; }
template< typename T > inline void minUpdate(T& a, T b) { a = min(a, b); }
template< typename T > inline void maxUpdate(T& a, T b) { a = max(a, b); }
// converter
template< typename F, typename T >
inline void convert(F& from, T& to) {
stringstream ss;
ss << from; ss >> to;
}
int N, K[100010];
int main() {
cin >> N;
K[0] = 1;
for_(i,0,N-1) cin >> K[i+1];
K[N] = K[N-1];
for_(i,1,N+1) {
if (K[i - 1] <= K[i]) {
cout << K[i - 1];
} else {
cout << K[i];
}
cout << (i < N ? " " : "\n");
}
}
Submission Info
Submission Time |
|
Task |
B - 積み鉛筆 |
User |
tsukasa_diary |
Language |
C++11 (GCC 4.9.2) |
Score |
0 |
Code Size |
2259 Byte |
Status |
WA |
Exec Time |
112 ms |
Memory |
1184 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 |
25 ms |
924 KB |
sample2.txt |
AC |
24 ms |
928 KB |
sample3.txt |
AC |
23 ms |
800 KB |
subtask0_0.txt |
AC |
111 ms |
1060 KB |
subtask0_1.txt |
AC |
87 ms |
1136 KB |
subtask0_10.txt |
AC |
83 ms |
1064 KB |
subtask0_11.txt |
WA |
93 ms |
1060 KB |
subtask0_12.txt |
WA |
101 ms |
1056 KB |
subtask0_13.txt |
AC |
84 ms |
1060 KB |
subtask0_14.txt |
AC |
97 ms |
1184 KB |
subtask0_2.txt |
AC |
85 ms |
1056 KB |
subtask0_3.txt |
AC |
96 ms |
1064 KB |
subtask0_4.txt |
AC |
88 ms |
1180 KB |
subtask0_5.txt |
AC |
84 ms |
1060 KB |
subtask0_6.txt |
AC |
95 ms |
1064 KB |
subtask0_7.txt |
AC |
77 ms |
1060 KB |
subtask0_8.txt |
AC |
90 ms |
1060 KB |
subtask0_9.txt |
AC |
112 ms |
1180 KB |