Submission #1171592

#TimeUsernameProblemLanguageResultExecution timeMemory
1171592aagiiBaloni (COCI15_baloni)C++20
Compilation error
0 ms0 KiB
#include <bits/stdc++.h>
// #include "shoes.h"
#define ll long long
#define pb push_back
#define ff first
#define ss second
#define mp make_pair
#define sz size()
#define veg vegeta
#define harderahhh ios::sync_with_stdio(0); cin.tie(0); cout.tie(0)
const int N = 1e9+7;
const int M = 998244353;
using namespace std;
// ll x, l, y, t, z, hp, sus1, sus2, g, sus, sus3, bruh, bruh1, bruh2, bruh3, dog1, h, r, dog2, dog3;
// ll ck1, ck2, ck3, dog, i, p, j, q, m, a[1000005], b[696969], c[696969], n, k, d[2000005], e[696969];
// ll x2[696969], x17[696969], x1[696969], joy[1005][1005], pp[1005][1005], di[1234566], de[1234566];
// string s1, s2, s3, s4, s5, s6, s7, s8, s9, rep1, rep2, rep, s, hsr[696969], gi[696969];
// char c1, c2, oon, hi[1005][1005], na[1005][1005], cc[696969], dd[696969];
// pair <ll, ll> goku[696969], veg[696969];
// vector<ll> aag[1000005], eeg[200005], ski, bidi;
// bool vis[200005];
// map <pair<ll,ll>, ll> mm;
// map <ll, ll> wii, waa;
// set <ll> kk;
// void dfs(ll x) {
    
// }
int main() {
    cin >> n;
    for (i = 1; i <= n; i++) {
        cin >> a[i];
    }
    for (i = 1; i <= n; i++) {
        if (wii[a[i]+1] > 0) {
            wii[a[i]+1]--;
            wii[a[i]]++;
        } else {
            wii[a[i]]++;
        }
    }
    for (i = 1; i <= 1000000; i++) {
        sus += wii[i];
    }
    cout << sus;
    
}

Compilation message (stderr)

baloni.cpp: In function 'int main()':
baloni.cpp:29:12: error: 'n' was not declared in this scope
   29 |     cin >> n;
      |            ^
baloni.cpp:30:10: error: 'i' was not declared in this scope
   30 |     for (i = 1; i <= n; i++) {
      |          ^
baloni.cpp:31:16: error: 'a' was not declared in this scope
   31 |         cin >> a[i];
      |                ^
baloni.cpp:33:10: error: 'i' was not declared in this scope
   33 |     for (i = 1; i <= n; i++) {
      |          ^
baloni.cpp:34:13: error: 'wii' was not declared in this scope
   34 |         if (wii[a[i]+1] > 0) {
      |             ^~~
baloni.cpp:34:17: error: 'a' was not declared in this scope
   34 |         if (wii[a[i]+1] > 0) {
      |                 ^
baloni.cpp:41:10: error: 'i' was not declared in this scope
   41 |     for (i = 1; i <= 1000000; i++) {
      |          ^
baloni.cpp:42:9: error: 'sus' was not declared in this scope; did you mean 'ss'?
   42 |         sus += wii[i];
      |         ^~~
      |         ss
baloni.cpp:42:16: error: 'wii' was not declared in this scope
   42 |         sus += wii[i];
      |                ^~~
baloni.cpp:44:13: error: 'sus' was not declared in this scope; did you mean 'ss'?
   44 |     cout << sus;
      |             ^~~
      |             ss