Scape

這道題是一個貪心題我們只需要看我們當前經過這家店是否要吃掉食物,吃掉食物是否划算,把我們認爲我們需要吃掉的食物加到sum就行了 #include<bits/stdc++.h> using namespace std; int n,c,w[1001]; int sum,ans; int main() { scanf("%d%d",&n,&c); for (int i=1;i<=n;i++) s
本站公眾號
   歡迎關注本站公眾號,獲取更多信息