Submission #88798

# Submission time Handle Problem Language Result Execution time Memory
88798 2018-12-08T19:56:40 Z asifthegreat Baloni (COCI15_baloni) C++14
0 / 100
104 ms 4004 KB
#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++){
        taken[ara[i]] = true;
        cnt++;
        if(taken[ara[i]+1])cnt--;
    }
    cout << cnt << endl;
    return 0;
}

Compilation message

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 time Memory Grader output
1 Incorrect 2 ms 376 KB Output isn't correct
2 Incorrect 2 ms 376 KB Output isn't correct
3 Incorrect 3 ms 576 KB Output isn't correct
4 Incorrect 2 ms 640 KB Output isn't correct
5 Incorrect 99 ms 3588 KB Output isn't correct
6 Incorrect 104 ms 4004 KB Output isn't correct
7 Incorrect 83 ms 4004 KB Output isn't correct
8 Incorrect 86 ms 4004 KB Output isn't correct
9 Incorrect 92 ms 4004 KB Output isn't correct
10 Incorrect 93 ms 4004 KB Output isn't correct