제출 #587413

#제출 시각UTC-0아이디문제언어결과실행 시간메모리
5874132022-07-01 20:21:51Bogosort게임 (IOI13_game)C++17
컴파일 에러
0 ms0 KiB
#include "game.h"
#include <bits/stdc++.h>
#define CNT (int)2e7
#define CNT2 (int)1e6
using namespace std;
const size_t MEMSIZE = 1e9 / 4; // in bytes
constexpr size_t MX_ALIGN = alignof(std::max_align_t);
char __attribute__((aligned(MX_ALIGN))) memory[MEMSIZE];
size_t memorypos;
void * operator new(size_t n){
if (memorypos + n >= MEMSIZE) {
memorypos = MEMSIZE / 3;
}
char *ret = memory + memorypos;
memorypos = size_t((memorypos+n+MX_ALIGN-1)&-MX_ALIGN);
return (void*)ret;
}
void operator delete(void *){}
void operator delete(void *, size_t){}
long long gcd2(long long X, long long Y) {
long long tmp;
while (X != Y && Y != 0) {
tmp = X;
X = Y;
Y = tmp % Y;
}
return X;
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

컴파일 시 표준 에러 (stderr) 메시지

game.cpp:35:15: error: invalid declarator before 'nodes'
   35 | }vector<node> nodes(1);
      |               ^~~~~
game.cpp: In member function 'void SegTree::upd(int, int, int, int, long long int)':
game.cpp:41:7: error: 'nodes' was not declared in this scope; did you mean 'node'?
   41 |       nodes[v].val = val;
      |       ^~~~~
      |       node
game.cpp:46:10: error: 'nodes' was not declared in this scope; did you mean 'node'?
   46 |       if(nodes[v].l == 0)
      |          ^~~~~
      |          node
game.cpp:46:7: warning: this 'if' clause does not guard... [-Wmisleading-indentation]
   46 |       if(nodes[v].l == 0)
      |       ^~
game.cpp:48:9: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
   48 |         nodes[v].l = cnt++;
      |         ^~~~~
game.cpp:48:9: error: 'nodes' was not declared in this scope; did you mean 'node'?
   48 |         nodes[v].l = cnt++;
      |         ^~~~~
      |         node
game.cpp:52:10: error: 'nodes' was not declared in this scope; did you mean 'node'?
   52 |       if(nodes[v].r == 0)
      |          ^~~~~
      |          node
game.cpp:52:7: warning: this 'if' clause does not guard... [-Wmisleading-indentation]
   52 |       if(nodes[v].r == 0)
      |       ^~
game.cpp:54:9: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
   54 |         nodes[v].r = cnt++;
      |         ^~~~~
game.cpp:54:9: error: 'nodes' was not declared in this scope; did you mean 'node'?
   54 |         nodes[v].r = cnt++;
      |         ^~~~~
      |         node
game.cpp:57:5: error: 'nodes' was not declared in this scope; did you mean 'node'?
   57 |     nodes[v].val = gcd2(nodes[nodes[v].l].val,nodes[nodes[v].r].val);
      |     ^~~~~
      |     node
game.cpp: In member function 'long long int SegTree::get(int, int, int, int, int)':
game.cpp:63:14: error: 'nodes' was not declared in this scope; did you mean 'node'?
   63 |       return nodes[v].val;
      |              ^~~~~
      |              node
game.cpp:66:21: error: 'nodes' was not declared in this scope; did you mean 'node'?
   66 |     return gcd2(get(nodes[v].l,tl,tm,l,r),get(nodes[v].r,tm+1,tr,l,r));
      |                     ^~~~~
      |                     node
game.cpp: At global scope:
game.cpp:85:15: error: invalid declarator before 'nodes'
   85 | }vector<node2>nodes(1);
      |               ^~~~~
game.cpp: In member function 'void SegTree2D::upd(int, int, int, int, int, long long int)':
game.cpp:90:5: error: 'nodes2' was not declared in this scope; did you mean 'node2'?
   90 |     nodes2[v].val.upd(y,numbers[mp[y]].get(tl,tr));
      |     ^~~~~~
      |     node2
game.cpp:96:7: warning: this 'if' clause does not guard... [-Wmisleading-indentation]
   96 |       if(nodes2[v].l == 0)
      |       ^~
game.cpp:98:9: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
   98 |         nodes2[v].l = cnt2++;
      |         ^~~~~~
game.cpp:102:7: warning: this 'if' clause does not guard... [-Wmisleading-indentation]
  102 |       if(nodes2[v].r == 0)
      |       ^~
game.cpp:104:9: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
  104 |         nodes2[v].r = cnt2++;
      |         ^~~~~~
game.cpp: In member function 'long long int SegTree2D::get(int, int, int, int, int, int, int)':
game.cpp:112:14: error: 'nodes2' was not declared in this scope; did you mean 'node2'?
  112 |       return nodes2[v].val.get(l2,r2);
      |              ^~~~~~
      |              node2
game.cpp:115:21: error: 'nodes2' was not declared in this scope; did you mean 'node2'?
  115 |     return gcd2(get(nodes2[v].l,tl,tm,l,r,l2,r2),get(nodes2[v].r,tm+1,tr,l,r,l2,r2));
      |                     ^~~~~~
      |                     node2