标签:blog os io for div log sp c ios
看懂题就是水题。。。
code
#include <iostream> #include <algorithm> using namespace std; int a[110], n, l, r, ans; int main() { cin >> n; for (int i = 0; i < n; i++) cin >> a[i]; r = n - 1; sort (a, a + n); while (l < r) { a[l]--, r--; if (!a[l]) l++; ans++; } cout << ans; return 0; }
标签:blog os io for div log sp c ios
原文地址:http://www.cnblogs.com/keam37/p/3950015.html