제출 #1147863

#제출 시각아이디문제언어결과실행 시간메모리
1147863ByeWorldPinball (JOI14_pinball)C++20
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h>
#define int long long
#define ll long long
#define pb push_back
#define fi first
#define se second
#define lf (id<<1)
#define rg ((id<<1)|1)
#define md ((l+r)>>1)
#define ld long double
using namespace std;
typedef pair<int,int> pii;
typedef pair<char,char> pcc;
typedef pair<pii,int> ipii;
typedef pair<pii,pii> ipiii;
const int MAXN = 6e5+10;
const int SQRT = 300;
const int MAXA = 50;
const int LOG = 20;
const int INF = 1e18+10;
const ld EPS = 1e-12;
const int MOD = 1e9+7;
int sum(int a, int b){ return (a+b)%MOD; }
void chsum(int &a, int b){ a = (a+b)%MOD; }
void chmn(int &a, int b){ a = min(a, b); }
void chmx(int &a, int b){ a = max(a, b); }

int n, m, le[MAXN], ri[MAXN], c[MAXN], w[MAXN];
int dp[MAXN][MAXN];

struct seg {
    int st[4*MAXN];
    void bd(int id,int l,int r){
        if(l==r){ st[id] = INF; return; }
        bd(lf,l,md); bd(rg,md+1,r);
        st[id] = min(st[lf], st[rg]);
    }
    int que(int id, int l, int r, int x, int y){
        if(x<=l && r<=y) return st[id];
        if(r<x || y<l) return INF;
        return min(que(lf,l,md,x,y), que(rg,md+1,r,x,y));
    }
    int upd(int id,int l, int r,int x,int p){
        if(l==r && l==x){
            if(st[id] < p) return st[id];
            return st[id] = p;
        }
        if(r<x || x<l) return st[id];
        return st[id] = min(upd(lf,l,md,x,p), upd(rg,md+1,r,x,p));
    } 
} LE, RI;
signed main(){
    // ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
    vector <int> cc; cc.pb(-1);
    cin>>n>>m;
    for(int i=1; i<=n; i++){
        cin>>le[i]>>ri[i]>>c[i]>>w[i];
        cc.pb(le[i]); cc.pb(ri[i]); cc.pb(c[i]);
    }
    sort(cc.begin(), cc.end());
    cc.resize(unique(cc.begin(), cc.end()) - cc.begin());
    for(int i=1; i<=n; i++){
        le[i] = lower_bound(cc.begin(), cc.end(), le[i]) - cc.begin();
        ri[i] = lower_bound(cc.begin(), cc.end(), ri[i]) - cc.begin();
        c[i] = lower_bound(cc.begin(), cc.end(), c[i]) - cc.begin();
    }
    m = cc.size()-1;
    LE.bd(1,1,m); LE.upd(1,1,m,1,0); 
    RI.bd(1,1,m); RI.upd(1,1,m,m,0);

    int ANS = INF;
    for(int i=1; i<=n; i++){
        LE.upd(1,1,m,c[i], LE.que(1,1,m,le[i],c[i])+w[i]);
        RI.upd(1,1,m,c[i], RI.que(1,1,m,c[i],ri[i])+w[i]);

        int te = LE.que(1,1,m,le[i],ri[i]) + RI.que(1,1,m,le[i],ri[i]);
        te += w[i];
        chmn(ANS, te);
        // cout << dp[2][5] << ' ' << i<< " p\n";
    }
    cout << (ANS==INF ? -1 : ANS) << '\n';
}

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

/tmp/ccDdyEnV.o: in function `main':
pinball.cpp:(.text.startup+0x6d): relocation truncated to fit: R_X86_64_PC32 against symbol `std::cin' defined in .bss._ZSt3cin section in /usr/lib/gcc/x86_64-linux-gnu/11/libstdc++.a(globals_io.o)
pinball.cpp:(.text.startup+0x80): relocation truncated to fit: R_X86_64_PC32 against symbol `n' defined in .bss section in /tmp/ccDdyEnV.o
pinball.cpp:(.text.startup+0xaf): relocation truncated to fit: R_X86_64_PC32 against symbol `m' defined in .bss section in /tmp/ccDdyEnV.o
pinball.cpp:(.text.startup+0xd0): relocation truncated to fit: R_X86_64_PC32 against symbol `n' defined in .bss section in /tmp/ccDdyEnV.o
pinball.cpp:(.text.startup+0xd8): relocation truncated to fit: R_X86_64_PC32 against symbol `le' defined in .bss section in /tmp/ccDdyEnV.o
pinball.cpp:(.text.startup+0xe9): relocation truncated to fit: R_X86_64_PC32 against symbol `c' defined in .bss section in /tmp/ccDdyEnV.o
pinball.cpp:(.text.startup+0xf0): relocation truncated to fit: R_X86_64_PC32 against symbol `ri' defined in .bss section in /tmp/ccDdyEnV.o
pinball.cpp:(.text.startup+0xf7): relocation truncated to fit: R_X86_64_PC32 against symbol `w' defined in .bss section in /tmp/ccDdyEnV.o
pinball.cpp:(.text.startup+0x169): relocation truncated to fit: R_X86_64_PC32 against symbol `n' defined in .bss section in /tmp/ccDdyEnV.o
pinball.cpp:(.text.startup+0x2e1): relocation truncated to fit: R_X86_64_PC32 against symbol `c' defined in .bss section in /tmp/ccDdyEnV.o
pinball.cpp:(.text.startup+0x2e8): additional relocation overflows omitted from the output
/usr/lib/gcc/x86_64-linux-gnu/11/libstdc++.a(ios_init.o): in function `std::ios_base::Init::Init()':
(.text._ZNSt8ios_base4InitC2Ev+0x1c): failed to convert GOTPCREL relocation against '_ZNSt8ios_base4Init11_S_refcountE'; relink with --no-relax
(.text._ZNSt8ios_base4InitC2Ev+0x1c6): failed to convert GOTPCREL relocation against '_ZSt4cout'; relink with --no-relax
(.text._ZNSt8ios_base4InitC2Ev+0x260): failed to convert GOTPCREL relocation against '_ZSt3cin'; relink with --no-relax
(.text._ZNSt8ios_base4InitC2Ev+0x2e2): failed to convert GOTPCREL relocation against '_ZSt4cerr'; relink with --no-relax
(.text._ZNSt8ios_base4InitC2Ev+0x353): failed to convert GOTPCREL relocation against '_ZSt4clog'; relink with --no-relax
(.text._ZNSt8ios_base4InitC2Ev+0x541): failed to convert GOTPCREL relocation against '_ZSt5wcout'; relink with --no-relax
(.text._ZNSt8ios_base4InitC2Ev+0x5e5): failed to convert GOTPCREL relocation against '_ZSt4wcin'; relink with --no-relax
(.text._ZNSt8ios_base4InitC2Ev+0x670): failed to convert GOTPCREL relocation against '_ZSt5wcerr'; relink with --no-relax
(.text._ZNSt8ios_base4InitC2Ev+0x6e9): failed to convert GOTPCREL relocation against '_ZSt5wclog'; relink with --no-relax
collect2: error: ld returned 1 exit status