제출 #1135220

#제출 시각아이디문제언어결과실행 시간메모리
1135220emptypringlescanSpeedrun (RMI21_speedrun)C++17
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; #include "speedrun.h" vector<int> adj[1005]; int par[1005]; vector<int> pre; void dfs(int x, int p){ par[x]=p; pre.push_back(x); for(int i:adj[x]){ if(i==p) continue; dfs(i,x); } } void assignHints(int st, int n, int A[], int B[]){ setHintLen(20); for(int i=1; i<n; i++){ adj[A[i]].push_back(B[i]); adj[B[i]].push_back(A[i]); } dfs(1,0); pre.push_back(pre[0]); for(int i=1; i<=n; i++){ for(int j=0; j<10; j++){ setHint(i,j+1,1&(par[i]>>j)); } for(int j=0; j<10; j++){ setHint(pre[i-1],j+11,1&(pre[i]>>j)); } } } void speedrun(int st, int n, int start){ int cur=start,nxt=-1; while(true){ if(nxt==-1){ nxt=0; for(int i=0; i<10; i++){ nxt|=(getHint(i+11)<<i); } } if(nxt==start) break; if(goTo(nxt)){ cur=nxt; nxt=-1; } else{ int p=0; for(int i=0; i<10; i++){ p|=(getHint(i+1)<<i); } assert(goTo(p)=true); } } }

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

In file included from /usr/include/c++/11/cassert:44,
                 from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:33,
                 from speedrun.cpp:1:
speedrun.cpp: In function 'void speedrun(int, int, int)':
speedrun.cpp:51:36: error: lvalue required as left operand of assignment
   51 |                         assert(goTo(p)=true);
      |                                ~~~~^~~