Submission #154553

#TimeUsernameProblemLanguageResultExecution timeMemory
154553phillipSan (COCI17_san)C++14
48 / 120
162 ms65540 KiB
#include <bits/stdc++.h> #define ll long long #define lp (pos+pos+1) #define rp (2*pos+2) #define m (l+r)/2 using namespace std; vector<ll>v[49]; ll h[49],g[49],k,ans; int n; int main() { cin>>n>>k; for(int i=0;i<n;i++) { cin>>h[i]>>g[i]; } for(int i=n-1;i>=0;i--) { v[i].push_back(g[i]); for(int j=0;j<i;j++) { if(h[j]>h[i])continue; for(int l=0;l<v[i].size();l++)v[j].push_back(g[j]+v[i][l]); } for(int j=0;j<v[i].size();j++) { if(v[i][j]>=k)ans++; } //cout<<ans<<"\n"; v[i].clear(); } cout<<ans; }

Compilation message (stderr)

san.cpp: In function 'int main()':
san.cpp:23:26: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
             for(int l=0;l<v[i].size();l++)v[j].push_back(g[j]+v[i][l]);
                         ~^~~~~~~~~~~~
san.cpp:25:22: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
         for(int j=0;j<v[i].size();j++)
                     ~^~~~~~~~~~~~
#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...