bzoj 2623 所罗门的咒语

这一题其实我没做出来....

我只是想吐吐槽。

题目要求识别验证码,而且连一点特征信息都不给!

我去偷看了一下数据,然后根据数据生成了图片:

我相信当年没有人能拿分吧。

贴一下transform.cpp的代码:

#include <cstdio>
#include <fstream>
#include <iostream>
using namespace std;

int main(int argc, char *argv[]) {
	FILE *fp;
	fp = fopen(argv[2], "wb");
	ifstream fin(argv[1]);
	cout << "ok";
	int h, w;
	fin >> w >> h;
	cout << w << ' ' << h << endl;
	fprintf(fp, "P6
%d %d
255
", w * 10, h * 10);
	static int A[100][100];
	for (int i = 0; i < h; i ++)
		for (int j = 0; j < w; j ++)
			fin >> A[i][j];
	for (int i = 0; i < h * 10; i ++) {
		for (int j = 0; j < w * 10; j ++) {
			static unsigned char color[3];
			color[0] = color[1] = color[2] = A[i / 10][j / 10];
			fwrite(color, 1, 3, fp);
		}
	}
	return 0;
}
原文地址:https://www.cnblogs.com/wangck/p/4294186.html