Submission #943848

#TimeUsernameProblemLanguageResultExecution timeMemory
943848thunoproSpeedrun (RMI21_speedrun)C++14
Compilation error
0 ms0 KiB
#include<bits/stdc++.h> using namespace std ; #define maxn 1009 #define ll long long #define pb push_back #define fi first #define se second #define left id<<1 #define right id<<1|1 #define re exit(0); #define _lower(x) lower_bound(v.begin(),v.end(),x)-v.begin()+1 #define TIME ( 1.0*clock() / CLOCKS_PER_SEC ) const int mod = 1e9+7 ; const int INF = 1e9 ; typedef vector<int> vi ; typedef pair<int,int> pii ; typedef vector<pii> vii ; template < typename T > void chkmin ( T &a , T b ) { if ( a > b ) a = b ; } template < typename T > void chkmax ( T &a , T b ) { if ( a < b ) a = b ; } void add ( int &a , int b ) { a += b ; if ( a >= mod ) a -= mod ; if ( a < 0 ) a += mod ; } void rf () { freopen ("bai1.inp","r",stdin) ; } mt19937 rng (time(0)) ; int _pow ( int a , int n ) { if ( n == 0 ) return 1 ; int res = _pow (a,n/2) ; if ( n % 2 ) return 1ll*res*res%mod*a%mod ; else return 1ll*res*res%mod ; } #include "speedrun.h" //int bit [maxn] ; //int LENGTH ; //int cur ; //bool adj [maxn][maxn] ; // //void setHintLen ( int l ) //{ // LENGTH = l ; //} //void setHint ( int i , int j , bool b ) //{ // bit [i] |= (1<<j) ; //} //int getLength () //{ // return LENGTH ; //} //bool getHint ( int j ) //{ // return (bit[cur]>>(j-1)) ; //} //bool goTo ( int x ) //{ // if ( adj [cur][x] == true ) // { // cur = x ; // return true ; // } //} vi adjList [maxn] ; int par [maxn] ; int euler [maxn] , timeDfs ; void dfs ( int u , int dfs_par = 0 ) { par [u] = dfs_par ; euler [timeDfs++] = u ; for ( auto v : adjList [u] ) { if ( v != dfs_par ) { dfs (v,u) ; } } } void setInterger ( int node , int id , int value ) { int offset = id*10+1 ; for ( int b = 0 ; b < 10 ; b ++ ) { if ( value>>b&1 ) setHint (node,offset+b,true) ; } } void assignHints ( int subtask , int n , vi A , vi B ) { setHintLen (20) ; for ( int i = 1 ; i <= n-1 ; i ++ ) { int u = A [i] , v = B [i] ; adjList [u] . pb (v) , adjList [v] . pb (u) ; } dfs (1) ; for ( int i = 0 ; i < n ; i ++ ) { setInterger (i+1,0,par[i+1]) ; setInterger (euler[i],1,euler[(i+1)%n]) ; } } int readInterger ( int id ) { int offset = id*10+1 ; int value = 0 ; for ( int b = 0 ; b < 10 ; b ++ ) { value += (getHint(offset+b)<<b) ; } return value ; } void speedrun ( int subtask , int n , int start ) { int node = start ; do { int target = readInterger (1) ; while (!goTo(target)) { node = readInterger (0) ; goTo (node) ; } node = target ; } while ( node != start ) ; } //int main () //{ // ios_base::sync_with_stdio(0); // cin.tie(0);cout.tie(0); //// rf () ; // //}

Compilation message (stderr)

speedrun.cpp: In function 'void rf()':
speedrun.cpp:32:10: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   32 |  freopen ("bai1.inp","r",stdin) ;
      |  ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
/usr/bin/ld: /tmp/ccstwriH.o: in function `main':
stub.cpp:(.text.startup+0x1d1): undefined reference to `assignHints(int, int, int*, int*)'
collect2: error: ld returned 1 exit status