제출 #224129

#제출 시각UTC-0아이디문제언어결과실행 시간메모리
2241292020-04-17 08:35:19dwscOlympic Bus (JOI20_ho_t4)C++14
16 / 100
136 ms4876 KiB
#include <bits/stdc++.h>
#define int long long
using namespace std;
typedef pair<int,int> ii;
typedef pair<ii,int> i3;
main(){
int n,m;
cin >> n >> m;
if (m <= 1000){
int ans = 1e18;
i3 edges[m];
int invert[m+1];
for (int i = 0; i < m; i++) {
cin >> edges[i].first.first >> edges[i].first.second >> edges[i].second;
cin >> invert[i];
}
invert[m] = 0;
for (int i = 0; i < m+1; i++){
int temp = invert[i];
vector<ii> tempadj[n+1];
for (int j = 0; j < m; j++){
if (j == i) tempadj[edges[j].first.second].push_back(ii(edges[j].first.first,edges[j].second));
else tempadj[edges[j].first.first].push_back(ii(edges[j].first.second,edges[j].second));
}
int dist1[n+1],dist2[n+1];
for (int j = 1; j <= n; j++) dist1[j] = dist2[j] = 1e18;
priority_queue<ii,vector<ii>,greater<ii> >pq;
pq.push(ii(0,1));
dist1[1] = 0;
while (!pq.empty()){
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

컴파일 시 표준 에러 (stderr) 메시지

ho_t4.cpp:6:6: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
 main(){
      ^
ho_t4.cpp: In function 'int main()':
ho_t4.cpp:35:35: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
                 for (int j = 0; j < tempadj[u].size(); j++){
                                 ~~^~~~~~~~~~~~~~~~~~~
ho_t4.cpp:50:35: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
                 for (int j = 0; j < tempadj[u].size(); j++){
                                 ~~^~~~~~~~~~~~~~~~~~~
ho_t4.cpp:84:31: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
             for (int j = 0; j < adj[u].size(); j++){
                             ~~^~~~~~~~~~~~~~~
ho_t4.cpp:99:31: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
             for (int j = 0; j < adj[u].size(); j++){
                             ~~^~~~~~~~~~~~~~~
ho_t4.cpp:116:31: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
             for (int j = 0; j < radj[u].size(); j++){
                             ~~^~~~~~~~~~~~~~~~
ho_t4.cpp:131:31: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
             for (int j = 0; j < radj[u].size(); j++){
                             ~~^~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...