RAID! UVA - 509
Posted jionkitten
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了RAID! UVA - 509相关的知识,希望对你有一定的参考价值。
链接:https://vjudge.net/problem/UVA-509
记录这个题主要是来记录一下自己遇到的神奇的bug,避免再走弯路。
#include <iostream> #include <stdio.h> #include <cstring> //#define LOCAL using namespace std; char disk[7][105][66]; int d, s, b, check, exibs[105][66], flcnt; char d2h[16] = {‘0‘, ‘1‘, ‘2‘, ‘3‘, ‘4‘, ‘5‘, ‘6‘, ‘7‘, ‘8‘, ‘9‘, ‘A‘, ‘B‘, ‘C‘, ‘D‘, ‘E‘, ‘F‘}; //一种更简单的写法:="0123456789ABCDEF" struct Flaw { int df, bf, sf; } flaw[6800]; int get(int cd, int cb) { char c; bool f = true; for (int i = 1; i <= s; ++i) { c = getchar(); if (c == ‘x‘) { if (exibs[cb][i] == 0) flcnt++, flaw[flcnt].df = cd, flaw[flcnt].bf = cb, flaw[flcnt].sf = i, exibs[cb][i] = 1; else f = false; } disk[cd][cb][i] = c; } disk[cd][cb][s + 1] = ‘