Computer Science/백준 알고리즘
[백준] 3052번 나머지 (C++)
roytravel
2022. 6. 14. 02:39
#include <iostream>
using namespace std;
int solution1()
{
int array[10] = {0, };
int remainder[42] = {0,};
int count = 0;
for (int i=0; i<10; i++)
{
cin >> array[i];
if (array[i] < 0 or array[i] > 1000)
return 0;
if (!remainder[array[i] % 42]++)
count = count + 1;
}
return count;
}
int main(void)
{
int count = 0;
count = solution1();
cout << count << endl;
return 0;
}