"Link" I am the link, point me:)
Test instructions
Enter the test instructions here
Exercises
Consider deleting position i.
The first i+1 will replace the first bit.
It would be better if the first bit of i+1 was larger than the first.
Then from small to big greedy Delete, find the first a[i+1]>a[i] I.
Then every time I delete such I can be.
Code
/*1.Shoud It use long long?2.Have ever test several sample (at least therr) yourself?3.Can You promise the solution are right? At Least,the main ideal4.use the puts ("") or Putchar () or printf and such things?5.init The used array or any value?6.use error max_value?7.use scanf instead of cin/cout?8.whatch out the detail input require*//*Be sure to write the idea here and then hit the code!!!*/#include <bits/stdc++.h>using namespaceStdConst intN =1e5;intN,d,l[n+10],r[n+10];CharS[n+10];voidScintx) {intL = L[x],r = R[x]; R[l] = R; L[r] = L;}intMain () {#ifdef Local_defineFreopen ("Rush_in.txt","R", stdin);#endifIos::sync_with_stdio (0), Cin.tie (0); while(CIN >> N >> d && n && D) {cin >> (s+1); for(inti =0; I <= n;i++) l[i] = i-1, r[i] = i+1;intnow = r[0]; while(1){if(d==0) Break;intNEX = R[now]; while(NEX <= n && S[nex]<=s[now]) {now = R[now]; NEX = R[nex]; } SC (now); now = L[now];if(now==0) now = R[now]; d--; } for(inti = r[0];i!=n+1; I=r[i]) cout << s[i]; cout << Endl; }return 0;}
"Exercise 8-4 UVA-11491" erasing and Winning