Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- #define dbg(i,j) cout<<"I am "<<i<<" = "<<endl<<j<<endl;
- #define dbr(name,a) cout<<name<<endl;for(auto x:a)cout<<x<<" ";cout<<endl;
- #define DBR(name,a) cout<<name<<endl;for(auto x:a){ for(auto y:x)cout<<y<<" ";cout<<endl;}
- #define dbmp(name,a) cout<<name<<endl;for(auto x:a){ cout<<x.first<<"\t"<<x.second<<endl;}
- #define dbp(name,a) cout<<name<<endl;cout<<a.first<<"\t"<<a.second<<endl;
- #define boost ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
- using namespace std;
- typedef long long int big;
- typedef long double fig;
- void fastscan(big &x)
- {
- bool neg = false;
- register big c;
- x = 0;
- c = getchar();
- if(c == '-')
- {
- neg = true;
- c = getchar();
- }
- for(;(c>47 && c<58);c=getchar()) x=(x<<1)+(x<<3)+c-48;
- if(neg) x *=-1;
- }
- void fastprint(big n)
- {
- if (n == 0)
- {
- putchar('0');
- putchar('\n');
- }
- else if (n == -1)
- {
- putchar('-');
- putchar('1');
- putchar('\n');
- }
- else
- {
- big neg=0;
- char buf[20];
- if(n<0){
- neg=1;
- n=-n;
- }
- buf[10] = '\n';
- big i = 9;
- while (n)
- {
- buf[i--] = n % 10 + '0';
- n /= 10;
- }
- if(neg)buf[i--]='-';
- while (buf[i] != '\n')
- putchar(buf[++i]);
- }
- }
- int main(){
- big n,k;
- fastscan(n);
- fastscan(k);
- big count=0;
- big t;
- while(n--){
- fastscan(t);
- if(t%k==0){
- count++;
- }
- }
- fastprint(count);
- }
Add Comment
Please, Sign In to add comment