hdu 4054 字串處理

2022-08-17 23:48:13 字數 956 閱讀 5730

現場賽中最水的題,發現這題時比賽已經進行了半個小時,可是我打了半個小時還沒有搞定,看著旁邊的隊伍乙個個地公升起氣球,更加緊張,後面還有一點小問題乾脆讓海峰寫了。今天發現杭電加了現場賽的題目,20分鐘就把這題給過了。看來賽場上的心理素質還得訓練,不然正式比賽的時候難以發揮出最好的水平~

/*

* hdu4054/win.cpp

* created on: 2011-10-6

* author : ben

*/#include

#include

#include

#include

#include

#include

#include

using

namespace std;

const

int max_len = 4200;

char ori[max_len], newstr[max_len];

void work() else

if (newstr[i] >= '

a' && newstr[i] <= '

z')

}int i = 0;

while (i * 16 + 16

<= len)

for (int j = 0; j < 16; j++)

putchar('

\n');

i++;

}if (i * 16

< len)

if (j % 2 == 1)

int k = 16 - j;

for (int j = 0; j < k - 1; j += 2)

for (int j = 0; j < j; j++)

putchar('

\n');}}

int main()

return

0;}

HDU 3183 字串處理

題目大意 給你一串數字,要你刪去n個數字,使得刪去n個數字後數值最小。解題思路 蛋疼的水題,搞了我一天。開始是暴力模擬,各種測試對但就是過不了。所以換了個寫法。思路主要是這樣的 因為需要你刪除m個數使得結果最小,所以每次對字串進行一次遍歷,從前往後,只要a i a j j的位置為i後面未標記的第乙個...

HDU 1228 字串處理

題意是將所給算式求出結果。用的方法非常麻煩,開始沒考慮到零也需要處理,以為遇上零直接跳過即可,知道發現零可以佔位,比如 one zero 值為 10 而不是 1 如下 1 include 2 using namespace std 3int main 416 else if strcmp s1,tw...

hdu 1073 字串處理

題意 給一系列的輸出和標準答案,比較二者是ac,pe或wa 字串處理還是比較薄弱,目前沒什麼時間搞字串專題,所以遇到一題就努力搞懂 1 include2 include3 include4 include5 include6 include7 include8 using namespace std...