Submission #1322209

#TimeUsernameProblemLanguageResultExecution timeMemory
1322209nurdaeeInfinite Race (EGOI24_infiniterace2)C++20
Compilation error
0 ms0 KiB
#include <bits/stdc++.h>

using namespace std;

#define nur ios::sync_with_stdio(false);cin.tie(nullptr);
#define all(v) v.begin(),v.end()
#define int long long 
#define pb push_back
#define vc vector
const int inf = 1e18;

void solve(){
    int n;
    cin >> n;
    int q;
    cin >> q;
    map<int , int> mp;
    int cnt = 0;
    for(int i = 0; i < x; i++){
        if( x < 0 ) mp[-x]--;
        else mp[x]++;
        if  ( mp[x] > 1 ) cnt++;
    }
    cout << cnt << "\n";
}
signed main() {
    nur 
    int t = 1;
    cin >> t;    
    while(t--) solve();
}

Compilation message (stderr)

Main.cpp: In function 'void solve()':
Main.cpp:19:24: error: 'x' was not declared in this scope
   19 |     for(int i = 0; i < x; i++){
      |                        ^