Code Submission Evaluation System Login

CSES - HIIT Open 2016

HIIT Open 2016

Contest start:2016-05-28 11:00:00
Contest end:2016-05-28 16:00:00

Task list | Submit code | Submissions | Messages | Scoreboard | Statistics


History
2016-05-28 12:08:48
2016-05-28 12:08:28
2016-05-28 12:06:12
Task:Interesting number
Sender:ContinuedLife
Submission time:2016-05-28 12:08:48
Status:READY
Result:ACCEPTED

Show test data

Code

#include <bits/stdc++.h>
#define _ ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0), cout.precision(6);

using namespace std;

int main(){ _
	int ans[20] = {2, 3, 5, 7, 11, 101, 131, 151, 181, 191, 313, 353, 373, 383, 727, 757, 787, 797, 919, 929};
	//set<int> si;
//	for(int i = 0; i < 21; ++i)	si.insert(anss[i]);
	
	int TC;	cin >> TC;
	while(TC--){
		int n, num;	cin >> n;
		for(int i = 0; i < n; ++i){
			cin >> num;
			for(int j = 0; j < 20; ++j)
				if(ans[j] == num)	cout << num << endl;
		}
	}

	return 0;
}