結果
| 問題 |
No.756 チャンパーノウン定数 (1)
|
| コンテスト | |
| ユーザー |
pyttkn
|
| 提出日時 | 2018-12-05 23:38:02 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 522 bytes |
| コンパイル時間 | 685 ms |
| コンパイル使用メモリ | 82,280 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-07-22 06:38:49 |
| 合計ジャッジ時間 | 1,514 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 20 |
ソースコード
#define _USE_MATH_DEFINES
#include<iostream>
#include<vector>
#include<algorithm>
#include<cmath>
#include<string>
#include<iomanip>
#include<cassert>
#include<functional>
int main(){
std::ios::sync_with_stdio(false);
std::cin.tie(0);
int d;//小数第d位
int num;
std::cin >> d;
if (d < 10){
std::cout << d << '\n';
}
else if (d % 2 == 0){//十の位のとき
num = 9 + (d + 1 - 9) / 2;
std::cout << num / 10 << '\n';
}
else{
num = 9 + (d - 9) / 2;
std::cout << num % 10 << '\n';
}
return 0;
}
pyttkn