Submission #1221000

#TimeUsernameProblemLanguageResultExecution timeMemory
1221000hmms127Cave (IOI13_cave)C++20
Compilation error
0 ms0 KiB
#include "cave.h"
#include <bits/stdc++.h>
using namespace std;
#define f2(m,n) for(int i=m;i<n;i++)
#define f4(m,n) for(int j=m;i<n;j++)
void exploreCave(int N);	
   int sw[N]={},dr[N]={};
   bool vis[N]={};
   f2(0,n){
      f4(0,n)if(!vis[j])sw[j]=0;
      int x=tryCombination(sw);
      bool bt=(x==i ? 1:0);
      int l=0,r=n-1,ans=0;
      while|(l<=r){
          int mid=(l+r)/2;
          f4(0,n){
              if(!vis[j]){
                  if(j<=mid)sw[i]=bt;
                  else sw[i]=bt^1;
              }
          }
          int x=tryCombination(sw); 
          if(x==i)ans=mid,l=mid+1;
          else r=mid-1;
      }
      vis[ans]=1;
      sw[ans]=bt;
      dr[ans]=i;
   }
   answer(sw,dr);
}

Compilation message (stderr)

cave.cpp:6:24: warning: `\U0000037e' is not in NFC [-Wnormalized=]
    6 | void exploreCave(int N);
      |                        ^
cave.cpp:6:24: error: expected initializer before '\U0000037e'
    6 | void exploreCave(int N);
      |                        ^
cave.cpp:7:16: error: expected unqualified-id before ',' token
    7 |    int sw[N]={},dr[N]={};
      |                ^
cave.cpp:7:20: error: 'N' was not declared in this scope
    7 |    int sw[N]={},dr[N]={};
      |                    ^
cave.cpp:7:22: error: expected constructor, destructor, or type conversion before '=' token
    7 |    int sw[N]={},dr[N]={};
      |                      ^
cave.cpp:8:13: error: 'N' was not declared in this scope
    8 |    bool vis[N]={};
      |             ^
cave.cpp:4:17: error: expected unqualified-id before 'for'
    4 | #define f2(m,n) for(int i=m;i<n;i++)
      |                 ^~~
cave.cpp:9:4: note: in expansion of macro 'f2'
    9 |    f2(0,n){
      |    ^~
cave.cpp:9:9: error: 'n' was not declared in this scope; did you mean 'yn'?
    9 |    f2(0,n){
      |         ^
cave.cpp:4:31: note: in definition of macro 'f2'
    4 | #define f2(m,n) for(int i=m;i<n;i++)
      |                               ^
cave.cpp:9:9: error: 'n' was not declared in this scope; did you mean 'yn'?
    9 |    f2(0,n){
      |         ^
cave.cpp:4:31: note: in definition of macro 'f2'
    4 | #define f2(m,n) for(int i=m;i<n;i++)
      |                               ^
cave.cpp:9:9: error: 'n' was not declared in this scope; did you mean 'yn'?
    9 |    f2(0,n){
      |         ^
cave.cpp:4:31: note: in definition of macro 'f2'
    4 | #define f2(m,n) for(int i=m;i<n;i++)
      |                               ^
cave.cpp:9:9: error: 'n' was not declared in this scope; did you mean 'yn'?
    9 |    f2(0,n){
      |         ^
cave.cpp:4:31: note: in definition of macro 'f2'
    4 | #define f2(m,n) for(int i=m;i<n;i++)
      |                               ^
cave.cpp:9:9: error: 'n' was not declared in this scope; did you mean 'yn'?
    9 |    f2(0,n){
      |         ^
cave.cpp:4:31: note: in definition of macro 'f2'
    4 | #define f2(m,n) for(int i=m;i<n;i++)
      |                               ^
cave.cpp:9:9: error: 'n' was not declared in this scope; did you mean 'yn'?
    9 |    f2(0,n){
      |         ^
cave.cpp:4:31: note: in definition of macro 'f2'
    4 | #define f2(m,n) for(int i=m;i<n;i++)
      |                               ^
cave.cpp:9:9: error: 'n' was not declared in this scope; did you mean 'yn'?
    9 |    f2(0,n){
      |         ^
cave.cpp:4:31: note: in definition of macro 'f2'
    4 | #define f2(m,n) for(int i=m;i<n;i++)
      |                               ^
cave.cpp:9:9: error: 'n' was not declared in this scope; did you mean 'yn'?
    9 |    f2(0,n){
      |         ^
cave.cpp:4:31: note: in definition of macro 'f2'
    4 | #define f2(m,n) for(int i=m;i<n;i++)
      |                               ^
cave.cpp:9:9: error: 'n' was not declared in this scope; did you mean 'yn'?
    9 |    f2(0,n){
      |         ^
cave.cpp:4:31: note: in definition of macro 'f2'
    4 | #define f2(m,n) for(int i=m;i<n;i++)
      |                               ^
cave.cpp:4:29: error: 'i' does not name a type
    4 | #define f2(m,n) for(int i=m;i<n;i++)
      |                             ^
cave.cpp:9:4: note: in expansion of macro 'f2'
    9 |    f2(0,n){
      |    ^~
cave.cpp:4:33: error: 'i' does not name a type
    4 | #define f2(m,n) for(int i=m;i<n;i++)
      |                                 ^
cave.cpp:9:4: note: in expansion of macro 'f2'
    9 |    f2(0,n){
      |    ^~
cave.cpp:30:10: error: expected constructor, destructor, or type conversion before '(' token
   30 |    answer(sw,dr);
      |          ^
cave.cpp:31:1: error: expected declaration before '}' token
   31 | }
      | ^