№ | Пользователь | Рейтинг |
---|---|---|
1 | tourist | 4009 |
2 | jiangly | 3823 |
3 | Benq | 3738 |
4 | Radewoosh | 3633 |
5 | jqdai0815 | 3620 |
6 | orzdevinwang | 3529 |
7 | ecnerwala | 3446 |
8 | Um_nik | 3396 |
9 | ksun48 | 3390 |
10 | gamegame | 3386 |
Страны | Города | Организации | Всё → |
№ | Пользователь | Вклад |
---|---|---|
1 | cry | 167 |
2 | Um_nik | 163 |
3 | maomao90 | 162 |
3 | atcoder_official | 162 |
5 | adamant | 159 |
6 | -is-this-fft- | 158 |
7 | awoo | 157 |
8 | TheScrasse | 154 |
9 | Dominater069 | 153 |
9 | nor | 153 |
Название |
---|
I remember someone solved this problem using int_128 in C++ very easily . You can try that .
give the link of your submisson please
I made a few moderations to your code.I hope you get that well. - Check mainly two number's.If they overflow then check the condition.
... ~~~~~
include<bits/stdc++.h>
using namespace std;
/* ###################################################################### ####################### THE BIG INT ########################## */
const int base = 1000000000; const int base_digits = 9;
struct Int {
}; /* ####################### THE BIG INT ########################## ###################################################################### */
int main(){
} ~~~~~
Why dont you just use python or java
I'm very sure that if you write OP's code in Java it will also get TLE. OP just multiplies the numbers together and allows the result to grow to $$$(10^{18})^{10^5)} \approx 10^{10^6}$$$. Doing $$$10^5$$$ multiplications with such numbers is too slow even if you use smart multiplication algorithms.
The problem statement isn't "can you work with bigints", it's "are you smart enough to break if the number grows too big".