Submission #1024436

#TimeUsernameProblemLanguageResultExecution timeMemory
1024436ZHIRDILBILDIZCave (IOI13_cave)C++14
Compilation error
0 ms0 KiB
#include<bits/stdc++.h>
#include"cave.h"
using namespace std ;
void exploreCave(int N)
{
    int S[N], [N] ;
    vector<int> un_us, us;
    for(int i = 0 ; i < N ; i++)
        un_us.push_back(i), [i] = 0 ;
    for(int i = 0 ; i < N ; i++)
    {
        for(int j : un_us)
            S[j] = 0 ;
        int trycomb = tryCombination(S);
        if(trycomb == i)
        {
            int l = -1, r = un_us.size() ;
            while(l + 1 < r)
            {
                int mid = (l + r) >> 1 ;
                for(int j = 0 ; j <= mid ; j++)
                    S[un_us[j]] = 1 ;
                if(tryCombination(S) == i)l = mid ;
                else r = mid ;
                for(int j = 0 ; j <= mid ; j++)
                    S[un_us[j]] = 0 ;
            }
            us.push_back(un_us[r]) ;
            un_us.erase(r + un_us.begin()) ;
            [us.back()] = i ;
            S[us.back()] = 1 ;
        }
        else
        {
            int l = -1, r = un_us.size() ;
            while(l + 1 < r)
            {
                int mid = (l + r) >> 1 ;
                for(int j = 0 ; j <= mid ; j++)
                    S[un_us[j]] = 1 ;
                if(tryCombination(S) == i)r = mid ;
                else l = mid ;
                for(int j = 0 ; j <= mid ; j++)
                    S[un_us[j]] = 0 ;
            }
            us.push_back(un_us[r]) ;
            un_us.erase(r + un_us.begin()) ;
            [us.back()] = i ;
            S[us.back()] = 0 ;
        }
    }
    answer(S, D) ;
}

Compilation message (stderr)

cave.cpp: In function 'void exploreCave(int)':
cave.cpp:6:15: error: expected unqualified-id before '[' token
    6 |     int S[N], [N] ;
      |               ^
cave.cpp: In lambda function:
cave.cpp:9:33: error: expected '{' before '=' token
    9 |         un_us.push_back(i), [i] = 0 ;
      |                                 ^
cave.cpp: In function 'void exploreCave(int)':
cave.cpp:9:35: error: no match for 'operator=' (operand types are 'exploreCave(int)::<lambda()>' and 'int')
    9 |         un_us.push_back(i), [i] = 0 ;
      |                                   ^
cave.cpp:9:31: note: candidate: 'exploreCave(int)::<lambda()>& exploreCave(int)::<lambda()>::operator=(const exploreCave(int)::<lambda()>&)' (deleted)
    9 |         un_us.push_back(i), [i] = 0 ;
      |                               ^
cave.cpp:9:31: note:   no known conversion for argument 1 from 'int' to 'const exploreCave(int)::<lambda()>&'
cave.cpp:30:16: error: expected ',' before '.' token
   30 |             [us.back()] = i ;
      |                ^
      |                ,
cave.cpp:30:16: error: expected identifier before '.' token
cave.cpp: In lambda function:
cave.cpp:30:25: error: expected '{' before '=' token
   30 |             [us.back()] = i ;
      |                         ^
cave.cpp: In function 'void exploreCave(int)':
cave.cpp:30:27: error: no match for 'operator=' (operand types are 'exploreCave(int)::<lambda()>' and 'int')
   30 |             [us.back()] = i ;
      |                           ^
cave.cpp:30:23: note: candidate: 'exploreCave(int)::<lambda()>& exploreCave(int)::<lambda()>::operator=(const exploreCave(int)::<lambda()>&)' (deleted)
   30 |             [us.back()] = i ;
      |                       ^
cave.cpp:30:23: note:   no known conversion for argument 1 from 'int' to 'const exploreCave(int)::<lambda()>&'
cave.cpp:48:16: error: expected ',' before '.' token
   48 |             [us.back()] = i ;
      |                ^
      |                ,
cave.cpp:48:16: error: expected identifier before '.' token
cave.cpp: In lambda function:
cave.cpp:48:25: error: expected '{' before '=' token
   48 |             [us.back()] = i ;
      |                         ^
cave.cpp: In function 'void exploreCave(int)':
cave.cpp:48:27: error: no match for 'operator=' (operand types are 'exploreCave(int)::<lambda()>' and 'int')
   48 |             [us.back()] = i ;
      |                           ^
cave.cpp:48:23: note: candidate: 'exploreCave(int)::<lambda()>& exploreCave(int)::<lambda()>::operator=(const exploreCave(int)::<lambda()>&)' (deleted)
   48 |             [us.back()] = i ;
      |                       ^
cave.cpp:48:23: note:   no known conversion for argument 1 from 'int' to 'const exploreCave(int)::<lambda()>&'
cave.cpp:52:15: error: 'D' was not declared in this scope
   52 |     answer(S, D) ;
      |               ^