Submission #1112367

#TimeUsernameProblemLanguageResultExecution timeMemory
1112367vjudge1Baloni (COCI15_baloni)C++17
0 / 100
212 ms26548 KiB
#include <bits/stdc++.h>

using namespace std;

int main()
{
    int a;
    int b;
    map<int,int> c;
    long long int toplam=0;
    scanf("%d",&a);
    for(int i=0;i<a;i++){
        scanf("%d",&b);
        c[b+i]=1;
        
    }
    for(auto&f: c){
        toplam+=f.second;
    }
    printf("%lld",toplam);

    return 0;
}

Compilation message (stderr)

baloni.cpp: In function 'int main()':
baloni.cpp:11:10: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   11 |     scanf("%d",&a);
      |     ~~~~~^~~~~~~~~
baloni.cpp:13:14: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   13 |         scanf("%d",&b);
      |         ~~~~~^~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...