169882025-05-19 21:21:50gfaragoHáromszögeléscpp17Forditási hiba
// Source: https://usaco.guide/general/io

#include <bits/stdc++.h>
using namespace std;


int query(int x, int y);



int solve1(int n){
    vector<array<int, 3>> a;
    for(int i=0;i<n;i++){
        for(int j=i+2;j<n;j++){
            if(i==0 && j==n-1) continue;
            int value=max(i, n-j);
            if(i==0){
                value=max(j, n-j);
            }
            a.push_back({value, i, j});
        }
    }
    sort(a.begin(), a.end());
    for(int i=0;i<a.size();i++){
        int value = a[i][0];
        int from = a[i][1];
        int to = a[i][2];
        cout << from << " " << to << " " << value << " ans:" << (from*n+to) << endl;
        // if(from, to) {
        //     return from*n+to;
        // }
    }
    return 0;
}

int solve1(int n){
    return 2;
}

// int main() {
//     solve(8);
// }
Forditási hiba
open /var/local/lib/isolate/412/box/a.out: no such file or directory
main.cpp:36:5: error: redefinition of 'int solve1(int)'
   36 | int solve1(int n){
      |     ^~~~~~
main.cpp:11:5: note: 'int solve1(int)' previously defined here
   11 | int solve1(int n){
      |     ^~~~~~