অদ্ভুত coders of Codeforces!!! (অদ্ভুত is a commonly used word in KUET meaning amazing)
We are thrilled to invite you to to participate in Replay of Ostad Presents Intra KUET Programming Contest 2023 which will be held on Tuesday, October 10,2023 at 19:00 (UTC+6).
You will have 5 hours to solve 13 problems. It is a beginner friendly contest. Teams preferred.
Thanks to the setters and testers of the contest: Mohaimin66, RUDRA_DAS, Likhon5, AngryBaymax, BrehamPie, Arnob, MinhazIbnMizan, weavile, Parvej, Noctambulant, Sabbir1807070, ShorifulSoumic, NM_Mehedy, Emon72, Creeping_Death_, brute__force__, _return_void_, Rafi, UmSuperNoob.
We hope you will enjoy the problemset.
UPD: Editorial
There's a typing mistake. It will be "Tuesday, October 10,2023"
Updated. Thanks for spotting. Sorry for the inconvenience.
Auto comment: topic has been updated by Arnob (previous revision, new revision, compare).
I can't see any register button
Registration will start at 1:00 pm.
How to solve problem I???
Put 'a' on every leaf and 'b' on every non-leaf or vice versa. It was out solution but it is not correct. You can create more optimal solutions using other characters. And I have no idea how to solve it. One case where our solution fails:
7
1 4
4 5
5 2
2 6
6 7
7 3
outupt: aaabccb
Will we get any editorial?
Unfortunately no, You can ask for solution ideas of some particular problem here, We'll try respond.
Editorial of the contest has been posted. Check it out.
In the code above if eps>1e-6 i got an WA . And how someone possibly know that he will got an WA for that ?
Code of problem k is provided below can anyone tell me why it shows wrong answer on test 2 .i have observed if sum of digits is divisible by 3 then that number is divisibld by 3 .so i make an digits array then count number of subarrays having digitsum 3 .#include
include
include
using namespace std;
int solution(vector arr, int n, int k) { int ans = 0; map<int, int> map; map[0] = 1; int sum = 0; int rem = 0; for (int i = 0; i < n; i++) { sum += arr[i]; rem = sum % k; if (rem < 0) { rem += k; } if (map.find(rem) != map.end()) { ans += map[rem]; } map[rem]++; } return ans; }
int main() { int t; cin >> t; while(t--){ int m,n; cin >> m>>n; vectorarr(m); string str = to_string(n); // int arr[m]; for (int i = 0; i < m; i++) { arr[i]=str[i]-'0'; } int k; k=3; cout << solution(arr, m, k) << endl; } return 0; }
The input $$$n$$$ cannot be stored in a 32 bit integer.
How to solve B ??
Update
Editorial of the contest will be posted soon.
include
include
include
using namespace std;
int solution(vector arr, int n, int k) { int ans = 0; map<int, int> mp; mp[0] = 1; int sum = 0; int rem = 0; for (int i = 0; i < n; i++) { sum += arr[i]; rem = sum % k; if (rem < 0) { rem += k; } if (mp.find(rem) != mp.end()) { ans += mp[rem]; } mp[rem]++; } return ans; }
int main() { // int t; int t; cin >> t; while(t--){ int m;string str; cin >> m>>str; vectorarr(m); // string str = to_string(n); // int arr[m]; for (int i = 0; i < m; i++) { arr[i]=str[i]-'0'; } int k; k=3; cout << solution(arr, m, k) << endl; } return 0; }
NOW I HAVE DONE IT CORRECTLY IN O(M) STILL I GOT TLE
std::ios::sync_with_stdio(false); std::cin.tie(nullptr);
type this in the main function before the input
Auto comment: topic has been updated by Arnob (previous revision, new revision, compare).
Arnob Brother, in L. not-incomplete question, why x constraint in 12 to 14?
question link: https://mirror.codeforces.com/gym/104663/problem/L?fbclid=IwAR3ZRc0KoevcYUKfBj2CT8GCs1kCBvxSsvfzXzGn6xo8jUCP_tK1o8IWTJI
We tried to keep it realistic. Each semester normally consists of 12 to 14 weeks.