Skip to content

Commit

Permalink
No commit message
Browse files Browse the repository at this point in the history
  • Loading branch information
gzshawnliang committed May 4, 2019
1 parent 619a01d commit 639fe6a
Show file tree
Hide file tree
Showing 3 changed files with 117 additions and 0 deletions.
83 changes: 83 additions & 0 deletions myCpps/P3952.cpp
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;
}
34 changes: 34 additions & 0 deletions myCpps/P3952.in
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 added myCpps/P3952.out
Empty file.

0 comments on commit 639fe6a

Please sign in to comment.