feat(bfs, backtracking): new problem formated
This commit is contained in:
24
sliding-puzzle/src/validator.cpp
Normal file
24
sliding-puzzle/src/validator.cpp
Normal file
@@ -0,0 +1,24 @@
|
||||
#include "testlib.h"
|
||||
#include <bits/stdc++.h>
|
||||
|
||||
using namespace std;
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
registerValidation(argc, argv);
|
||||
|
||||
string game = inf.readToken("[0-5]{3}", "top");
|
||||
inf.readEoln();
|
||||
game += inf.readToken("[0-5]{3}", "bottom");
|
||||
inf.readEoln();
|
||||
inf.readEof();
|
||||
|
||||
vector<bool> nums(6, false);
|
||||
for (char c : game)
|
||||
{
|
||||
ensuref(!nums[c - '0'], "Repeated occurence of number %c", c);
|
||||
nums[c - '0'] = true;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user