結果
| 問題 |
No.1213 sio
|
| コンテスト | |
| ユーザー |
Nachia
|
| 提出日時 | 2020-11-21 11:53:37 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 3 ms / 2,000 ms |
| コード長 | 482 bytes |
| コンパイル時間 | 2,021 ms |
| コンパイル使用メモリ | 191,416 KB |
| 最終ジャッジ日時 | 2025-01-16 03:53:37 |
|
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 25 |
ソースコード
#include<bits/stdc++.h>
using namespace std;
using LL=long long;
using ULL=unsigned long long;
#define rep(i,n) for(int i=0;i<(n);i++)
int main(){
LL N,M; cin>>N>>M;
LL ans=0;
while(true){
if(N%2==0 && M%2==0){
ans=0; break;
}
if(N%2==1) swap(N,M);
if(N%2==1){
if(N==3 || M==3){ ans=N/4+M/4; break; }
if(N%4==3 && M%4==3){ ans=N/4+M/4+2; break; }
ans=N/4+M/4; break;
}
ans=N/4; break;
}
cout<<ans<<endl;
return 0;
}
Nachia