Submission #114969

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
1149692019-06-04 08:21:27IVIosabXylophone (JOI18_xylophone)C++17
Compilation error
0 ms0 KiB
#include <bits/stdc++.h>
#include "xylophone.h"
using namespace std;
static int A[5000];
int a[5005];
void solve(int N) {
int value = query(1, N);
map<pair<int,int>,int> mp;
for(int i=1;i<n-1;i++){
int t=query(i,i+1);
mp[{i,i+1}]=t;
}
for(int i=1;i<n-2;i++){
int t=query(i,i+2);
if(mp[{i,i+1}]+mp[{i+1,i+2}]==t){
mp[{i,i+2]=1;
}
}
int p1=1,p2=N;
while(p2>p1){
int v=query(p1,p2);
if(v!=value){
p2++;
break;
}
p2--;
}
while(p1<p2){
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

xylophone.cpp: In function 'void solve(int)':
xylophone.cpp:11:16: error: 'n' was not declared in this scope
  for(int i=1;i<n-1;i++){
                ^
xylophone.cpp:15:16: error: 'n' was not declared in this scope
  for(int i=1;i<n-2;i++){
                ^
xylophone.cpp:18:22: error: expected '}' before ']' token
             mp[{i,i+2]=1;
                      ^
xylophone.cpp:39:8: error: 'n' was not declared in this scope
  a[p2]=n;
        ^
xylophone.cpp: At global scope:
xylophone.cpp:5:12: warning: 'A' defined but not used [-Wunused-variable]
 static int A[5000];
            ^