結論
- Python3にする
- decimalを使う
環境
How to change env of anaconda
conda activate py35
- まず、なぜ3.5を使おうとしているのかと言うと、Python 2.7ではdecimalが正しい値を返してくれなかったから
- この問題で確認できる https://yukicoder.me/problems/no/81
- 3.5にしたらdecimalは正しく動いた
online judge tools でpythonコードのテストをする
oj t -c "python ans.py" または oj t -c "python3 ans.py"
- サンプルテストも通ったので提出するとAC