Submission #1175638
Source Code Expand
#include <bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define REP(i,n) FOR(i,0,n)
#define ALL(v) (v).begin(),(v).end()
template<typename A, typename B> inline bool chmax(A &a, B b) { if (a<b) { a=b; return 1; } return 0; }
template<typename A, typename B> inline bool chmin(A &a, B b) { if (a>b) { a=b; return 1; } return 0; }
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<pii, int> P;
#define INF (1<<29)
#define INFL (1ll<<60)
#define EPS (1e-8)
#define PI (acos(-1))
const ll MOD = 1000000007ll;
int main() {
int n;
int k[112345];
cin >> n;
REP(i, n - 1) scanf("%d", k + i);
printf("%d ", k[0]);
REP(i, n - 2) printf("%d ", min(k[i], k[i + 1]));
printf("%d\n", k[n - 2]);
return 0;
}
Submission Info
Submission Time
2017-03-21 21:22:41+0900
Task
B - 積み鉛筆
User
tkmst201
Language
C++14 (GCC 5.4.1)
Score
80
Code Size
817 Byte
Status
AC
Exec Time
21 ms
Memory
1536 KB
Compile Error
./Main.cpp: In function ‘int main()’:
./Main.cpp:27:34: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
REP(i, n - 1) scanf("%d", k + i);
^
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
sample1.txt, sample2.txt, sample3.txt, 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
1 ms
256 KB
sample2.txt
AC
1 ms
256 KB
sample3.txt
AC
1 ms
256 KB
subtask0_0.txt
AC
19 ms
1408 KB
subtask0_1.txt
AC
18 ms
1152 KB
subtask0_10.txt
AC
17 ms
1152 KB
subtask0_11.txt
AC
18 ms
1280 KB
subtask0_12.txt
AC
18 ms
1408 KB
subtask0_13.txt
AC
17 ms
1152 KB
subtask0_14.txt
AC
19 ms
1280 KB
subtask0_2.txt
AC
15 ms
1152 KB
subtask0_3.txt
AC
17 ms
1408 KB
subtask0_4.txt
AC
18 ms
1152 KB
subtask0_5.txt
AC
16 ms
1152 KB
subtask0_6.txt
AC
18 ms
1408 KB
subtask0_7.txt
AC
15 ms
1024 KB
subtask0_8.txt
AC
18 ms
1280 KB
subtask0_9.txt
AC
21 ms
1536 KB