답안 #713825

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
713825 2023-03-23T05:51:17 Z LittleOrange 통행료 (IOI18_highway) C++17
0 / 100
13 ms 1232 KB
#include "highway.h"
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
struct line{
    ll to,i;
};

void find_pair(int N, std::vector<int> U, std::vector<int> V, int A, int B) {
  int M = U.size();
  vector<vector<line>> con(N);
  for(ll i = 0;i<M;i++){
    con[U[i]].push_back({V[i],i});
    con[V[i]].push_back({U[i],i});
  }
  if (M == N-1){
    vector<int> w(M,0);
    ll total_dis = ask(w)/A;
    auto doask = [&](){
        return (ask(w)-total_dis*A)/(B-A);
    };
    if (N<=100){
        vector<int> ans;
        for(int i = 0;i<N;i++){
            for(line l : con[i]){
                w[l.i] = 1;
            }
            if (doask()==1) ans.push_back(i+1);
            for(line l : con[i]){
                w[l.i] = 0;
            }
        }
        answer(ans[0],ans[1]);
    }
  }
}
# 결과 실행 시간 메모리 Grader output
1 Runtime error 1 ms 208 KB Execution killed with signal 13
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 336 KB Output is incorrect: answered not exactly once.
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 8 ms 1136 KB Output is incorrect: answered not exactly once.
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 336 KB Output is incorrect: answered not exactly once.
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 13 ms 1184 KB Output is incorrect: answered not exactly once.
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 12 ms 1232 KB Output is incorrect: answered not exactly once.
2 Halted 0 ms 0 KB -