Submission #556464

#TimeUsernameProblemLanguageResultExecution timeMemory
556464InternetPerson10Boat (APIO16_boat)C++17
9 / 100
1 ms340 KiB
#include <bits/stdc++.h> typedef long long ll; using namespace std; const ll MOD = 1e9 + 7; int main() { ios::sync_with_stdio(false); cin.tie(0); int n; cin >> n; vector<ll> nums(n), sums(n); for(int i = 0; i < n; i++) { cin >> nums[i]; cin >> nums[i]; sums[i] = 1; } for(int i = 1; i < n; i++) { for(int j = 0; j < i; j++) { if(nums[j] < nums[i]) sums[i] += sums[j]; sums[i] %= MOD; } } ll ans = 0; for(int i = 0; i < n; i++) ans += sums[i]; cout << ans % MOD << '\n'; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...