-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMT06.cpp
More file actions
48 lines (42 loc) · 844 Bytes
/
Copy pathMT06.cpp
File metadata and controls
48 lines (42 loc) · 844 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#include <set>
#include <iostream>
#include <cmath>
#include <vector>
#include <algorithm>
using namespace std;
bool check(int n){
int result = sqrt(n);
if(result * result == n){
return true;
}
return false;
}
int main(){
ios_base::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
int row, col;
int m[100][100];
vector<int> result;
cin >> row >> col;
for(int i=0; i<row; i++){
for(int j=0; j<col; j++){
cin >> m[i][j];
if(check(m[i][j])){
result.push_back(m[i][j]);
}
}
}
if(result.size() == 0){
cout << "NOT FOUND";
}
else{
set<int> aset;
for(auto v: result){
aset.insert(v);
}
for(auto s: aset){
cout << s << " ";
}
}
}