제출 #857930

#제출 시각UTC-0아이디문제언어결과실행 시간메모리
8579302023-10-07 07:28:25Trisanu_DasVillage (BOI20_village)C++17
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h>
using namespace std;
#define int long long
int adj[11][11];
signed main(){
int n,; cin >> n;
memset(adj, INT_MAX, sizeof(adj));
for(int i = 0; i < n ; i++) adj[i][i] = 0;
for(int x = 0; x < n - 1; x++){
int u, v; cin >> u >> v;
adj[u][v] = adj[v][u] = 1;
}
//Floyd Warshall
for(int k = 0; k < n; k++) for(int i = 0; i < n; i++) for(int j = 0; j < n; j++) adj[i][j] = min(adj[i][j], adj[i][k] + adj[k][j]);
vector<int> perm, mn, mx;
int mx_val = INT_MIN, mn_val = INT_MAX;
for(int i = 0; i < n; i++) perm.push_back(i);
do{
int sum = 0; bool flag = true;
for(int i = 0; i < n; i++){
if(perm[i] == i){
flag = false; break;
}
sum += adj[i][perm[i]];
if(!flag) continue;
if(sum < mn_val){
mn_val = sum; mn = perm;
}
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

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

Village.cpp: In function 'int main()':
Village.cpp:8:9: error: expected unqualified-id before ';' token
    8 |   int n,; cin >> n;
      |         ^