結果

問題 No.683 Two Operations No.3
ユーザー regretsfoxregretsfox
提出日時 2018-05-11 23:02:16
言語 C
(gcc 12.3.0)
結果
TLE  
実行時間 -
コード長 540 bytes
コンパイル時間 1,325 ms
コンパイル使用メモリ 28,824 KB
実行使用メモリ 5,920 KB
最終ジャッジ日時 2023-09-10 17:47:12
合計ジャッジ時間 4,945 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,380 KB
testcase_01 AC 1 ms
4,376 KB
testcase_02 AC 0 ms
4,376 KB
testcase_03 AC 0 ms
4,380 KB
testcase_04 AC 0 ms
4,380 KB
testcase_05 AC 1 ms
4,380 KB
testcase_06 TLE -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

#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;
}
0