답안 #957245

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
957245 2024-04-03T09:59:46 Z DeltaStruct Lost in the cycle (IOI19_cycle) C++17
컴파일 오류
0 ms 0 KB
#include "cycle.h"
#include <bits/stdc++.h>
using namespace std;

void escape(int+n){
  if (n==2){ jump(1); return; }
  int ret = jump(n/2); if (ret==false) jump(n/2);
  int l = 0,r = n,mid,now = 0,nxt;
  while(abs(l-r)>1){
    mid+=(l+r)/2,nxt=(now+n-1)/n*n+mid,nxt=jump((nxt-now)%n),now=nxt;
    if (nxt) l = mid;
    else r = mid;
    now = nxt;
  }
  nxt=(now+n-1)/n*n+l,nxt=jump((nxt-now)%n);
}

Compilation message

cycle.cpp:5:16: error: expected ',' or '...' before '+' token
    5 | void escape(int+n){
      |                ^
cycle.cpp: In function 'void escape(int)':
cycle.cpp:6:7: error: 'n' was not declared in this scope; did you mean 'yn'?
    6 |   if (n==2){ jump(1); return; }
      |       ^
      |       yn
cycle.cpp:7:18: error: 'n' was not declared in this scope; did you mean 'yn'?
    7 |   int ret = jump(n/2); if (ret==false) jump(n/2);
      |                  ^
      |                  yn