| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1367257 | biserailieva | Superpiece (EGOI22_superpiece) | C++20 | 1 ms | 344 KiB |
#include <bits/stdc++.h>
using namespace std;
int main()
{
int q;
cin>>q;
while(q--)
{
string s;
cin>>s;
long long a, b, c, d;
cin>>a>>b>>c>>d;
if(s=="P")
{
if(b!=d || a>c)
{
cout<<-1<<endl;
}
else
{
cout<<c-a<<endl;
}
}
else if(s=="B")
{
if(a==c && b==d)
{
cout<<0<<endl;
}
else if(abs((a+b)%2)!=abs((c+d)%2))
{
cout<<-1<<endl;
}
else if((a-c==b-d) || (a-c==d-b))
{
cout<<1<<endl;
}
else
{
cout<<2<<endl;
}
}
}
return 0;
}| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
