답안 #533330

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
533330 2022-03-05T13:23:26 Z ddy888 Autobus (COCI22_autobus) C++17
컴파일 오류
0 ms 0 KB
#undef _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
#define fast ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define int long long 
#define pb push_back
#define fi first
#define si second
#define ar array
typedef pair<int,int> pi;
typedef tuple<int,int,int> ti;  
void debug_out() {cerr<<endl;}
template <typename Head, typename... Tail>
void debug_out(Head H, Tail... T) {cerr<<" "<<to_string(H);debug_out(T...);}
#define debug(...) cerr<<"["<<#__VA_ARGS__<<"]:",debug_out(__VA_ARGS__)

const int INF = 1e14 + 7;
int N, M, K, Q, dist[80][80], path[80][80];
vector<pi> adj[80];

signed main() {s
    fast;
    cin >> N >> M;
    for (int i = 1; i <= N; ++i) for (int j = 1; j <= N; ++j) dist[i][j] = INF;
    for (int i = 1; i <= M; ++i) {
        int u, v, c; cin >> u >> v >> c;
        dist[u][v] = c;
        path[u][v] = 1;
    }
    cin >> K >> Q;
    for (int k = 1; k <= N; ++k) {
        for (int i = 1; i <= N; ++i) {
            for (int j = 1; j <= N; ++j) {
                if (i == j) dist[i][j] = 0, path[i][j] = 0;
                int new_dist = dist[i][k] + dist[k][j];
                int new_path = path[i][k] + path[k][j];
                if (new_dist < dist[i][j] && new_path <= K) {
                    dist[i][j] = new_dist;
                    path[i][j] = new_path;
                } else if (new_dist == dist[i][j] && new_path < path[i][j]) {
                    path[i][j] = new_path;
                }
            }
        }
    }
    while (Q--) {
        int u, v; cin >> u >> v;
        if (dist[u][v] == INF) cout << -1 << '\n';
        else cout << dist[u][v] << '\n';
    }
    return 0;
}

Compilation message

Main.cpp: In function 'int main()':
Main.cpp:21:16: error: 's' was not declared in this scope
   21 | signed main() {s
      |                ^