Pagini recente » Borderou de evaluare (job #2395485) | Borderou de evaluare (job #468432) | Borderou de evaluare (job #119058) | Borderou de evaluare (job #13575) | Borderou de evaluare (job #2722150)
Borderou de evaluare (job #2722150)
Raport evaluator
Compilare:
main.cpp:2:93: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
using namespace std; ifstream f("euro3.in"); ofstream g("euro3.out"); const int o=1e9; main(){int t; f>>t; while(t--){int n,m,i,x; f>>n>>m; vector<int>v(n+1),c(m+1,o),d(m+1,-1); for(int i=1;i<=n;++i) f>>v[i]; sort(v.begin()+1,v.end()); d[0]=o; for(i=1;i<=n;++i){for(x=m;x>=v[i];--x) d[x]=max(min(d[x-v[i]],v[i]),d[x]); for(x=m;x>=1;--x) if(d[x]>0) c[x]=min(c[x],v[i]-d[x]);} for(x=1;x<=m;++x) g<<(c[x]!=o?c[x]:-1)<<" "; g<<"\n";}}
^
Test |
Timp executie |
Memorie folosita |
Mesaj |
Punctaj/test |
1 | 3ms | 131kb | OK | 10 |
2 | 2ms | 131kb | OK | 10 |
3 | 3ms | 131kb | OK | 10 |
4 | 3ms | 131kb | OK | 10 |
5 | 4ms | 131kb | OK | 10 |
6 | 50ms | 262kb | OK | 10 |
7 | 101ms | 262kb | OK | 10 |
8 | 164ms | 262kb | OK | 10 |
9 | 201ms | 262kb | OK | 10 |
10 | 251ms | 262kb | OK | 10 |
Punctaj total | 100 |