Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- int v[10],s[10];
- using namespace std;
- ifstream g ("date.in");
- ofstream f ("date.out");
- int nr(int n)
- {
- int ct=0;
- while(n>9)
- {
- ct++;
- n/=10;
- }
- return ct;
- }
- int main()
- {
- int n,ct=0,x;
- g>>n;
- while(g>>x)
- {
- v[nr(x)]++;
- ct++;
- }
- if(ct<n)
- {
- f<<"Nu exista";
- return 0;
- }
- for(int i=0;i<10;i++)
- s[i]=s[i-1]+v[i];
- int j=0;
- while(s[j]<n)
- j++;
- f<<1;
- for(int i=1;i<=j;i++)
- f<<0;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement