結果
| 問題 |
No.668 6.0*10^23
|
| コンテスト | |
| ユーザー |
kyawashell
|
| 提出日時 | 2018-03-27 22:27:51 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 5 ms / 2,000 ms |
| コード長 | 812 bytes |
| コンパイル時間 | 2,119 ms |
| コンパイル使用メモリ | 192,468 KB |
| 最終ジャッジ日時 | 2025-01-05 09:38:00 |
|
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 50 |
ソースコード
#include<bits/stdc++.h>
typedef long long ll;
typedef unsigned long long ull;
using namespace std;
#define pb push_back
int dy[]={0, 0, 1, -1, 1, 1, -1, -1};
int dx[]={1, -1, 0, 0, 1, -1, -1, 1};
#define FOR(i,a,b) for (int i=(a);i<(b);i++)
#define RFOR(i,a,b) for (int i=(b)-1;i>=(a);i--)
#define REP(i,n) for (int i=0;i<(n);i++)
#define RREP(i,n) for (int i=(n)-1;i>=0;i--)
#define mp make_pair
#define fi first
#define sc second
string N;
int main(){
cin >> N;
bool f = false;
if(N[0] == '9' && N[1] =='9' && N[2] >= '5') {
cout << "1.0";
f = true;
}else if(N[1] =='9' && N[2] >= '5') {
N[0] += 1;
cout << N[0] << '.' << 0;
}else if(N[2] >= '5') {
N[1] += 1;
cout << N[0] << '.' << N[1];
}else{
cout << N[0] << '.' << N[1];
}
cout << "*10^" << N.length() - 1 + f << endl;
return 0;
}
kyawashell