1039 Course List for Student

Source: Internet
Author: User

Title Link: https://pintia.cn/problem-sets/994805342720868352/problems/994805447855292416

The way to open the hash is what I learned from other people's blog, but also the first time, it feels good to use, the next time you meet this topic has a train of thought.

Then inside Sync_with_stdio (false) and the following sentence is to speed up the input and output, this is C + + compatible C input and output, but in the test, OJ will report a section error, I tested, only these two words will still error, before I have used such statements, No error, why is it here?

The code is as follows:

1#include <iostream>2#include <vector>3#include <stdio.h>4#include <fstream>5#include <algorithm>6#include <cstdlib>7 using namespacestd;8 Const intMAXN = -* -* -+Ten;9 intTransCharname[]) {Ten     intRET =0; One      for(inti =0; I <3; i++){ ARET = ret* -+name[0]-'A'; -     } -RET + = name[3]-'0'; the     returnret; - } -vector<int>V[MAXN]; - intMain () { +     //Ios::sync_with_stdio (false); -     //cin.tie (0); +     intn,m,k,l; A     intstem; at     Charname[5]; -CIN >> N >>m; -      for(inti =0; I < m; i++){ -Cin >> K >>l; -          for(intj =0; J < L; J + +){ -scanf"%s", name); in //cin >> name; -Stem =Trans (name); to V[stem].push_back (k); + //cout << stem << endl; -         } the     } *vector<int>:: iterator it; $      for(inti =0; I < n; i++){Panax Notoginsengscanf"%s", name); - //cin >> name; theStem =Trans (name); +cout << name <<" "<<v[stem].size (); A sort (V[stem].begin (), V[stem].end ()); the          for(it = V[stem].begin (); It! = V[stem].end (); it++){ +cout <<" "<< *it; -         } $cout <<Endl; $     } -     return 0; -}

1039 Course List for Student

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.