From 9f4f85ea725d5247a1238a4e57de614d89153fbd Mon Sep 17 00:00:00 2001 From: Ren Baoshuo Date: Tue, 17 Nov 2020 19:27:36 +0800 Subject: [PATCH] =?UTF-8?q?P1897=20=E7=94=B5=E6=A2=AF=E9=87=8C=E7=9A=84?= =?UTF-8?q?=E7=88=B1=E6=83=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit R42070546 --- problem/P1897/P1897.cpp | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 problem/P1897/P1897.cpp diff --git a/problem/P1897/P1897.cpp b/problem/P1897/P1897.cpp new file mode 100644 index 00000000..70873fc4 --- /dev/null +++ b/problem/P1897/P1897.cpp @@ -0,0 +1,24 @@ +#include + +using namespace std; + +int main() { + int n, a[100005]; + queue q; + cin >> n; + for (int i = 0; i < n; i++) { + cin >> a[i]; + } + sort(a, a + n); + int h, s, t; + h = a[n - 1]; + s = unique(a, a + n) - a; + t = h * (4 + 6) + n; + for (int i = 0; i < s; i++) { + if (a[i]) { + t += 5; + } + } + cout << t << endl; + return 0; +}