Submission #23477

#TimeUsernameProblemLanguageResultExecution timeMemory
23477mohammad_kilaniBoat (APIO16_boat)C++14
0 / 100
0 ms2028 KiB
#include<bits/stdc++.h> using namespace std; int n , m ; int a[1001]; int cur[1001]; int main(){ //freopen("in.txt","r",stdin); //freopen("out.txt","w",stdout); scanf("%d",&n); int sum = 0 ; for(int i=0;i<n;i++){ scanf("%d",&a[i]); int b; scanf("%d",&b); for(int j=0;j<i;j++){ if(a[i] > a[j]){ cur[i]+=cur[j]; } } cur[i]++; sum+=cur[i]; } printf("%d\n",sum); return 0; }

Compilation message (stderr)

boat.cpp: In function 'int main()':
boat.cpp:9:19: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     scanf("%d",&n);
                   ^
boat.cpp:12:26: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
         scanf("%d",&a[i]);
                          ^
boat.cpp:14:23: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
         scanf("%d",&b);
                       ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...