結果

問題 No.2224 UFO Game
ユーザー publfl2publfl2
提出日時 2023-02-24 21:24:03
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 364 bytes
コンパイル時間 173 ms
コンパイル使用メモリ 31,468 KB
実行使用メモリ 4,352 KB
最終ジャッジ日時 2023-10-11 05:45:02
合計ジャッジ時間 1,042 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <stdio.h>
#include <string.h>

char x[110];
int main()
{
	long long int ans = 0;
	scanf("%s",x+1);
	int a = strlen(x+1);
	if(x[1]=='x')
	{
		for(int i=2;i<=a;i++) ans*=10, ans+=(x[i]-'0');
		long long int p = 1;
		for(int i=1;i<=32;i++) p*=2;
		printf("%lld",p-ans);
	}
	else
	{
		for(int i=1;i<=a;i++) ans*=10, ans+=(x[i]-'0');
		printf("%lld",ans);
	}
}
0