結果
問題 | No.138 化石のバージョン |
ユーザー |
![]() |
提出日時 | 2015-04-26 07:15:03 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 5,000 ms |
コード長 | 376 bytes |
コンパイル時間 | 676 ms |
コンパイル使用メモリ | 57,588 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-12-29 13:11:59 |
合計ジャッジ時間 | 1,555 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 33 |
コンパイルメッセージ
main.cpp: In function ‘int main()’: main.cpp:8:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 8 | scanf("%d.%d.%d",&d1[0],&d1[1],&d1[2]); | ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ main.cpp:9:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 9 | scanf("%d.%d.%d",&d2[0],&d2[1],&d2[2]); | ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ソースコード
#include <iostream> #include <cmath> #include <cstdlib> #include <cstdio> using namespace std; int main(){ int data1=0,data2=0,d1[3],d2[3]; scanf("%d.%d.%d",&d1[0],&d1[1],&d1[2]); scanf("%d.%d.%d",&d2[0],&d2[1],&d2[2]); data1=d1[0]*1000000+d1[1]*1000+d1[2]; data2=d2[0]*1000000+d2[1]*1000+d2[2]; if(data1>=data2) cout<<"YES"<<endl; else cout<<"NO"<<endl; return 0; }