評分結果(參考) : AC (4ms, 336KB)
#include<bits/stdc++.h>
#define int long long
using namespace std;
signed main(){
ios::sync_with_stdio(false);
cin.tie(nullptr);
int c, w;
cin >> c >> w;
int ans = 0;
while(w>0){
if(c >= 12){
c -= 10;
w--;
ans++;
}
else{
w -= (12-c);
c = 12;
}
}
cout << ans;
return 0;
}
評分結果(參考) : AC (2ms, 344KB)
#include<bits/stdc++.h>
#define int long long
using namespace std;
signed main(){
ios::sync_with_stdio(false);
cin.tie(nullptr);
int c, w;
cin >> c >> w;
cout << min(w, (c+w-2)/11);
return 0;
}