QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#142409#1139. StationsAbdelmagedNour#Compile Error//C++20835b2023-08-19 03:02:562024-07-04 02:39:57

Judging History

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

  • [2024-07-04 02:39:57]
  • 评测
  • [2023-08-19 03:02:56]
  • 提交

stations

#include <bits/stdc++.h>
#include "stub.cpp"
using namespace std;
#include "stations.h"
int id;
vector<vector<int>>adj;
vector<int>labels;
void dfs(int v, int p, int d) {
    if(!d)labels[v]=id++;
    for(auto u:adj[v]){
        if(u==p)continue;
        dfs(u,v,d^1);
    }
    if(d)labels[v]=id++;
}
vector<int>label(int n,int k,vector<int>u,vector<int>v){
    labels.assign(n,-1);
    adj.assign(n,{});
    id=0;
    for(int i=0;i<u.size();i++)adj[u[i]].push_back(v[i]),adj[v[i]].push_back(u[i]);
    dfs(0,0,0);
    return labels;
}
int find_next_station(int s,int t,vector<int>c){
    if(s<c[0]){
        if(t<s||t>=c.back())return c.back();
        return *lower_bound(c.begin(),c.end(),t);
    }
    if(t>s||t<=c[0])return c[0];
    return *--upper_bound(c.begin(),c.end(),t);
    return c[0];
}

详细

stations.code:2:10: fatal error: stub.cpp: No such file or directory
    2 | #include "stub.cpp"
      |          ^~~~~~~~~~
compilation terminated.
grader_stations.cpp: In function ‘int main(int, char**)’:
grader_stations.cpp:8:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    8 |         scanf("%d", &phaseid);
      |         ~~~~~^~~~~~~~~~~~~~~~