結果

問題 No.138 化石のバージョン
ユーザー naimonon77
提出日時 2015-09-27 21:08:57
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 1,227 bytes
コンパイル時間 641 ms
コンパイル使用メモリ 66,712 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-12-29 13:34:55
合計ジャッジ時間 1,827 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 33
権限があれば一括ダウンロードができます

ソースコード

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 no = 0;

   /* 入力開始! */
   cin >> c0 >> c1;
   /* 入力終了! */
   char go = 1;
   char tmp0 = 0,tmp1 = 0;
   char cnt = 0;
   while(go) {
      if( atoi(c0+tmp0) > atoi(c1+tmp1) ) {
         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(no) cout << "NO";
   else cout << "YES";
   cout << endl;
   return 0;
}
0