제출 #519168

#제출 시각아이디문제언어결과실행 시간메모리
519168nickmet2004Longest beautiful sequence (IZhO17_subsequence)C++11
컴파일 에러
0 ms0 KiB
#include<bits/stdc++.h> using namespace std; const int N = 1e5 + 5 , M = 10; int n,a[N] , k[N]; int dp[1<<10+5][1<<10+5][M+1] , p[1<<10+5][1<<10+5][M+1], P[N] , mx , id; int main (){ ios_base::sync_with_stdio(0); cin.tie(0); cin >> n; for(int i= 0; i< n; ++i) cin >> a[i]; for(int i = 0; i< n; ++i)cin >> k[i]; memset(P , -1 , sizeof(P)); for(int i =0; i < n; ++i){ int A = a[i] >> M , B = a[i] & ((1<<M) - 1) , ans = 0; for(int l =0; l < (1<<M); ++l){ int y = k[i] - __builtin_popcount(l & A); if(y < 0 || y > 10) continue; if(dp[l][B][y] > ans){ ans = dp[l][B][y]; P[i] = p[l][B][y]; } } ans++; if(ans > mx)mx = ans, id = i; for(int r= 0; r< (1<<M);++r){ int y = __builtin_popcount(B & r); if(dp[A][r][y] < ans){ dp[A][r][y] = ans; p[A][r][y] = i; } } } vector<int> X; while(1){ X.emplace_back(id); id = P[id]; if(id == -1)break; } reverse(X.begin() , X.end()); cout << X.size() << endl; for(int x : X)cout << x+1 << " "; }

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

subsequence.cpp:6:13: warning: suggest parentheses around '+' inside '<<' [-Wparentheses]
    6 | int dp[1<<10+5][1<<10+5][M+1] , p[1<<10+5][1<<10+5][M+1], P[N] , mx , id;
      |           ~~^~
subsequence.cpp:6:22: warning: suggest parentheses around '+' inside '<<' [-Wparentheses]
    6 | int dp[1<<10+5][1<<10+5][M+1] , p[1<<10+5][1<<10+5][M+1], P[N] , mx , id;
      |                    ~~^~
subsequence.cpp:6:40: warning: suggest parentheses around '+' inside '<<' [-Wparentheses]
    6 | int dp[1<<10+5][1<<10+5][M+1] , p[1<<10+5][1<<10+5][M+1], P[N] , mx , id;
      |                                      ~~^~
subsequence.cpp:6:49: warning: suggest parentheses around '+' inside '<<' [-Wparentheses]
    6 | int dp[1<<10+5][1<<10+5][M+1] , p[1<<10+5][1<<10+5][M+1], P[N] , mx , id;
      |                                               ~~^~
/tmp/ccyla6Is.o: in function `main':
subsequence.cpp:(.text.startup+0x11): 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/10/libstdc++.a(globals_io.o)
subsequence.cpp:(.text.startup+0x19): relocation truncated to fit: R_X86_64_PC32 against symbol `a' defined in .bss section in /tmp/ccyla6Is.o
subsequence.cpp:(.text.startup+0x3c): relocation truncated to fit: R_X86_64_PC32 against symbol `n' defined in .bss section in /tmp/ccyla6Is.o
subsequence.cpp:(.text.startup+0x43): 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/10/libstdc++.a(globals_io.o)
subsequence.cpp:(.text.startup+0x4a): 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/10/libstdc++.a(globals_io.o)
subsequence.cpp:(.text.startup+0x59): relocation truncated to fit: R_X86_64_PC32 against symbol `n' defined in .bss section in /tmp/ccyla6Is.o
subsequence.cpp:(.text.startup+0x79): relocation truncated to fit: R_X86_64_PC32 against symbol `n' defined in .bss section in /tmp/ccyla6Is.o
subsequence.cpp:(.text.startup+0x8c): relocation truncated to fit: R_X86_64_PC32 against symbol `k' defined in .bss section in /tmp/ccyla6Is.o
subsequence.cpp:(.text.startup+0x95): 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/10/libstdc++.a(globals_io.o)
subsequence.cpp:(.text.startup+0xae): relocation truncated to fit: R_X86_64_PC32 against symbol `n' defined in .bss section in /tmp/ccyla6Is.o
subsequence.cpp:(.text.startup+0xe4): additional relocation overflows omitted from the output
/usr/bin/ld: failed to convert GOTPCREL relocation; relink with --no-relax
collect2: error: ld returned 1 exit status