結果
問題 |
No.138 化石のバージョン
|
ユーザー |
|
提出日時 | 2020-05-23 13:47:11 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 5,000 ms |
コード長 | 500 bytes |
コンパイル時間 | 1,597 ms |
コンパイル使用メモリ | 168,656 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-10-08 00:19:18 |
合計ジャッジ時間 | 2,690 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 33 |
ソースコード
#include <bits/stdc++.h> #define rep(i,n) for(int i=0; i<(n); i++) using namespace std; typedef long long ll; int main(){ string s1,s2; cin>>s1>>s2; rep(i,3){ int n1=s1.find("."); int n2=s2.find("."); string f1=s1.substr(0,n1); string f2=s2.substr(0,n2); s1.replace(0,n1+1,""); s2.replace(0,n2+1,""); int g1=stoi(f1); int g2=stoi(f2); if(g1>g2){ cout << "YES" << endl; return 0; } else if(g1<g2){ cout << "NO" << endl; return 0; } } cout << "YES" << endl; }