Amritapuri_ABCD_Nov9_Contest
- Info
- Hidden Rankings
Description:
This contest is configured to run in SEB environment and you will be monitored throughout the contest and any sort of distractions and malpractices are not allowed.
Please note these points before attending the contest.
- The contest has to be done using the SEB.
- Any anti-virus software in your machine has to be disabled while attending the contest.
- Please don't wait for the last minute to submit all the solutions, submit the solutions as and when you complete the problems.
- Don't panic if the submission results are delayed, wait for the confirmation message before submitting the solution again.
- The contest is fully monitored using logs and plagiarism checker so if you minimise the full screen of SEB or if you go to some other sites through other browsers your exam stands cancelled.
Organizers:
Problems
Problem | Points | AC Rate | Users | |
---|---|---|---|---|
Telephone Vector | 20p | 0.2% | 1 | |
Game Plan | 30p | 3.3% | 4 |
Comments
my code for q2 i was not able to submit
include<iostream>
include<map>
include<vector>
include<set>
include<algorithm>
using namespace std; int main(){ int p,x,y=1,z=0,out=0; string q; cin>>q; cin>>p; set<char> set; map<char,int> m; vector<int> v; for(auto i:q) { set.insert(i); } for(auto i:q) { m[i]++; } for(auto i:set){ v.push_back(m[i]); } sort(v.begin(),v.end()); x=v.back(); v.pop_back(); for(int i=0;i<(int)v.size();i++){ if(v.back()==x) y++; else z+=v.back(); v.pop_back(); } out =xy; if(p>y-1){ cout<< max(out+z,out+(p-y+1)(x-1))<<endl;; } else cout<<out+z<<endl; return 0; }
ayyagare No. 1