随笔分类 - ACM~~UVA
摘要:贪心算法 1 #include <iostream> 2 #include <vector> 3 #include <algorithm> 4 5 using namespace std; 6 7 struct Job{ 8 int j,b; 9 bool operator < (const Job& x) const {10 if( j == x.j ) return b < x.b;11 return j > x.j;12 }13 };14 15 int main(){16 int n,iCase = 0;17 w...
        阅读全文
                
摘要:贪心的思想 1 #include <iostream> 2 #include <algorithm> 3 #include <vector> 4 5 using namespace std; 6 7 int main(){ 8 int n,m; 9 while(cin >> n>>m && n && m){10 vector<int> heads(n),knights(m);11 for(int i = 0; i < n; i ++ ) cin >> heads[i];12
        阅读全文
                

 浙公网安备 33010602011771号
浙公网安备 33010602011771号