제출 #1260272

#제출 시각아이디문제언어결과실행 시간메모리
1260272zertiniiInfinite Race (EGOI24_infiniterace2)C++20
컴파일 에러
0 ms0 KiB
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
//#pragma GCC optimize("Ofast,unroll-loops,fast-math,O3")
#include <bits/stdc++.h>
using namespace std;

#define ios ios_base::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr)
#define pb push_back
#define all(x) (x).begin(), (x).end()
#define fi first
#define se second
#define yes cout << "YES" << '\n'
#define no cout << "NO" << '\n'
#define stop return 0
#define str string
#define int long long
#define veci vector<int>
#define skip continue
#define sz size()
#define pii pair<int,int>

const int MOD = 1e9 + 7;
const int INF = 1e18;
const int N = 1e6 + 5;
const int inf = 1e9 + 7;

int b[N];
int dp[N];
int n, m;
str s;

void tin() {
    cin >> n >> m;
    int kol = 0;
    for(int i = 0;i < m;i++) {
        int x;
        cin >> x;
        if(n == 2) {
            kol = m - 1;
        }
        else {
            veci a(n, 0);
            int kol1 = 0;
            if(a[x] == kol1) {
                kol++;
                kol1++;
        }
        a[x] = kol1;
    }
    cout << kol - 1;
}

signed main() {
    ios;
    int t = 1;
    //cin >> t;
    while(t--) {
        tin();
    }
    stop;
}

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

Main.cpp: In function 'void tin()':
Main.cpp:52:12: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
   52 | signed main() {
      |            ^~
Main.cpp:52:12: note: remove parentheses to default-initialize a variable
   52 | signed main() {
      |            ^~
      |            --
Main.cpp:52:12: note: or replace parentheses with braces to value-initialize a variable
Main.cpp:52:15: error: a function-definition is not allowed here before '{' token
   52 | signed main() {
      |               ^
Main.cpp:60:2: error: expected '}' at end of input
   60 | }
      |  ^
Main.cpp:31:12: note: to match this '{'
   31 | void tin() {
      |            ^