結果
| 問題 | 
                            No.138 化石のバージョン
                             | 
                    
| コンテスト | |
| ユーザー | 
                             FVRChan
                         | 
                    
| 提出日時 | 2017-09-29 09:13:49 | 
| 言語 | C++11(廃止可能性あり)  (gcc 13.3.0)  | 
                    
| 結果 | 
                             
                                WA
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 566 bytes | 
| コンパイル時間 | 495 ms | 
| コンパイル使用メモリ | 65,072 KB | 
| 実行使用メモリ | 5,248 KB | 
| 最終ジャッジ日時 | 2024-11-15 19:45:56 | 
| 合計ジャッジ時間 | 1,444 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge4 / judge3 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 29 WA * 4 | 
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:10:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   10 |         scanf("%d.%d.%d",&a,&b,&c);
      |         ~~~~~^~~~~~~~~~~~~~~~~~~~~
main.cpp:11:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   11 |         scanf("%d.%d.%d",&aa,&bb,&cc);
      |         ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
            
            ソースコード
#include<iostream>
#include<queue>
#include<cstdio>
#include<utility>
#include<algorithm>
#include<cmath>
using namespace std;
int main(){
	int a,b,c,aa,bb,cc;
	scanf("%d.%d.%d",&a,&b,&c);
	scanf("%d.%d.%d",&aa,&bb,&cc);
	if(aa<a){
		cout<<"YES"<<endl;return 0;
	}else if(aa>a){
		cout<<"NO"<<endl;return 0;
	}else{
		if(bb<b){
			cout<<"YES"<<endl;return 0;
		}else if(bb>b){
			cout<<"NO"<<endl;return 0;
		}else{
			if(cc<c){
				cout<<"YES"<<endl;return 0;
			}else if(cc>c){
				cout<<"NO"<<endl;return 0;
			}else{
				cout<<"NO"<<endl;return 0;
			}
		}
	}
}
            
            
            
        
            
FVRChan