結果
| 問題 |
No.683 Two Operations No.3
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2019-07-04 22:22:13 |
| 言語 | C (gcc 13.3.0) |
| 結果 |
MLE
|
| 実行時間 | - |
| コード長 | 635 bytes |
| コンパイル時間 | 247 ms |
| コンパイル使用メモリ | 28,800 KB |
| 実行使用メモリ | 816,384 KB |
| 最終ジャッジ日時 | 2024-09-19 06:47:44 |
| 合計ジャッジ時間 | 2,087 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 6 MLE * 1 -- * 9 |
コンパイルメッセージ
main.c: In function 'op':
main.c:6:13: warning: implicit declaration of function 'exit' [-Wimplicit-function-declaration]
6 | exit(0);
| ^~~~
main.c:2:1: note: include '<stdlib.h>' or provide a declaration of 'exit'
1 | #include <stdio.h>
+++ |+#include <stdlib.h>
2 | long long int a,b;
main.c:6:13: warning: incompatible implicit declaration of built-in function 'exit' [-Wbuiltin-declaration-mismatch]
6 | exit(0);
| ^~~~
main.c:6:13: note: include '<stdlib.h>' or provide a declaration of 'exit'
ソースコード
#include <stdio.h>
long long int a,b;
void op(long long int x,long long int y){
if (x==0 && y==0){
printf("Yes\n");
exit(0);
}
if ((x%2==1)&&(y%2==1)){
return;
}
else if((x%2==0)&&(y%2==0)){
if ((x/2)%2==1){
op(x-1,y/2);
}
else if ((y/2)%2==1){
op(x/2,y-1);
}
else{
op(x-1,y/2);
op(x/2,y-1);
}
}
else if (x%2==0){
op(x/2,y-1);
}
else{
op(x-1,y/2);
}
}
int main(){
scanf("%lld %lld",&a,&b);
op(a,b);
printf("No\n");
return 0;
}