Search is not available for this dataset
name stringlengths 2 88 | description stringlengths 31 8.62k | public_tests dict | private_tests dict | solution_type stringclasses 2
values | programming_language stringclasses 5
values | solution stringlengths 1 983k |
|---|---|---|---|---|---|---|
p01329 Stolen Jewel | The jewel, a national treasure of the Kingdom of Pal, was stolen by bandits. As an adventurer, you heard the rumor and headed for the thief's hideout and managed to get the jewels back.
However, when I went to return the jewel to the castle of the Kingdom of Pal, the guard of the castle said, "My king has not complete... | {
"input": [
"6 7\n.......\n...#...\n...#.S.\n...###.\n.G.....\n.......\n2\nLL\nDD",
"7 6\n......\n.####.\n.####.\n...S#.\n...##.\n...##.\n.....G\n3\nLD\nDD\nLLL\n7 8\nS#......\n.#.####.\n.#.#G.#.\n.#.##.#.\n.#....#.\n.######.\n........\n8\nDDDD\nDDDU\nUUUU\nUUUD\nRRRR\nRRRL\nLLLL\nLLLR\n3 8\n\nS......G\n\n2\... | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
const int INF = 1e8;
const int dx[] = {1, 0, -1, 0};
const int dy[] = {0, 1, 0, -1};
string D = "DRUL";
const int var = 4;
int trans(char c) {
switch (c) {
case 'R':
return 0;
case 'D':
return 1;
case 'L':
return 2;
case 'U':
return... |
p01329 Stolen Jewel | The jewel, a national treasure of the Kingdom of Pal, was stolen by bandits. As an adventurer, you heard the rumor and headed for the thief's hideout and managed to get the jewels back.
However, when I went to return the jewel to the castle of the Kingdom of Pal, the guard of the castle said, "My king has not complete... | {
"input": [
"6 7\n.......\n...#...\n...#.S.\n...###.\n.G.....\n.......\n2\nLL\nDD",
"7 6\n......\n.####.\n.####.\n...S#.\n...##.\n...##.\n.....G\n3\nLD\nDD\nLLL\n7 8\nS#......\n.#.####.\n.#.#G.#.\n.#.##.#.\n.#....#.\n.######.\n........\n8\nDDDD\nDDDU\nUUUU\nUUUD\nRRRR\nRRRL\nLLLL\nLLLR\n3 8\n\nS......G\n\n2\... | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
int tx[] = {0, 1, 0, -1};
int ty[] = {-1, 0, 1, 0};
static const double EPS = 1e-8;
class Nodes {
public:
class Nodes* children[256];
bool has_word;
Nodes() : has_word(false) {
for (int i = 0; i < 256; i++) {
children[i] = NULL;
}
}
};
class Trie {
p... |
p01329 Stolen Jewel | The jewel, a national treasure of the Kingdom of Pal, was stolen by bandits. As an adventurer, you heard the rumor and headed for the thief's hideout and managed to get the jewels back.
However, when I went to return the jewel to the castle of the Kingdom of Pal, the guard of the castle said, "My king has not complete... | {
"input": [
"6 7\n.......\n...#...\n...#.S.\n...###.\n.G.....\n.......\n2\nLL\nDD",
"7 6\n......\n.####.\n.####.\n...S#.\n...##.\n...##.\n.....G\n3\nLD\nDD\nLLL\n7 8\nS#......\n.#.####.\n.#.#G.#.\n.#.##.#.\n.#....#.\n.######.\n........\n8\nDDDD\nDDDU\nUUUU\nUUUD\nRRRR\nRRRL\nLLLL\nLLLR\n3 8\n\nS......G\n\n2\... | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
int tx[] = {0, 1, 0, -1};
int ty[] = {-1, 0, 1, 0};
static const double EPS = 1e-8;
class Nodes {
public:
class Nodes* children[256];
bool has_word;
Nodes() : has_word(false) {
for (int i = 0; i < 256; i++) {
children[i] = NULL;
}
}
};
class Trie {
p... |
p01329 Stolen Jewel | The jewel, a national treasure of the Kingdom of Pal, was stolen by bandits. As an adventurer, you heard the rumor and headed for the thief's hideout and managed to get the jewels back.
However, when I went to return the jewel to the castle of the Kingdom of Pal, the guard of the castle said, "My king has not complete... | {
"input": [
"6 7\n.......\n...#...\n...#.S.\n...###.\n.G.....\n.......\n2\nLL\nDD",
"7 6\n......\n.####.\n.####.\n...S#.\n...##.\n...##.\n.....G\n3\nLD\nDD\nLLL\n7 8\nS#......\n.#.####.\n.#.#G.#.\n.#.##.#.\n.#....#.\n.######.\n........\n8\nDDDD\nDDDU\nUUUU\nUUUD\nRRRR\nRRRL\nLLLL\nLLLR\n3 8\n\nS......G\n\n2\... | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
int H, W, K, x[100][100], dist[100][100][200], sx, sy, gx, gy,
dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0, -1};
string S[10], dir = "DRUL";
vector<tuple<string, int, int>> vec;
vector<tuple<int, int, int>> X[100][100][200];
vector<pair<int, int>> banned[200];
void build_ba... |
p01329 Stolen Jewel | The jewel, a national treasure of the Kingdom of Pal, was stolen by bandits. As an adventurer, you heard the rumor and headed for the thief's hideout and managed to get the jewels back.
However, when I went to return the jewel to the castle of the Kingdom of Pal, the guard of the castle said, "My king has not complete... | {
"input": [
"6 7\n.......\n...#...\n...#.S.\n...###.\n.G.....\n.......\n2\nLL\nDD",
"7 6\n......\n.####.\n.####.\n...S#.\n...##.\n...##.\n.....G\n3\nLD\nDD\nLLL\n7 8\nS#......\n.#.####.\n.#.#G.#.\n.#.##.#.\n.#....#.\n.######.\n........\n8\nDDDD\nDDDU\nUUUU\nUUUD\nRRRR\nRRRL\nLLLL\nLLLR\n3 8\n\nS......G\n\n2\... | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
static const int MAX = 50;
static const int PMAX = 11;
static const string DT = "URDL";
static const int di[4] = {-1, 0, 1, 0};
static const int dj[4] = {0, 1, 0, -1};
int H, W, np;
char G[MAX][MAX];
string P[PMAX];
class State {
public:
unsigned short pos;
short M[PMA... |
p01329 Stolen Jewel | The jewel, a national treasure of the Kingdom of Pal, was stolen by bandits. As an adventurer, you heard the rumor and headed for the thief's hideout and managed to get the jewels back.
However, when I went to return the jewel to the castle of the Kingdom of Pal, the guard of the castle said, "My king has not complete... | {
"input": [
"6 7\n.......\n...#...\n...#.S.\n...###.\n.G.....\n.......\n2\nLL\nDD",
"7 6\n......\n.####.\n.####.\n...S#.\n...##.\n...##.\n.....G\n3\nLD\nDD\nLLL\n7 8\nS#......\n.#.####.\n.#.#G.#.\n.#.##.#.\n.#....#.\n.######.\n........\n8\nDDDD\nDDDU\nUUUU\nUUUD\nRRRR\nRRRL\nLLLL\nLLLR\n3 8\n\nS......G\n\n2\... | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
int m, n, nr, ns;
string mat[53];
string rule[13];
int d[53][53][113];
int t[113][4];
string suf[113];
int dx[] = {-1, 0, 1, 0};
int dy[] = {0, 1, 0, -1};
char dc[] = {'U', 'R', 'D', 'L'};
struct Status {
int x, y, s, d;
Status() {}
Status(int dd, int xx, int yy, int ... |
p01329 Stolen Jewel | The jewel, a national treasure of the Kingdom of Pal, was stolen by bandits. As an adventurer, you heard the rumor and headed for the thief's hideout and managed to get the jewels back.
However, when I went to return the jewel to the castle of the Kingdom of Pal, the guard of the castle said, "My king has not complete... | {
"input": [
"6 7\n.......\n...#...\n...#.S.\n...###.\n.G.....\n.......\n2\nLL\nDD",
"7 6\n......\n.####.\n.####.\n...S#.\n...##.\n...##.\n.....G\n3\nLD\nDD\nLLL\n7 8\nS#......\n.#.####.\n.#.#G.#.\n.#.##.#.\n.#....#.\n.######.\n........\n8\nDDDD\nDDDU\nUUUU\nUUUD\nRRRR\nRRRL\nLLLL\nLLLR\n3 8\n\nS......G\n\n2\... | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
struct NODE {
int x, y, a, b, cost;
NODE(int A, int B, int C, int D, int E) {
x = A, y = B, a = C, b = D, cost = E;
}
};
int dx[] = {-1, 0, 1, 0};
int dy[] = {0, -1, 0, 1};
char dc[] = {'L', 'U', 'R', 'D'};
int main() {
int W, H;
while (cin >> H >> W) {
ch... |
p01329 Stolen Jewel | The jewel, a national treasure of the Kingdom of Pal, was stolen by bandits. As an adventurer, you heard the rumor and headed for the thief's hideout and managed to get the jewels back.
However, when I went to return the jewel to the castle of the Kingdom of Pal, the guard of the castle said, "My king has not complete... | {
"input": [
"6 7\n.......\n...#...\n...#.S.\n...###.\n.G.....\n.......\n2\nLL\nDD",
"7 6\n......\n.####.\n.####.\n...S#.\n...##.\n...##.\n.....G\n3\nLD\nDD\nLLL\n7 8\nS#......\n.#.####.\n.#.#G.#.\n.#.##.#.\n.#....#.\n.######.\n........\n8\nDDDD\nDDDU\nUUUU\nUUUD\nRRRR\nRRRL\nLLLL\nLLLR\n3 8\n\nS......G\n\n2\... | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
static const int MAX = 50;
static const int PMAX = 11;
static const string DT = "URDL";
static const int di[4] = {-1, 0, 1, 0};
static const int dj[4] = {0, 1, 0, -1};
int H, W, np;
char G[MAX][MAX];
string P[PMAX];
class State {
public:
short pos, M[PMAX];
State() {
... |
p01329 Stolen Jewel | The jewel, a national treasure of the Kingdom of Pal, was stolen by bandits. As an adventurer, you heard the rumor and headed for the thief's hideout and managed to get the jewels back.
However, when I went to return the jewel to the castle of the Kingdom of Pal, the guard of the castle said, "My king has not complete... | {
"input": [
"6 7\n.......\n...#...\n...#.S.\n...###.\n.G.....\n.......\n2\nLL\nDD",
"7 6\n......\n.####.\n.####.\n...S#.\n...##.\n...##.\n.....G\n3\nLD\nDD\nLLL\n7 8\nS#......\n.#.####.\n.#.#G.#.\n.#.##.#.\n.#....#.\n.######.\n........\n8\nDDDD\nDDDU\nUUUU\nUUUD\nRRRR\nRRRL\nLLLL\nLLLR\n3 8\n\nS......G\n\n2\... | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
class state {
public:
int x, y;
vector<int> ma;
state(int _x, int _y, vector<int> m) {
x = _x;
y = _y;
ma.swap(m);
}
bool operator<(const state& a) const {
if (x != a.x) return x < a.x;
if (y != a.y) return y < a.y;
return ma < a.ma;
}
... |
p01329 Stolen Jewel | The jewel, a national treasure of the Kingdom of Pal, was stolen by bandits. As an adventurer, you heard the rumor and headed for the thief's hideout and managed to get the jewels back.
However, when I went to return the jewel to the castle of the Kingdom of Pal, the guard of the castle said, "My king has not complete... | {
"input": [
"6 7\n.......\n...#...\n...#.S.\n...###.\n.G.....\n.......\n2\nLL\nDD",
"7 6\n......\n.####.\n.####.\n...S#.\n...##.\n...##.\n.....G\n3\nLD\nDD\nLLL\n7 8\nS#......\n.#.####.\n.#.#G.#.\n.#.##.#.\n.#....#.\n.######.\n........\n8\nDDDD\nDDDU\nUUUU\nUUUD\nRRRR\nRRRL\nLLLL\nLLLR\n3 8\n\nS......G\n\n2\... | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
static const double EPS = 1e-9;
static const double PI = acos(-1.0);
struct Point {
int x;
int y;
int cost;
int str;
Point(int x, int y, int cost, int str) : x(x), y(y), cost(cost), str(str) {
;
}
};
int w, h, p;
set<int> prefix;
set<int> ban;
set<string> pa... |
p01329 Stolen Jewel | The jewel, a national treasure of the Kingdom of Pal, was stolen by bandits. As an adventurer, you heard the rumor and headed for the thief's hideout and managed to get the jewels back.
However, when I went to return the jewel to the castle of the Kingdom of Pal, the guard of the castle said, "My king has not complete... | {
"input": [
"6 7\n.......\n...#...\n...#.S.\n...###.\n.G.....\n.......\n2\nLL\nDD",
"7 6\n......\n.####.\n.####.\n...S#.\n...##.\n...##.\n.....G\n3\nLD\nDD\nLLL\n7 8\nS#......\n.#.####.\n.#.#G.#.\n.#.##.#.\n.#....#.\n.######.\n........\n8\nDDDD\nDDDU\nUUUU\nUUUD\nRRRR\nRRRL\nLLLL\nLLLR\n3 8\n\nS......G\n\n2\... | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
const string ds = "URDL";
const int dx[4] = {0, 1, 0, -1};
const int dy[4] = {-1, 0, 1, 0};
int n, m;
vector<string> g;
struct AhoCorasick {
static const int max_n = 101;
static const int alph_size = 26;
struct node_t {
int parent, suffLink;
char charFromParen... |
p01329 Stolen Jewel | The jewel, a national treasure of the Kingdom of Pal, was stolen by bandits. As an adventurer, you heard the rumor and headed for the thief's hideout and managed to get the jewels back.
However, when I went to return the jewel to the castle of the Kingdom of Pal, the guard of the castle said, "My king has not complete... | {
"input": [
"6 7\n.......\n...#...\n...#.S.\n...###.\n.G.....\n.......\n2\nLL\nDD",
"7 6\n......\n.####.\n.####.\n...S#.\n...##.\n...##.\n.....G\n3\nLD\nDD\nLLL\n7 8\nS#......\n.#.####.\n.#.#G.#.\n.#.##.#.\n.#....#.\n.######.\n........\n8\nDDDD\nDDDU\nUUUU\nUUUD\nRRRR\nRRRL\nLLLL\nLLLR\n3 8\n\nS......G\n\n2\... | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
struct PMA {
bool isRoot = false;
set<int> matched;
map<char, PMA*> nexts;
PMA* faild;
PMA() : matched(), nexts(), faild() {}
~PMA() {
for (auto&& n : nexts) {
delete n.second;
}
}
static PMA build(const vector<string>& patterns) {
PMA root... |
p01329 Stolen Jewel | The jewel, a national treasure of the Kingdom of Pal, was stolen by bandits. As an adventurer, you heard the rumor and headed for the thief's hideout and managed to get the jewels back.
However, when I went to return the jewel to the castle of the Kingdom of Pal, the guard of the castle said, "My king has not complete... | {
"input": [
"6 7\n.......\n...#...\n...#.S.\n...###.\n.G.....\n.......\n2\nLL\nDD",
"7 6\n......\n.####.\n.####.\n...S#.\n...##.\n...##.\n.....G\n3\nLD\nDD\nLLL\n7 8\nS#......\n.#.####.\n.#.#G.#.\n.#.##.#.\n.#....#.\n.######.\n........\n8\nDDDD\nDDDU\nUUUU\nUUUD\nRRRR\nRRRL\nLLLL\nLLLR\n3 8\n\nS......G\n\n2\... | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
int tx[] = {0, 1, 0, -1};
int ty[] = {-1, 0, 1, 0};
static const double EPS = 1e-8;
const static char dir[4] = {'U', 'R', 'D', 'L'};
const static string dir_str[4] = {"U", "R", "D", "L"};
namespace AhoCorasick {
class Node;
class SearchMachine;
struct MatchingResult {
map... |
p01329 Stolen Jewel | The jewel, a national treasure of the Kingdom of Pal, was stolen by bandits. As an adventurer, you heard the rumor and headed for the thief's hideout and managed to get the jewels back.
However, when I went to return the jewel to the castle of the Kingdom of Pal, the guard of the castle said, "My king has not complete... | {
"input": [
"6 7\n.......\n...#...\n...#.S.\n...###.\n.G.....\n.......\n2\nLL\nDD",
"7 6\n......\n.####.\n.####.\n...S#.\n...##.\n...##.\n.....G\n3\nLD\nDD\nLLL\n7 8\nS#......\n.#.####.\n.#.#G.#.\n.#.##.#.\n.#....#.\n.######.\n........\n8\nDDDD\nDDDU\nUUUU\nUUUD\nRRRR\nRRRL\nLLLL\nLLLR\n3 8\n\nS......G\n\n2\... | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
struct S {
int t;
int y, x;
int h;
};
int main() {
for (int N, M; cin >> N >> M, N;) {
char g[50][51];
int sy, sx;
for (int i = 0; i < N; i++) {
cin >> g[i];
for (int j = 0; j < M; j++) {
if (g[i][j] == 'S') {
sy = i;
... |
p01329 Stolen Jewel | The jewel, a national treasure of the Kingdom of Pal, was stolen by bandits. As an adventurer, you heard the rumor and headed for the thief's hideout and managed to get the jewels back.
However, when I went to return the jewel to the castle of the Kingdom of Pal, the guard of the castle said, "My king has not complete... | {
"input": [
"6 7\n.......\n...#...\n...#.S.\n...###.\n.G.....\n.......\n2\nLL\nDD",
"7 6\n......\n.####.\n.####.\n...S#.\n...##.\n...##.\n.....G\n3\nLD\nDD\nLLL\n7 8\nS#......\n.#.####.\n.#.#G.#.\n.#.##.#.\n.#....#.\n.######.\n........\n8\nDDDD\nDDDU\nUUUU\nUUUD\nRRRR\nRRRL\nLLLL\nLLLR\n3 8\n\nS......G\n\n2\... | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
int W, H;
char map[55][55];
int P;
string S[15];
int sx, sy, gx, gy;
vector<string> vec;
int Next[105][4];
bool ng[105][4];
const int dx[] = {1, 0, -1, 0}, dy[] = {0, -1, 0, 1};
const char c[] = {'R', 'U', 'L', 'D'};
int dist[55][55][105];
int bfs() {
for (int x = 1; x <=... |
p01329 Stolen Jewel | The jewel, a national treasure of the Kingdom of Pal, was stolen by bandits. As an adventurer, you heard the rumor and headed for the thief's hideout and managed to get the jewels back.
However, when I went to return the jewel to the castle of the Kingdom of Pal, the guard of the castle said, "My king has not complete... | {
"input": [
"6 7\n.......\n...#...\n...#.S.\n...###.\n.G.....\n.......\n2\nLL\nDD",
"7 6\n......\n.####.\n.####.\n...S#.\n...##.\n...##.\n.....G\n3\nLD\nDD\nLLL\n7 8\nS#......\n.#.####.\n.#.#G.#.\n.#.##.#.\n.#....#.\n.######.\n........\n8\nDDDD\nDDDU\nUUUU\nUUUD\nRRRR\nRRRL\nLLLL\nLLLR\n3 8\n\nS......G\n\n2\... | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
enum DIR {
North,
East,
South,
West,
};
struct Node {
int num, parent_id, children[4], suffix_link, depth;
bool finish_FLG;
DIR pattern[10];
};
struct Data {
void set(int arg_row, int arg_col) {
row = arg_row;
col = arg_col;
}
int row, col;
};
st... |
p01329 Stolen Jewel | The jewel, a national treasure of the Kingdom of Pal, was stolen by bandits. As an adventurer, you heard the rumor and headed for the thief's hideout and managed to get the jewels back.
However, when I went to return the jewel to the castle of the Kingdom of Pal, the guard of the castle said, "My king has not complete... | {
"input": [
"6 7\n.......\n...#...\n...#.S.\n...###.\n.G.....\n.......\n2\nLL\nDD",
"7 6\n......\n.####.\n.####.\n...S#.\n...##.\n...##.\n.....G\n3\nLD\nDD\nLLL\n7 8\nS#......\n.#.####.\n.#.#G.#.\n.#.##.#.\n.#....#.\n.######.\n........\n8\nDDDD\nDDDU\nUUUU\nUUUD\nRRRR\nRRRL\nLLLL\nLLLR\n3 8\n\nS......G\n\n2\... | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include<iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<queue>
#include<cassert>
#include<set>
#define INF (1<<29)
using namespace std;
const string ds="URDL";
const int dx[4]={0,1,0,-1};
const int dy[4]={-1,0,1,0};
int n,m;
vector<string>g;
struct AhoCorasick{
static const int max_n =10... |
p01329 Stolen Jewel | The jewel, a national treasure of the Kingdom of Pal, was stolen by bandits. As an adventurer, you heard the rumor and headed for the thief's hideout and managed to get the jewels back.
However, when I went to return the jewel to the castle of the Kingdom of Pal, the guard of the castle said, "My king has not complete... | {
"input": [
"6 7\n.......\n...#...\n...#.S.\n...###.\n.G.....\n.......\n2\nLL\nDD",
"7 6\n......\n.####.\n.####.\n...S#.\n...##.\n...##.\n.....G\n3\nLD\nDD\nLLL\n7 8\nS#......\n.#.####.\n.#.#G.#.\n.#.##.#.\n.#....#.\n.######.\n........\n8\nDDDD\nDDDU\nUUUU\nUUUD\nRRRR\nRRRL\nLLLL\nLLLR\n3 8\n\nS......G\n\n2\... | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
const string ds = "URDL";
const int dx[4] = {0, 1, 0, -1};
const int dy[4] = {-1, 0, 1, 0};
int n, m;
vector<string> g;
struct AhoCorasick {
static const int alph_size = 26;
struct node_t {
int parent, suffLink;
char charFromParent;
int children[alph_size];
... |
p01329 Stolen Jewel | The jewel, a national treasure of the Kingdom of Pal, was stolen by bandits. As an adventurer, you heard the rumor and headed for the thief's hideout and managed to get the jewels back.
However, when I went to return the jewel to the castle of the Kingdom of Pal, the guard of the castle said, "My king has not complete... | {
"input": [
"6 7\n.......\n...#...\n...#.S.\n...###.\n.G.....\n.......\n2\nLL\nDD",
"7 6\n......\n.####.\n.####.\n...S#.\n...##.\n...##.\n.....G\n3\nLD\nDD\nLLL\n7 8\nS#......\n.#.####.\n.#.#G.#.\n.#.##.#.\n.#....#.\n.######.\n........\n8\nDDDD\nDDDU\nUUUU\nUUUD\nRRRR\nRRRL\nLLLL\nLLLR\n3 8\n\nS......G\n\n2\... | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
int tx[] = {0, 1, 0, -1};
int ty[] = {-1, 0, 1, 0};
static const double EPS = 1e-8;
const static char dir[4] = {'U', 'R', 'D', 'L'};
const static string dir_str[4] = {"U", "R", "D", "L"};
namespace AhoCorasick {
class Node;
class SearchMachine;
struct MatchingResult {
map... |
p01329 Stolen Jewel | The jewel, a national treasure of the Kingdom of Pal, was stolen by bandits. As an adventurer, you heard the rumor and headed for the thief's hideout and managed to get the jewels back.
However, when I went to return the jewel to the castle of the Kingdom of Pal, the guard of the castle said, "My king has not complete... | {
"input": [
"6 7\n.......\n...#...\n...#.S.\n...###.\n.G.....\n.......\n2\nLL\nDD",
"7 6\n......\n.####.\n.####.\n...S#.\n...##.\n...##.\n.....G\n3\nLD\nDD\nLLL\n7 8\nS#......\n.#.####.\n.#.#G.#.\n.#.##.#.\n.#....#.\n.######.\n........\n8\nDDDD\nDDDU\nUUUU\nUUUD\nRRRR\nRRRL\nLLLL\nLLLR\n3 8\n\nS......G\n\n2\... | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
int tx[] = {0, 1, 0, -1};
int ty[] = {-1, 0, 1, 0};
static const double EPS = 1e-8;
const static char dir[4] = {'U', 'R', 'D', 'L'};
const static string dir_str[4] = {"U", "R", "D", "L"};
static char dir_idx[256];
class Nodes {
public:
class Nodes* children[4];
bool ha... |
p01329 Stolen Jewel | The jewel, a national treasure of the Kingdom of Pal, was stolen by bandits. As an adventurer, you heard the rumor and headed for the thief's hideout and managed to get the jewels back.
However, when I went to return the jewel to the castle of the Kingdom of Pal, the guard of the castle said, "My king has not complete... | {
"input": [
"6 7\n.......\n...#...\n...#.S.\n...###.\n.G.....\n.......\n2\nLL\nDD",
"7 6\n......\n.####.\n.####.\n...S#.\n...##.\n...##.\n.....G\n3\nLD\nDD\nLLL\n7 8\nS#......\n.#.####.\n.#.#G.#.\n.#.##.#.\n.#....#.\n.######.\n........\n8\nDDDD\nDDDU\nUUUU\nUUUD\nRRRR\nRRRL\nLLLL\nLLLR\n3 8\n\nS......G\n\n2\... | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
int tx[] = {0, 1, 0, -1};
int ty[] = {-1, 0, 1, 0};
static const double EPS = 1e-8;
const static char dir[4] = {'U', 'R', 'D', 'L'};
const static string dir_str[4] = {"U", "R", "D", "L"};
class Nodes {
public:
class Nodes* children[4];
bool has_word;
Nodes() : has_wo... |
p01329 Stolen Jewel | The jewel, a national treasure of the Kingdom of Pal, was stolen by bandits. As an adventurer, you heard the rumor and headed for the thief's hideout and managed to get the jewels back.
However, when I went to return the jewel to the castle of the Kingdom of Pal, the guard of the castle said, "My king has not complete... | {
"input": [
"6 7\n.......\n...#...\n...#.S.\n...###.\n.G.....\n.......\n2\nLL\nDD",
"7 6\n......\n.####.\n.####.\n...S#.\n...##.\n...##.\n.....G\n3\nLD\nDD\nLLL\n7 8\nS#......\n.#.####.\n.#.#G.#.\n.#.##.#.\n.#....#.\n.######.\n........\n8\nDDDD\nDDDU\nUUUU\nUUUD\nRRRR\nRRRL\nLLLL\nLLLR\n3 8\n\nS......G\n\n2\... | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
class state {
public:
int x, y;
vector<int> ma;
state(int _x, int _y, vector<int> m) {
x = _x;
y = _y;
ma.swap(m);
}
bool operator<(const state& a) const {
if (x != a.x) return x < a.x;
if (y != a.y) return y < a.y;
return ma < a.ma;
}
... |
p01329 Stolen Jewel | The jewel, a national treasure of the Kingdom of Pal, was stolen by bandits. As an adventurer, you heard the rumor and headed for the thief's hideout and managed to get the jewels back.
However, when I went to return the jewel to the castle of the Kingdom of Pal, the guard of the castle said, "My king has not complete... | {
"input": [
"6 7\n.......\n...#...\n...#.S.\n...###.\n.G.....\n.......\n2\nLL\nDD",
"7 6\n......\n.####.\n.####.\n...S#.\n...##.\n...##.\n.....G\n3\nLD\nDD\nLLL\n7 8\nS#......\n.#.####.\n.#.#G.#.\n.#.##.#.\n.#....#.\n.######.\n........\n8\nDDDD\nDDDU\nUUUU\nUUUD\nRRRR\nRRRL\nLLLL\nLLLR\n3 8\n\nS......G\n\n2\... | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
const string ds = "URDL";
const int dx[4] = {0, 1, 0, -1};
const int dy[4] = {-1, 0, 1, 0};
int n, m;
vector<string> g;
struct AhoCorasick {
static const int max_n = 101;
static const int alph_size = 26;
struct node_t {
int parent, suffLink;
char charFromParen... |
p01329 Stolen Jewel | The jewel, a national treasure of the Kingdom of Pal, was stolen by bandits. As an adventurer, you heard the rumor and headed for the thief's hideout and managed to get the jewels back.
However, when I went to return the jewel to the castle of the Kingdom of Pal, the guard of the castle said, "My king has not complete... | {
"input": [
"6 7\n.......\n...#...\n...#.S.\n...###.\n.G.....\n.......\n2\nLL\nDD",
"7 6\n......\n.####.\n.####.\n...S#.\n...##.\n...##.\n.....G\n3\nLD\nDD\nLLL\n7 8\nS#......\n.#.####.\n.#.#G.#.\n.#.##.#.\n.#....#.\n.######.\n........\n8\nDDDD\nDDDU\nUUUU\nUUUD\nRRRR\nRRRL\nLLLL\nLLLR\n3 8\n\nS......G\n\n2\... | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
const int _dx[] = {0, 1, 0, -1};
const int _dy[] = {-1, 0, 1, 0};
set<string> memo[50][50];
int main() {
const char *ldru = "URDL";
int w, h;
while (~scanf("%d%d ", &h, &w)) {
char buff[64][64];
int sx, sy;
int gx, gy;
for (int i = 0; i < (int)(h); i++... |
p01329 Stolen Jewel | The jewel, a national treasure of the Kingdom of Pal, was stolen by bandits. As an adventurer, you heard the rumor and headed for the thief's hideout and managed to get the jewels back.
However, when I went to return the jewel to the castle of the Kingdom of Pal, the guard of the castle said, "My king has not complete... | {
"input": [
"6 7\n.......\n...#...\n...#.S.\n...###.\n.G.....\n.......\n2\nLL\nDD",
"7 6\n......\n.####.\n.####.\n...S#.\n...##.\n...##.\n.....G\n3\nLD\nDD\nLLL\n7 8\nS#......\n.#.####.\n.#.#G.#.\n.#.##.#.\n.#....#.\n.######.\n........\n8\nDDDD\nDDDU\nUUUU\nUUUD\nRRRR\nRRRL\nLLLL\nLLLR\n3 8\n\nS......G\n\n2\... | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
int tx[] = {0, 1, 0, -1};
int ty[] = {-1, 0, 1, 0};
static const double EPS = 1e-8;
const static char dir[4] = {'U', 'R', 'D', 'L'};
const static string dir_str[4] = {"U", "R", "D", "L"};
namespace AhoCorasick {
class Node;
class SearchMachine;
}; // namespace AhoCorasick
... |
p01329 Stolen Jewel | The jewel, a national treasure of the Kingdom of Pal, was stolen by bandits. As an adventurer, you heard the rumor and headed for the thief's hideout and managed to get the jewels back.
However, when I went to return the jewel to the castle of the Kingdom of Pal, the guard of the castle said, "My king has not complete... | {
"input": [
"6 7\n.......\n...#...\n...#.S.\n...###.\n.G.....\n.......\n2\nLL\nDD",
"7 6\n......\n.####.\n.####.\n...S#.\n...##.\n...##.\n.....G\n3\nLD\nDD\nLLL\n7 8\nS#......\n.#.####.\n.#.#G.#.\n.#.##.#.\n.#....#.\n.######.\n........\n8\nDDDD\nDDDU\nUUUU\nUUUD\nRRRR\nRRRL\nLLLL\nLLLR\n3 8\n\nS......G\n\n2\... | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
int tx[] = {0, 1, 0, -1};
int ty[] = {-1, 0, 1, 0};
static const double EPS = 1e-8;
const static char dir[4] = {'U', 'R', 'D', 'L'};
const static string dir_str[4] = {"U", "R", "D", "L"};
class Nodes {
public:
class Nodes* children[4];
bool has_word;
Nodes() : has_wo... |
p01329 Stolen Jewel | The jewel, a national treasure of the Kingdom of Pal, was stolen by bandits. As an adventurer, you heard the rumor and headed for the thief's hideout and managed to get the jewels back.
However, when I went to return the jewel to the castle of the Kingdom of Pal, the guard of the castle said, "My king has not complete... | {
"input": [
"6 7\n.......\n...#...\n...#.S.\n...###.\n.G.....\n.......\n2\nLL\nDD",
"7 6\n......\n.####.\n.####.\n...S#.\n...##.\n...##.\n.....G\n3\nLD\nDD\nLLL\n7 8\nS#......\n.#.####.\n.#.#G.#.\n.#.##.#.\n.#....#.\n.######.\n........\n8\nDDDD\nDDDU\nUUUU\nUUUD\nRRRR\nRRRL\nLLLL\nLLLR\n3 8\n\nS......G\n\n2\... | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
struct S {
int y, x, t;
vector<int> v;
};
int main() {
for (int N, M; cin >> N >> M, N;) {
char g[50][51];
int y, x;
for (int i = 0; i < N; i++) {
cin >> g[i];
for (int j = 0; j < M; j++) {
if (g[i][j] == 'S') {
y = i;
... |
p01329 Stolen Jewel | The jewel, a national treasure of the Kingdom of Pal, was stolen by bandits. As an adventurer, you heard the rumor and headed for the thief's hideout and managed to get the jewels back.
However, when I went to return the jewel to the castle of the Kingdom of Pal, the guard of the castle said, "My king has not complete... | {
"input": [
"6 7\n.......\n...#...\n...#.S.\n...###.\n.G.....\n.......\n2\nLL\nDD",
"7 6\n......\n.####.\n.####.\n...S#.\n...##.\n...##.\n.....G\n3\nLD\nDD\nLLL\n7 8\nS#......\n.#.####.\n.#.#G.#.\n.#.##.#.\n.#....#.\n.######.\n........\n8\nDDDD\nDDDU\nUUUU\nUUUD\nRRRR\nRRRL\nLLLL\nLLLR\n3 8\n\nS......G\n\n2\... | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
const string ds = "URDL";
const int dx[4] = {0, 1, 0, -1};
const int dy[4] = {-1, 0, 1, 0};
int n, m;
vector<string> g;
struct AhoCorasick {
static const int alph_size = 26;
struct node_t {
int parent, suffLink;
char charFromParent;
int children[alph_size];
... |
p01329 Stolen Jewel | The jewel, a national treasure of the Kingdom of Pal, was stolen by bandits. As an adventurer, you heard the rumor and headed for the thief's hideout and managed to get the jewels back.
However, when I went to return the jewel to the castle of the Kingdom of Pal, the guard of the castle said, "My king has not complete... | {
"input": [
"6 7\n.......\n...#...\n...#.S.\n...###.\n.G.....\n.......\n2\nLL\nDD",
"7 6\n......\n.####.\n.####.\n...S#.\n...##.\n...##.\n.....G\n3\nLD\nDD\nLLL\n7 8\nS#......\n.#.####.\n.#.#G.#.\n.#.##.#.\n.#....#.\n.######.\n........\n8\nDDDD\nDDDU\nUUUU\nUUUD\nRRRR\nRRRL\nLLLL\nLLLR\n3 8\n\nS......G\n\n2\... | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
static const int MAX = 50;
static const int PMAX = 11;
static const string DT = "URDL";
static const int di[4] = {-1, 0, 1, 0};
static const int dj[4] = {0, 1, 0, -1};
int H, W, np;
char G[MAX][MAX];
string P[PMAX];
class State {
public:
short pos, M[PMAX];
State() {
... |
p01329 Stolen Jewel | The jewel, a national treasure of the Kingdom of Pal, was stolen by bandits. As an adventurer, you heard the rumor and headed for the thief's hideout and managed to get the jewels back.
However, when I went to return the jewel to the castle of the Kingdom of Pal, the guard of the castle said, "My king has not complete... | {
"input": [
"6 7\n.......\n...#...\n...#.S.\n...###.\n.G.....\n.......\n2\nLL\nDD",
"7 6\n......\n.####.\n.####.\n...S#.\n...##.\n...##.\n.....G\n3\nLD\nDD\nLLL\n7 8\nS#......\n.#.####.\n.#.#G.#.\n.#.##.#.\n.#....#.\n.######.\n........\n8\nDDDD\nDDDU\nUUUU\nUUUD\nRRRR\nRRRL\nLLLL\nLLLR\n3 8\n\nS......G\n\n2\... | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
class state {
public:
int n, x, y;
vector<int> route;
state(int n = 0, int x = 0, int y = 0) : n(n), x(x), y(y) {}
};
int dx[] = {0, 1, 0, -1};
int dy[] = {-1, 0, 1, 0};
int main() {
int n, m;
while (cin >> n >> m && n && m) {
bool G[50][50];
int gy, gx, ... |
p01329 Stolen Jewel | The jewel, a national treasure of the Kingdom of Pal, was stolen by bandits. As an adventurer, you heard the rumor and headed for the thief's hideout and managed to get the jewels back.
However, when I went to return the jewel to the castle of the Kingdom of Pal, the guard of the castle said, "My king has not complete... | {
"input": [
"6 7\n.......\n...#...\n...#.S.\n...###.\n.G.....\n.......\n2\nLL\nDD",
"7 6\n......\n.####.\n.####.\n...S#.\n...##.\n...##.\n.....G\n3\nLD\nDD\nLLL\n7 8\nS#......\n.#.####.\n.#.#G.#.\n.#.##.#.\n.#....#.\n.######.\n........\n8\nDDDD\nDDDU\nUUUU\nUUUD\nRRRR\nRRRL\nLLLL\nLLLR\n3 8\n\nS......G\n\n2\... | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
enum DIR {
North,
East,
South,
West,
};
struct Node {
int num, parent_id, children[4], suffix_link, depth;
bool finish_FLG;
DIR pattern[10];
};
struct Data {
void set(int arg_row, int arg_col) {
row = arg_row;
col = arg_col;
}
int row, col;
};
st... |
p01329 Stolen Jewel | The jewel, a national treasure of the Kingdom of Pal, was stolen by bandits. As an adventurer, you heard the rumor and headed for the thief's hideout and managed to get the jewels back.
However, when I went to return the jewel to the castle of the Kingdom of Pal, the guard of the castle said, "My king has not complete... | {
"input": [
"6 7\n.......\n...#...\n...#.S.\n...###.\n.G.....\n.......\n2\nLL\nDD",
"7 6\n......\n.####.\n.####.\n...S#.\n...##.\n...##.\n.....G\n3\nLD\nDD\nLLL\n7 8\nS#......\n.#.####.\n.#.#G.#.\n.#.##.#.\n.#....#.\n.######.\n........\n8\nDDDD\nDDDU\nUUUU\nUUUD\nRRRR\nRRRL\nLLLL\nLLLR\n3 8\n\nS......G\n\n2\... | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
const int dx[] = {-1, 0, 1, 0}, dy[] = {0, 1, 0, -1};
const char dd[] = {'L', 'D', 'R', 'U'};
struct Trie {
bool leaf;
Trie *node[256];
Trie() {
leaf = false;
for (int i = 0; i < 256; i++) {
node[i] = (Trie *)0;
}
}
void insert(const string &str)... |
p01329 Stolen Jewel | The jewel, a national treasure of the Kingdom of Pal, was stolen by bandits. As an adventurer, you heard the rumor and headed for the thief's hideout and managed to get the jewels back.
However, when I went to return the jewel to the castle of the Kingdom of Pal, the guard of the castle said, "My king has not complete... | {
"input": [
"6 7\n.......\n...#...\n...#.S.\n...###.\n.G.....\n.......\n2\nLL\nDD",
"7 6\n......\n.####.\n.####.\n...S#.\n...##.\n...##.\n.....G\n3\nLD\nDD\nLLL\n7 8\nS#......\n.#.####.\n.#.#G.#.\n.#.##.#.\n.#....#.\n.######.\n........\n8\nDDDD\nDDDU\nUUUU\nUUUD\nRRRR\nRRRL\nLLLL\nLLLR\n3 8\n\nS......G\n\n2\... | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
int tx[] = {0, 1, 0, -1};
int ty[] = {-1, 0, 1, 0};
static const double EPS = 1e-8;
const static char dir[4] = {'U', 'R', 'D', 'L'};
const static string dir_str[4] = {"U", "R", "D", "L"};
class Nodes {
public:
class Nodes* children[256];
bool has_word;
Nodes() : has_... |
p01329 Stolen Jewel | The jewel, a national treasure of the Kingdom of Pal, was stolen by bandits. As an adventurer, you heard the rumor and headed for the thief's hideout and managed to get the jewels back.
However, when I went to return the jewel to the castle of the Kingdom of Pal, the guard of the castle said, "My king has not complete... | {
"input": [
"6 7\n.......\n...#...\n...#.S.\n...###.\n.G.....\n.......\n2\nLL\nDD",
"7 6\n......\n.####.\n.####.\n...S#.\n...##.\n...##.\n.....G\n3\nLD\nDD\nLLL\n7 8\nS#......\n.#.####.\n.#.#G.#.\n.#.##.#.\n.#....#.\n.######.\n........\n8\nDDDD\nDDDU\nUUUU\nUUUD\nRRRR\nRRRL\nLLLL\nLLLR\n3 8\n\nS......G\n\n2\... | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int i, j;
int h, w;
while (cin >> h >> w, h || w) {
int a[52][52], sx, sy, tx, ty;
memset(a, -1, sizeof(a));
for (i = 1; i < h + 1; i++) {
for (j = 1; j < w + 1; j++) {
char s;
cin >> s;
if (s != '#') {
... |
p01329 Stolen Jewel | The jewel, a national treasure of the Kingdom of Pal, was stolen by bandits. As an adventurer, you heard the rumor and headed for the thief's hideout and managed to get the jewels back.
However, when I went to return the jewel to the castle of the Kingdom of Pal, the guard of the castle said, "My king has not complete... | {
"input": [
"6 7\n.......\n...#...\n...#.S.\n...###.\n.G.....\n.......\n2\nLL\nDD",
"7 6\n......\n.####.\n.####.\n...S#.\n...##.\n...##.\n.....G\n3\nLD\nDD\nLLL\n7 8\nS#......\n.#.####.\n.#.#G.#.\n.#.##.#.\n.#....#.\n.######.\n........\n8\nDDDD\nDDDU\nUUUU\nUUUD\nRRRR\nRRRL\nLLLL\nLLLR\n3 8\n\nS......G\n\n2\... | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
const string ds = "URDL";
const int dx[4] = {0, 1, 0, -1};
const int dy[4] = {-1, 0, 1, 0};
int n, m;
vector<string> g;
struct AhoCorasick {
static const int max_n = 101;
static const int alph_size = 26;
struct node_t {
int parent, suffLink;
char charFromParen... |
p01329 Stolen Jewel | The jewel, a national treasure of the Kingdom of Pal, was stolen by bandits. As an adventurer, you heard the rumor and headed for the thief's hideout and managed to get the jewels back.
However, when I went to return the jewel to the castle of the Kingdom of Pal, the guard of the castle said, "My king has not complete... | {
"input": [
"6 7\n.......\n...#...\n...#.S.\n...###.\n.G.....\n.......\n2\nLL\nDD",
"7 6\n......\n.####.\n.####.\n...S#.\n...##.\n...##.\n.....G\n3\nLD\nDD\nLLL\n7 8\nS#......\n.#.####.\n.#.#G.#.\n.#.##.#.\n.#....#.\n.######.\n........\n8\nDDDD\nDDDU\nUUUU\nUUUD\nRRRR\nRRRL\nLLLL\nLLLR\n3 8\n\nS......G\n\n2\... | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
const int inf = 1e9;
const int64_t inf64 = 1e18;
const double eps = 1e-9;
template <typename T>
ostream& operator<<(ostream& os, const vector<T>& vec) {
os << "[";
for (const auto& v : vec) {
os << v << ",";
}
os << "]";
return os;
}
using i64 = int64_t;
const... |
p01329 Stolen Jewel | The jewel, a national treasure of the Kingdom of Pal, was stolen by bandits. As an adventurer, you heard the rumor and headed for the thief's hideout and managed to get the jewels back.
However, when I went to return the jewel to the castle of the Kingdom of Pal, the guard of the castle said, "My king has not complete... | {
"input": [
"6 7\n.......\n...#...\n...#.S.\n...###.\n.G.....\n.......\n2\nLL\nDD",
"7 6\n......\n.####.\n.####.\n...S#.\n...##.\n...##.\n.....G\n3\nLD\nDD\nLLL\n7 8\nS#......\n.#.####.\n.#.#G.#.\n.#.##.#.\n.#....#.\n.######.\n........\n8\nDDDD\nDDDU\nUUUU\nUUUD\nRRRR\nRRRL\nLLLL\nLLLR\n3 8\n\nS......G\n\n2\... | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
class state {
public:
int x, y;
vector<int> ma;
state(int _x, int _y, vector<int> m) {
x = _x;
y = _y;
ma.swap(m);
}
bool operator<(const state& a) const {
if (x != a.x) return x < a.x;
if (y != a.y) return y < a.y;
return ma < a.ma;
}
... |
p01329 Stolen Jewel | The jewel, a national treasure of the Kingdom of Pal, was stolen by bandits. As an adventurer, you heard the rumor and headed for the thief's hideout and managed to get the jewels back.
However, when I went to return the jewel to the castle of the Kingdom of Pal, the guard of the castle said, "My king has not complete... | {
"input": [
"6 7\n.......\n...#...\n...#.S.\n...###.\n.G.....\n.......\n2\nLL\nDD",
"7 6\n......\n.####.\n.####.\n...S#.\n...##.\n...##.\n.....G\n3\nLD\nDD\nLLL\n7 8\nS#......\n.#.####.\n.#.#G.#.\n.#.##.#.\n.#....#.\n.######.\n........\n8\nDDDD\nDDDU\nUUUU\nUUUD\nRRRR\nRRRL\nLLLL\nLLLR\n3 8\n\nS......G\n\n2\... | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
class Sit {
public:
int x, y;
string cur;
};
class AhoCorasick {
private:
static const int MAX_V = 1000001;
private:
map<string, int> _dict;
int _vertex;
map<string, set<string> > _stepPrv;
map<string, string> _stepBack;
set<string> _dictStr;
public:
... |
p01329 Stolen Jewel | The jewel, a national treasure of the Kingdom of Pal, was stolen by bandits. As an adventurer, you heard the rumor and headed for the thief's hideout and managed to get the jewels back.
However, when I went to return the jewel to the castle of the Kingdom of Pal, the guard of the castle said, "My king has not complete... | {
"input": [
"6 7\n.......\n...#...\n...#.S.\n...###.\n.G.....\n.......\n2\nLL\nDD",
"7 6\n......\n.####.\n.####.\n...S#.\n...##.\n...##.\n.....G\n3\nLD\nDD\nLLL\n7 8\nS#......\n.#.####.\n.#.#G.#.\n.#.##.#.\n.#....#.\n.######.\n........\n8\nDDDD\nDDDU\nUUUU\nUUUD\nRRRR\nRRRL\nLLLL\nLLLR\n3 8\n\nS......G\n\n2\... | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
int NODE_NUM;
struct Node {
map<char, Node*> next;
Node* fail;
vector<int> match;
int node_id;
Node() : fail(NULL) { node_id = NODE_NUM++; }
~Node() {
for (auto p : next)
if (p.second) delete p.second;
}
};
Node* build(vector<string> pattens) {
Nod... |
p01329 Stolen Jewel | The jewel, a national treasure of the Kingdom of Pal, was stolen by bandits. As an adventurer, you heard the rumor and headed for the thief's hideout and managed to get the jewels back.
However, when I went to return the jewel to the castle of the Kingdom of Pal, the guard of the castle said, "My king has not complete... | {
"input": [
"6 7\n.......\n...#...\n...#.S.\n...###.\n.G.....\n.......\n2\nLL\nDD",
"7 6\n......\n.####.\n.####.\n...S#.\n...##.\n...##.\n.....G\n3\nLD\nDD\nLLL\n7 8\nS#......\n.#.####.\n.#.#G.#.\n.#.##.#.\n.#....#.\n.######.\n........\n8\nDDDD\nDDDU\nUUUU\nUUUD\nRRRR\nRRRL\nLLLL\nLLLR\n3 8\n\nS......G\n\n2\... | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <stdio.h>
#include <cmath>
#include <algorithm>
#include <cfloat>
#include <stack>
#include <queue>
#include <vector>
#include <string>
#include <iostream>
#include <set>
#include <map>
#include <time.h>
typedef long long int ll;
typedef unsigned long long int ull;
#define BIG_NUM 2000000000
#define MOD 100000... |
p01329 Stolen Jewel | The jewel, a national treasure of the Kingdom of Pal, was stolen by bandits. As an adventurer, you heard the rumor and headed for the thief's hideout and managed to get the jewels back.
However, when I went to return the jewel to the castle of the Kingdom of Pal, the guard of the castle said, "My king has not complete... | {
"input": [
"6 7\n.......\n...#...\n...#.S.\n...###.\n.G.....\n.......\n2\nLL\nDD",
"7 6\n......\n.####.\n.####.\n...S#.\n...##.\n...##.\n.....G\n3\nLD\nDD\nLLL\n7 8\nS#......\n.#.####.\n.#.#G.#.\n.#.##.#.\n.#....#.\n.######.\n........\n8\nDDDD\nDDDU\nUUUU\nUUUD\nRRRR\nRRRL\nLLLL\nLLLR\n3 8\n\nS......G\n\n2\... | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
const string ds = "URDL";
const int dx[4] = {0, 1, 0, -1};
const int dy[4] = {-1, 0, 1, 0};
int n, m;
vector<string> g;
struct AhoCorasick {
static const int alph_size = 26;
struct node_t {
int parent, suffLink;
char charFromParent;
int children[alph_size];
... |
p01329 Stolen Jewel | The jewel, a national treasure of the Kingdom of Pal, was stolen by bandits. As an adventurer, you heard the rumor and headed for the thief's hideout and managed to get the jewels back.
However, when I went to return the jewel to the castle of the Kingdom of Pal, the guard of the castle said, "My king has not complete... | {
"input": [
"6 7\n.......\n...#...\n...#.S.\n...###.\n.G.....\n.......\n2\nLL\nDD",
"7 6\n......\n.####.\n.####.\n...S#.\n...##.\n...##.\n.....G\n3\nLD\nDD\nLLL\n7 8\nS#......\n.#.####.\n.#.#G.#.\n.#.##.#.\n.#....#.\n.######.\n........\n8\nDDDD\nDDDU\nUUUU\nUUUD\nRRRR\nRRRL\nLLLL\nLLLR\n3 8\n\nS......G\n\n2\... | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
static const int MAX = 50;
static const int PMAX = 11;
static const string DT = "URDL";
static const int di[4] = {-1, 0, 1, 0};
static const int dj[4] = {0, 1, 0, -1};
int H, W, np;
char G[MAX][MAX];
string P[PMAX];
class State {
public:
int pos, M[PMAX];
State() {
... |
p01329 Stolen Jewel | The jewel, a national treasure of the Kingdom of Pal, was stolen by bandits. As an adventurer, you heard the rumor and headed for the thief's hideout and managed to get the jewels back.
However, when I went to return the jewel to the castle of the Kingdom of Pal, the guard of the castle said, "My king has not complete... | {
"input": [
"6 7\n.......\n...#...\n...#.S.\n...###.\n.G.....\n.......\n2\nLL\nDD",
"7 6\n......\n.####.\n.####.\n...S#.\n...##.\n...##.\n.....G\n3\nLD\nDD\nLLL\n7 8\nS#......\n.#.####.\n.#.#G.#.\n.#.##.#.\n.#....#.\n.######.\n........\n8\nDDDD\nDDDU\nUUUU\nUUUD\nRRRR\nRRRL\nLLLL\nLLLR\n3 8\n\nS......G\n\n2\... | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
const string ds = "URDL";
const int dx[4] = {0, 1, 0, -1};
const int dy[4] = {-1, 0, 1, 0};
int n, m;
vector<string> g;
struct AhoCorasick {
static const int alph_size = 26;
struct node_t {
int parent, suffLink;
char charFromParent;
int children[alph_size];
... |
p01329 Stolen Jewel | The jewel, a national treasure of the Kingdom of Pal, was stolen by bandits. As an adventurer, you heard the rumor and headed for the thief's hideout and managed to get the jewels back.
However, when I went to return the jewel to the castle of the Kingdom of Pal, the guard of the castle said, "My king has not complete... | {
"input": [
"6 7\n.......\n...#...\n...#.S.\n...###.\n.G.....\n.......\n2\nLL\nDD",
"7 6\n......\n.####.\n.####.\n...S#.\n...##.\n...##.\n.....G\n3\nLD\nDD\nLLL\n7 8\nS#......\n.#.####.\n.#.#G.#.\n.#.##.#.\n.#....#.\n.######.\n........\n8\nDDDD\nDDDU\nUUUU\nUUUD\nRRRR\nRRRL\nLLLL\nLLLR\n3 8\n\nS......G\n\n2\... | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
int tx[] = {0, 1, 0, -1};
int ty[] = {-1, 0, 1, 0};
static const double EPS = 1e-8;
class Nodes {
public:
class Nodes* children[256];
bool has_word;
Nodes() : has_word(false) {
for (int i = 0; i < 256; i++) {
children[i] = NULL;
}
}
};
class Trie {
p... |
p01329 Stolen Jewel | The jewel, a national treasure of the Kingdom of Pal, was stolen by bandits. As an adventurer, you heard the rumor and headed for the thief's hideout and managed to get the jewels back.
However, when I went to return the jewel to the castle of the Kingdom of Pal, the guard of the castle said, "My king has not complete... | {
"input": [
"6 7\n.......\n...#...\n...#.S.\n...###.\n.G.....\n.......\n2\nLL\nDD",
"7 6\n......\n.####.\n.####.\n...S#.\n...##.\n...##.\n.....G\n3\nLD\nDD\nLLL\n7 8\nS#......\n.#.####.\n.#.#G.#.\n.#.##.#.\n.#....#.\n.######.\n........\n8\nDDDD\nDDDU\nUUUU\nUUUD\nRRRR\nRRRL\nLLLL\nLLLR\n3 8\n\nS......G\n\n2\... | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
const int inf = 1e9;
const int64_t inf64 = 1e18;
const double eps = 1e-9;
template <typename T>
ostream& operator<<(ostream& os, const vector<T>& vec) {
os << "[";
for (const auto& v : vec) {
os << v << ",";
}
os << "]";
return os;
}
using i64 = int64_t;
const... |
p01329 Stolen Jewel | The jewel, a national treasure of the Kingdom of Pal, was stolen by bandits. As an adventurer, you heard the rumor and headed for the thief's hideout and managed to get the jewels back.
However, when I went to return the jewel to the castle of the Kingdom of Pal, the guard of the castle said, "My king has not complete... | {
"input": [
"6 7\n.......\n...#...\n...#.S.\n...###.\n.G.....\n.......\n2\nLL\nDD",
"7 6\n......\n.####.\n.####.\n...S#.\n...##.\n...##.\n.....G\n3\nLD\nDD\nLLL\n7 8\nS#......\n.#.####.\n.#.#G.#.\n.#.##.#.\n.#....#.\n.######.\n........\n8\nDDDD\nDDDU\nUUUU\nUUUD\nRRRR\nRRRL\nLLLL\nLLLR\n3 8\n\nS......G\n\n2\... | {
"input": [],
"output": []
} | IN-CORRECT | cpp |
UTPC 2010
Stolen Jewel |
p01329 Stolen Jewel | The jewel, a national treasure of the Kingdom of Pal, was stolen by bandits. As an adventurer, you heard the rumor and headed for the thief's hideout and managed to get the jewels back.
However, when I went to return the jewel to the castle of the Kingdom of Pal, the guard of the castle said, "My king has not complete... | {
"input": [
"6 7\n.......\n...#...\n...#.S.\n...###.\n.G.....\n.......\n2\nLL\nDD",
"7 6\n......\n.####.\n.####.\n...S#.\n...##.\n...##.\n.....G\n3\nLD\nDD\nLLL\n7 8\nS#......\n.#.####.\n.#.#G.#.\n.#.##.#.\n.#....#.\n.######.\n........\n8\nDDDD\nDDDU\nUUUU\nUUUD\nRRRR\nRRRL\nLLLL\nLLLR\n3 8\n\nS......G\n\n2\... | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
class PMA {
int id;
bool tail;
PMA *failure;
PMA *next[256];
public:
PMA(int id = 0) : id(id), tail(false), failure(0) {
memset(next, 0, sizeof(next));
}
~PMA() {
for (int i = 0; i < 256; i++) {
if (next[i] && next[i] != this) delete next[i];
... |
p01329 Stolen Jewel | The jewel, a national treasure of the Kingdom of Pal, was stolen by bandits. As an adventurer, you heard the rumor and headed for the thief's hideout and managed to get the jewels back.
However, when I went to return the jewel to the castle of the Kingdom of Pal, the guard of the castle said, "My king has not complete... | {
"input": [
"6 7\n.......\n...#...\n...#.S.\n...###.\n.G.....\n.......\n2\nLL\nDD",
"7 6\n......\n.####.\n.####.\n...S#.\n...##.\n...##.\n.....G\n3\nLD\nDD\nLLL\n7 8\nS#......\n.#.####.\n.#.#G.#.\n.#.##.#.\n.#....#.\n.######.\n........\n8\nDDDD\nDDDU\nUUUU\nUUUD\nRRRR\nRRRL\nLLLL\nLLLR\n3 8\n\nS......G\n\n2\... | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
int tx[] = {0, 1, 0, -1};
int ty[] = {-1, 0, 1, 0};
static const double EPS = 1e-8;
const static char dir[4] = {'U', 'R', 'D', 'L'};
const static string dir_str[4] = {"U", "R", "D", "L"};
class Nodes {
public:
class Nodes* children[256];
bool has_word;
Nodes() : has_... |
p01329 Stolen Jewel | The jewel, a national treasure of the Kingdom of Pal, was stolen by bandits. As an adventurer, you heard the rumor and headed for the thief's hideout and managed to get the jewels back.
However, when I went to return the jewel to the castle of the Kingdom of Pal, the guard of the castle said, "My king has not complete... | {
"input": [
"6 7\n.......\n...#...\n...#.S.\n...###.\n.G.....\n.......\n2\nLL\nDD",
"7 6\n......\n.####.\n.####.\n...S#.\n...##.\n...##.\n.....G\n3\nLD\nDD\nLLL\n7 8\nS#......\n.#.####.\n.#.#G.#.\n.#.##.#.\n.#....#.\n.######.\n........\n8\nDDDD\nDDDU\nUUUU\nUUUD\nRRRR\nRRRL\nLLLL\nLLLR\n3 8\n\nS......G\n\n2\... | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
int tx[] = {0, 1, 0, -1};
int ty[] = {-1, 0, 1, 0};
static const double EPS = 1e-8;
class Nodes {
public:
class Nodes* children[256];
bool has_word;
Nodes() : has_word(false) {
for (int i = 0; i < 256; i++) {
children[i] = NULL;
}
}
};
class Trie {
p... |
p01329 Stolen Jewel | The jewel, a national treasure of the Kingdom of Pal, was stolen by bandits. As an adventurer, you heard the rumor and headed for the thief's hideout and managed to get the jewels back.
However, when I went to return the jewel to the castle of the Kingdom of Pal, the guard of the castle said, "My king has not complete... | {
"input": [
"6 7\n.......\n...#...\n...#.S.\n...###.\n.G.....\n.......\n2\nLL\nDD",
"7 6\n......\n.####.\n.####.\n...S#.\n...##.\n...##.\n.....G\n3\nLD\nDD\nLLL\n7 8\nS#......\n.#.####.\n.#.#G.#.\n.#.##.#.\n.#....#.\n.######.\n........\n8\nDDDD\nDDDU\nUUUU\nUUUD\nRRRR\nRRRL\nLLLL\nLLLR\n3 8\n\nS......G\n\n2\... | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
template <typename T>
struct Maybe {
T val;
bool valid;
Maybe() : valid(false) {}
Maybe(T &t) : val(t), valid(true) {}
T &operator=(const T &rv) {
val = rv;
valid = true;
return val;
}
operator T() { return valid ? val : T(); }
const T &fetch(con... |
p01329 Stolen Jewel | The jewel, a national treasure of the Kingdom of Pal, was stolen by bandits. As an adventurer, you heard the rumor and headed for the thief's hideout and managed to get the jewels back.
However, when I went to return the jewel to the castle of the Kingdom of Pal, the guard of the castle said, "My king has not complete... | {
"input": [
"6 7\n.......\n...#...\n...#.S.\n...###.\n.G.....\n.......\n2\nLL\nDD",
"7 6\n......\n.####.\n.####.\n...S#.\n...##.\n...##.\n.....G\n3\nLD\nDD\nLLL\n7 8\nS#......\n.#.####.\n.#.#G.#.\n.#.##.#.\n.#....#.\n.######.\n........\n8\nDDDD\nDDDU\nUUUU\nUUUD\nRRRR\nRRRL\nLLLL\nLLLR\n3 8\n\nS......G\n\n2\... | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
struct S {
int t;
int y, x;
string h;
};
int main() {
for (int N, M; cin >> N >> M, N;) {
char g[50][51];
int sy, sx;
for (int i = 0; i < N; i++) {
cin >> g[i];
for (int j = 0; j < M; j++) {
if (g[i][j] == 'S') {
sy = i;
... |
p01329 Stolen Jewel | The jewel, a national treasure of the Kingdom of Pal, was stolen by bandits. As an adventurer, you heard the rumor and headed for the thief's hideout and managed to get the jewels back.
However, when I went to return the jewel to the castle of the Kingdom of Pal, the guard of the castle said, "My king has not complete... | {
"input": [
"6 7\n.......\n...#...\n...#.S.\n...###.\n.G.....\n.......\n2\nLL\nDD",
"7 6\n......\n.####.\n.####.\n...S#.\n...##.\n...##.\n.....G\n3\nLD\nDD\nLLL\n7 8\nS#......\n.#.####.\n.#.#G.#.\n.#.##.#.\n.#....#.\n.######.\n........\n8\nDDDD\nDDDU\nUUUU\nUUUD\nRRRR\nRRRL\nLLLL\nLLLR\n3 8\n\nS......G\n\n2\... | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
int tx[] = {0, 1, 0, -1};
int ty[] = {-1, 0, 1, 0};
static const double EPS = 1e-8;
class Nodes {
public:
class Nodes* children[256];
bool has_word;
Nodes() : has_word(false) {
for (int i = 0; i < 256; i++) {
children[i] = NULL;
}
}
};
class Trie {
p... |
p01329 Stolen Jewel | The jewel, a national treasure of the Kingdom of Pal, was stolen by bandits. As an adventurer, you heard the rumor and headed for the thief's hideout and managed to get the jewels back.
However, when I went to return the jewel to the castle of the Kingdom of Pal, the guard of the castle said, "My king has not complete... | {
"input": [
"6 7\n.......\n...#...\n...#.S.\n...###.\n.G.....\n.......\n2\nLL\nDD",
"7 6\n......\n.####.\n.####.\n...S#.\n...##.\n...##.\n.....G\n3\nLD\nDD\nLLL\n7 8\nS#......\n.#.####.\n.#.#G.#.\n.#.##.#.\n.#....#.\n.######.\n........\n8\nDDDD\nDDDU\nUUUU\nUUUD\nRRRR\nRRRL\nLLLL\nLLLR\n3 8\n\nS......G\n\n2\... | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include<iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<queue>
#include<cassert>
#define INF (1<<29)
using namespace std;
const string ds="URDL";
const int dx[4]={0,1,0,-1};
const int dy[4]={-1,0,1,0};
int n,m;
vector<string>g;
struct AhoCorasick{
static const int max_n =101;
static co... |
p01329 Stolen Jewel | The jewel, a national treasure of the Kingdom of Pal, was stolen by bandits. As an adventurer, you heard the rumor and headed for the thief's hideout and managed to get the jewels back.
However, when I went to return the jewel to the castle of the Kingdom of Pal, the guard of the castle said, "My king has not complete... | {
"input": [
"6 7\n.......\n...#...\n...#.S.\n...###.\n.G.....\n.......\n2\nLL\nDD",
"7 6\n......\n.####.\n.####.\n...S#.\n...##.\n...##.\n.....G\n3\nLD\nDD\nLLL\n7 8\nS#......\n.#.####.\n.#.#G.#.\n.#.##.#.\n.#....#.\n.######.\n........\n8\nDDDD\nDDDU\nUUUU\nUUUD\nRRRR\nRRRL\nLLLL\nLLLR\n3 8\n\nS......G\n\n2\... | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
const int inf = 1e9;
const int64_t inf64 = 1e18;
const double eps = 1e-9;
template <typename T>
ostream& operator<<(ostream& os, const vector<T>& vec) {
os << "[";
for (const auto& v : vec) {
os << v << ",";
}
os << "]";
return os;
}
using i64 = int64_t;
const... |
p01329 Stolen Jewel | The jewel, a national treasure of the Kingdom of Pal, was stolen by bandits. As an adventurer, you heard the rumor and headed for the thief's hideout and managed to get the jewels back.
However, when I went to return the jewel to the castle of the Kingdom of Pal, the guard of the castle said, "My king has not complete... | {
"input": [
"6 7\n.......\n...#...\n...#.S.\n...###.\n.G.....\n.......\n2\nLL\nDD",
"7 6\n......\n.####.\n.####.\n...S#.\n...##.\n...##.\n.....G\n3\nLD\nDD\nLLL\n7 8\nS#......\n.#.####.\n.#.#G.#.\n.#.##.#.\n.#....#.\n.######.\n........\n8\nDDDD\nDDDU\nUUUU\nUUUD\nRRRR\nRRRL\nLLLL\nLLLR\n3 8\n\nS......G\n\n2\... | {
"input": [],
"output": []
} | IN-CORRECT | java | import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
public class Main{
static char get(int k){
return k==0?'U':k==1?'R':k==2?'D':'L';
}
static int get(char k){
return k=='U'?0:k=='R'?1:k=='D'?2:3;
}
static class V{
public int ID;
public V[] c;
public boolean leaf;
public V(in... |
p01329 Stolen Jewel | The jewel, a national treasure of the Kingdom of Pal, was stolen by bandits. As an adventurer, you heard the rumor and headed for the thief's hideout and managed to get the jewels back.
However, when I went to return the jewel to the castle of the Kingdom of Pal, the guard of the castle said, "My king has not complete... | {
"input": [
"6 7\n.......\n...#...\n...#.S.\n...###.\n.G.....\n.......\n2\nLL\nDD",
"7 6\n......\n.####.\n.####.\n...S#.\n...##.\n...##.\n.....G\n3\nLD\nDD\nLLL\n7 8\nS#......\n.#.####.\n.#.#G.#.\n.#.##.#.\n.#....#.\n.######.\n........\n8\nDDDD\nDDDU\nUUUU\nUUUD\nRRRR\nRRRL\nLLLL\nLLLR\n3 8\n\nS......G\n\n2\... | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
int m, n, nr, ns;
string mat[53];
string rule[13];
int d[53][53][113];
int t[113][4];
string suf[113];
int dx[] = {-1, 0, 1, 0};
int dy[] = {0, 1, 0, -1};
char dc[] = {'U', 'R', 'D', 'L'};
struct Status {
int x, y, s, d;
Status() {}
Status(int dd, int xx, int yy, int ... |
p01329 Stolen Jewel | The jewel, a national treasure of the Kingdom of Pal, was stolen by bandits. As an adventurer, you heard the rumor and headed for the thief's hideout and managed to get the jewels back.
However, when I went to return the jewel to the castle of the Kingdom of Pal, the guard of the castle said, "My king has not complete... | {
"input": [
"6 7\n.......\n...#...\n...#.S.\n...###.\n.G.....\n.......\n2\nLL\nDD",
"7 6\n......\n.####.\n.####.\n...S#.\n...##.\n...##.\n.....G\n3\nLD\nDD\nLLL\n7 8\nS#......\n.#.####.\n.#.#G.#.\n.#.##.#.\n.#....#.\n.######.\n........\n8\nDDDD\nDDDU\nUUUU\nUUUD\nRRRR\nRRRL\nLLLL\nLLLR\n3 8\n\nS......G\n\n2\... | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
int H, W, K, x[60][60], dist[60][60][200], sx, sy, gx, gy,
dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0, -1};
string S[10], dir = "DRUL";
vector<tuple<string, int, int>> vec;
vector<tuple<int, int, int>> X[60][60][200];
vector<pair<int, int>> banned[200];
void build_banned()... |
p01329 Stolen Jewel | The jewel, a national treasure of the Kingdom of Pal, was stolen by bandits. As an adventurer, you heard the rumor and headed for the thief's hideout and managed to get the jewels back.
However, when I went to return the jewel to the castle of the Kingdom of Pal, the guard of the castle said, "My king has not complete... | {
"input": [
"6 7\n.......\n...#...\n...#.S.\n...###.\n.G.....\n.......\n2\nLL\nDD",
"7 6\n......\n.####.\n.####.\n...S#.\n...##.\n...##.\n.....G\n3\nLD\nDD\nLLL\n7 8\nS#......\n.#.####.\n.#.#G.#.\n.#.##.#.\n.#....#.\n.######.\n........\n8\nDDDD\nDDDU\nUUUU\nUUUD\nRRRR\nRRRL\nLLLL\nLLLR\n3 8\n\nS......G\n\n2\... | {
"input": [],
"output": []
} | IN-CORRECT | java |
import java.util.*;
class State{
char x, y;
short cost;
String path;
char[] match;
State(char x, char y, short cost, String path, char[] match){
this.x = x;
this.y = y;
this.cost = cost;
this.path = path;
this.match = match;
}
public boolean equals(Object o){
State st = (State)... |
p01329 Stolen Jewel | The jewel, a national treasure of the Kingdom of Pal, was stolen by bandits. As an adventurer, you heard the rumor and headed for the thief's hideout and managed to get the jewels back.
However, when I went to return the jewel to the castle of the Kingdom of Pal, the guard of the castle said, "My king has not complete... | {
"input": [
"6 7\n.......\n...#...\n...#.S.\n...###.\n.G.....\n.......\n2\nLL\nDD",
"7 6\n......\n.####.\n.####.\n...S#.\n...##.\n...##.\n.....G\n3\nLD\nDD\nLLL\n7 8\nS#......\n.#.####.\n.#.#G.#.\n.#.##.#.\n.#....#.\n.######.\n........\n8\nDDDD\nDDDU\nUUUU\nUUUD\nRRRR\nRRRL\nLLLL\nLLLR\n3 8\n\nS......G\n\n2\... | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
struct node {
int proh;
int to[4];
int fail;
node() {
proh = 0;
memset(to, 0, sizeof to);
fail = 0;
}
};
int w, h;
char field[52][52];
vector<node> ac;
int dx[] = {-1, 0, 1, 0};
int dy[] = {0, -1, 0, 1};
void addptn(const char *ptn) {
int x = 1, f = ... |
p01329 Stolen Jewel | The jewel, a national treasure of the Kingdom of Pal, was stolen by bandits. As an adventurer, you heard the rumor and headed for the thief's hideout and managed to get the jewels back.
However, when I went to return the jewel to the castle of the Kingdom of Pal, the guard of the castle said, "My king has not complete... | {
"input": [
"6 7\n.......\n...#...\n...#.S.\n...###.\n.G.....\n.......\n2\nLL\nDD",
"7 6\n......\n.####.\n.####.\n...S#.\n...##.\n...##.\n.....G\n3\nLD\nDD\nLLL\n7 8\nS#......\n.#.####.\n.#.#G.#.\n.#.##.#.\n.#....#.\n.######.\n........\n8\nDDDD\nDDDU\nUUUU\nUUUD\nRRRR\nRRRL\nLLLL\nLLLR\n3 8\n\nS......G\n\n2\... | {
"input": [],
"output": []
} | IN-CORRECT | java | import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
public class Main{
static char get(int k){
return k==0?'U':k==1?'R':k==2?'D':'L';
}
static int get(char k){
return k=='U'?0:k=='R'?1:k=='D'?2:3;
}
static class V{
public int ID;
public V[] c;
public boolean leaf;
public V(in... |
p01329 Stolen Jewel | The jewel, a national treasure of the Kingdom of Pal, was stolen by bandits. As an adventurer, you heard the rumor and headed for the thief's hideout and managed to get the jewels back.
However, when I went to return the jewel to the castle of the Kingdom of Pal, the guard of the castle said, "My king has not complete... | {
"input": [
"6 7\n.......\n...#...\n...#.S.\n...###.\n.G.....\n.......\n2\nLL\nDD",
"7 6\n......\n.####.\n.####.\n...S#.\n...##.\n...##.\n.....G\n3\nLD\nDD\nLLL\n7 8\nS#......\n.#.####.\n.#.#G.#.\n.#.##.#.\n.#....#.\n.######.\n........\n8\nDDDD\nDDDU\nUUUU\nUUUD\nRRRR\nRRRL\nLLLL\nLLLR\n3 8\n\nS......G\n\n2\... | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
int tx[] = {0, 1, 0, -1};
int ty[] = {-1, 0, 1, 0};
static const double EPS = 1e-8;
class Nodes {
public:
class Nodes* children[256];
bool has_word;
Nodes() : has_word(false) {
for (int i = 0; i < 256; i++) {
children[i] = NULL;
}
}
};
class Trie {
p... |
p01329 Stolen Jewel | The jewel, a national treasure of the Kingdom of Pal, was stolen by bandits. As an adventurer, you heard the rumor and headed for the thief's hideout and managed to get the jewels back.
However, when I went to return the jewel to the castle of the Kingdom of Pal, the guard of the castle said, "My king has not complete... | {
"input": [
"6 7\n.......\n...#...\n...#.S.\n...###.\n.G.....\n.......\n2\nLL\nDD",
"7 6\n......\n.####.\n.####.\n...S#.\n...##.\n...##.\n.....G\n3\nLD\nDD\nLLL\n7 8\nS#......\n.#.####.\n.#.#G.#.\n.#.##.#.\n.#....#.\n.######.\n........\n8\nDDDD\nDDDU\nUUUU\nUUUD\nRRRR\nRRRL\nLLLL\nLLLR\n3 8\n\nS......G\n\n2\... | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
int tx[] = {0, 1, 0, -1};
int ty[] = {-1, 0, 1, 0};
static const double EPS = 1e-8;
class Nodes {
public:
class Nodes* children[256];
bool has_word;
Nodes() : has_word(false) {
for (int i = 0; i < 256; i++) {
children[i] = NULL;
}
}
};
class Trie {
p... |
p01329 Stolen Jewel | The jewel, a national treasure of the Kingdom of Pal, was stolen by bandits. As an adventurer, you heard the rumor and headed for the thief's hideout and managed to get the jewels back.
However, when I went to return the jewel to the castle of the Kingdom of Pal, the guard of the castle said, "My king has not complete... | {
"input": [
"6 7\n.......\n...#...\n...#.S.\n...###.\n.G.....\n.......\n2\nLL\nDD",
"7 6\n......\n.####.\n.####.\n...S#.\n...##.\n...##.\n.....G\n3\nLD\nDD\nLLL\n7 8\nS#......\n.#.####.\n.#.#G.#.\n.#.##.#.\n.#....#.\n.######.\n........\n8\nDDDD\nDDDU\nUUUU\nUUUD\nRRRR\nRRRL\nLLLL\nLLLR\n3 8\n\nS......G\n\n2\... | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
int tx[] = {0, 1, 0, -1};
int ty[] = {-1, 0, 1, 0};
static const double EPS = 1e-8;
const static char dir[4] = {'U', 'R', 'D', 'L'};
const static string dir_str[4] = {"U", "R", "D", "L"};
namespace AhoCorasick {
class Node;
class SearchMachine;
struct MatchingResult {
map... |
p01329 Stolen Jewel | The jewel, a national treasure of the Kingdom of Pal, was stolen by bandits. As an adventurer, you heard the rumor and headed for the thief's hideout and managed to get the jewels back.
However, when I went to return the jewel to the castle of the Kingdom of Pal, the guard of the castle said, "My king has not complete... | {
"input": [
"6 7\n.......\n...#...\n...#.S.\n...###.\n.G.....\n.......\n2\nLL\nDD",
"7 6\n......\n.####.\n.####.\n...S#.\n...##.\n...##.\n.....G\n3\nLD\nDD\nLLL\n7 8\nS#......\n.#.####.\n.#.#G.#.\n.#.##.#.\n.#....#.\n.######.\n........\n8\nDDDD\nDDDU\nUUUU\nUUUD\nRRRR\nRRRL\nLLLL\nLLLR\n3 8\n\nS......G\n\n2\... | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
struct Data {
int cur, cost;
pair<int, int> info;
string debug;
Data(int cur = (INT_MAX), int cost = (INT_MAX),
pair<int, int> info = pair<int, int>((INT_MAX), (INT_MAX)),
string debug = "$$$")
: cur(cur), cost(cost), info(info), debug(debug) {}
... |
p01329 Stolen Jewel | The jewel, a national treasure of the Kingdom of Pal, was stolen by bandits. As an adventurer, you heard the rumor and headed for the thief's hideout and managed to get the jewels back.
However, when I went to return the jewel to the castle of the Kingdom of Pal, the guard of the castle said, "My king has not complete... | {
"input": [
"6 7\n.......\n...#...\n...#.S.\n...###.\n.G.....\n.......\n2\nLL\nDD",
"7 6\n......\n.####.\n.####.\n...S#.\n...##.\n...##.\n.....G\n3\nLD\nDD\nLLL\n7 8\nS#......\n.#.####.\n.#.#G.#.\n.#.##.#.\n.#....#.\n.######.\n........\n8\nDDDD\nDDDU\nUUUU\nUUUD\nRRRR\nRRRL\nLLLL\nLLLR\n3 8\n\nS......G\n\n2\... | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
int tx[] = {0, 1, 0, -1};
int ty[] = {-1, 0, 1, 0};
static const double EPS = 1e-8;
const static char dir[4] = {'U', 'R', 'D', 'L'};
const static string dir_str[4] = {"U", "R", "D", "L"};
class Nodes {
public:
class Nodes* children[256];
bool has_word;
Nodes() : has_... |
p01329 Stolen Jewel | The jewel, a national treasure of the Kingdom of Pal, was stolen by bandits. As an adventurer, you heard the rumor and headed for the thief's hideout and managed to get the jewels back.
However, when I went to return the jewel to the castle of the Kingdom of Pal, the guard of the castle said, "My king has not complete... | {
"input": [
"6 7\n.......\n...#...\n...#.S.\n...###.\n.G.....\n.......\n2\nLL\nDD",
"7 6\n......\n.####.\n.####.\n...S#.\n...##.\n...##.\n.....G\n3\nLD\nDD\nLLL\n7 8\nS#......\n.#.####.\n.#.#G.#.\n.#.##.#.\n.#....#.\n.######.\n........\n8\nDDDD\nDDDU\nUUUU\nUUUD\nRRRR\nRRRL\nLLLL\nLLLR\n3 8\n\nS......G\n\n2\... | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
struct S {
int t;
int y, x;
string h;
};
int main() {
for (int N, M; cin >> N >> M, N;) {
char g[50][51];
int sy, sx;
for (int i = 0; i < N; i++) {
cin >> g[i];
for (int j = 0; j < M; j++) {
if (g[i][j] == 'S') {
sy = i;
... |
p01329 Stolen Jewel | The jewel, a national treasure of the Kingdom of Pal, was stolen by bandits. As an adventurer, you heard the rumor and headed for the thief's hideout and managed to get the jewels back.
However, when I went to return the jewel to the castle of the Kingdom of Pal, the guard of the castle said, "My king has not complete... | {
"input": [
"6 7\n.......\n...#...\n...#.S.\n...###.\n.G.....\n.......\n2\nLL\nDD",
"7 6\n......\n.####.\n.####.\n...S#.\n...##.\n...##.\n.....G\n3\nLD\nDD\nLLL\n7 8\nS#......\n.#.####.\n.#.#G.#.\n.#.##.#.\n.#....#.\n.######.\n........\n8\nDDDD\nDDDU\nUUUU\nUUUD\nRRRR\nRRRL\nLLLL\nLLLR\n3 8\n\nS......G\n\n2\... | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
int tx[] = {0, 1, 0, -1};
int ty[] = {-1, 0, 1, 0};
static const double EPS = 1e-8;
class Nodes {
public:
class Nodes* children[256];
bool has_word;
Nodes() : has_word(false) {
for (int i = 0; i < 256; i++) {
children[i] = NULL;
}
}
};
class Trie {
p... |
p01329 Stolen Jewel | The jewel, a national treasure of the Kingdom of Pal, was stolen by bandits. As an adventurer, you heard the rumor and headed for the thief's hideout and managed to get the jewels back.
However, when I went to return the jewel to the castle of the Kingdom of Pal, the guard of the castle said, "My king has not complete... | {
"input": [
"6 7\n.......\n...#...\n...#.S.\n...###.\n.G.....\n.......\n2\nLL\nDD",
"7 6\n......\n.####.\n.####.\n...S#.\n...##.\n...##.\n.....G\n3\nLD\nDD\nLLL\n7 8\nS#......\n.#.####.\n.#.#G.#.\n.#.##.#.\n.#....#.\n.######.\n........\n8\nDDDD\nDDDU\nUUUU\nUUUD\nRRRR\nRRRL\nLLLL\nLLLR\n3 8\n\nS......G\n\n2\... | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
struct Node {
int x, y, state, step;
};
const int maxn = 50 + 5, maxp = 10 + 5, maxstate = 105;
const char *URDL = "URDL";
set<int> vis[maxn][maxn];
int n, m, p, nxt[maxstate][4];
string grid[maxn], ban[maxp];
bool ng[maxstate];
const int dx[4] = {-1, 0, 1, 0}, dy[4] = {0... |
p01329 Stolen Jewel | The jewel, a national treasure of the Kingdom of Pal, was stolen by bandits. As an adventurer, you heard the rumor and headed for the thief's hideout and managed to get the jewels back.
However, when I went to return the jewel to the castle of the Kingdom of Pal, the guard of the castle said, "My king has not complete... | {
"input": [
"6 7\n.......\n...#...\n...#.S.\n...###.\n.G.....\n.......\n2\nLL\nDD",
"7 6\n......\n.####.\n.####.\n...S#.\n...##.\n...##.\n.....G\n3\nLD\nDD\nLLL\n7 8\nS#......\n.#.####.\n.#.#G.#.\n.#.##.#.\n.#....#.\n.######.\n........\n8\nDDDD\nDDDU\nUUUU\nUUUD\nRRRR\nRRRL\nLLLL\nLLLR\n3 8\n\nS......G\n\n2\... | {
"input": [],
"output": []
} | IN-CORRECT | java | import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
public class Main{
static char get(int k){
return k==0?'U':k==1?'R':k==2?'D':'L';
}
static int get(char k){
return k=='U'?0:k=='R'?1:k=='D'?2:3;
}
static class V{
public int ID;
public V[] c;
public boolean leaf;
public V(in... |
p01329 Stolen Jewel | The jewel, a national treasure of the Kingdom of Pal, was stolen by bandits. As an adventurer, you heard the rumor and headed for the thief's hideout and managed to get the jewels back.
However, when I went to return the jewel to the castle of the Kingdom of Pal, the guard of the castle said, "My king has not complete... | {
"input": [
"6 7\n.......\n...#...\n...#.S.\n...###.\n.G.....\n.......\n2\nLL\nDD",
"7 6\n......\n.####.\n.####.\n...S#.\n...##.\n...##.\n.....G\n3\nLD\nDD\nLLL\n7 8\nS#......\n.#.####.\n.#.#G.#.\n.#.##.#.\n.#....#.\n.######.\n........\n8\nDDDD\nDDDU\nUUUU\nUUUD\nRRRR\nRRRL\nLLLL\nLLLR\n3 8\n\nS......G\n\n2\... | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
int tx[] = {0, 1, 0, -1};
int ty[] = {-1, 0, 1, 0};
static const double EPS = 1e-8;
const static char dir[4] = {'U', 'R', 'D', 'L'};
const static string dir_str[4] = {"U", "R", "D", "L"};
class Nodes {
public:
class Nodes* children[4];
bool has_word;
Nodes() : has_wo... |
p01329 Stolen Jewel | The jewel, a national treasure of the Kingdom of Pal, was stolen by bandits. As an adventurer, you heard the rumor and headed for the thief's hideout and managed to get the jewels back.
However, when I went to return the jewel to the castle of the Kingdom of Pal, the guard of the castle said, "My king has not complete... | {
"input": [
"6 7\n.......\n...#...\n...#.S.\n...###.\n.G.....\n.......\n2\nLL\nDD",
"7 6\n......\n.####.\n.####.\n...S#.\n...##.\n...##.\n.....G\n3\nLD\nDD\nLLL\n7 8\nS#......\n.#.####.\n.#.#G.#.\n.#.##.#.\n.#....#.\n.######.\n........\n8\nDDDD\nDDDU\nUUUU\nUUUD\nRRRR\nRRRL\nLLLL\nLLLR\n3 8\n\nS......G\n\n2\... | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
struct Trie {
Trie* child[256];
Trie* fail;
vector<int> matched;
Trie() {
for (int i = 0; i < 256; i++) child[i] = NULL;
fail = NULL;
}
~Trie() {}
};
Trie pool[50000];
int pool_pos;
inline Trie* alloc() { return &(pool[pool_pos++] = Trie()); }
inline voi... |
p01329 Stolen Jewel | The jewel, a national treasure of the Kingdom of Pal, was stolen by bandits. As an adventurer, you heard the rumor and headed for the thief's hideout and managed to get the jewels back.
However, when I went to return the jewel to the castle of the Kingdom of Pal, the guard of the castle said, "My king has not complete... | {
"input": [
"6 7\n.......\n...#...\n...#.S.\n...###.\n.G.....\n.......\n2\nLL\nDD",
"7 6\n......\n.####.\n.####.\n...S#.\n...##.\n...##.\n.....G\n3\nLD\nDD\nLLL\n7 8\nS#......\n.#.####.\n.#.#G.#.\n.#.##.#.\n.#....#.\n.######.\n........\n8\nDDDD\nDDDU\nUUUU\nUUUD\nRRRR\nRRRL\nLLLL\nLLLR\n3 8\n\nS......G\n\n2\... | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
const string ds = "URDL";
const int dx[4] = {0, 1, 0, -1};
const int dy[4] = {-1, 0, 1, 0};
int n, m;
vector<string> g;
struct AhoCorasick {
static const int max_n = 101;
static const int alph_size = 26;
struct node_t {
int parent, suffLink;
char charFromParen... |
p01329 Stolen Jewel | The jewel, a national treasure of the Kingdom of Pal, was stolen by bandits. As an adventurer, you heard the rumor and headed for the thief's hideout and managed to get the jewels back.
However, when I went to return the jewel to the castle of the Kingdom of Pal, the guard of the castle said, "My king has not complete... | {
"input": [
"6 7\n.......\n...#...\n...#.S.\n...###.\n.G.....\n.......\n2\nLL\nDD",
"7 6\n......\n.####.\n.####.\n...S#.\n...##.\n...##.\n.....G\n3\nLD\nDD\nLLL\n7 8\nS#......\n.#.####.\n.#.#G.#.\n.#.##.#.\n.#....#.\n.######.\n........\n8\nDDDD\nDDDU\nUUUU\nUUUD\nRRRR\nRRRL\nLLLL\nLLLR\n3 8\n\nS......G\n\n2\... | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
struct State {
int x, y, e;
};
const int INF = (1 << 28);
const int MAXH = 51;
const int MAXW = 51;
const int MAXP = 11;
const string dc[] = {"R", "D", "L", "U"};
const int dx[] = {1, 0, -1, 0};
const int dy[] = {0, 1, 0, -1};
int H, W;
char G[MAXH][MAXW];
int P;
vector<s... |
p01329 Stolen Jewel | The jewel, a national treasure of the Kingdom of Pal, was stolen by bandits. As an adventurer, you heard the rumor and headed for the thief's hideout and managed to get the jewels back.
However, when I went to return the jewel to the castle of the Kingdom of Pal, the guard of the castle said, "My king has not complete... | {
"input": [
"6 7\n.......\n...#...\n...#.S.\n...###.\n.G.....\n.......\n2\nLL\nDD",
"7 6\n......\n.####.\n.####.\n...S#.\n...##.\n...##.\n.....G\n3\nLD\nDD\nLLL\n7 8\nS#......\n.#.####.\n.#.#G.#.\n.#.##.#.\n.#....#.\n.######.\n........\n8\nDDDD\nDDDU\nUUUU\nUUUD\nRRRR\nRRRL\nLLLL\nLLLR\n3 8\n\nS......G\n\n2\... | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
struct State {
int x, y, e;
};
const int INF = (1 << 28);
const int MAXH = 51;
const int MAXW = 51;
const int MAXP = 11;
const string dc[] = {"R", "D", "L", "U"};
const int dx[] = {1, 0, -1, 0};
const int dy[] = {0, 1, 0, -1};
int H, W;
char G[MAXH][MAXW];
int P;
vector<s... |
p01329 Stolen Jewel | The jewel, a national treasure of the Kingdom of Pal, was stolen by bandits. As an adventurer, you heard the rumor and headed for the thief's hideout and managed to get the jewels back.
However, when I went to return the jewel to the castle of the Kingdom of Pal, the guard of the castle said, "My king has not complete... | {
"input": [
"6 7\n.......\n...#...\n...#.S.\n...###.\n.G.....\n.......\n2\nLL\nDD",
"7 6\n......\n.####.\n.####.\n...S#.\n...##.\n...##.\n.....G\n3\nLD\nDD\nLLL\n7 8\nS#......\n.#.####.\n.#.#G.#.\n.#.##.#.\n.#....#.\n.######.\n........\n8\nDDDD\nDDDU\nUUUU\nUUUD\nRRRR\nRRRL\nLLLL\nLLLR\n3 8\n\nS......G\n\n2\... | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
int tx[] = {0, 1, 0, -1};
int ty[] = {-1, 0, 1, 0};
static const double EPS = 1e-8;
const static char dir[4] = {'U', 'R', 'D', 'L'};
const static string dir_str[4] = {"U", "R", "D", "L"};
static char dir_idx[256];
class Nodes {
public:
class Nodes* children[4];
bool ha... |
p01329 Stolen Jewel | The jewel, a national treasure of the Kingdom of Pal, was stolen by bandits. As an adventurer, you heard the rumor and headed for the thief's hideout and managed to get the jewels back.
However, when I went to return the jewel to the castle of the Kingdom of Pal, the guard of the castle said, "My king has not complete... | {
"input": [
"6 7\n.......\n...#...\n...#.S.\n...###.\n.G.....\n.......\n2\nLL\nDD",
"7 6\n......\n.####.\n.####.\n...S#.\n...##.\n...##.\n.....G\n3\nLD\nDD\nLLL\n7 8\nS#......\n.#.####.\n.#.#G.#.\n.#.##.#.\n.#....#.\n.######.\n........\n8\nDDDD\nDDDU\nUUUU\nUUUD\nRRRR\nRRRL\nLLLL\nLLLR\n3 8\n\nS......G\n\n2\... | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
enum DIR {
North,
East,
South,
West,
};
struct Node {
int num, parent_id, children[4], suffix_link, depth;
bool finish_FLG;
DIR pattern[10];
};
struct Data {
void set(int arg_row, int arg_col) {
row = arg_row;
col = arg_col;
}
int row, col;
};
st... |
p01329 Stolen Jewel | The jewel, a national treasure of the Kingdom of Pal, was stolen by bandits. As an adventurer, you heard the rumor and headed for the thief's hideout and managed to get the jewels back.
However, when I went to return the jewel to the castle of the Kingdom of Pal, the guard of the castle said, "My king has not complete... | {
"input": [
"6 7\n.......\n...#...\n...#.S.\n...###.\n.G.....\n.......\n2\nLL\nDD",
"7 6\n......\n.####.\n.####.\n...S#.\n...##.\n...##.\n.....G\n3\nLD\nDD\nLLL\n7 8\nS#......\n.#.####.\n.#.#G.#.\n.#.##.#.\n.#....#.\n.######.\n........\n8\nDDDD\nDDDU\nUUUU\nUUUD\nRRRR\nRRRL\nLLLL\nLLLR\n3 8\n\nS......G\n\n2\... | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
int tx[] = {0, 1, 0, -1};
int ty[] = {-1, 0, 1, 0};
static const double EPS = 1e-8;
const static char dir[4] = {'U', 'R', 'D', 'L'};
const static string dir_str[4] = {"U", "R", "D", "L"};
class Nodes {
public:
class Nodes* children[256];
bool has_word;
Nodes() : has_... |
p01329 Stolen Jewel | The jewel, a national treasure of the Kingdom of Pal, was stolen by bandits. As an adventurer, you heard the rumor and headed for the thief's hideout and managed to get the jewels back.
However, when I went to return the jewel to the castle of the Kingdom of Pal, the guard of the castle said, "My king has not complete... | {
"input": [
"6 7\n.......\n...#...\n...#.S.\n...###.\n.G.....\n.......\n2\nLL\nDD",
"7 6\n......\n.####.\n.####.\n...S#.\n...##.\n...##.\n.....G\n3\nLD\nDD\nLLL\n7 8\nS#......\n.#.####.\n.#.#G.#.\n.#.##.#.\n.#....#.\n.######.\n........\n8\nDDDD\nDDDU\nUUUU\nUUUD\nRRRR\nRRRL\nLLLL\nLLLR\n3 8\n\nS......G\n\n2\... | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
class PMA {
int id;
bool tail;
PMA *failure;
PMA *next[256];
public:
PMA(int id = 0) : id(id), tail(false), failure(0) {
memset(next, 0, sizeof(next));
}
~PMA() {
for (int i = 0; i < 256; i++) {
if (next[i] && next[i] != this) delete next[i];
... |
p01329 Stolen Jewel | The jewel, a national treasure of the Kingdom of Pal, was stolen by bandits. As an adventurer, you heard the rumor and headed for the thief's hideout and managed to get the jewels back.
However, when I went to return the jewel to the castle of the Kingdom of Pal, the guard of the castle said, "My king has not complete... | {
"input": [
"6 7\n.......\n...#...\n...#.S.\n...###.\n.G.....\n.......\n2\nLL\nDD",
"7 6\n......\n.####.\n.####.\n...S#.\n...##.\n...##.\n.....G\n3\nLD\nDD\nLLL\n7 8\nS#......\n.#.####.\n.#.#G.#.\n.#.##.#.\n.#....#.\n.######.\n........\n8\nDDDD\nDDDU\nUUUU\nUUUD\nRRRR\nRRRL\nLLLL\nLLLR\n3 8\n\nS......G\n\n2\... | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
const int vy[] = {0, 1, 0, -1}, vx[] = {1, 0, -1, 0};
const string temp = "RDLU";
const int mask = (1 << 18) - 1;
int H, W, P, sx, sy;
string S[50], V[10];
int solve() {
queue<tuple<int, int, int, int> > que;
int min_cost[50][50][10][10];
memset(min_cost, -1, sizeof(m... |
p01329 Stolen Jewel | The jewel, a national treasure of the Kingdom of Pal, was stolen by bandits. As an adventurer, you heard the rumor and headed for the thief's hideout and managed to get the jewels back.
However, when I went to return the jewel to the castle of the Kingdom of Pal, the guard of the castle said, "My king has not complete... | {
"input": [
"6 7\n.......\n...#...\n...#.S.\n...###.\n.G.....\n.......\n2\nLL\nDD",
"7 6\n......\n.####.\n.####.\n...S#.\n...##.\n...##.\n.....G\n3\nLD\nDD\nLLL\n7 8\nS#......\n.#.####.\n.#.#G.#.\n.#.##.#.\n.#....#.\n.######.\n........\n8\nDDDD\nDDDU\nUUUU\nUUUD\nRRRR\nRRRL\nLLLL\nLLLR\n3 8\n\nS......G\n\n2\... | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
class Sit {
public:
int x, y;
vector<int> points;
};
int h, w;
int n;
char field[51][51];
string prohibits[20];
int sy, sx, gx, gy;
set<vector<int> > used[51][51];
const int dy[] = {-1, 0, 1, 0};
const int dx[] = {0, 1, 0, -1};
int bfs() {
Sit init;
init.x = sx;
... |
p01329 Stolen Jewel | The jewel, a national treasure of the Kingdom of Pal, was stolen by bandits. As an adventurer, you heard the rumor and headed for the thief's hideout and managed to get the jewels back.
However, when I went to return the jewel to the castle of the Kingdom of Pal, the guard of the castle said, "My king has not complete... | {
"input": [
"6 7\n.......\n...#...\n...#.S.\n...###.\n.G.....\n.......\n2\nLL\nDD",
"7 6\n......\n.####.\n.####.\n...S#.\n...##.\n...##.\n.....G\n3\nLD\nDD\nLLL\n7 8\nS#......\n.#.####.\n.#.#G.#.\n.#.##.#.\n.#....#.\n.######.\n........\n8\nDDDD\nDDDU\nUUUU\nUUUD\nRRRR\nRRRL\nLLLL\nLLLR\n3 8\n\nS......G\n\n2\... | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
const int dx[] = {-1, 0, 1, 0}, dy[] = {0, 1, 0, -1};
const char dd[] = {'L', 'D', 'R', 'U'};
struct Trie {
bool leaf;
Trie *node[256];
Trie() {
leaf = false;
for (int i = 0; i < 256; i++) {
node[i] = (Trie *)0;
}
}
void insert(const string &str)... |
p01329 Stolen Jewel | The jewel, a national treasure of the Kingdom of Pal, was stolen by bandits. As an adventurer, you heard the rumor and headed for the thief's hideout and managed to get the jewels back.
However, when I went to return the jewel to the castle of the Kingdom of Pal, the guard of the castle said, "My king has not complete... | {
"input": [
"6 7\n.......\n...#...\n...#.S.\n...###.\n.G.....\n.......\n2\nLL\nDD",
"7 6\n......\n.####.\n.####.\n...S#.\n...##.\n...##.\n.....G\n3\nLD\nDD\nLLL\n7 8\nS#......\n.#.####.\n.#.#G.#.\n.#.##.#.\n.#....#.\n.######.\n........\n8\nDDDD\nDDDU\nUUUU\nUUUD\nRRRR\nRRRL\nLLLL\nLLLR\n3 8\n\nS......G\n\n2\... | {
"input": [],
"output": []
} | IN-CORRECT | cpp | /*
* AOJ 2212: Stolen Jewel
* ???????????°?????????????????°??°???????????¨?????¨???????????????????????¨???????????¶?????????????????¢?????????????????¨???????????????????????¢????¬????????????¶????±???°????????????????°???\??°???
* ?±???????DP+?????????
* ??????????????¢?§???????????????????????????¶???????¢?????... |
p01329 Stolen Jewel | The jewel, a national treasure of the Kingdom of Pal, was stolen by bandits. As an adventurer, you heard the rumor and headed for the thief's hideout and managed to get the jewels back.
However, when I went to return the jewel to the castle of the Kingdom of Pal, the guard of the castle said, "My king has not complete... | {
"input": [
"6 7\n.......\n...#...\n...#.S.\n...###.\n.G.....\n.......\n2\nLL\nDD",
"7 6\n......\n.####.\n.####.\n...S#.\n...##.\n...##.\n.....G\n3\nLD\nDD\nLLL\n7 8\nS#......\n.#.####.\n.#.#G.#.\n.#.##.#.\n.#....#.\n.######.\n........\n8\nDDDD\nDDDU\nUUUU\nUUUD\nRRRR\nRRRL\nLLLL\nLLLR\n3 8\n\nS......G\n\n2\... | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
const int INF = INT_MAX;
const long long INFL = LLONG_MAX;
const long double pi = acos(-1);
int N, M;
int numP;
string P[20];
string T[20];
int dehejedj[4] = {-1, 0, 1, 0};
int dehejedjdfejfwjj[4] = {0, 1, 0, -1};
string URDL = "URDL";
int nxt[105][4];
int bad[105];
int dis... |
p01329 Stolen Jewel | The jewel, a national treasure of the Kingdom of Pal, was stolen by bandits. As an adventurer, you heard the rumor and headed for the thief's hideout and managed to get the jewels back.
However, when I went to return the jewel to the castle of the Kingdom of Pal, the guard of the castle said, "My king has not complete... | {
"input": [
"6 7\n.......\n...#...\n...#.S.\n...###.\n.G.....\n.......\n2\nLL\nDD",
"7 6\n......\n.####.\n.####.\n...S#.\n...##.\n...##.\n.....G\n3\nLD\nDD\nLLL\n7 8\nS#......\n.#.####.\n.#.#G.#.\n.#.##.#.\n.#....#.\n.######.\n........\n8\nDDDD\nDDDU\nUUUU\nUUUD\nRRRR\nRRRL\nLLLL\nLLLR\n3 8\n\nS......G\n\n2\... | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
int m, n, nr, ns;
string mat[53];
string rule[13];
int d[53][53][113];
int t[113][4];
string suf[113];
int dx[] = {-1, 0, 1, 0};
int dy[] = {0, 1, 0, -1};
char dc[] = {'U', 'R', 'D', 'L'};
map<char, int> dir;
struct Status {
int x, y, s, d;
Status() {}
Status(int dd, ... |
p01329 Stolen Jewel | The jewel, a national treasure of the Kingdom of Pal, was stolen by bandits. As an adventurer, you heard the rumor and headed for the thief's hideout and managed to get the jewels back.
However, when I went to return the jewel to the castle of the Kingdom of Pal, the guard of the castle said, "My king has not complete... | {
"input": [
"6 7\n.......\n...#...\n...#.S.\n...###.\n.G.....\n.......\n2\nLL\nDD",
"7 6\n......\n.####.\n.####.\n...S#.\n...##.\n...##.\n.....G\n3\nLD\nDD\nLLL\n7 8\nS#......\n.#.####.\n.#.#G.#.\n.#.##.#.\n.#....#.\n.######.\n........\n8\nDDDD\nDDDU\nUUUU\nUUUD\nRRRR\nRRRL\nLLLL\nLLLR\n3 8\n\nS......G\n\n2\... | {
"input": [],
"output": []
} | IN-CORRECT | java | import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
public class Main{
static char get(int k){
return k==0?'U':k==1?'R':k==2?'D':'L';
}
static int get(char k){
return k=='U'?0:k=='R'?1:k=='D'?2:3;
}
static class V{
public int ID;
public V[] c;
public boolean leaf;
public V(in... |
p01329 Stolen Jewel | The jewel, a national treasure of the Kingdom of Pal, was stolen by bandits. As an adventurer, you heard the rumor and headed for the thief's hideout and managed to get the jewels back.
However, when I went to return the jewel to the castle of the Kingdom of Pal, the guard of the castle said, "My king has not complete... | {
"input": [
"6 7\n.......\n...#...\n...#.S.\n...###.\n.G.....\n.......\n2\nLL\nDD",
"7 6\n......\n.####.\n.####.\n...S#.\n...##.\n...##.\n.....G\n3\nLD\nDD\nLLL\n7 8\nS#......\n.#.####.\n.#.#G.#.\n.#.##.#.\n.#....#.\n.######.\n........\n8\nDDDD\nDDDU\nUUUU\nUUUD\nRRRR\nRRRL\nLLLL\nLLLR\n3 8\n\nS......G\n\n2\... | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
int tx[] = {0, 1, 0, -1};
int ty[] = {-1, 0, 1, 0};
static const double EPS = 1e-8;
class Nodes {
public:
class Nodes* children[256];
bool has_word;
Nodes() : has_word(false) {
for (int i = 0; i < 256; i++) {
children[i] = NULL;
}
}
};
class Trie {
p... |
p01329 Stolen Jewel | The jewel, a national treasure of the Kingdom of Pal, was stolen by bandits. As an adventurer, you heard the rumor and headed for the thief's hideout and managed to get the jewels back.
However, when I went to return the jewel to the castle of the Kingdom of Pal, the guard of the castle said, "My king has not complete... | {
"input": [
"6 7\n.......\n...#...\n...#.S.\n...###.\n.G.....\n.......\n2\nLL\nDD",
"7 6\n......\n.####.\n.####.\n...S#.\n...##.\n...##.\n.....G\n3\nLD\nDD\nLLL\n7 8\nS#......\n.#.####.\n.#.#G.#.\n.#.##.#.\n.#....#.\n.######.\n........\n8\nDDDD\nDDDU\nUUUU\nUUUD\nRRRR\nRRRL\nLLLL\nLLLR\n3 8\n\nS......G\n\n2\... | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
struct NODE {
int x, y, a, b, cost;
NODE(int A, int B, int C, int D, int E) {
x = A, y = B, a = C, b = D, cost = E;
}
};
int dx[] = {-1, 0, 1, 0};
int dy[] = {0, -1, 0, 1};
char dc[] = {'L', 'U', 'R', 'D'};
int main() {
int W, H;
while (cin >> H >> W) {
ch... |
p01329 Stolen Jewel | The jewel, a national treasure of the Kingdom of Pal, was stolen by bandits. As an adventurer, you heard the rumor and headed for the thief's hideout and managed to get the jewels back.
However, when I went to return the jewel to the castle of the Kingdom of Pal, the guard of the castle said, "My king has not complete... | {
"input": [
"6 7\n.......\n...#...\n...#.S.\n...###.\n.G.....\n.......\n2\nLL\nDD",
"7 6\n......\n.####.\n.####.\n...S#.\n...##.\n...##.\n.....G\n3\nLD\nDD\nLLL\n7 8\nS#......\n.#.####.\n.#.#G.#.\n.#.##.#.\n.#....#.\n.######.\n........\n8\nDDDD\nDDDU\nUUUU\nUUUD\nRRRR\nRRRL\nLLLL\nLLLR\n3 8\n\nS......G\n\n2\... | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
const string ds = "URDL";
const int dx[4] = {0, 1, 0, -1};
const int dy[4] = {-1, 0, 1, 0};
int n, m;
vector<string> g;
struct AhoCorasick {
static const int max_n = 101;
static const int alph_size = 26;
struct node_t {
int parent, suffLink;
char charFromParen... |
p01329 Stolen Jewel | The jewel, a national treasure of the Kingdom of Pal, was stolen by bandits. As an adventurer, you heard the rumor and headed for the thief's hideout and managed to get the jewels back.
However, when I went to return the jewel to the castle of the Kingdom of Pal, the guard of the castle said, "My king has not complete... | {
"input": [
"6 7\n.......\n...#...\n...#.S.\n...###.\n.G.....\n.......\n2\nLL\nDD",
"7 6\n......\n.####.\n.####.\n...S#.\n...##.\n...##.\n.....G\n3\nLD\nDD\nLLL\n7 8\nS#......\n.#.####.\n.#.#G.#.\n.#.##.#.\n.#....#.\n.######.\n........\n8\nDDDD\nDDDU\nUUUU\nUUUD\nRRRR\nRRRL\nLLLL\nLLLR\n3 8\n\nS......G\n\n2\... | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
class PMA {
int id;
bool match;
PMA *failure;
PMA *next[256];
public:
PMA(int id = 0) : id(id), match(false), failure(0) {
memset(next, 0, sizeof(next));
}
~PMA() {
for (int i = 0; i < 256; i++) {
if (next[i] && next[i] != this) delete next[i];... |
p01329 Stolen Jewel | The jewel, a national treasure of the Kingdom of Pal, was stolen by bandits. As an adventurer, you heard the rumor and headed for the thief's hideout and managed to get the jewels back.
However, when I went to return the jewel to the castle of the Kingdom of Pal, the guard of the castle said, "My king has not complete... | {
"input": [
"6 7\n.......\n...#...\n...#.S.\n...###.\n.G.....\n.......\n2\nLL\nDD",
"7 6\n......\n.####.\n.####.\n...S#.\n...##.\n...##.\n.....G\n3\nLD\nDD\nLLL\n7 8\nS#......\n.#.####.\n.#.#G.#.\n.#.##.#.\n.#....#.\n.######.\n........\n8\nDDDD\nDDDU\nUUUU\nUUUD\nRRRR\nRRRL\nLLLL\nLLLR\n3 8\n\nS......G\n\n2\... | {
"input": [],
"output": []
} | IN-CORRECT | java |
import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.Map;
import java.uti... |
p01329 Stolen Jewel | The jewel, a national treasure of the Kingdom of Pal, was stolen by bandits. As an adventurer, you heard the rumor and headed for the thief's hideout and managed to get the jewels back.
However, when I went to return the jewel to the castle of the Kingdom of Pal, the guard of the castle said, "My king has not complete... | {
"input": [
"6 7\n.......\n...#...\n...#.S.\n...###.\n.G.....\n.......\n2\nLL\nDD",
"7 6\n......\n.####.\n.####.\n...S#.\n...##.\n...##.\n.....G\n3\nLD\nDD\nLLL\n7 8\nS#......\n.#.####.\n.#.#G.#.\n.#.##.#.\n.#....#.\n.######.\n........\n8\nDDDD\nDDDU\nUUUU\nUUUD\nRRRR\nRRRL\nLLLL\nLLLR\n3 8\n\nS......G\n\n2\... | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
struct Data {
int cur, cost;
pair<int, int> info;
string debug;
Data(int cur = (INT_MAX), int cost = (INT_MAX),
pair<int, int> info = pair<int, int>((INT_MAX), (INT_MAX)),
string debug = "$$$")
: cur(cur), cost(cost), info(info), debug(debug) {}
... |
p01329 Stolen Jewel | The jewel, a national treasure of the Kingdom of Pal, was stolen by bandits. As an adventurer, you heard the rumor and headed for the thief's hideout and managed to get the jewels back.
However, when I went to return the jewel to the castle of the Kingdom of Pal, the guard of the castle said, "My king has not complete... | {
"input": [
"6 7\n.......\n...#...\n...#.S.\n...###.\n.G.....\n.......\n2\nLL\nDD",
"7 6\n......\n.####.\n.####.\n...S#.\n...##.\n...##.\n.....G\n3\nLD\nDD\nLLL\n7 8\nS#......\n.#.####.\n.#.#G.#.\n.#.##.#.\n.#....#.\n.######.\n........\n8\nDDDD\nDDDU\nUUUU\nUUUD\nRRRR\nRRRL\nLLLL\nLLLR\n3 8\n\nS......G\n\n2\... | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
const string ds = "URDL";
const int dx[4] = {0, 1, 0, -1};
const int dy[4] = {-1, 0, 1, 0};
int n, m;
vector<string> g;
struct AhoCorasick {
static const int alph_size = 26;
struct node_t {
int parent, suffLink;
char charFromParent;
int children[alph_size];
... |
p01329 Stolen Jewel | The jewel, a national treasure of the Kingdom of Pal, was stolen by bandits. As an adventurer, you heard the rumor and headed for the thief's hideout and managed to get the jewels back.
However, when I went to return the jewel to the castle of the Kingdom of Pal, the guard of the castle said, "My king has not complete... | {
"input": [
"6 7\n.......\n...#...\n...#.S.\n...###.\n.G.....\n.......\n2\nLL\nDD",
"7 6\n......\n.####.\n.####.\n...S#.\n...##.\n...##.\n.....G\n3\nLD\nDD\nLLL\n7 8\nS#......\n.#.####.\n.#.#G.#.\n.#.##.#.\n.#....#.\n.######.\n........\n8\nDDDD\nDDDU\nUUUU\nUUUD\nRRRR\nRRRL\nLLLL\nLLLR\n3 8\n\nS......G\n\n2\... | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
int tx[] = {0, 1, 0, -1};
int ty[] = {-1, 0, 1, 0};
static const double EPS = 1e-8;
const static char dir[4] = {'U', 'R', 'D', 'L'};
const static string dir_str[4] = {"U", "R", "D", "L"};
namespace AhoCorasick {
class Node;
class SearchMachine;
struct MatchingResult {
map... |
p01329 Stolen Jewel | The jewel, a national treasure of the Kingdom of Pal, was stolen by bandits. As an adventurer, you heard the rumor and headed for the thief's hideout and managed to get the jewels back.
However, when I went to return the jewel to the castle of the Kingdom of Pal, the guard of the castle said, "My king has not complete... | {
"input": [
"6 7\n.......\n...#...\n...#.S.\n...###.\n.G.....\n.......\n2\nLL\nDD",
"7 6\n......\n.####.\n.####.\n...S#.\n...##.\n...##.\n.....G\n3\nLD\nDD\nLLL\n7 8\nS#......\n.#.####.\n.#.#G.#.\n.#.##.#.\n.#....#.\n.######.\n........\n8\nDDDD\nDDDU\nUUUU\nUUUD\nRRRR\nRRRL\nLLLL\nLLLR\n3 8\n\nS......G\n\n2\... | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
int m, n, nr, ns;
string mat[13];
string rule[13];
int d[53][53][113];
int t[113][4];
string suf[113];
int dx[] = {-1, 0, 1, 0};
int dy[] = {0, 1, 0, -1};
char dc[] = {'U', 'R', 'D', 'L'};
map<char, int> dir;
struct Status {
int x, y, s;
Status() {}
Status(int xx, int... |
p01329 Stolen Jewel | The jewel, a national treasure of the Kingdom of Pal, was stolen by bandits. As an adventurer, you heard the rumor and headed for the thief's hideout and managed to get the jewels back.
However, when I went to return the jewel to the castle of the Kingdom of Pal, the guard of the castle said, "My king has not complete... | {
"input": [
"6 7\n.......\n...#...\n...#.S.\n...###.\n.G.....\n.......\n2\nLL\nDD",
"7 6\n......\n.####.\n.####.\n...S#.\n...##.\n...##.\n.....G\n3\nLD\nDD\nLLL\n7 8\nS#......\n.#.####.\n.#.#G.#.\n.#.##.#.\n.#....#.\n.######.\n........\n8\nDDDD\nDDDU\nUUUU\nUUUD\nRRRR\nRRRL\nLLLL\nLLLR\n3 8\n\nS......G\n\n2\... | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
int tx[] = {0, 1, 0, -1};
int ty[] = {-1, 0, 1, 0};
static const double EPS = 1e-8;
const static char dir[4] = {'U', 'R', 'D', 'L'};
const static string dir_str[4] = {"U", "R", "D", "L"};
class Nodes {
public:
class Nodes* children[4];
bool has_word;
Nodes() : has_wo... |
p01329 Stolen Jewel | The jewel, a national treasure of the Kingdom of Pal, was stolen by bandits. As an adventurer, you heard the rumor and headed for the thief's hideout and managed to get the jewels back.
However, when I went to return the jewel to the castle of the Kingdom of Pal, the guard of the castle said, "My king has not complete... | {
"input": [
"6 7\n.......\n...#...\n...#.S.\n...###.\n.G.....\n.......\n2\nLL\nDD",
"7 6\n......\n.####.\n.####.\n...S#.\n...##.\n...##.\n.....G\n3\nLD\nDD\nLLL\n7 8\nS#......\n.#.####.\n.#.#G.#.\n.#.##.#.\n.#....#.\n.######.\n........\n8\nDDDD\nDDDU\nUUUU\nUUUD\nRRRR\nRRRL\nLLLL\nLLLR\n3 8\n\nS......G\n\n2\... | {
"input": [],
"output": []
} | IN-CORRECT | python3 | from heapq import heappush, heappop
from collections import deque
def main():
while True:
n, m = map(int, input().split())
if n == 0:break
mp = ["#" * (m + 2)] + ["#" + input() + "#" for _ in range(n)] + ["#" * (m + 2)]
for y in range(1, n + 1):
for x in range(1, m + 1):
if mp[y][x] == ... |
p01329 Stolen Jewel | The jewel, a national treasure of the Kingdom of Pal, was stolen by bandits. As an adventurer, you heard the rumor and headed for the thief's hideout and managed to get the jewels back.
However, when I went to return the jewel to the castle of the Kingdom of Pal, the guard of the castle said, "My king has not complete... | {
"input": [
"6 7\n.......\n...#...\n...#.S.\n...###.\n.G.....\n.......\n2\nLL\nDD",
"7 6\n......\n.####.\n.####.\n...S#.\n...##.\n...##.\n.....G\n3\nLD\nDD\nLLL\n7 8\nS#......\n.#.####.\n.#.#G.#.\n.#.##.#.\n.#....#.\n.######.\n........\n8\nDDDD\nDDDU\nUUUU\nUUUD\nRRRR\nRRRL\nLLLL\nLLLR\n3 8\n\nS......G\n\n2\... | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
struct Data {
int cur, cost;
pair<int, int> info;
string debug;
Data(int cur = (INT_MAX), int cost = (INT_MAX),
pair<int, int> info = pair<int, int>((INT_MAX), (INT_MAX)),
string debug = "$$$")
: cur(cur), cost(cost), info(info), debug(debug) {}
... |
p01329 Stolen Jewel | The jewel, a national treasure of the Kingdom of Pal, was stolen by bandits. As an adventurer, you heard the rumor and headed for the thief's hideout and managed to get the jewels back.
However, when I went to return the jewel to the castle of the Kingdom of Pal, the guard of the castle said, "My king has not complete... | {
"input": [
"6 7\n.......\n...#...\n...#.S.\n...###.\n.G.....\n.......\n2\nLL\nDD",
"7 6\n......\n.####.\n.####.\n...S#.\n...##.\n...##.\n.....G\n3\nLD\nDD\nLLL\n7 8\nS#......\n.#.####.\n.#.#G.#.\n.#.##.#.\n.#....#.\n.######.\n........\n8\nDDDD\nDDDU\nUUUU\nUUUD\nRRRR\nRRRL\nLLLL\nLLLR\n3 8\n\nS......G\n\n2\... | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
class PMA {
int id;
bool tail;
PMA *failure;
PMA *next[256];
public:
PMA(int id = 0) : id(id), tail(false), failure(0) {
memset(next, 0, sizeof(next));
}
~PMA() {
for (int i = 0; i < 256; i++) {
if (next[i] && next[i] != this) delete next[i];
... |
p01329 Stolen Jewel | The jewel, a national treasure of the Kingdom of Pal, was stolen by bandits. As an adventurer, you heard the rumor and headed for the thief's hideout and managed to get the jewels back.
However, when I went to return the jewel to the castle of the Kingdom of Pal, the guard of the castle said, "My king has not complete... | {
"input": [
"6 7\n.......\n...#...\n...#.S.\n...###.\n.G.....\n.......\n2\nLL\nDD",
"7 6\n......\n.####.\n.####.\n...S#.\n...##.\n...##.\n.....G\n3\nLD\nDD\nLLL\n7 8\nS#......\n.#.####.\n.#.#G.#.\n.#.##.#.\n.#....#.\n.######.\n........\n8\nDDDD\nDDDU\nUUUU\nUUUD\nRRRR\nRRRL\nLLLL\nLLLR\n3 8\n\nS......G\n\n2\... | {
"input": [],
"output": []
} | IN-CORRECT | python3 | from heapq import heappush, heappop
from collections import deque
def main():
while True:
n, m = map(int, input().split())
if n == 0:break
mp = ["#" * (m + 2)] + ["#" + input() + "#" for _ in range(n)] + ["#" * (m + 2)]
for y in range(1, n + 1):
for x in range(1, m + 1):
if mp[y][x] == ... |
p01329 Stolen Jewel | The jewel, a national treasure of the Kingdom of Pal, was stolen by bandits. As an adventurer, you heard the rumor and headed for the thief's hideout and managed to get the jewels back.
However, when I went to return the jewel to the castle of the Kingdom of Pal, the guard of the castle said, "My king has not complete... | {
"input": [
"6 7\n.......\n...#...\n...#.S.\n...###.\n.G.....\n.......\n2\nLL\nDD",
"7 6\n......\n.####.\n.####.\n...S#.\n...##.\n...##.\n.....G\n3\nLD\nDD\nLLL\n7 8\nS#......\n.#.####.\n.#.#G.#.\n.#.##.#.\n.#....#.\n.######.\n........\n8\nDDDD\nDDDU\nUUUU\nUUUD\nRRRR\nRRRL\nLLLL\nLLLR\n3 8\n\nS......G\n\n2\... | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
int m, n, nr, ns;
string mat[53];
string rule[13];
int d[53][53][113];
int t[113][4];
string suf[113];
int dx[] = {-1, 0, 1, 0};
int dy[] = {0, 1, 0, -1};
char dc[] = {'U', 'R', 'D', 'L'};
struct Status {
int x, y, s, d;
Status() {}
Status(int dd, int xx, int yy, int ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.