Submission #154526

# Submission time Handle Problem Language Result Execution time Memory
154526 2019-09-22T13:26:22 Z phillip San (COCI17_san) C++14
0 / 120
1000 ms 380 KB
#include <bits/stdc++.h>
using namespace std;
int ans,k;
void ed(int sum)
{
    if(sum>=k)ans++;
}
int h[49],g[49],n;
void bt(int x,int sum)
{
    sum+=g[x];
    ed(sum);
    for(int i=x+1;i<n;i++)
    {
        if(h[i]>=h[x])
        {
            bt(i,sum);
        }
    }
}
int main()
{
    cin>>n>>k;
    for(int i=0;i<n;i++)cin>>h[i]>>g[i];
    for(int i=0;i<n;i++)
    {
        bt(i,0);
    }
    cout<<ans;
}
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 252 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 4 ms 376 KB Output is correct
2 Incorrect 8 ms 256 KB Output isn't correct
# Verdict Execution time Memory Grader output
1 Execution timed out 1076 ms 276 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1077 ms 256 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1063 ms 380 KB Time limit exceeded
2 Halted 0 ms 0 KB -