###### tags: `Zerojudge` 【題解】apcs f605: 1. 購買力 === Posted on 2022/4/24 | By : Victoria1103 【題目敘述】https://zerojudge.tw/ShowProblem?problemid=f605 ```cpp= #include <iostream> #include <algorithm> using namespace std; int main() { int n; int price[3]; int d; int number=0; int money=0; cin >> n >> d; while (n--) { for (int i=0;i<3;i++) { cin >> price[i]; } sort (price , price + 3); if (price[2]-price[0]>=d) { number++; money=money+(price[0]+price[1]+price[2])/3; } } cout << endl << number << " " << money; return 0; }
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up