Submission #740039

#TimeUsernameProblemLanguageResultExecution timeMemory
740039mzvBaloni (COCI15_baloni)C++17
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> #define ccd ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0); #define ll long long #define endl '\n' using namespace std; /* ------------------------ hi lol ------------------------ */ // author : mzv int n,x,arrow[1'000'000],ans=0; int main() { ccd memset(arr,0,sizeof(arr)); cin >> n; for (int i=1;i<=n;i++) { cin >> x; if (arrow[x]>0) { arrow[x]--; // ad arrow tinggi x, langsung meledak } arrow[x-1]++; // balon ke x kena, arrow jatuh ke x-1 } for (int i=0;i<=n;i++) { ans += arrow[i]; } cout << ans << endl; }

Compilation message (stderr)

baloni.cpp: In function 'int main()':
baloni.cpp:17:9: error: 'arr' was not declared in this scope
   17 |  memset(arr,0,sizeof(arr));
      |         ^~~