제출 #467453

#제출 시각아이디문제언어결과실행 시간메모리
467453thiennnBaloni (COCI15_baloni)C++14
100 / 100
223 ms3856 KiB
#include <bits/stdc++.h>
using namespace std;
#define fasty ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0);
#define forinc(x,a,b) for(int x=a;x<=b;x++)
#define ford(x,a,b) for(int x=a;x>=b;x--)
#define forv(a,b) for(auto&a:b)
#define fi first
#define se second
#define pb push_back
#define ii pair<int,int>
#define mt make_tuple
#define all(a) a.begin(),a.end()
#define reset(f,x) memset(f,x,sizeof(f))
#define getbit(x,i) ((x>>i)&1)
#define batbit(x,i) (x|(1ll<<i))
#define tatbit(x,i) (x&~(1<<i))
#define gg exit(0);
const int N = 1e6+10;
int h[N];
int cnt[N];
int shoot;
int n;
main()
{
    cin >> n;
    forinc(i,1,n)
    {
        int x;
        cin >> x;
        if(cnt[x] == 0)
        {
            cnt[x-1]++;
            shoot++;
        }
        else
        {
            cnt[x]--;
            cnt[x-1]++;
        }

    }
    cout << shoot;
}

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

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