-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
619a01d
commit 639fe6a
Showing
3 changed files
with
117 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,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; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
8 | ||
2 O(1) | ||
F i 1 1 | ||
E | ||
2 O(n^1) | ||
F x 1 n | ||
E | ||
1 O(1) | ||
F x 1 n | ||
4 O(n^2) | ||
F x 5 n | ||
F y 10 n | ||
E | ||
E | ||
4 O(n^2) | ||
F x 9 n | ||
E | ||
F y 2 n | ||
E | ||
4 O(n^1) | ||
F x 9 n | ||
F y n 4 | ||
E | ||
E | ||
4 O(1) | ||
F y n 4 | ||
F x 9 n | ||
E | ||
E | ||
4 O(n^2) | ||
F x 1 n | ||
F x 1 10 | ||
E | ||
E |
Empty file.