Skip to content

Commit

Permalink
No commit message
Browse files Browse the repository at this point in the history
  • Loading branch information
gzshawnliang committed Aug 8, 2019
1 parent a266cfc commit f4e7aa8
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 7 deletions.
13 changes: 9 additions & 4 deletions myCpps/maps.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

using namespace std;

ifstream fin("maps.in");
ifstream fin("lineSweep.in");
ofstream fout("maps.out");

const int inf = INT_MAX / 2;
Expand Down Expand Up @@ -51,7 +51,12 @@ int main()
set<double> _set;
for (int i = 0; i <= n - 1; ++i)
{
fin >> a_t[i].x1 >> a_t[i].y1 >> a_t[i].x2 >> a_t[i].y2;
double t1, t2, t3, t4; fin >> t1 >> t2 >> t3 >> t4;
a_t[i].x1 = min(t1, t3);
a_t[i].y1 = min(t2, t4);
a_t[i].x2 = max(t1, t3);
a_t[i].y2 = max(t2, t4);

_set.insert(a_t[i].x1);
_set.insert(a_t[i].y1);
_set.insert(a_t[i].x2);
Expand Down Expand Up @@ -88,7 +93,7 @@ int main()
sort(l.begin(), l.end());

int sizeL = l.size();
vector<double> h(itod.size() + 1, 0.0);
vector<double> h(sizeL, 0.0);
for (int i = 0; i <= sizeL - 2; ++i)
{
int nowX = l[i].x, nextX = l[i + 1].x;
Expand Down Expand Up @@ -127,7 +132,7 @@ int main()
//ans = (int)(ans * 100.0 + 0.5) / 100.0;

fout << "Test case #" << t << '\n';
fout << "Total explored area: " << ans << '\n';
fout << "Total explored area: " << ans << "\n\n";

}
return 0;
Expand Down
11 changes: 8 additions & 3 deletions myCpps/mapsOJ.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,12 @@ int main()
set<double> _set;
for (int i = 0; i <= n - 1; ++i)
{
cin >> a_t[i].x1 >> a_t[i].y1 >> a_t[i].x2 >> a_t[i].y2;
double t1, t2, t3, t4; cin >> t1 >> t2 >> t3 >> t4;
a_t[i].x1 = min(t1, t3);
a_t[i].y1 = min(t2, t4);
a_t[i].x2 = max(t1, t3);
a_t[i].y2 = max(t2, t4);

_set.insert(a_t[i].x1);
_set.insert(a_t[i].y1);
_set.insert(a_t[i].x2);
Expand Down Expand Up @@ -88,7 +93,7 @@ int main()
sort(l.begin(), l.end());

int sizeL = l.size();
vector<double> h(itod.size() + 1, 0.0);
vector<double> h(sizeL, 0.0);
for (int i = 0; i <= sizeL - 2; ++i)
{
int nowX = l[i].x, nextX = l[i + 1].x;
Expand Down Expand Up @@ -126,7 +131,7 @@ int main()


cout << "Test case #" << t << '\n';
cout << "Total explored area: " << ans << '\n';
cout << "Total explored area: " << ans << "\n\n";

}
cout.flush();
Expand Down

0 comments on commit f4e7aa8

Please sign in to comment.