Submission #66083950
Source Code Expand
#include <iostream> #include <cmath> int main() { double A, B; std::cin >>A >> B; double C = A / B; std::string S = std::to_string(C); int t = -1; for (int i = 0; i < (int)S.size(); i++) { if (S[i] == '.') { t = S[i + 1] - '0'; } } std::cout << (t > 4 ? std::ceil(C) : std::floor(C)) << '\n'; return 0; }
Submission Info
Submission Time | |
---|---|
Task | A - Approximation |
User | juten10x |
Language | C++ 17 (gcc 12.2) |
Score | 150 |
Code Size | 365 Byte |
Status | AC |
Exec Time | 2 ms |
Memory | 3860 KiB |
Judge Result
Set Name | Sample | All | ||||
---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 150 / 150 | ||||
Status |
|
|
Set Name | Test Cases |
---|---|
Sample | 00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt |
All | 00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt, 01_handmade_03.txt, 01_handmade_04.txt, 01_handmade_05.txt, 01_handmade_06.txt, 02_random_07.txt, 02_random_08.txt, 02_random_09.txt, 02_random_10.txt, 02_random_11.txt, 02_random_12.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
00_sample_00.txt | AC | 1 ms | 3800 KiB |
00_sample_01.txt | AC | 1 ms | 3668 KiB |
00_sample_02.txt | AC | 1 ms | 3812 KiB |
01_handmade_03.txt | AC | 1 ms | 3744 KiB |
01_handmade_04.txt | AC | 1 ms | 3740 KiB |
01_handmade_05.txt | AC | 1 ms | 3832 KiB |
01_handmade_06.txt | AC | 1 ms | 3800 KiB |
02_random_07.txt | AC | 2 ms | 3736 KiB |
02_random_08.txt | AC | 1 ms | 3736 KiB |
02_random_09.txt | AC | 1 ms | 3740 KiB |
02_random_10.txt | AC | 1 ms | 3860 KiB |
02_random_11.txt | AC | 1 ms | 3760 KiB |
02_random_12.txt | AC | 1 ms | 3764 KiB |