Submission #638649

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
6386492022-09-06 15:39:19PoonYaPatBoat (APIO16_boat)C++14
36 / 100
2071 ms4292 KiB
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int mod=1e9+7;
int n,c[1001],st[501],ed[501],cnt;
ll dp[501][1001];
set<int> ss;
int main() {
ios_base::sync_with_stdio(0); cin.tie(0);
cin>>n;
for (int i=1; i<=n; ++i) {
cin>>st[i]>>ed[i]; --st[i];
ss.insert(st[i]);
ss.insert(ed[i]);
}
cnt=ss.size()-1;
int idx=0;
for (auto it=ss.begin(); it!=ss.end(); ++it) c[idx++]=*it;
for (int i=0; i<=cnt; ++i) dp[0][i]=1;
for (int i=1; i<=n; ++i) {
dp[i][0]=1; //don't send any boat
for (int j=1; j<=cnt; ++j) { //consider from the range from c[j-1]+1 to c[j]
dp[i][j]=dp[i][j-1];
int idx=0;
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

boat.cpp: In function 'int main()':
boat.cpp:41:36: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   41 |                     for (int h=0; h<v.size(); ++h) {
      |                                   ~^~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...