結果
問題 | No.1213 sio |
ユーザー |
![]() |
提出日時 | 2020-08-30 17:54:07 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 19 ms / 2,000 ms |
コード長 | 414 bytes |
コンパイル時間 | 2,410 ms |
コンパイル使用メモリ | 192,568 KB |
最終ジャッジ日時 | 2025-01-14 01:55:11 |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 25 |
ソースコード
#include <bits/stdc++.h>using namespace std;int main(){long long N, M;cin >> N >> M;if (N % 2 == 0 && M % 2 == 0){cout << 0 << endl;} else if (!(N % 2 == 1 && M % 2 == 1)){if (N % 2 == 1){swap(N, M);}cout << N / 4 << endl;} else if (N % 4 == 3 && M % 4 == 3 && N != 3 && M != 3){cout << N / 4 + M / 4 + 2 << endl;} else {cout << N / 4 + M / 4 << endl;}}