Skip to content

Commit

Permalink
MAGA Array Problem
Browse files Browse the repository at this point in the history
  • Loading branch information
harrypotter0 committed Jan 24, 2018
1 parent 1d147f5 commit 361b400
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Binary file added CP/JanuaryCookOff2018/a.out
Binary file not shown.
6 changes: 4 additions & 2 deletions CP/JanuaryCookOff2018/prob3.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ bool ok(int i)
int N;
int ans()
{
int i = (N + 1) / 2;
int j = (N + 2) / 2;
int i = (N + 1) / 2;cout<<i<<"::i's value";
int j = (N + 2) / 2;cout<<j<<"::j's value";
int id = 0;
D1[id] = N + 2;
D2[id] = N + 2;
Expand All @@ -27,10 +27,12 @@ int ans()
{
if (ok(i))
D1[id] = 0;
cout<<A[i]<<"::A[i]'s value"<<A[j]<<"::A[j]'s value";
swap(A[i], A[j]);
if (ok(i))
D2[id] = 1;
swap(A[i], A[j]);
cout<<D1[id]<<"1id"<<" "<<D2[id]<<"2id";
}
while (true)
{
Expand Down

0 comments on commit 361b400

Please sign in to comment.