이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "Azer.h"
#include <vector>
#include<bits/stdc++.h>
// namespace {
//
// int N;
// int variable_example[500000];
// int count;
//
// } // namespace
using namespace std;
const int lim = 2005;
const int inf = 1e9;
int n;
int curCity, curbit;
int myGuess[lim];
void InitA(int N, int A, vector<int> U, vector<int> V, vector<int> C) {
n = N;
curCity = 1;
curbit = 19;
}
void ReceiveA(bool x) {
if(x) myGuess[curCity] += (1<<curbit);
curbit--;
if(curbit < 0){
curCity++;
curbit = 19;
}
}
vector<int> Answer() {
vector<int> ans(n);
cout << endl;
for (int k = 0; k < n; ++k) {
// cout << "gussed dist." << k << " = " << myGuess[k] << endl;
ans[k] = myGuess[k];
}
return ans;
}
#include "Baijan.h"
#include <vector>
#include<bits/stdc++.h>
// namespace {
// int N;
// int count;
//
// bool FunctionExample(bool P) {
// return !P;
// }
// } // namespace
using namespace std;
const int lim = 2005;
const int inf = 1e9;
vector<int> adj[lim], weight[lim];
int dist[lim];
void dijk(int n){
set<pair<int, int>> can;
for(int i = 1; i < n; i++) dist[i] = inf;
for(int i = 0; i < n; i++) can.emplace(dist[i], i);
while(!can.empty()){
int no = can.begin()->second;
can.erase(can.begin());
for(int i = 0; i < adj[no].size(); i++){
int v = adj[no][i], p = weight[no][i];
if(p+dist[no] < dist[v]){
can.erase({dist[v], v});
dist[v] = p+dist[no];
can.emplace(dist[v], v);
}
}
}
}
void addEdge(int a, int b, int w){
adj[a].push_back(b);
adj[b].push_back(a);
weight[a].push_back(w);
weight[b].push_back(w);
}
void InitB(int N, int B, vector<int> S, vector<int> T, vector<int> D) {
for(int i = 0; i < B; i++){
addEdge(S[i], T[i], D[i]);
}
dijk(N);
for(int i = 1; i < N; i++){
for(int k = 19; k >= 0; k--){
SendB((1<<k)&dist[i]);
}
}
}
void ReceiveB(bool y) {
}
컴파일 시 표준 에러 (stderr) 메시지
Baijan.cpp: In function 'void dijk(int)':
Baijan.cpp:29:26: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
29 | for(int i = 0; i < adj[no].size(); i++){
| ~~^~~~~~~~~~~~~~~~
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |