답안 #764802

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
764802 2023-06-24T04:54:17 Z vjudge1 Roadside Advertisements (NOI17_roadsideadverts) C++17
컴파일 오류
0 ms 0 KB
//Bismillahir-Rahmanir-Rahim

# include <bits/stdc++.h>
 
# define pb push_back
# define ff first
# define ss second
# define nl "\n"
# define sz(x) ((int)(x).size())
# define deb(x) cerr << #x  << " = " << x << endl; 
# define pll pair <ll, ll>
# define pii pair <int, int>
 
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
 
const ll maxn = 1e6 + 25;
const ll inf = 2e18 + 0;
const ll mod = 1e9 + 7;
const ll dx[] = {-1, 1, 0, 0};
const ll dy[] = {0, 0, -1, 1};
const ll P = 67;

using namespace std;

ll n, a[maxn];

void ma1n (/* SABR */)
{
    cin >> n;
    ll sum = 0;
    for (ll i = 1,u, v, w; i < n; ++i)
    {
        cin >> u >> v >> w;
        sum += w;
    }
    cin >> q;
    cout << sum;
}

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0); cout.tie(0);
//  freopen("file.in", "r", stdin);
//  freopen("file.out", "w", stdout);
    int ttt = 1;
//  cin >> ttt;
    for (int test = 1; test <= ttt; ++test)
    {
//      cout << "Case " << test << ":" << '\n';
        ma1n();
    }
    return 0;
}

// 998batrr | BbIWEJI 3A TObOU!!!
// tourist  | BbIWEJI 3A TObOU!!!

Compilation message

roadsideadverts.cpp: In function 'void ma1n()':
roadsideadverts.cpp:38:12: error: 'q' was not declared in this scope
   38 |     cin >> q;
      |            ^