結果
| 問題 |
No.201 yukicoderじゃんけん
|
| コンテスト | |
| ユーザー |
greentea011
|
| 提出日時 | 2019-04-11 12:00:19 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 5,000 ms |
| コード長 | 553 bytes |
| コンパイル時間 | 782 ms |
| コンパイル使用メモリ | 80,044 KB |
| 実行使用メモリ | 6,948 KB |
| 最終ジャッジ日時 | 2024-07-18 09:42:45 |
| 合計ジャッジ時間 | 1,432 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 20 |
ソースコード
#include <iostream>
#include <string>
#include <sstream>
#include <map>
int main() {
std::string s;
std::string n;
std::string p;
std::map<std::string,std::string> m;
while(std::getline(std::cin,s)) {
std::istringstream ss(s);
ss>>n>>p;
m.insert(std::make_pair(p,n));
}
if (m.size()==1) std::cout<<-1<<std::endl;
else if (m.begin()->first.size()>m.rbegin()->first.size()) {
std::cout<<m.begin()->second<<std::endl;
}
else {
std::cout<<m.rbegin()->second<<std::endl;
}
}
greentea011