Tried to solve the last div2 B 1993B - Parity and Sum, my approach happens to be similar to the editorial but some how my solution 274988685 fails, can anyone please enlighten me on what i might be missing?

# | User | Rating |
---|---|---|

1 | tourist | 3947 |

2 | jiangly | 3740 |

3 | Radewoosh | 3652 |

4 | Benq | 3626 |

5 | jqdai0815 | 3620 |

6 | orzdevinwang | 3612 |

7 | ecnerwala | 3587 |

8 | Geothermal | 3569 |

8 | cnnfls_csy | 3569 |

10 | ksun48 | 3485 |

# | User | Contrib. |
---|---|---|

1 | awoo | 162 |

2 | maomao90 | 160 |

3 | adamant | 156 |

4 | atcoder_official | 155 |

5 | cry | 152 |

5 | maroonrk | 152 |

7 | nor | 150 |

8 | SecondThread | 148 |

8 | -is-this-fft- | 148 |

10 | Petr | 147 |

I think nobody should be allowed to register on codeforces with email accounts that aren't from Gmail, Hotmail, or Yahoo mail. What's the point when you ban someone for cheating when they could just get a disposable email, create another alt account and continue cheating? As far as i know, you'd need a sh*t ton of phone numbers at your disposal to create multiple email accounts on Gmail because you can not use one phone number more than once for verification. I know this would not entirely solve the problem of cheating, but it'll go a very very long way in drastically reducing that disgusting act because it's currently an eye sore. An IP ban?

I know this might sound discriminatory but i also think stricter measures need to be taken for people that are from certain countries where the epidemic of cheating is more prevalent.

Hello Guys.. I was trying to solve This atcoder problem From the last beginner contest but i was not able to come up with a working solution during the contest...After some upsolving, i finally came up with a solution that seems to work but the only problem is that it get's TLE on all the tests except the first three for which it passes and I don't know/understand why. This was the first ever ABC problem D that i have attempted after reading the problem statement.

This is the code below and I just need a little help or maybe come hints as to how to make it work because i can't think of a way to optimize it further.

```
#include <set>
#include <numeric>
#include <algorithm>
#include <vector>
#include <iostream>
#pragma GCC optimize ("O3")
#pragma GCC target ("sse4")
using namespace std;
int check(vector<int> a){
int q = a.size();
set<int> s; for(int i = 0; i < q; i++){
s.insert(a[i]);
}
return s.size();
}
void solve(){
int n , t; cin >> n >> t;
vector<int> mex; for(int i = 0; i < n; i++) mex.push_back(0);
for(int i = 0; i < t; i++){
int a, b; cin >> a >> b;
mex[a-1] += b;
cout << check(mex) << endl;
}
}
int main (){
ios::sync_with_stdio(false);
cin.tie(nullptr);
//ll t; cin >> t;
//for(;t--;){
solve();
//}
return 0;
}
```

I was trying to solve an exercise while studying basic probabilities and while solving the exercise, I thought of this problem which I thought was fun, so I decided to share it with my fellow noobs :)

Please if you're anything above a newbie, (in Ercole Visconti's voice) This problem is not for you (no offence) :)

**Problem Statement**

You have n tiles numbered from 1 through to n. You are also given an integer K. The task it to count all pairs of integers (a,b) from the n tiles whose difference is K. that means (a — b) = K

**Input** The one and only line of the input contains two positive integer n and K. **Output** Print the number of such pairs (a, b) whose difference is K, thank you.

**Sample input** 100 11 **Sample output** 89

Hello please i was wondering why my code for This problem B from the last atcoder beginner contest is getting WA for some few tests? This is the code below. I'd really appreciate any help :)

```
#include <iostream>
#include <vector>
#include <cmath>
#include <set>
#include <map>
using namespace std;
vector<int> tob(int n){
vector<int> a;
for(int i=0; i<n; i++){
int ans = n%2;
if(ans==0){
a.push_back(ans);
} else{
break;
}
n/=2;
}
return a;
}
void solve(){
//cout << "stuff works" << endl;
int count = 0;
int n; cin >> n;
vector<int> a = tob(n);
for(auto c : a ) count +=1;
cout << count << endl;
}
int main (){
ios::sync_with_stdio(false);
cin.tie(nullptr);
//ll T = 1;
//ll T; cin >> T;
//for(;T--;){
solve();
//}
return 0;
}
```

Codeforces (c) Copyright 2010-2024 Mike Mirzayanov

The only programming contests Web 2.0 platform

Server time: Aug/13/2024 11:22:22 (l1).

Desktop version, switch to mobile version.

Supported by

User lists

Name |
---|