CF719A Vitya in the Countryside

https://www.luogu.org/problemnew/show/CF719A

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#include<bits/stdc++.h>
using namespace std;

int num[100],n;

int main(void)
{
cin >> n;
for(int i = 1;i <= n;++i)
cin >> num[i];

if(n == 1 && num[n] != 15 && num[n] != 0) cout << "-1";
else if(num[n] == 15) cout << "DOWN";
else if(num[n] == 0) cout << "UP";
else if(num[n] < 15 && num[n] > num[n-1]) cout << "UP";
else if(num[n] < 15 && num[n] < num[n-1]) cout << "DOWN";

return 0;
}
本站文章除注明转载外均为原创,未经允许不要转载哇. ヾ(゚ー゚ヾ) http://chicago01.top/2019/05/10/cf719a-vitya-in-the-countryside/index.html
Compartir