# | User | Rating |
---|---|---|
1 | tourist | 3985 |
2 | jiangly | 3814 |
3 | jqdai0815 | 3682 |
4 | Benq | 3529 |
5 | orzdevinwang | 3526 |
6 | ksun48 | 3517 |
7 | Radewoosh | 3410 |
8 | hos.lyric | 3399 |
9 | ecnerwala | 3392 |
9 | Um_nik | 3392 |
# | User | Contrib. |
---|---|---|
1 | cry | 169 |
2 | maomao90 | 162 |
2 | Um_nik | 162 |
4 | atcoder_official | 161 |
5 | djm03178 | 158 |
6 | -is-this-fft- | 157 |
7 | adamant | 155 |
8 | awoo | 154 |
8 | Dominater069 | 154 |
10 | luogu_official | 150 |
You're given a number $$$n$$$ It may be prime or not, It's required from you to get 4 positive prime numbers at which their summition equals to $$$n$$$, and if this isn't possible, then state that (There's more that one test cast BTW).
My approach was to get all prime numbers form 2 to 10000000 using sieve theory only once, and to try assume 3 of these numbers and get every possible combination of 2's and 3's (Assuming that all prime numbers can be deduce from summition of these two) let these numbers are $$$x$$$, $$$y$$$ and $$$z$$$ and if there exist a fourth number at which this 4th number = n - x + y + z
and If it's positive and prime, then we found the answer otherwise this won't be possible.
If there's something wrong with my approach? If not there's the mistake in my code Link to the problem is here
Two friends Kunal and Satyam are playing an interesting game. They take turns drawing a ball from a bag which initially contains R red balls and G green balls. Each player draws a ball alternatively and never put it back. The person who is the first to draw a red balls wins. Satyam always draws first. If there are no more balls in the bag and nobody has drawn a red ball, the satyam wins.
Input -----
The first line will contain the number of test cases T. The first line of each test case will contain a number R (number of red balls) and G(number of green balls )
Cases:
2 1 --> 0.6666667 1 1 ---> 0.50000 10 0 ----> 1.0000
problem link is here:
I tired to solve the problem using top-bottom approach but my codes gives wrong answer at the last case (0 instead of 1)
int probability = 0, c = 0;
void magic(int red, int green, int turn){
if(green == -1 || red == -1)return ;
if(red == 0){
probability++;
if(turn % 2 == 0) c++;
return ;
}
if(turn == -1) turn = 0;
else turn++;
magic(red, green-1, turn % 2);
magic(red-1, green, turn % 2);
return ;
}
int main(){
ios::sync_with_stdio(0);
cin.tie(nullptr);
int q;
cin >> q;
while(q--){
int x, y;
cin >> x >> y;
magic(x, y, -1);
cout << fixed << setprecision(9) << c * 1.0 / probability << '\n';
probability = 0, c = 0;
}
return 0;
}
I will appreciate any kind of help from all of you, and thanks for your time
When I enter my submission page and click in my submission IDs, It doesn't work with me, and so when I enter a problem like and click on my submissions the "Click here to see details" doesn't work too!
Does someone else have the same Issue as mine?
Hi everyone,
This problem gives you two inputs N, M and N contains a number like (123) and all what you have to do is to add some digits on the left or the right of the (123) to make it divisible by M Hint about solving this problem, Or a solution for It?
constrains :- N<= 10^12 and M <= 2 * 10^5
Sample tests:-
(Test 1) 1 2 ===> 10 (Test 2) 2 11 ===> 22 (Test 3)234 823 ===> 12345
problem link: https://www.urionlinejudge.com.br/judge/en/problems/view/2788
And thanks In advance. :)
I has been 6 months since I start to solve problems from any online judge (Codeforces was the first one by the way) but since then, I barely notice a difference in my problem solving skills from now and 6 months ago even I had solve +100 problem and every time I register in a contest (div 2 or 3), my rate always decreases by -90 or more, and even If I managed to solve a problem It would be an A only.
So what should I do to improve my self even more? or begin a professional problem-solver requires lot of years practising? I'll be very grateful If you recommeded a few solutions based on your experience ^^
Thanks in advance.
Name |
---|