标签:spl play 技术 names clu iostream hide cout 函数
1 #include<iostream> 2 using namespace std; 3 4 int n, m; 5 int a[10010], b[10010], c[10010]; 6 int x[10010]; 7 8 int main() 9 { 10 cin >> n >> m; 11 for (int i = 1; i <= n; i++) 12 { 13 cin >> a[i] >> b[i] >> c[i]; 14 x[i] = 1; 15 } 16 int s = 0; 17 for (int i = 1; i <= m; i++) 18 { 19 int miny = 0x3f3f3f3f; 20 int t = 1; 21 for (int j = 1; j <= n; j++) 22 { 23 if (a[j] * x[j] * x[j] + b[j] * x[j] + c[j] < miny) 24 { 25 miny = a[j] * x[j] * x[j] + b[j] * x[j] + c[j]; 26 27 t = j; 28 29 } 30 } 31 s = miny; 32 cout << miny << " "; 33 x[t]++; 34 } 35 return 0; 36 }
标签:spl play 技术 names clu iostream hide cout 函数
原文地址:https://www.cnblogs.com/thjkhdf12/p/11641377.html