Contest Duration: ~ (local time) (100 minutes) Back to Home

Submission #2733114

Source Code Expand

Copy
```#include <iostream>
#include <string>
#include <sstream>
#include <algorithm>
#include <cmath>
#include <cstdlib>
#include <vector>
#include <queue>
#include <utility>
using namespace std;

typedef long long ll;
typedef pair<int, int> P;

#define For(i, a, b) for(int i = (a); i < (b); i++)
#define Rep(i, n) For(i, 0, (n))
#define Rrep(i, n) for(int i = (n - 1); i >= 0; i--)
#define pb push_back

const int inf = 999999999;
const int mod = 1000000007;
const int dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0, -1};

int main(){
ll k; cin >> k;
ll p[9] = {1, 2, 3, 4, 5, 6, 7, 8, 9};
ll a[9] = {9, 99, 999, 9999, 99999, 999999, 9999999, 99999999, 999999999};
vector<ll> v(p, p + 9);
Rep(i, 9){
For(j, 1, 10){
int t = 10;
Rep(q, i){
t *= 10;
}
v.pb(a[i] + j * t);
}
}
Rep(i, k - v.size()){
v.pb(a[8] * 10 + 9 + (i + 1) * 10000000000);
}
Rep(i, k){
cout << v[i] << endl;
}
}```

Submission Info

Submission Time 2018-06-23 22:35:44+0900 D - Snuke Numbers niimi C++14 (GCC 5.4.1) 0 943 Byte WA 2109 ms 256 KB

Judge Result

Set Name Score / Max Score Test Cases
Sample 0 / 0 sample.txt
All 0 / 500 sample.txt, 1.txt, sample.txt
Case Name Status Exec Time Memory
1.txt 2 ms 256 KB
sample.txt 2109 ms -1832628 KB