codeforce 659B
来源:互联网 发布:linux 查看服务器版本 编辑:程序博客网 时间:2024/05/29 07:42
659B
#include <bits/stdc++.h>using namespace std;#define LL long long#define INF 0x3f3f3f3#define pi acos(-1)const int maxn=1e3+5;const int maxx=1e6+5;set< pair<int,string> >v[11111];string s[111111];int n,m,a[111111],b[111111];int main(){cin>>n>>m;for(int i=1; i<=n; i++){ cin>>s[i]>>a[i]>>b[i]; v[a[i]].insert( make_pair( -b[i],s[i] ) );} for(int i=1; i<=m; i++){ set< pair<int,string> >::iterator it=v[i].begin(); string q=it->second; int g=it->first; v[i].erase(it); it=v[i].begin(); string w=it->second; int h=it->first; v[i].erase(it); if( v[i].empty() ){ cout<<q<<" "<<w<<endl; continue; } it=v[i].begin(); string tr=it->second; int jk=it->first; if( jk==h ){ cout<<"?"<<endl; } else{ cout<<q<<" "<<w<<endl; } }return 0;}
0 0
- codeforce 659B
- Codeforce # B Sequence Formatting
- codeforce 298 B Sail
- 【codeforce】B. Flag Day
- codeforce B. Road Construction
- CodeForce 126B
- codeforce #247 B(div2)
- codeforce 6B dfs
- codeforce 7B
- codeforce 9B
- codeforce 13B
- codeforce 15B
- codeforce 17 B
- codeforce 18B
- codeforce 34B
- codeforce 486B
- 【模拟】Codeforce 302B
- (320B)codeforce
- listview的上滑下滑监听,上下滑监听隐藏顶部选项栏
- 第18章 JAVA I/O系统
- openwrt之wrtnode学习日记day5
- begin
- Lifecycle Sorter插件
- codeforce 659B
- 如何禁止svg图的放大缩小功能
- eclipse常用插件地址(不断更新)
- hadoop系列:zookeeper(2)——zookeeper核心原理(选举)
- 算法 0-1背包问题
- 使用sklearn做特征工程
- 怎么计算union和struct中字节数计算
- Linux yum 命令介绍
- spring mvc返回json 类型的 数据