[UVa11729] Commando War

“Waiting for orders we held in the wood,

word from the front never came

By evening the sound of the gunfire was miles away

Ah softly we moved through the shadows, slip away through the trees

Crossing their lines in the mists in the fields on our hands and our knees

And all that I ever, was able to see

The fire in the air, glowing red, silhouetting the smoke on the breeze”

这是山人见过最诗情画意热血沸腾的UVa题目 实属难得 相见恨晚

山人不觉想起了前些天qzy学长发来的读诗录音 更生AC此题的念头 更不愿参照题解完成

今日思索多时 终于有些头绪 竟一举拿下

说到底 这一道思维题 做出来也不足为称道 只是其中有些细节可以启发思路

for(i=2;i<=n;i++){
    if( a[i-1].j > a[i].b+a[i].j ) a[i].j = a[i-1].j-a[i].b;
}

原文地址:https://www.cnblogs.com/peccavi/p/4981888.html