답안 #167474

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
167474 2019-12-08T16:15:45 Z Toirov_Sadi 별들과 삼각형 (IZhO11_triangle) C++17
0 / 100
4 ms 376 KB
#include <bits/stdc++.h>

#define fr first
#define se second

using namespace std;

const long long N = 3e5 + 7;
const long long inf = 1e9 + 7;
const long long mod = 1e9 + 7;

long long n;
long long res;
pair<long long, long long> d[N];
int main()
{
    freopen( "triangles.in", "r", stdin );
    freopen( "triangles.out", "w", stdout );

    ios_base::sync_with_stdio( false );

    cin >> n;
    for(int i = 1; i <= n; i ++){
        cin >> d[i].fr >> d[i].se;
    }
    for(int i = 1; i <= n; i ++){
        for(int j = 1; j <= n; j ++){
            for(int k = 1; k <= n; k ++){
                if(i == j || i == k || j == k){
                    continue;
                }
                pair<long long, long long> a = d[i];
                pair<long long, long long> b = d[j];
                pair<long long, long long> c = d[k];
                res += (a.fr == b.fr && b.se == c.se);
            }
        }
    }cout << res << "\n";
}

Compilation message

triangle.cpp: In function 'int main()':
triangle.cpp:17:12: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)', declared with attribute warn_unused_result [-Wunused-result]
     freopen( "triangles.in", "r", stdin );
     ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
triangle.cpp:18:12: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)', declared with attribute warn_unused_result [-Wunused-result]
     freopen( "triangles.out", "w", stdout );
     ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Incorrect 4 ms 376 KB Output isn't correct
2 Halted 0 ms 0 KB -