제출 #1361480

#제출 시각아이디문제언어결과실행 시간메모리
1361480jalol2503개의 봉우리 (IOI25_triples)C++20
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h>
using namespace std;

long long count_triples(vector<int> &H){
    int n = H.size();
    long long ans = 0;

    for(int i = 0; i < n; i++){
        for(int j = i + 1; j < n; j++){
            for(int k = j + 1; k < n; k++){
                int a = H[i], b = H[j], c = H[k];
                int x = j - i, y = k - j, z = k - i;
                if( (a==x && b==y && c==z) ||
                    (a==x && b==z && c==y) ||
                    (a==y && b==x && c==z) ||
                    (a==y && b==z && c==x) ||
                    (a==z && b==x && c==y) ||
                    (a==z && b==y && c==x) ){
                    ans++;
                }
            }
        }
    }
    return ans;
}

int main(){
    ios::sync_with_stdio(false);
    cin.tie(nullptr);

    int n;
    cin >> n;

    vector<int> v(n);
    for(int i = 0; i < n; i++) cin >> v[i];

    cout << count_triples(v);
}

컴파일 시 표준 에러 (stderr) 메시지

/usr/bin/ld: /tmp/ccI3I0Tz.o: in function `main':
grader.cpp:(.text.startup+0x0): multiple definition of `main'; /tmp/ccmD1tOD.o:triples.cpp:(.text.startup+0x0): first defined here
/usr/bin/ld: /tmp/ccI3I0Tz.o: in function `main':
grader.cpp:(.text.startup+0x197): undefined reference to `construct_range(int, int)'
/usr/bin/ld: grader.cpp:(.text.startup+0x367): undefined reference to `count_triples(std::vector<int, std::allocator<int> >)'
collect2: error: ld returned 1 exit status