답안 #70250

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
70250 2018-08-22T14:12:28 Z MladenP 비밀 (JOI14_secret) C++17
컴파일 오류
0 ms 0 KB
#include "secret.h"
#define m (l+r)/2
#define R return
#define s 
int n,i,a[1010],d[1010][1010];void Z(int l,int r){if(l>=r)G;for(int i=m+1;i<=r;i++)d[m][i]=Secret(d[m][i-1],a[i]);for(int i=m-2;i>=l;i--)d[i][m-1]=Secret(a[i],d[i+1][m-1]);Z(l,m-1);Z(m+1, r);}void Init(int N,int A[]){for(i=1,n=N;i<=n;i++)a[i]=A[i-1],d[i][i]=a[i];Z(1,N);}int Q(int l,int r,int L,int R){if(L<m&&m<=R)G Secret(d[L][m-1],d[m][R]);if(L==m)G d[m][R];if(m<L)G Q(m+1,r,L,R);G Q(l,m-1,L,R);}int Query(int L,int R){L++;R++;if(L==R)G a[L];G Q(1,n,L,R);}

Compilation message

secret.cpp: In function 'void Z(int, int)':
secret.cpp:5:59: error: 'G' was not declared in this scope
 int n,i,a[1010],d[1010][1010];void Z(int l,int r){if(l>=r)G;for(int i=m+1;i<=r;i++)d[m][i]=Secret(d[m][i-1],a[i]);for(int i=m-2;i>=l;i--)d[i][m-1]=Secret(a[i],d[i+1][m-1]);Z(l,m-1);Z(m+1, r);}void Init(int N,int A[]){for(i=1,n=N;i<=n;i++)a[i]=A[i-1],d[i][i]=a[i];Z(1,N);}int Q(int l,int r,int L,int R){if(L<m&&m<=R)G Secret(d[L][m-1],d[m][R]);if(L==m)G d[m][R];if(m<L)G Q(m+1,r,L,R);G Q(l,m-1,L,R);}int Query(int L,int R){L++;R++;if(L==R)G a[L];G Q(1,n,L,R);}
                                                           ^
secret.cpp: At global scope:
secret.cpp:3:11: error: expected ',' or '...' before 'return'
 #define R return
           ^
secret.cpp:5:300: note: in expansion of macro 'R'
 int n,i,a[1010],d[1010][1010];void Z(int l,int r){if(l>=r)G;for(int i=m+1;i<=r;i++)d[m][i]=Secret(d[m][i-1],a[i]);for(int i=m-2;i>=l;i--)d[i][m-1]=Secret(a[i],d[i+1][m-1]);Z(l,m-1);Z(m+1, r);}void Init(int N,int A[]){for(i=1,n=N;i<=n;i++)a[i]=A[i-1],d[i][i]=a[i];Z(1,N);}int Q(int l,int r,int L,int R){if(L<m&&m<=R)G Secret(d[L][m-1],d[m][R]);if(L==m)G d[m][R];if(m<L)G Q(m+1,r,L,R);G Q(l,m-1,L,R);}int Query(int L,int R){L++;R++;if(L==R)G a[L];G Q(1,n,L,R);}
                                                                                                                                                                                                                                                                                                            ^
secret.cpp: In function 'int Q(int, int, int, int)':
secret.cpp:3:11: error: expected primary-expression before 'return'
 #define R return
           ^
secret.cpp:5:314: note: in expansion of macro 'R'
 int n,i,a[1010],d[1010][1010];void Z(int l,int r){if(l>=r)G;for(int i=m+1;i<=r;i++)d[m][i]=Secret(d[m][i-1],a[i]);for(int i=m-2;i>=l;i--)d[i][m-1]=Secret(a[i],d[i+1][m-1]);Z(l,m-1);Z(m+1, r);}void Init(int N,int A[]){for(i=1,n=N;i<=n;i++)a[i]=A[i-1],d[i][i]=a[i];Z(1,N);}int Q(int l,int r,int L,int R){if(L<m&&m<=R)G Secret(d[L][m-1],d[m][R]);if(L==m)G d[m][R];if(m<L)G Q(m+1,r,L,R);G Q(l,m-1,L,R);}int Query(int L,int R){L++;R++;if(L==R)G a[L];G Q(1,n,L,R);}
                                                                                                                                                                                                                                                                                                                          ^
secret.cpp:3:11: error: expected ')' before 'return'
 #define R return
           ^
secret.cpp:5:314: note: in expansion of macro 'R'
 int n,i,a[1010],d[1010][1010];void Z(int l,int r){if(l>=r)G;for(int i=m+1;i<=r;i++)d[m][i]=Secret(d[m][i-1],a[i]);for(int i=m-2;i>=l;i--)d[i][m-1]=Secret(a[i],d[i+1][m-1]);Z(l,m-1);Z(m+1, r);}void Init(int N,int A[]){for(i=1,n=N;i<=n;i++)a[i]=A[i-1],d[i][i]=a[i];Z(1,N);}int Q(int l,int r,int L,int R){if(L<m&&m<=R)G Secret(d[L][m-1],d[m][R]);if(L==m)G d[m][R];if(m<L)G Q(m+1,r,L,R);G Q(l,m-1,L,R);}int Query(int L,int R){L++;R++;if(L==R)G a[L];G Q(1,n,L,R);}
                                                                                                                                                                                                                                                                                                                          ^
secret.cpp:5:316: error: 'G' was not declared in this scope
 int n,i,a[1010],d[1010][1010];void Z(int l,int r){if(l>=r)G;for(int i=m+1;i<=r;i++)d[m][i]=Secret(d[m][i-1],a[i]);for(int i=m-2;i>=l;i--)d[i][m-1]=Secret(a[i],d[i+1][m-1]);Z(l,m-1);Z(m+1, r);}void Init(int N,int A[]){for(i=1,n=N;i<=n;i++)a[i]=A[i-1],d[i][i]=a[i];Z(1,N);}int Q(int l,int r,int L,int R){if(L<m&&m<=R)G Secret(d[L][m-1],d[m][R]);if(L==m)G d[m][R];if(m<L)G Q(m+1,r,L,R);G Q(l,m-1,L,R);}int Query(int L,int R){L++;R++;if(L==R)G a[L];G Q(1,n,L,R);}
                                                                                                                                                                                                                                                                                                                            ^
secret.cpp:5:352: error: 'G' was not declared in this scope
 int n,i,a[1010],d[1010][1010];void Z(int l,int r){if(l>=r)G;for(int i=m+1;i<=r;i++)d[m][i]=Secret(d[m][i-1],a[i]);for(int i=m-2;i>=l;i--)d[i][m-1]=Secret(a[i],d[i+1][m-1]);Z(l,m-1);Z(m+1, r);}void Init(int N,int A[]){for(i=1,n=N;i<=n;i++)a[i]=A[i-1],d[i][i]=a[i];Z(1,N);}int Q(int l,int r,int L,int R){if(L<m&&m<=R)G Secret(d[L][m-1],d[m][R]);if(L==m)G d[m][R];if(m<L)G Q(m+1,r,L,R);G Q(l,m-1,L,R);}int Query(int L,int R){L++;R++;if(L==R)G a[L];G Q(1,n,L,R);}
                                                                                                                                                                                                                                                                                                                                                                ^
secret.cpp:5:369: error: 'G' was not declared in this scope
 int n,i,a[1010],d[1010][1010];void Z(int l,int r){if(l>=r)G;for(int i=m+1;i<=r;i++)d[m][i]=Secret(d[m][i-1],a[i]);for(int i=m-2;i>=l;i--)d[i][m-1]=Secret(a[i],d[i+1][m-1]);Z(l,m-1);Z(m+1, r);}void Init(int N,int A[]){for(i=1,n=N;i<=n;i++)a[i]=A[i-1],d[i][i]=a[i];Z(1,N);}int Q(int l,int r,int L,int R){if(L<m&&m<=R)G Secret(d[L][m-1],d[m][R]);if(L==m)G d[m][R];if(m<L)G Q(m+1,r,L,R);G Q(l,m-1,L,R);}int Query(int L,int R){L++;R++;if(L==R)G a[L];G Q(1,n,L,R);}
                                                                                                                                                                                                                                                                                                                                                                                 ^
secret.cpp:5:384: error: 'G' was not declared in this scope
 int n,i,a[1010],d[1010][1010];void Z(int l,int r){if(l>=r)G;for(int i=m+1;i<=r;i++)d[m][i]=Secret(d[m][i-1],a[i]);for(int i=m-2;i>=l;i--)d[i][m-1]=Secret(a[i],d[i+1][m-1]);Z(l,m-1);Z(m+1, r);}void Init(int N,int A[]){for(i=1,n=N;i<=n;i++)a[i]=A[i-1],d[i][i]=a[i];Z(1,N);}int Q(int l,int r,int L,int R){if(L<m&&m<=R)G Secret(d[L][m-1],d[m][R]);if(L==m)G d[m][R];if(m<L)G Q(m+1,r,L,R);G Q(l,m-1,L,R);}int Query(int L,int R){L++;R++;if(L==R)G a[L];G Q(1,n,L,R);}
                                                                                                                                                                                                                                                                                                                                                                                                ^
secret.cpp:5:399: warning: no return statement in function returning non-void [-Wreturn-type]
 int n,i,a[1010],d[1010][1010];void Z(int l,int r){if(l>=r)G;for(int i=m+1;i<=r;i++)d[m][i]=Secret(d[m][i-1],a[i]);for(int i=m-2;i>=l;i--)d[i][m-1]=Secret(a[i],d[i+1][m-1]);Z(l,m-1);Z(m+1, r);}void Init(int N,int A[]){for(i=1,n=N;i<=n;i++)a[i]=A[i-1],d[i][i]=a[i];Z(1,N);}int Q(int l,int r,int L,int R){if(L<m&&m<=R)G Secret(d[L][m-1],d[m][R]);if(L==m)G d[m][R];if(m<L)G Q(m+1,r,L,R);G Q(l,m-1,L,R);}int Query(int L,int R){L++;R++;if(L==R)G a[L];G Q(1,n,L,R);}
                                                                                                                                                                                                                                                                                                                                                                                                               ^
secret.cpp: At global scope:
secret.cpp:3:11: error: expected ',' or '...' before 'return'
 #define R return
           ^
secret.cpp:5:420: note: in expansion of macro 'R'
 int n,i,a[1010],d[1010][1010];void Z(int l,int r){if(l>=r)G;for(int i=m+1;i<=r;i++)d[m][i]=Secret(d[m][i-1],a[i]);for(int i=m-2;i>=l;i--)d[i][m-1]=Secret(a[i],d[i+1][m-1]);Z(l,m-1);Z(m+1, r);}void Init(int N,int A[]){for(i=1,n=N;i<=n;i++)a[i]=A[i-1],d[i][i]=a[i];Z(1,N);}int Q(int l,int r,int L,int R){if(L<m&&m<=R)G Secret(d[L][m-1],d[m][R]);if(L==m)G d[m][R];if(m<L)G Q(m+1,r,L,R);G Q(l,m-1,L,R);}int Query(int L,int R){L++;R++;if(L==R)G a[L];G Q(1,n,L,R);}
                                                                                                                                                                                                                                                                                                                                                                                                                                    ^
secret.cpp: In function 'int Query(int, int)':
secret.cpp:5:430: error: expected primary-expression before ';' token
 int n,i,a[1010],d[1010][1010];void Z(int l,int r){if(l>=r)G;for(int i=m+1;i<=r;i++)d[m][i]=Secret(d[m][i-1],a[i]);for(int i=m-2;i>=l;i--)d[i][m-1]=Secret(a[i],d[i+1][m-1]);Z(l,m-1);Z(m+1, r);}void Init(int N,int A[]){for(i=1,n=N;i<=n;i++)a[i]=A[i-1],d[i][i]=a[i];Z(1,N);}int Q(int l,int r,int L,int R){if(L<m&&m<=R)G Secret(d[L][m-1],d[m][R]);if(L==m)G d[m][R];if(m<L)G Q(m+1,r,L,R);G Q(l,m-1,L,R);}int Query(int L,int R){L++;R++;if(L==R)G a[L];G Q(1,n,L,R);}
                                                                                                                                                                                                                                                                                                                                                                                                                                              ^
secret.cpp:3:11: error: expected primary-expression before 'return'
 #define R return
           ^
secret.cpp:5:437: note: in expansion of macro 'R'
 int n,i,a[1010],d[1010][1010];void Z(int l,int r){if(l>=r)G;for(int i=m+1;i<=r;i++)d[m][i]=Secret(d[m][i-1],a[i]);for(int i=m-2;i>=l;i--)d[i][m-1]=Secret(a[i],d[i+1][m-1]);Z(l,m-1);Z(m+1, r);}void Init(int N,int A[]){for(i=1,n=N;i<=n;i++)a[i]=A[i-1],d[i][i]=a[i];Z(1,N);}int Q(int l,int r,int L,int R){if(L<m&&m<=R)G Secret(d[L][m-1],d[m][R]);if(L==m)G d[m][R];if(m<L)G Q(m+1,r,L,R);G Q(l,m-1,L,R);}int Query(int L,int R){L++;R++;if(L==R)G a[L];G Q(1,n,L,R);}
                                                                                                                                                                                                                                                                                                                                                                                                                                                     ^
secret.cpp:3:11: error: expected ')' before 'return'
 #define R return
           ^
secret.cpp:5:437: note: in expansion of macro 'R'
 int n,i,a[1010],d[1010][1010];void Z(int l,int r){if(l>=r)G;for(int i=m+1;i<=r;i++)d[m][i]=Secret(d[m][i-1],a[i]);for(int i=m-2;i>=l;i--)d[i][m-1]=Secret(a[i],d[i+1][m-1]);Z(l,m-1);Z(m+1, r);}void Init(int N,int A[]){for(i=1,n=N;i<=n;i++)a[i]=A[i-1],d[i][i]=a[i];Z(1,N);}int Q(int l,int r,int L,int R){if(L<m&&m<=R)G Secret(d[L][m-1],d[m][R]);if(L==m)G d[m][R];if(m<L)G Q(m+1,r,L,R);G Q(l,m-1,L,R);}int Query(int L,int R){L++;R++;if(L==R)G a[L];G Q(1,n,L,R);}
                                                                                                                                                                                                                                                                                                                                                                                                                                                     ^
secret.cpp:5:439: error: 'G' was not declared in this scope
 int n,i,a[1010],d[1010][1010];void Z(int l,int r){if(l>=r)G;for(int i=m+1;i<=r;i++)d[m][i]=Secret(d[m][i-1],a[i]);for(int i=m-2;i>=l;i--)d[i][m-1]=Secret(a[i],d[i+1][m-1]);Z(l,m-1);Z(m+1, r);}void Init(int N,int A[]){for(i=1,n=N;i<=n;i++)a[i]=A[i-1],d[i][i]=a[i];Z(1,N);}int Q(int l,int r,int L,int R){if(L<m&&m<=R)G Secret(d[L][m-1],d[m][R]);if(L==m)G d[m][R];if(m<L)G Q(m+1,r,L,R);G Q(l,m-1,L,R);}int Query(int L,int R){L++;R++;if(L==R)G a[L];G Q(1,n,L,R);}
                                                                                                                                                                                                                                                                                                                                                                                                                                                       ^
secret.cpp:5:446: error: 'G' was not declared in this scope
 int n,i,a[1010],d[1010][1010];void Z(int l,int r){if(l>=r)G;for(int i=m+1;i<=r;i++)d[m][i]=Secret(d[m][i-1],a[i]);for(int i=m-2;i>=l;i--)d[i][m-1]=Secret(a[i],d[i+1][m-1]);Z(l,m-1);Z(m+1, r);}void Init(int N,int A[]){for(i=1,n=N;i<=n;i++)a[i]=A[i-1],d[i][i]=a[i];Z(1,N);}int Q(int l,int r,int L,int R){if(L<m&&m<=R)G Secret(d[L][m-1],d[m][R]);if(L==m)G d[m][R];if(m<L)G Q(m+1,r,L,R);G Q(l,m-1,L,R);}int Query(int L,int R){L++;R++;if(L==R)G a[L];G Q(1,n,L,R);}
                                                                                                                                                                                                                                                                                                                                                                                                                                                              ^