Skip to content

Instantly share code, notes, and snippets.

@sifue
Created August 20, 2017 05:13
Show Gist options
  • Save sifue/f0ed2834081540034bf4ae678f1bc56e to your computer and use it in GitHub Desktop.
Save sifue/f0ed2834081540034bf4ae678f1bc56e to your computer and use it in GitHub Desktop.
書き直したらこんな感じ
#include <iostream>
#include <algorithm>
#include <set>
using namespace std;
int main(){
int N;
cin >> N;
int p[N][3];
int i, j;
for(i = 0; i < N; i++){
for(j = 0; j < 3; j++){
cin >> p[i][j];
}
}
set< set<int> > Q;
for(int k = 0; k < N; k++){
set<int> S;
for(int l = 0; l < 3; l++){
S.insert(p[k][l]);
}
Q.insert(S);
}
cout << (N - Q.size()) << endl;
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment