Submission #731769

#TimeUsernameProblemLanguageResultExecution timeMemory
731769TrunktyWalking (NOI12_walking)C++14
25 / 25
1 ms408 KiB
#include <bits/extc++.h> using namespace std; typedef long long ll; #define int ll int l,n,ans; vector<vector<int>> peeps; int dp[505]; signed main(){ ios_base::sync_with_stdio(false); cin.tie(NULL); cin >> l >> n; for(int i=1;i<=n;i++){ int a,b; cin >> a >> b; peeps.push_back({a,b}); } sort(peeps.begin(),peeps.end()); for(int i=0;i<peeps.size();i++){ int x = peeps[i][0], y = peeps[i][1]; dp[i] = 1; for(int j=0;j<i;j++){ if(l*y+peeps[j][0]*peeps[j][1]*y>l*peeps[j][1]+x*peeps[j][1]*y){ dp[i] = max(dp[i],dp[j]+1); } } ans = max(ans,dp[i]); } cout << ans << "\n"; return 0; }

Compilation message (stderr)

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