-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathecnuoj3274.cpp
69 lines (67 loc) · 1.41 KB
/
ecnuoj3274.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#include<iostream>
#include<vector>
using namespace std;
vector<int> water(vector<int> v,int &signal)
{
vector<int> rv;
signal = 0;
int i=0;
for(i=0;i<v.size();i++)
{
if(v[i]==1)
{
rv.push_back(v[i]);
}
if(v[i]==5)
{
rv.push_back(v[i]);
}
if(v[i]>=2&&v[i]<=4)
{
rv.push_back(1);
rv.push_back(1);
signal=1;
break;
}
}
for(int j=i+1;j<v.size();j++)
{
rv.push_back(v[j]);
}
return rv;
}
int main()
{
int n=0;
while (scanf("%d",&n)==1)
{
int signal = 0;
vector<int> v;
for(int i=0;i<n;i++)
{
int t=0;
scanf("%d",&t);
v.push_back(t);
}
vector<int> rv=water(v,signal);
if(signal==0)
{
cout<<"Deep Dark Fantasy of ECNU"<<endl;
}
else
{
for(int i=0;i<rv.size();i++)
{
if(i==rv.size()-1)
{
cout<<rv[i]<<endl;
}
else
{
cout<<rv[i]<<" ";
}
}
}
}
return 0;
}