#include<bits/stdc++.h>
#define pb push_back
#define int long long
#define S second
#define F first
#define inputt freopen("input.txt","r",stdin);freopen("outut.txt","w",stdout);
#define ahah ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
using namespace std;
const int N=1e6+7;
const int MOD=1e9+7;
int x[N],y[N];
signed main() {
ahah
int n;
cin >> n;
for(int i = 1 ; i <= n ; i++){
cin >> x[i] >> y[i];
}
int ans=0;
for(int i = 1 ; i <= n ; i++){
for(int j = i+1 ; j <= n ; j++){
for(int k = j+1 ; k <= n ; k++){
set<int>xax;
set<int>yax;
xax.insert(x[i]);
xax.insert(x[j]);
xax.insert(x[k]);
yax.insert(y[i]);
yax.insert(y[j]);
yax.insert(y[k]);
if(xax.size() == 2 and yax.size() == 2){
ans++;
}
}
}
}
cout << ans;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
2504 KB |
Output is correct |
2 |
Correct |
1 ms |
2388 KB |
Output is correct |
3 |
Correct |
1 ms |
2388 KB |
Output is correct |
4 |
Correct |
1 ms |
2512 KB |
Output is correct |
5 |
Correct |
1 ms |
2420 KB |
Output is correct |
6 |
Correct |
3 ms |
2388 KB |
Output is correct |
7 |
Correct |
22 ms |
2388 KB |
Output is correct |
8 |
Correct |
146 ms |
2508 KB |
Output is correct |
9 |
Execution timed out |
2082 ms |
2388 KB |
Time limit exceeded |
10 |
Halted |
0 ms |
0 KB |
- |