- fuxun 的博客
此地无有代码块(点进会吃亏)
- @ 2024-8-6 20:32:28
我说了别进来😕
1 1 1 1 11 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 11 1 1
1 1 1 1 1
11 1 1 1 11 1
1 1 1 11 1 1 1 1 1 1 1 1
1
这题答案参考
#include<bits/stdc++.h>
using namespace std;
int main (){
int a[13];
for (int i = 1; i <= 12; i++) {
cin >> a[i];
}
int last = 0, tot = 0;
for (int i = 1; i <= 12; i++) {
int now = last + 300;
now -= a[i];
if (now < 0) {
//不够用
cout<<-1*i;
return 0;
} else {
if (now >= 100) {
tot += now / 100;
}
last = now % 100;
}
}
cout << tot * 120 + last;
}