| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1367271 | biserailieva | Superpiece (EGOI22_superpiece) | C++20 | 2 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[0]=='Q')
{
if(a==c && b==d)
{
cout<<0<<endl;
}
else if(a==c || b==d || abs(a-c)==abs(b-d))
{
cout<<1<<endl;
}
else
{
cout<<2<<endl;
}
}
if(s=="P")
{
if(b!=d || a>c)
{
cout<<-1<<endl;
}
else
{
cout<<c-a<<endl;
}
}
else if(s=="KP" || s=="K")
{
cout<<max(abs(a-c), abs(b-d))<<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;
}
}
else if(s[0]=='B')
{
}
}
return 0;
}| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
