Submission #469496

# Submission time Handle Problem Language Result Execution time Memory
469496 2021-09-01T07:58:17 Z Karabasan Baloni (COCI15_baloni) C++17
100 / 100
90 ms 6040 KB
#include <bits/stdc++.h>

using namespace std;
int dizi[1000005];
int ind[1000005];
int n;
int main()
{
    scanf("%d",&n);
    for(int i=0;i<n;i++)
        scanf("%d",&dizi[i]);
    int cevap=n;
    for(int i=0;i<n;i++)
    {
        if(ind[dizi[i]+1]>0)
            {
                cevap--;
                ind[dizi[i]+1]--;
            }
        ind[dizi[i]]++;
    }
    printf("%d",cevap);
    return 0;
}

Compilation message

baloni.cpp: In function 'int main()':
baloni.cpp:9:10: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
    9 |     scanf("%d",&n);
      |     ~~~~~^~~~~~~~~
baloni.cpp:11:14: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   11 |         scanf("%d",&dizi[i]);
      |         ~~~~~^~~~~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 1 ms 204 KB Output is correct
3 Correct 1 ms 332 KB Output is correct
4 Correct 2 ms 332 KB Output is correct
5 Correct 87 ms 5728 KB Output is correct
6 Correct 90 ms 6040 KB Output is correct
7 Correct 75 ms 5444 KB Output is correct
8 Correct 73 ms 5464 KB Output is correct
9 Correct 81 ms 5572 KB Output is correct
10 Correct 80 ms 5708 KB Output is correct