Codeforces Round #436 (Div. 2), problem: (E) Fire Solution In C/C++

By | 2017-09-26T16:40:39+00:00 September 26th, 2017|Categories: C/C++, Programming|Tags: , , , , , , , , |

#include<iostream> #include<cstdio> #include<algorithm> #include<bitset> using namespace std; struct node{ int t,d,p,tot; }a[200]; int f[3000]; bool cmp(node x,node y){ return x.d<y.d; } bitset<150> ans[2050]; int cc[2050]; int main(){ int n; scanf("%d",&n); for (int i=1;i<=n;++i){ scanf("%d%d%d",&a[i].t,&a[i].d,&a[i].p); a[i].tot=i; } sort(a+1,a+n+1,cmp); for (int i=1;i<=n;++i) for (int j=a[i].d-1;j>=a[i].t;--j) if [...]