Skip to content

Commit 874ab23

Browse files
committed
Added 467B - Fedor and New Game.cpp
1 parent 7924613 commit 874ab23

File tree

1 file changed

+43
-0
lines changed

1 file changed

+43
-0
lines changed

467B - Fedor and New Game.cpp

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
// ॐ नमः शिवाय
2+
#include<bits/stdc++.h>
3+
using namespace std;
4+
5+
#define ll long long
6+
#define pb push_back
7+
#define ff first
8+
#define ss second
9+
#define mp make_pair
10+
11+
// Code Written By: Vikash Patel
12+
// Codeforces Profile: https://codeforces.com/profile/vikashpatel
13+
14+
int main()
15+
{
16+
ios_base::sync_with_stdio(0);
17+
cin.tie(0);
18+
cout.tie(0);
19+
20+
// #ifndef ONLINE_JUDGE
21+
// freopen("input.txt", "r", stdin);
22+
// freopen("/Users/vikash/Desktop/output.txt", "w", stdout);
23+
// #endif
24+
25+
int n, m, k;
26+
cin>>n>>m>>k;
27+
int pa[m+1]; // Players Army
28+
for(int i=1; i<=m+1; i++)
29+
{
30+
cin>>pa[i];
31+
}
32+
int fedor = pa[m+1];
33+
int pf = 0; // Potential Friends
34+
for(int i=1; i<=m; i++)
35+
{
36+
int check = pa[i] ^ fedor;
37+
if(__builtin_popcount(check) <= k)
38+
pf++;
39+
}
40+
cout<<pf<<endl;
41+
return 0;
42+
}
43+

0 commit comments

Comments
 (0)