Submission #839112

#TimeUsernameProblemLanguageResultExecution timeMemory
839112BulaBaloni (COCI15_baloni)C++14
100 / 100
259 ms4044 KiB
#include <bits/stdc++.h> using namespace std; #define ll long long #define pb push_back #define all(x) x.begin(),x.end() #define rall(x) x.rbegin(),x.rend() #define ff first #define sc second #define int ll const ll mod = 1e9 + 7, N = 1e5 + 1; main(){ int n; cin >> n; map<int, int> mp; int ans = 0; for(int i = 1; i <= n; i++){ int x; cin >> x; mp[x]++; if(mp[x + 1] > 0) mp[x + 1] --; else ans ++; } cout << ans << endl; }

Compilation message (stderr)

baloni.cpp:13:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   13 | main(){
      | ^~~~
#Verdict Execution timeMemoryGrader output
Fetching results...