Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions enormous input.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#include <bits/stdc++.h>

using namespace std;

// Usually, you can use scanf/printf in C++.
// However, if you want to use cin/cout, it is usually slow.
// To make it faster. Use cin.tie(NULL) and set ios_base::sync_with_stdio(false)
// See the below code for details.

int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);

// Read the input n, k
int n, k;
cin >> n >> k;

// ans denotes number of integers n divisible by k
int ans = 0;

for (int i = 0; i < n; i++) {
int t;
cin >> t;

if (t % k == 0) {
ans++;
}
}

// Print the ans.
cout << ans << "\n";

return 0;
}