瞎扯几句

1.

上篇提到的某AES加密装置代码:main.c.exe

加密了,双击会有密码提示;然后看了那些破烂代码你也自然就会知道如何把二进制文件剥离出这个 main.c.exe 了。

嗯,写得很草,自己玩玩而已——事实是,画图标的时间不见得比码代码的时间短。

 

2.

复习没状态啊没状态。

 

3.

几张照片

 

IMG_0028

某晚某神秘的小生物来袭。

 

IMG_0059

某晚雷雨交加,想拍几条闪电可惜天空不给力,长时间曝光就成这样鸟。

 

IMG_0115

我喜欢用草做桌面

 

IMG_0184

这货真的不是我,放在这儿只是为了炫耀一下我的偷拍技术大有长进。

 

4.

还是C++对我的胃口啊,以前玩ACM实现过不止一个 trie-tree,没有一个这么简单的:

class TT{
public:
    map<char,TT*> t;
    void insert(char const*s){
        if(s[0]!=0){
            if(t[s[0]]==0){
                t[s[0]]=new TT;
            }
            t[s[0]]->insert(s+1);
            ++t[0];
        } else {
            ++t[1];
        }
    }
    TT(){}
    ~TT(){
        for(map<char,TT*>::iterator i=t.begin();i!=t.end();++i)
            if(i->first>10)delete i->second;
    }
};

于是POJ2001的代码一共就这么长:

#include<map>
#include<string>
#include<vector>
#include<iostream>
#define C char
using namespace std;struct T{map<C,T*>t;void x(C const*s){if(
*s){if(t[*s]==0)t[*s]=new T;t[*s]->x(s+1);++t[0];}else++t[1];
}T(){}~T(){for(map<C,T*>::iterator i=t.begin();i!=t.end();++i
)if(i->first>10)delete i->second;}}; int main(){T*p,t;vector<
string>P;for(C s[24];cin>>s;P.push_back(s))t.x(s);for(int i=0
,I=P.size();i!=I;++i){p=&t;cout<<P[i]<<' ';for(int j=0,J=P[i]
.size();j<J;++j){C h=P[i][j];if(p&& (p->t[0]-1>0||p->t[1])&&p
->t.find(h)!=p->t.end()){cout<<h;p= p->t[h];}else break;}cout
<<endl;}return 0;}

——某晚感到非常无聊做的这题。BTW,这个代码长度排不到第一页,shame。

 

5.

END;

 



0 comments

add a comment