結果

問題 No.2224 UFO Game
ユーザー Beksultan AlmazbekovBeksultan Almazbekov
提出日時 2023-03-03 20:17:55
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 486 bytes
コンパイル時間 2,594 ms
コンパイル使用メモリ 160,232 KB
実行使用メモリ 4,348 KB
最終ジャッジ日時 2023-10-18 01:13:29
合計ジャッジ時間 1,957 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,348 KB
testcase_01 AC 2 ms
4,348 KB
testcase_02 AC 2 ms
4,348 KB
testcase_03 AC 2 ms
4,348 KB
testcase_04 AC 1 ms
4,348 KB
testcase_05 AC 2 ms
4,348 KB
testcase_06 AC 2 ms
4,348 KB
testcase_07 AC 2 ms
4,348 KB
testcase_08 AC 2 ms
4,348 KB
testcase_09 AC 1 ms
4,348 KB
testcase_10 AC 1 ms
4,348 KB
testcase_11 AC 1 ms
4,348 KB
testcase_12 AC 2 ms
4,348 KB
testcase_13 AC 2 ms
4,348 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp:19:1: warning: ISO C++ forbids declaration of ‘main’ with no type [-Wreturn-type]
   19 | main(){
      | ^~~~

ソースコード

diff #

#include <bits/stdc++.h>
#define pb push_back
#define pii pair<int,int> 
#define sc second
#define all(s) s.begin(),s.end()
#define fr first
#define int long long
using namespace std;
const int N = 100012;
int fun(string s){
	int ans = 0;
	while (!s.empty()){
		ans *= 10;
		ans += s[0]-'0';
		s.erase(s.begin());
	}
	return ans;
}
main(){
	
	string s;
	cin>>s;
	int ans = 0;
	if (s[0] == 'x'){
		s.erase(s.begin());
		ans = 4294967296-fun(s);
	}
	else 
		ans = fun(s);
	cout <<ans;
	
}
0