제출 #433649

#제출 시각아이디문제언어결과실행 시간메모리
433649oscar1f다리 (APIO19_bridges)C++17
13 / 100
3093 ms5828 KiB
#include<bits/stdc++.h> using namespace std; const int MAX_PONTS=100*1000+1,MAX_SOMMET=50*1000+1; int nbIles,nbPonts,date,rep,nbReq,typeReq,idPont,nouvPoids,posDep,poidsAuto; int ponts[MAX_PONTS][3]; vector<int> adja[MAX_SOMMET]; int dv[MAX_SOMMET]; void DFS(int pos) { if (dv[pos]!=date) { dv[pos]=date; rep++; for (int ivois=0;ivois<adja[pos].size();ivois++) { if (ponts[adja[pos][ivois]][2]>=poidsAuto) { DFS(ponts[adja[pos][ivois]][0]); DFS(ponts[adja[pos][ivois]][1]); } } } } int main() { ios_base::sync_with_stdio(false); cin>>nbIles>>nbPonts; for (int i=1;i<=nbPonts;i++) { cin>>ponts[i][0]>>ponts[i][1]>>ponts[i][2]; adja[ponts[i][0]].push_back(i); adja[ponts[i][1]].push_back(i); } cin>>nbReq; for (int ireq=1;ireq<=nbReq;ireq++) { cin>>typeReq; if (typeReq==1) { cin>>idPont>>nouvPoids; ponts[idPont][2]=nouvPoids; } else { cin>>posDep>>poidsAuto; rep=0; date=ireq; DFS(posDep); cout<<rep<<endl; } } }

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

bridges.cpp: In function 'void DFS(int)':
bridges.cpp:14:25: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   14 |   for (int ivois=0;ivois<adja[pos].size();ivois++) {
      |                    ~~~~~^~~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...