Submission #5942676


Source Code Expand

#include <iostream>
#include <iomanip>
#include <ios> 
#include <vector>
#include <string>
#include <algorithm>
#include <functional>
#include <queue>
#include <stack>
#include <set>
#include <cmath>
#include <bitset>
#include <map>
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define rep1(i,n) for(int i=1;i<=(int)(n);i++)
#define sz(c) ((int)(c).size())

using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vll;
const int MAX=30010;

ll pt(int e){
	ll ans=1;
	rep(_,e)ans*=10;
	return ans;
}

int main(){
	set<ll> st;
	rep(i,15){
		if(i==0)rep1(k,9)st.insert((ll)k);
		else if(i<=10){
			rep(k,i*10)st.insert( (ll)(k+1)* pt(i)-1);
		}
		else if(i<=14){
			rep(k,(i-1)*10)st.insert( (ll)(k+1)* pt(i)-1);
		}
	}
	int K;
	cin>>K;
	int tmp=K;
	for(auto it=st.begin(); it!=st.end(); it++){
		cout<<*it<<endl;
		tmp--;
		if(tmp==0) break;
	}
}

Submission Info

Submission Time
Task D - Snuke Numbers
User spawn
Language C++14 (GCC 5.4.1)
Score 500
Code Size 923 Byte
Status AC
Exec Time 3 ms
Memory 256 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 500 / 500
Status
AC × 1
AC × 3
Set Name Test Cases
Sample sample.txt
All sample.txt, 1.txt, sample.txt
Case Name Status Exec Time Memory
1.txt AC 3 ms 256 KB
sample.txt AC 1 ms 256 KB