admin管理员组文章数量:1582731
Problem here
All submissions for this problem are available.
Problem
The purpose of this problem is to verify whether the method you are using to read input data is sufficiently fast to handle problems branded with the enormous Input/Output warning. You are expected to be able to process at least 2.5MB of input data per second at runtime.
Input
The input begins with two positive integers n k (n, k<=107). The next n lines of input contain one positive integer ti, not greater than 109, each.
Output
Write a single integer to output, denoting how many integers ti are divisible by k.
Example
Input:
7 3
1
51
966369
7
9
999996
11
Output:
4
Solution
#include <iostream>
using namespace std;
int main(){
int n, k;
while(cin >> n >> k){
int count = 0;
while(n--){
int num;
cin >> num;
if(num % k == 0)
count++;
}
cout << count << endl;
}
return 0;
}
本文标签: EnormousCodeChefTestInput
版权声明:本文标题:【CodeChef】Enormous Input Test 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:https://www.elefans.com/xitong/1727901461a1136964.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论