'commit'
This commit is contained in:
32
LuoGu/RuMen/P2192.cpp
Normal file
32
LuoGu/RuMen/P2192.cpp
Normal file
@@ -0,0 +1,32 @@
|
||||
#include <bits/stdc++.h>
|
||||
|
||||
using namespace std;
|
||||
|
||||
int main() {
|
||||
//读入输出优化的强迫症
|
||||
ios::sync_with_stdio(false);
|
||||
int n;
|
||||
cin >> n;
|
||||
int a = 0, b = 0;
|
||||
for (int i = 0; i < n; i++) {
|
||||
int tmp;
|
||||
cin >> tmp;
|
||||
if (tmp == 5) a++;
|
||||
else b++;
|
||||
}
|
||||
if (!b) {
|
||||
cout << -1;
|
||||
return 0;
|
||||
}
|
||||
for (int i = 0; i < a / 9; i++) {
|
||||
cout << "555555555";
|
||||
}
|
||||
if (a / 9 == 0) {
|
||||
cout << 0;
|
||||
return 0;
|
||||
}
|
||||
for (int i = 0; i < b; i++) {
|
||||
cout << 0;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user