제출 #1330350

#제출 시각아이디문제언어결과실행 시간메모리
1330350KhoaDuyHack (APIO25_hack)C++20
컴파일 에러
0 ms0 KiB
#include "hack.h"
#include "grader.cpp"
#include <bits/stdc++.h>
using namespace std;
#define ll long long
const int blsz=7630;
const int MAXN=1e9;
int hack(){
    int blcnt=(MAXN/blsz);
    int a=0,b=0;
    vector<ll> def;
    for(int i=1;i<=blsz;i++){
        def.push_back(i);
    }
    for(int i=__lg(blcnt);i>=0;i--){
        vector<ll> v=def;
        for(int bruh=0;bruh<(1<<i);bruh++){
            v.push_back(v.back()+blsz);
        }
        if(!collisions(v)){
            a+=(1<<i);
            def.push_back(def.back()+1LL*(1<<i)*blsz);
        }
    }
    for(b=0;b+1<blsz;b++){
        if(a==0&&b==0){
            continue;
        }
        if(collisions({1,1+1LL*a*blsz+b})){
            break;
        }
    }
    return (a*blsz+b);
}

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

/usr/bin/ld: /tmp/ccBJUtez.o: in function `main':
grader.cpp:(.text.startup+0x0): multiple definition of `main'; /tmp/ccib54HV.o:hack.cpp:(.text.startup+0x0): first defined here
/usr/bin/ld: /tmp/ccBJUtez.o: in function `collisions(std::vector<long long, std::allocator<long long> >)':
grader.cpp:(.text+0x570): multiple definition of `collisions(std::vector<long long, std::allocator<long long> >)'; /tmp/ccib54HV.o:hack.cpp:(.text+0x570): first defined here
collect2: error: ld returned 1 exit status