제출 #872674

#제출 시각UTC-0아이디문제언어결과실행 시간메모리
8726742023-11-13 14:13:46HossamHero7Autobus (COCI22_autobus)C++14
70 / 70
203 ms200316 KiB
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define endl '\n'
int edge[71][71];
vector<pair<int,int>> adj[71];
ll dp[71][71][70*70+1];
int K;
ll solve(int i,int j,int k){
if(i == j) return 0;
if(k == K) return 1e18;
ll &ret = dp[i][j][k];
if(~ret) return ret;
ret = 1e18;
for(auto [ch,c] : adj[i]) ret = min(ret,solve(ch,j,k+1)+c);
return ret;
}
void solve(){
int n,m;
cin>>n>>m;
for(int i=1;i<=n;i++) for(int j=1;j<=n;j++) edge[i][j] = 1e9;
for(int i=0;i<m;i++){
int a,b,c;
cin>>a>>b>>c;
edge[a][b] = min(edge[a][b] , c);
}
int cnt = 0;
for(int i=1;i<=n;i++){
for(int j=1;j<=n;j++) {
if(edge[i][j] != 1e9) adj[i].push_back({j,edge[i][j]}) , cnt++;
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

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

Main.cpp: In function 'll solve(int, int, int)':
Main.cpp:15:14: warning: structured bindings only available with '-std=c++17' or '-std=gnu++17'
   15 |     for(auto [ch,c] : adj[i]) ret = min(ret,solve(ch,j,k+1)+c);
      |              ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...