이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include<bits/stdc++.h>
#define int long long
using namespace std;
vector<int> getMinH(int w)
{
// if()
vector<int> resp;
for(int cand = 2; cand <= 6; cand++)
if((w * cand)%6 == 0) resp.push_back(cand);
return resp;
}
int32_t main()
{
int w,h; cin >> w >> h;
vector<int> pos = getMinH(w);
if(w % 2 == 0 && w % 3)
{
if(h % 3 == 0)
cout << "YES";
else cout << "NO";
}
else if(w % 2 && w % 3 == 0)
{
if(h % 2 == 0)
cout << "YES";
else
cout << "NO";
}
else if(w % 2 == 0 && w % 3 == 0)
{
cout << "YES";
}
else
{
if(h % 6 == 0) cout << "YES";
else cout << "NO";
}
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |