-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathP3952.cpp
83 lines (69 loc) · 1.41 KB
/
P3952.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
#include <iostream>
#include <fstream>
#include <cstdlib>
#include <algorithm>
#include <string>
#include <queue>
#include <map>
#include <set>
#include <stack>
#include <vector>
#include <iterator>
using namespace std;
struct line
{
char first;
char value;
int x;
int y;
};
int main()
{
ifstream cin("P3952.in");
ofstream cout("P3952.out");
int testCase; cin >> testCase;
for (int t = 1; t <= testCase; ++t)
{
int l;
string s;
cin >> l >> s;
int givenAns = 0;
if (s[2] == '1')
{
givenAns = 1;
}
else
{
for (int i = 4; '0' <= s[i] && s[i] <= '9'; ++i)
{
givenAns = givenAns * 10 + (s[i] - '0');
}
}
vector <line> code(l);
for (int i = 0; i <= l - 1; ++i)
{
cin >> code[i].first;
if (code[i].first == 'F')
{
cin >> code[i].value >> code[i].x >> code[i].y;
if (code[i].x - 'n' == 0) code[i].x = 666;
if (code[i].y - 'n' == 0) code[i].y = 666;
}
else
{
code[i].value = '-';
code[i].x = -1;
code[i].y = -1;
}
}
cout << "----------0\n";
cout << "l:" << l << '\n';
cout << "givenAns:" << givenAns << '\n';
for (int i = 0; i <= l - 1; ++i)
{
cout << code[i].first << ' ' << code[i].value << ' ' << code[i].x << ' ' << code[i].y << '\n';
}
cout << "\n------------------------------------------\n";
}
return 0;
}