結果

問題 No.138 化石のバージョン
ユーザー stone_725
提出日時 2015-02-02 15:56:32
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 279 bytes
コンパイル時間 1,645 ms
コンパイル使用メモリ 159,600 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2024-12-29 13:01:00
合計ジャッジ時間 2,828 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 33
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:7:8: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    7 |   scanf("%d.%d.%d", &a.first.first, &a.first.second, &a.second);
      |   ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
main.cpp:8:8: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    8 |   scanf("%d.%d.%d", &b.first.first, &b.first.second, &b.second);
      |   ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

ソースコード

diff #

#include <bits/stdc++.h>

using namespace std;

int main(){
  pair<pair<int, int>, int> a, b;
  scanf("%d.%d.%d", &a.first.first, &a.first.second, &a.second);
  scanf("%d.%d.%d", &b.first.first, &b.first.second, &b.second);
  printf("%s\n", a >= b ? "YES" : "NO");
  return 0;
}
0