From 94f1ba668f7bd774cd8bd1576426a31425ade914 Mon Sep 17 00:00:00 2001 From: Ren Baoshuo Date: Fri, 9 Oct 2020 21:21:25 +0800 Subject: [PATCH] =?UTF-8?q?P6382=20=E3=80=8EMdOI=20R2=E3=80=8FCar?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit R39592154 --- problem/P6382/P6382.cpp | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 problem/P6382/P6382.cpp diff --git a/problem/P6382/P6382.cpp b/problem/P6382/P6382.cpp new file mode 100644 index 00000000..1f86b2f6 --- /dev/null +++ b/problem/P6382/P6382.cpp @@ -0,0 +1,23 @@ +// R39592154 + +#include + +using namespace std; + +int main() { + string name; + cin >> name; + if(name[0] != 'M' || name[1] != 'D' || name[2] != 'A') { + cout << "1 1 1 1 1" << endl; + } else { + int i = 7; + while(!('0' <= name[i] && name[i] <= '9')) i--; + int last = name[i] - '0'; + cout << (last == 1 || last == 9 ? 1 : 0) << ' '; + cout << (last == 2 || last == 8 ? 1 : 0) << ' '; + cout << (last == 3 || last == 7 ? 1 : 0) << ' '; + cout << (last == 4 || last == 6 ? 1 : 0) << ' '; + cout << (last == 5 || last == 0 ? 1 : 0) << endl; + } + return 0; +}