QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#466197#5029. 在路上james1BadCreeperCompile Error//C++17835b2024-07-07 16:53:232024-07-07 16:53:24

Judging History

你现在查看的是最新测评结果

  • [2024-07-07 16:53:24]
  • 评测
  • [2024-07-07 16:53:23]
  • 提交

answer

#include "soul.h"
#include <bits/stdc++.h>
using namespace std; 
const int N = 1e5 + 5; 

mt19937 rng(time(0));
int n;  

int tot; 
struct Node {
    int x; 
    bool operator< (const Node a) const {
        if (x == tot) return 1; 
        if (a.x == tot) return 0; 
        return ask(tot, x, a.x) == x; 
    }
} a[N]; 

int centroid(int id, int N, int m) {
    n = N; 
    if (id == 1) return ask(1, 2, 3); 
    if (id == 3 || id == 5) {
        int u = 1, v = 2; 
        for (int i = 3; i <= n; ++i) {
            int w = ask(u, v, i); 
            if (v == w) v = i; 
            else if (u == w) u = i; 
        }
        for (int i = 1; i <= n; ++i) a[i].x = i; 
        nth_element(a + 1, a + (n + 1) / 2, a + n + 1); 
        return a[(n + 1) / 2].x; 
    }
    assert(0); 
    return -1; 
}

详细

implementer.cpp: In function ‘int main()’:
implementer.cpp:60:14: warning: ignoring return value of ‘size_t fread(void*, size_t, size_t, FILE*)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   60 |         fread(Interactor::rbuf,1,50000000,stdin);
      |         ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
answer.code:1:10: fatal error: soul.h: No such file or directory
    1 | #include "soul.h"
      |          ^~~~~~~~
compilation terminated.