My issue
include
include
include
using namespace std;
int main() {
for (int t = 0; t < 10; t++) {
set s;
for (int i = 0; i < 10; i++) {
int num;
cin >> num;
s.insert(num % 42);
}
cout << s.size() << endl; // Output the number of distinct values considered MOD 42 for each test case
}
return 0;
} this is my code. it works for the first testcase given in problem, however other 9 testcases are not given and i am getting wrong answer
My code
#include <iostream>
#include <vector>
#include <set>
using namespace std;
int main() {
for (int t = 0; t < 10; t++) {
set<int> s;
for (int i = 0; i < 10; i++) {
int num;
cin >> num;
s.insert(num % 42);
}
cout << s.size() << endl; // Output the number of distinct values considered MOD 42 for each test case
}
return 0;
}
Problem Link: NSIT13 Problem - CodeChef