【題解】Codeforces 1129B. Wrong Answer

【題目敘述】http://codeforces.com/contest/1129/problem/B

#include <iostream>
using namespace std;
 
int k, cnt;
 
int main() {
    cin >> k;
    k++;
    cnt = k / 999999;
    k -= cnt * 999999;
    if (k) cout << cnt+2 << "\n";
    else cout << cnt+1 << "\n";
    cout << -1;
    for (int i = 0; i < cnt; i++){
        cout << " " << 1000000;
    }
    if (k) cout << " " << k+1;
    cout << "\n";
}
分享本文 Share with friends