結果
問題 |
No.683 Two Operations No.3
|
ユーザー |
|
提出日時 | 2018-05-12 08:46:20 |
言語 | C (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 1 ms / 2,000 ms |
コード長 | 540 bytes |
コンパイル時間 | 206 ms |
コンパイル使用メモリ | 29,952 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-06-28 09:58:05 |
合計ジャッジ時間 | 808 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 16 |
ソースコード
#include<stdio.h> #include<stdlib.h> int main(void){ long long int a,b; long long int stack[100000][2]; int stacktop=1; scanf("%lld %lld",&a,&b); stack[0][0]=a; stack[0][1]=b; while(stacktop>0){ stacktop--; a=stack[stacktop][0]; b=stack[stacktop][1]; if(a==0||b==0){ printf("Yes\n"); return 0; } if(a%2==0&&b>0){ stack[stacktop][0]=a/2; stack[stacktop][1]=b-1; stacktop++; } if(b%2==0&&a>0){ stack[stacktop][0]=b/2; stack[stacktop][1]=a-1; stacktop++; } } printf("No\n"); return 0; }