답안 #1005840

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1005840 2024-06-23T06:53:17 Z irmuun 통행료 (IOI18_highway) C++17
5 / 100
9 ms 1248 KB
#include<bits/stdc++.h>
#include "highway.h"
 
using namespace std;
 
#define ll long long
#define pb push_back
#define ff first
#define ss second
#define all(s) s.begin(),s.end()
#define rall(s) s.rbegin(),s.rend()

void find_pair(int n,vector<int>u,vector<int>v,int A, int B){
    int m=u.size();
    vector<int>w(m,0);
    vector<pair<int,int>>adj[n];
    for(int i=0;i<m;i++){
        adj[u[i]].pb({v[i],i});
        adj[v[i]].pb({u[i],i});
    }
    ll C=ask(w);
    for(int t=1;t<n;t++){
        for(auto [_,i]:adj[t]){
            w[i]=1;
        }
        ll cost=ask(w);
        if(cost==C-A+B){
            answer(0,t);
            break;
        }
        for(auto [_,i]:adj[t]){
            w[i]=0;
        }
    }
    return;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 344 KB Output is correct
2 Correct 0 ms 344 KB Output is correct
3 Correct 1 ms 596 KB Output is correct
4 Correct 1 ms 344 KB Output is correct
5 Correct 1 ms 344 KB Output is correct
6 Correct 0 ms 344 KB Output is correct
7 Correct 0 ms 344 KB Output is correct
8 Correct 0 ms 344 KB Output is correct
9 Correct 1 ms 344 KB Output is correct
10 Correct 0 ms 344 KB Output is correct
11 Correct 0 ms 344 KB Output is correct
12 Correct 1 ms 344 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Runtime error 1 ms 512 KB Execution killed with signal 13
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 8 ms 1112 KB Execution killed with signal 13
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 1 ms 600 KB Execution killed with signal 13
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 9 ms 1244 KB Execution killed with signal 13
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 8 ms 1248 KB Execution killed with signal 13
2 Halted 0 ms 0 KB -