結果

問題 No.201 yukicoderじゃんけん
ユーザー alpha_virginis
提出日時 2015-05-03 23:43:50
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 606 bytes
コンパイル時間 1,444 ms
コンパイル使用メモリ 159,220 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-07-05 17:31:40
合計ジャッジ時間 1,920 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 17 WA * 3
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
 
int main() {
 
  std::string n1, n2;
  std::string p1, p2;
  std::string c1, c2;

  std::cin >> n1 >> p1 >> c1;
  std::cin >> n2 >> p2 >> c2;

  if( p1.size() > p2.size() ) {
    std::cout << n1 << std::endl;
    return 0;
  }

  if( p1.size() < p2.size() ) {
    std::cout << n2 << std::endl;
    return 0;
  }

  for(int i = p1.size()-1; i >= 0; --i) {
    if( p1[i] > p2[i] ) {
      std::cout << n1 << std::endl;
      return 0;
    }
    if( p1[i] < p2[i] ) {
      std::cout << n2 << std::endl;
      return 0;
    }
  }

  std::cout << "-1" << std::endl;

  return 0;
}
 
0