제출 #1168236

#제출 시각아이디문제언어결과실행 시간메모리
1168236Faisal_Saqib새로운 문제 (POI13_spa)C++17
컴파일 에러
0 ms0 KiB
#include <bitset>
#include <iostream>
#include <unordered_map>
#include <queue>
using namespace std;
#define ll long long
int n,k;
char c;
ll asp=0;
// 10000000040
// 2e9 = 2000000000
bitset<10000000000> ban[2];
ll read()
{
    asp=0;
    for(int i=0;i<n;i++)
    {
        cin>>c;
        asp<<=1;
        asp+=c-'0';
    }
    return asp;
}
ll pw2[70];
int main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    cin>>n>>k;
    if(n<=44)
    {
        
    }
    else
    {
        exit(-1);
    }
    pw2[0]=1;
    for(int i=1;i<=n;i++)
        pw2[i]=2ll*pw2[i-1];
    ll st=read(),ed=read();
    for(int i=0;i<k;i++)
    {
        ll c=read();
        ban[0][c]=ban[1][c]=1;
    }
    // lets do a double sided bfs
    // better time complexity
    queue<ll>pq;
    ban[0][st]=1;
    pq.push(st);
    ban[1][ed]=1;
    pq.push(ed);
    ll op=0;
    while(pq.size())
    {
        ll x=pq.front();
        pq.pop();
        // op++;
        // ll x=xa.first;
        if(ban[0][x]&ban[1][x])
        {
            cout<<"TAK"<<endl;
            return 0;
        }
        // if(op*n >= 2e9)
        // {
        //     break;
        // }
        for(int bi=0;bi<n;bi++)
        {
            ll y=x^pw2[bi];
            for(int at=0;at<2;at++)
            {
                if(ban[at][x] and !ban[at][y])
                {
                    if(ban[1-at][y])
                    {
                        cout<<"TAK"<<endl;
                        return 0;
                    }
                    ban[at][y]=1;
                    pq.push(y);
                }
            }
        }
    }
    cout<<"NIE"<<endl;
    return 0;
}

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

/tmp/cc7mKCtT.o: in function `read()':
spa.cpp:(.text+0x86): relocation truncated to fit: R_X86_64_PC32 against symbol `n' defined in .bss section in /tmp/cc7mKCtT.o
spa.cpp:(.text+0x8d): relocation truncated to fit: R_X86_64_PC32 against symbol `asp' defined in .bss section in /tmp/cc7mKCtT.o
spa.cpp:(.text+0x9e): relocation truncated to fit: R_X86_64_PC32 against symbol `c' defined in .bss section in /tmp/cc7mKCtT.o
spa.cpp:(.text+0xa6): 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)
spa.cpp:(.text+0xc1): relocation truncated to fit: R_X86_64_PC32 against symbol `c' defined in .bss section in /tmp/cc7mKCtT.o
spa.cpp:(.text+0xc8): relocation truncated to fit: R_X86_64_PC32 against symbol `asp' defined in .bss section in /tmp/cc7mKCtT.o
spa.cpp:(.text+0xd1): relocation truncated to fit: R_X86_64_PC32 against symbol `n' defined in .bss section in /tmp/cc7mKCtT.o
spa.cpp:(.text+0xde): relocation truncated to fit: R_X86_64_PC32 against symbol `asp' defined in .bss section in /tmp/cc7mKCtT.o
/tmp/cc7mKCtT.o: in function `main':
spa.cpp:(.text.startup+0x13): 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)
spa.cpp:(.text.startup+0x39): relocation truncated to fit: R_X86_64_PC32 against symbol `n' defined in .bss section in /tmp/cc7mKCtT.o
spa.cpp:(.text.startup+0x43): 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