結果

問題 No.138 化石のバージョン
ユーザー naimonon77
提出日時 2015-09-27 20:59:25
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 1,236 bytes
コンパイル時間 584 ms
コンパイル使用メモリ 66,456 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-07-19 11:01:09
合計ジャッジ時間 1,518 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 29 WA * 4
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>
#include <string>
#include <cstring>
#include <algorithm>
#include <sstream>
#include <map>
#include <set>
using namespace std;


#define REP(i,a,b) for(i=a;i<b;i++)
#define rep(i,n) REP(i,0,n)

typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
/* ここからが本編 */
/* */
int main(void)
{
   char c0[12];
   char c1[12];
   bool yes = 0,no = 0;

   /* 入力開始! */
   cin >> c0 >> c1;
   /* 入力終了! */
   char go = 1;
   char tmp0 = 0,tmp1 = 0; 
   while(go) {
      if( atoi(c0+tmp0) >= atoi(c1+tmp1) ) {
         yes = 1;break;
      }
      else if(atoi(c0+tmp0) < atoi(c1+tmp1) ) {
         no = 1;break;
      }
      else {
         for(;;) {
            tmp0++;
            if(c0[tmp0] == '.') {
               tmp0++;break;
            }
            else if(c0[tmp0] == '\0') {
               go = 0;break;
            }
         }
         for(;;) {
            tmp1++;
            if(c1[tmp1] == '.') {
               tmp1++;break;
            }
            else if(c1[tmp1] == '\0') {
               go = 0;break;
            }
         }
      }
   }
   if(yes) cout << "YES";
   else if(no) cout << "NO";
   cout << endl;
   return 0;
}
0