結果
| 問題 |
No.2224 UFO Game
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2023-03-03 20:17:55 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 486 bytes |
| コンパイル時間 | 1,302 ms |
| コンパイル使用メモリ | 159,464 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-09-17 22:13:00 |
| 合計ジャッジ時間 | 1,566 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 11 |
コンパイルメッセージ
main.cpp:19:1: warning: ISO C++ forbids declaration of ‘main’ with no type [-Wreturn-type]
19 | main(){
| ^~~~
ソースコード
#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;
}