# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
86988 | rakuten | Star triangles (IZhO11_triangle) | C++14 | 3 ms | 472 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
#define fr first
#define sc second
#define pb push_back
#define mk make_pair
#define ll long long
#define OK puts("OK")
#define sz(s) (int)s.size()
#define all(s) s.begin(), s.end()
using namespace std;
const int N = 3e5+10;
const int inf = 1e9+7;
int x[N] , y [N] , cnt ;
double a , b , c ;
int main() {
int n ;
cin >> n ;
for (int i = 0 ;i < n ;i ++ )
{
cin >> x [i] >> y [i] ;
}
for (int i = 0 ;i < n - 2 ; i ++ )
{
for (int j = i + 1 ;j < n - 1 ; j ++ )
{
for (int z = j + 1 ; z < n ; z ++ )
{
vector < double > v;
a = sqrt ( (x [i] - x [j] ) * (x [i] - x [j] ) + (y [i] - y [j] ) * (y [i] - y [j] )) ;
b = sqrt ( (x [i] - x [z] ) * (x [i] - x [z] ) + (y [i] - y [z] ) * (y [i] - y [z] )) ;
c = sqrt ( (x [z] - x [j] ) * (x [z] - x [j] ) + (y [z] - y [j] ) * (y [z] - y [j] )) ;
// cout << a << ' ' << b << ' ' << c << endl;
v.pb(a);
v.pb(b);
v.pb(c);
sort (all (v)) ;
if (v[0] + v[1] > v[2])
cnt ++ ;
}
}
}
cout << cnt ;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |