Submission #6414783
Source Code Expand
// https://atcoder.jp/contests/bcu30-2019/tasks/bcu30_2019_b
#include <bits/stdc++.h>
#define _overload3(_1, _2, _3, name, ...) name
#define REP(i, n) for (int(i) = 0; (i) < (n); (i)++)
#define REPR(i, n) for (int(i) = (n); (i) >= 0; (i)--)
#define FOR(i, m, n) for (int(i) = (m); (i) < (n); i++)
#define FORR(i, m, n) for (int(i) = (n); (i) >= (m); i--)
#define rep(...) _overload3(__VA_ARGS__, FOR, REP, )(__VA_ARGS__)
#define repr(...) _overload3(__VA_ARGS__, FORR, REPR, )(__VA_ARGS__)
#define UNIQUE(v) v.erase(unique(v.begin(), v.end()), v.end());
#define INF 1e9
#define ALL(v) (v).begin(), (v).end()
#define pb push_back
#define mp make_pair
#define F first
#define S second
using namespace std;
using ll = long long;
using pll = pair<ll, ll>;
int main()
{
ll N, lA = 0, A, cnt = 1;
cin >> N;
rep(i, N)
{
cin >> A;
if (A < lA)
cnt++;
lA = A;
}
if (lA == 0)
cnt--;
cout << cnt << '\n';
return 0;
}
Submission Info
| Submission Time |
|
| Task |
B - Interval Addition |
| User |
nshun |
| Language |
C++14 (GCC 5.4.1) |
| Score |
100 |
| Code Size |
986 Byte |
| Status |
AC |
| Exec Time |
86 ms |
| Memory |
256 KiB |
Judge Result
| Set Name |
Sample |
All |
| Score / Max Score |
0 / 0 |
100 / 100 |
| Status |
|
|
| Set Name |
Test Cases |
| Sample |
s1.txt, s2.txt, s3.txt |
| All |
01.txt, 02.txt, 03.txt, 04.txt, 05.txt, 06.txt, 07.txt, 08.txt, 09.txt, 10.txt, 11.txt, 12.txt, 13.txt, 14.txt, 15.txt, 16.txt, 17.txt, 18.txt, 19.txt, 20.txt, 21.txt, 22.txt, 23.txt, s1.txt, s2.txt, s3.txt |
| Case Name |
Status |
Exec Time |
Memory |
| 01.txt |
AC |
1 ms |
256 KiB |
| 02.txt |
AC |
1 ms |
256 KiB |
| 03.txt |
AC |
1 ms |
256 KiB |
| 04.txt |
AC |
1 ms |
256 KiB |
| 05.txt |
AC |
1 ms |
256 KiB |
| 06.txt |
AC |
2 ms |
256 KiB |
| 07.txt |
AC |
2 ms |
256 KiB |
| 08.txt |
AC |
2 ms |
256 KiB |
| 09.txt |
AC |
2 ms |
256 KiB |
| 10.txt |
AC |
2 ms |
256 KiB |
| 11.txt |
AC |
78 ms |
256 KiB |
| 12.txt |
AC |
78 ms |
256 KiB |
| 13.txt |
AC |
32 ms |
256 KiB |
| 14.txt |
AC |
74 ms |
256 KiB |
| 15.txt |
AC |
56 ms |
256 KiB |
| 16.txt |
AC |
55 ms |
256 KiB |
| 17.txt |
AC |
47 ms |
256 KiB |
| 18.txt |
AC |
68 ms |
256 KiB |
| 19.txt |
AC |
86 ms |
256 KiB |
| 20.txt |
AC |
1 ms |
256 KiB |
| 21.txt |
AC |
1 ms |
256 KiB |
| 22.txt |
AC |
1 ms |
256 KiB |
| 23.txt |
AC |
80 ms |
256 KiB |
| s1.txt |
AC |
1 ms |
256 KiB |
| s2.txt |
AC |
1 ms |
256 KiB |
| s3.txt |
AC |
1 ms |
256 KiB |