Submission #1075075

# Submission time Handle Problem Language Result Execution time Memory
1075075 2024-08-25T18:05:46 Z Maite_Morale Closing Time (IOI23_closing) C++17
0 / 100
72 ms 33856 KB
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define vi vector<int>
#define vll vector<ll>
#define pll pair<ll,ll>
#define vpll vector<pll>
#define MAX 500005
#define F first
#define S second 
vpll v[MAX];
ll pass[MAX];
int max_score(int N, int X, int Y, long long K,vi U, vi V, vi W){
    for(int i=0;i<=N;i++){v[i]={};pass[i]=0;}
    for(int i=0;i<V.size();i++){
        v[V[i]].push_back({U[i],W[i]});
        v[U[i]].push_back({V[i],W[i]});
    }
    priority_queue<pll> q;ll r=0;
    q.push({0,X});q.push({0,Y});
    while(!q.empty()){
        pll u=q.top();q.pop();
        if(pass[u.S]==1)continue;
        if(K<-u.F)continue;
        pass[u.S]=1;r++;
        K+=u.F;
        for(auto w : v[u.S]){
            if(pass[w.S]==0)q.push({u.F-w.S,w.F});
        }
    }
return r;
}

Compilation message

closing.cpp: In function 'int max_score(int, int, int, long long int, std::vector<int>, std::vector<int>, std::vector<int>)':
closing.cpp:15:18: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   15 |     for(int i=0;i<V.size();i++){
      |                 ~^~~~~~~~~
# Verdict Execution time Memory Grader output
1 Incorrect 5 ms 13660 KB 1st lines differ - on the 1st token, expected: '6', found: '4'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 72 ms 33856 KB 1st lines differ - on the 1st token, expected: '451', found: '10'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 5 ms 13660 KB 1st lines differ - on the 1st token, expected: '3', found: '2'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 5 ms 13660 KB 1st lines differ - on the 1st token, expected: '3', found: '2'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 5 ms 13660 KB 1st lines differ - on the 1st token, expected: '3', found: '2'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 5 ms 13660 KB 1st lines differ - on the 1st token, expected: '6', found: '4'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 5 ms 13660 KB 1st lines differ - on the 1st token, expected: '6', found: '4'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 5 ms 13660 KB 1st lines differ - on the 1st token, expected: '6', found: '4'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 5 ms 13660 KB 1st lines differ - on the 1st token, expected: '6', found: '4'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 5 ms 13660 KB 1st lines differ - on the 1st token, expected: '6', found: '4'
2 Halted 0 ms 0 KB -