mirror of
https://git.sb/baoshuo/OI-codes.git
synced 2024-12-24 03:31:59 +00:00
B2020 分糖果
R56993927
This commit is contained in:
parent
d74aba08ef
commit
91486e9a70
32
Luogu/problem/B2020/B2020.cpp
Normal file
32
Luogu/problem/B2020/B2020.cpp
Normal file
@ -0,0 +1,32 @@
|
||||
#include <bits/stdc++.h>
|
||||
|
||||
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;
|
||||
}
|
Loading…
Reference in New Issue
Block a user