답안 #1086667

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1086667 2024-09-11T08:51:37 Z LeonidCuk 비밀 (JOI14_secret) C++17
컴파일 오류
0 ms 0 KB
#include <bits/stdc++.h>
#include "secret.h"
using namespace std;
vector<int>v,dp[11];
void daq(int i,int l,int r)
{
    if(l==r)
    {
        dp[i][l]=v[l];
        return;
    }
    int m=(l+r)/2;
    dp[i][m]=v[m];
    for(int j=m-1;j>=l;j++)
    {
        dp[i][j]=Secret(dp[i][j+1],v[j]);
    }
    dp[i][m+1]=v[m+1];
    for(int j=m+2;j<=r;j++)
    {
        dp[i][j]=Secret(dp[i][j-1],v[j]);
    }
    daq(i+1,l,m);
    da1(i+1,m+1,r);
}
int najdi(int i,int l,int r)
{
    if(l==r)
    {
        return v[l];
    }
    int m=(l+r)/2;
    if(l<=m&&m<r)
    {
        return Secret(dp[i][l],dp[i][r]);
    }
    else if(r<=m)
    {
        return najdi(i+1,l,m);
    }
    else
    {
        return najdi(i+1,m+1,r);
    }
}
void Innit(int N,int A[])
{
    for(int i=0;i<N;;i++)
    {
        v.push_back(A[i]);
    }
    for(int i=0;i<12)
    {
        dp[i].resize(N);
    }
    daq(0,0,N-1);
}
int Query(int l,int r)
{
      return(0,l,r);
}

Compilation message

secret.cpp: In function 'void daq(int, int, int)':
secret.cpp:24:5: error: 'da1' was not declared in this scope; did you mean 'daq'?
   24 |     da1(i+1,m+1,r);
      |     ^~~
      |     daq
secret.cpp: In function 'void Innit(int, int*)':
secret.cpp:48:21: error: expected primary-expression before ';' token
   48 |     for(int i=0;i<N;;i++)
      |                     ^
secret.cpp:48:21: error: expected ')' before ';' token
   48 |     for(int i=0;i<N;;i++)
      |        ~            ^
      |                     )
secret.cpp:48:5: warning: this 'for' clause does not guard... [-Wmisleading-indentation]
   48 |     for(int i=0;i<N;;i++)
      |     ^~~
secret.cpp:48:22: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'for'
   48 |     for(int i=0;i<N;;i++)
      |                      ^
secret.cpp:48:22: error: 'i' was not declared in this scope
secret.cpp:52:21: error: expected ';' before ')' token
   52 |     for(int i=0;i<12)
      |                     ^
      |                     ;
secret.cpp: In function 'int Query(int, int)':
secret.cpp:60:14: warning: left operand of comma operator has no effect [-Wunused-value]
   60 |       return(0,l,r);
      |              ^
secret.cpp:60:18: warning: right operand of comma operator has no effect [-Wunused-value]
   60 |       return(0,l,r);
      |                  ^