Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <queue>
- #include <string>
- using namespace std;
- /*
- int main()
- {
- priority_queue<int> Q;
- queue<int> T;
- for(string s; cin >> s;)
- if(s == "$") break;
- else if(s == "#")
- {
- for(int i =0; !Q.empty() and i <5 ; i++)
- {
- T.push(Q.top());
- Q.pop();
- }
- }
- else
- {
- Q.push(stoi(s));
- }
- while(!T.empty())
- {
- cout << T.front()<<" ";
- T.pop();
- }
- return 0;
- }
- */
- ///////////////////////////////////////////////////////////////
- #include <map>
- #include <iomanip>
- int main(){
- int n; cin >> n;
- string line;
- cin.ignore();
- map<int,int> box;
- bool flag = true;
- while(n--){
- int mx=0;
- getline(cin, line);
- for(char& i:line)
- {
- if ( i == '-') continue;
- if ( i >= 'Q') i-=1;
- mx *= 10;
- if(i >= 'A') mx+= (i-'A')/3+2;
- else mx += i-'0';
- }
- flag &= ((box[mx]+=1) == 1);
- if (flag) cout << "svi razliciti";
- else
- for(auto& i : box){
- if(i.second > 1)
- cout << setfill('0')<< setw(3)<<(i.first / 10000)
- << "-"
- << setfill('0')<< setw(4)<<(i.first % 10000)
- << ' '<< i.second << "\n";
- }
- return 0;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement