/ Vijos /

记录详情

Compile Error

/in/foo.cc: In function 'void left_rotate(Node*)':
/in/foo.cc:44:62: error: expected primary-expression before ',' token
   44 |         Editor* editor = (Editor*)((char*)x - offsetof(Editor, root));
      |                                                              ^
/in/foo.cc:44:64: error: 'root' was not declared in this scope
   44 |         Editor* editor = (Editor*)((char*)x - offsetof(Editor, root));
      |                                                                ^~~~
/in/foo.cc:44:47: error: 'offsetof' was not declared in this scope
   44 |         Editor* editor = (Editor*)((char*)x - offsetof(Editor, root));
      |                                               ^~~~~~~~
/in/foo.cc:4:1: note: 'offsetof' is defined in header '<cstddef>'; did you forget to '#include <cstddef>'?
    3 | #include <string.h>
  +++ |+#include <cstddef>
    4 | 
/in/foo.cc: In function 'void right_rotate(Node*)':
/in/foo.cc:64:62: error: expected primary-expression before ',' token
   64 |         Editor* editor = (Editor*)((char*)x - offsetof(Editor, root));
      |                                                              ^
/in/foo.cc:64:64: error: 'root' was not declared in this scope
   64 |         Editor* editor = (Editor*)((char*)x - offsetof(Editor, root));
      |                                                                ^~~~
/in/foo.cc:64:47: error: 'offsetof' was not declared in this scope
   64 |         Editor* editor = (Editor*)((char*)x - offsetof(Editor, root));
      |                                               ^~~~~~~~
/in/foo.cc:64:47: note: 'offsetof' is defined in header '<cstddef>'; did you forget to '#include <cstddef>'?
/in/foo.cc: In function 'void splay(Node*)':
/in/foo.cc:79:58: error: expected primary-expression before ',' token
   79 |     Editor* editor = (Editor*)((char*)x - offsetof(Editor, root));
      |                                                          ^
/in/foo.cc:79:60: error: 'root' was not declared in this scope
   79 |     Editor* editor = (Editor*)((char*)x - offsetof(Editor, root));
      |                                                            ^~~~
/in/foo.cc:79:43: error: 'offsetof' was not declared in this scope
   79 |     Editor* editor = (Editor*)((char*)x - offsetof(Editor, root));
      |                                           ^~~~~~~~
/in/foo.cc:79:43: note: 'offsetof' is defined in header '<cstddef>'; did you forget to '#include <cstddef>'?

信息

递交者
类型
递交
题目
P1856 文本编辑器
语言
C++
递交时间
2025-05-12 10:30:55
评测时间
2025-05-12 10:30:55
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes