# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
23478 | mohammad_kilani | Boat (APIO16_boat) | C++14 | 0 ms | 2028 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include<bits/stdc++.h>
using namespace std;
int mod = 1000000007;
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]%=mod;
}
}
cur[i]++;
cur[i]%=mod;
sum+=cur[i];
sum%=mod;
}
printf("%d\n",sum);
return 0;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |