結果

問題 No.138 化石のバージョン
コンテスト
ユーザー 313makoto0
提出日時 2015-01-31 16:41:54
言語 C90(gcc12)
(gcc 12.4.0)
コンパイル:
gcc-12 -O2 -std=c90 -DONLINE_JUDGE -o a.out _filename_ -lm
実行:
./a.out
結果
AC  
実行時間 0 ms / 5,000 ms
+ 716µs
コード長 592 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 82 ms
コンパイル使用メモリ 28,800 KB
実行使用メモリ 5,888 KB
最終ジャッジ日時 2026-07-23 20:51:20
合計ジャッジ時間 1,736 ms
ジャッジサーバーID
(参考情報)
judge1_0 / judge3_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 33
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c: In function ‘main’:
main.c:11:3: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   11 |   scanf("%s",buf);
      |   ^~~~~~~~~~~~~~~
main.c:15:3: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   15 |   scanf("%s",buf);
      |   ^~~~~~~~~~~~~~~

ソースコード

diff #
raw source code

#include<stdio.h>
#include<string.h>
#include<stdlib.h>

int main()
{
  int a,b,c,d,e,f;
  char buf[20];
  char token[10]=".";

  scanf("%s",buf);
  a=atoi(strtok(buf,token));
  b=atoi(strtok(NULL,token));
  c=atoi(strtok(NULL,token));
  scanf("%s",buf);
  d=atoi(strtok(buf,token));
  e=atoi(strtok(NULL,token));
  f=atoi(strtok(NULL,token));

  if (a>d) {
    printf("YES\n");
  } else if (a<d) {
    printf("NO\n");
  } else if (b>e) {
    printf("YES\n");
  } else if (b<e) {
    printf("NO\n");
  } else if (c>=f) {
    printf("YES\n");
  } else {
    printf("NO\n");
  }

  return 0;
}
0