From 91486e9a70c34911d8cfe3e15e21b3f96614011b Mon Sep 17 00:00:00 2001 From: Ren Baoshuo Date: Thu, 26 Aug 2021 15:07:44 +0800 Subject: [PATCH] =?UTF-8?q?B2020=20=E5=88=86=E7=B3=96=E6=9E=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit R56993927 --- Luogu/problem/B2020/B2020.cpp | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 Luogu/problem/B2020/B2020.cpp diff --git a/Luogu/problem/B2020/B2020.cpp b/Luogu/problem/B2020/B2020.cpp new file mode 100644 index 00000000..ff597106 --- /dev/null +++ b/Luogu/problem/B2020/B2020.cpp @@ -0,0 +1,32 @@ +#include + +using namespace std; + +int a[6], sum; + +int main() { + cin >> a[1] >> a[2] >> a[3] >> a[4] >> a[5]; + sum += a[1] % 3; + a[1] /= 3; + a[5] += a[1]; + a[2] += a[1]; + sum += a[2] % 3; + a[2] /= 3; + a[3] += a[2]; + a[1] += a[2]; + sum += a[3] % 3; + a[3] /= 3; + a[4] += a[3]; + a[2] += a[3]; + sum += a[4] % 3; + a[4] /= 3; + a[5] += a[4]; + a[3] += a[4]; + sum += a[5] % 3; + a[5] /= 3; + a[1] += a[5]; + a[4] += a[5]; + cout << a[1] << ' ' << a[2] << ' ' << a[3] << ' ' << a[4] << ' ' << a[5] << endl + << sum << endl; + return 0; +}