結果
問題 | No.138 化石のバージョン |
ユーザー |
👑 |
提出日時 | 2022-08-08 16:17:10 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 20 ms / 5,000 ms |
コード長 | 832 bytes |
コンパイル時間 | 779 ms |
コンパイル使用メモリ | 73,980 KB |
最終ジャッジ日時 | 2025-01-30 19:26:20 |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 33 |
ソースコード
#include <iostream>#include <list>#include <vector>#include <string>#include <stdio.h>#include <stdint.h>using namespace std;using uint = unsigned int;using ll = long long;#define CIN( LL , A ) LL A; cin >> A#define GETLINE( A ) string A; getline( cin , A )int main(){CIN( string , S0 );CIN( string , S1 );S0 += ".";S1 += ".";string S[2] = { S0 , S1 };ll A[2] = {};for( ll i = 0 ; i < 2 ; i++ ){const string& Si = S[i];const uint& size = Si.size();ll& Ai = A[i];ll d = 0;for( ll j = 0 ; j < size ; j++ ){const string c = Si.substr( j , 1 );if( c == "." ){Ai = Ai * 1000 + d;d = 0;} else {d = d * 10 + stoi( c );}}}const string answer = A[0] < A[1] ? "NO" : "YES";cout << answer << endl;return 0;}