제출 #88795

#제출 시각아이디문제언어결과실행 시간메모리
88795asifthegreatBaloni (COCI15_baloni)C++14
0 / 100
2067 ms3952 KiB
#include <bits/stdc++.h>
using namespace std;

#define debug(a) cout << #a << " = " << a << endl

const int N = 1000004;

int ara[N],n;
bitset<1000003>taken;

int main()
{
    scanf("%d",&n);
    for(int i = 0; i < n;i++)scanf("%d",&ara[i]);
    int cnt = 0;
    for(int i = 0;i < n;i++){
        if(taken[i])continue;
        taken[i] = true;
        cnt++;
        int ase_naki = ara[i]-1;
        for(int j = i+1;j < n;j++){
            if(ara[j] == ase_naki){
                taken[j] = true;
                ase_naki--;
            }
        }
    }   
    cout << cnt << endl;
    return 0;
}

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

baloni.cpp: In function 'int main()':
baloni.cpp:13:10: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     scanf("%d",&n);
     ~~~~~^~~~~~~~~
baloni.cpp:14:35: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     for(int i = 0; i < n;i++)scanf("%d",&ara[i]);
                              ~~~~~^~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...