Spread the word.

Share the link on social media.

Share
  • Facebook
Have an account? Sign In Now

Sign Up

Have an account? Sign In Now

Sign In

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

Sorry, you do not have permission to ask a question, You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here
Sign InSign Up

SIKSHAPATH

SIKSHAPATH Navigation

  • Home
  • Questions
  • Blog
    • Computer Science(CSE)
    • NPTEL
    • Startup
  • Shop
    • Internshala Answers
Search
Ask A Question

Mobile menu

Close
Ask A Question
  • Home
  • Questions
  • Blog
    • Computer Science(CSE)
    • NPTEL
    • Startup
  • Shop
    • Internshala Answers
Home/ Questions/Q 1221
Next
In Process

SIKSHAPATH Latest Questions

Berlin
  • 0
  • 0
Berlin
Asked: October 27, 20212021-10-27T12:18:11+05:30 2021-10-27T12:18:11+05:30In: Programming Language

Total Correct Submissions

  • 0
  • 0

Codechef challenges have three divisions. In one challenge, there are NN problems in each division, but some problems may be shared among multiple divisions. Each problem is uniquely identified by a code — a string containing only uppercase English letters. Each participant can only submit in one of the divisions.

Chef wants to find the number of correct solutions, in total among all 33 divisions, for each problem. Given a list of NN problem codes with the numbers of correct solutions for each problem in each division, find the total number of correct solutions for each problem and sort them in non-decreasing order.

 

Sample Input 1 

3
1
A 1
B 2
C 3
2
AA 1
AB 1
AB 1
AC 1
AC 1
AD 1
1
Z 100
Z 100
Z 100

Sample Output 1 

1 2 3
1 1 2 2
300
codechef
  • 1 1 Answer
  • 693 Views
  • 0 Followers
  • 0
Answer
Share
  • Facebook

    1 Answer

    • Voted
    • Oldest
    • Recent
    1. Professor
      Professor
      2021-10-27T12:39:18+05:30Added an answer on October 27, 2021 at 12:39 pm

      #include<bits/stdc++.h>
      using namespace std;
      #define ll long long int
      #define mp make_pair
      #define pb push_back
      #define ff first
      #define ss second
      #define pii pair<int,int>
      #define deb(x) cout << #x << ” ” << x << endl
      #define all(x) (x).begin(),(x).end()
      #define fio ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
      #define rep(x,start,end) for(auto x=(start)-((start)>(end));x!=(end)-((start)>(end));((start)<(end)?x++:x–))
      #include<climits>
      const int MOD = 1e9 + 7;
      const ll INF = 1e12;

      ll mod(ll a) {
      if (a >= 0)
      return a;
      else
      return (-1 * a);
      }

      void swap(ll a, ll b) {
      ll temp = a;
      a = b;
      b = temp;
      }

      ll power(ll a, ll b) {
      ll result = 1;
      while (b) {
      if (b % 2)
      result = (result % MOD) * (a % MOD);
      a = ((a % MOD) * (a % MOD)) % MOD;
      b = b / 2;
      }
      return result;
      }
      bool power_check(ll a) {
      bool ans = true;
      while (a > 1) {
      if (a % 2 == 0) {
      a = a / 2;
      }
      else {
      ans = false;
      break;
      }
      }
      return ans;
      }

      void solve() {
      unordered_map<string,int> mp;
      int n;
      cin >>n;
      for (int i = 0; i < 3*n; ++i)
      {
      string s;
      cin >> s;
      int v;
      cin >> v;
      mp[s] += v;
      }
      vector<int> v;
      for(auto x:mp){
      v.pb(x.second);
      }
      sort(all(v));
      for(int x:v){
      cout << x << ” “;
      }
      cout << endl;
      return;
      }

       

      int main() {
      #ifndef ONLINE_JUDGE
      freopen(“input.txt”, “r”, stdin);
      freopen(“output.txt”, “w”, stdout);
      #endif
      fio
      //cout << 1000000000 * 1000000000;
      int qqq;
      cin >> qqq;
      //qqq = 1;
      while (qqq–) {
      solve();
      }
      //ll ans = 1LL << 64;
      //cout << ans << endl;
      return 0;
      }

        • -4
      • Reply
      • Share
        Share
        • Share on WhatsApp
        • Share on Facebook
        • Share on Twitter
        • Share on LinkedIn

    Leave an answer
    Cancel reply

    You must login to add an answer.

    Forgot Password?

    Need An Account, Sign Up Here

    Sidebar

    store ads

    Stats

    • Questions 1k
    • Answers 1k
    • Posts 149
    • Best Answers 89
    • This Free AI Tool Translates Entire Books in Minute !
    • AI News: 🎬 Hollywood’s AI Studios, 🎓 OpenAI’s Latest Gift to Educators, 🚚 Class8 Bags $22M, 🧠 Google Gemini’s Memory Upgrade
    • AI NEWS: Legal Action Against OpenAI, $16M Paid, & Elon Musk’s Praise from Investor 🤖💰📑 | AI Boosts Cloud Seeding for Water Security 🌱💧
    • AI News: 🎬AI Video Tool Scam Exposed🤯, 🛰️ AI-Powered Drones to Ukraine 😱, Google’s $20M AI Push, Sam Altman Joins SF’s Leadership Team
    • AI News: 🤝 Biden Meets Xi on AI Talks, 💡 Xavier Niel’s Advice for Europe, ♻️ Hong Kong’s Smart Bin Revolution, 🚀 AI x Huawei

    Explore

    • Recent Questions
    • Questions For You
    • Answers With Time
    • Most Visited
    • New Questions
    • Recent Questions With Time

    Footer

    SIKSHAPATH

    Helpful Links

    • Contact
    • Disclaimer
    • Privacy Policy Notice
    • TERMS OF USE
    • FAQs
    • Refund/Cancellation Policy
    • Delivery Policy for Sikshapath

    Follow Us

    © 2021-24 Sikshapath. All Rights Reserved

    Insert/edit link

    Enter the destination URL

    Or link to existing content

      No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.