답안 #255229

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
255229 2020-07-31T15:27:50 Z khangal 통행료 (IOI18_highway) C++14
0 / 100
25 ms 1152 KB
#include "highway.h"
#include<bits/stdc++.h>
using namespace std;
typedef int  ll; 
typedef pair<ll,ll> pl;
typedef vector<ll> vl;
#define po pop_back
#define pb push_back
#define mk make_pair
#define lw lower_bound
#define up upper_bound
#define ff first
#define ss second
#define boost ios_base::sync_with_stdio(); cin.tie(0); cout.tie(0);
#define MOD 1000000007
#define MAX 1e18
#define MIN -1e18
#define rep(i,a,b) for(ll i=a;i<=b;i++)
#define per(i,a,b) for(ll i=b;i>=a;i--)
#define con continue
#define freopen freopen("input.txt", "r", stdin);freopen("output.txt", "w", stdout);
#define PI 3.14159265358979323846264338327950288419716939937510582097494459230781640628
// typedef tree<ll , null_type, less<ll>, rb_tree_tag, tree_order_statistics_node_update> indexed_set;
// template< typename T>
// using indexed_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
// ll n,m,ans,mid,mn,mx,T,sum,h1,h2,e[1234567],b[1234567],c[1234567],d[1<<20],k,i,j,l,r,h,a[1234567],w,x,y,z,res,par[1234567],cnt,sz[1234567];
bool used[12345];
vector<int> v[12345],vec,vec1;
string s1,s;
bool ok;
ll ans;
vector<int> V,U;
void dfs(int x){
    bool ok=0;
    for (int i=0;i<v[x].size();i++)
    if (!used[v[x][i]]){
        int res = v[x][i];
        ok=1;
        used[v[x][i]]=1;
        if(x == U[res])
            dfs(V[res]);
        else dfs(U[res]);
    }
    if (ok==0)ans=x;
}
void find_pair(int N,vector<int> U,vector<int> V,int A,int B) {
    int m = U.size();
    for(int i=0;i<m;i++){
        v[U[i]].pb(i);
        v[V[i]].pb(i);
    }
    vector<int> w(m);
    for(int i=0;i<m;i++)w[i]=0;
    ll dist = ask(w);
    for(int i=0;i<m;i++){
        w[i]=1;
        long long res = ask(w);
        if(dist == res)used[i]=1;
        w[i] = 0;
    }
    dfs(0);
    answer(0,ans);
}

Compilation message

highway.cpp: In function 'void dfs(int)':
highway.cpp:35:19: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     for (int i=0;i<v[x].size();i++)
                  ~^~~~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Runtime error 2 ms 1024 KB Execution killed with signal 11 (could be triggered by violating memory limits)
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 3 ms 640 KB Output is incorrect: more than 100 calls to ask.
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 15 ms 1152 KB Output is incorrect: more than 100 calls to ask.
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 3 ms 640 KB Output is incorrect: more than 100 calls to ask.
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 25 ms 1152 KB Output is incorrect: more than 100 calls to ask.
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 25 ms 1144 KB Output is incorrect: more than 100 calls to ask.
2 Halted 0 ms 0 KB -