hihoCoder太阁最新面经算法竞赛10 register

Ended

Participants:138

Verdict:Accepted
Score:100 / 100
Submitted:2016-07-29 23:05:37

Lang:G++

Edit
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#include<iostream>
#include<string>
#include<map>
#include<cmath>
#include<set>
using namespace std;
struct inf
{
    string id;
    double price;
    bool operator <(const inf &a) const
    {
        if (id!=a.id) return id<a.id;
            else return price<a.price;
    }
    bool operator ==(const inf &a) const
    {
        if (id==a.id&&fabs(price-a.price)<1e-6) return true;
            else return false;
    }
};
map<inf,int> mp;
int main()
{
    int n,m,i,j;
    bool flag;
    string date;
    cin>>n;
    mp.clear();
    for (i=0;i<n;i++)
    {
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX