結果
問題 | No.138 化石のバージョン |
ユーザー |
👑 |
提出日時 | 2022-08-08 16:15:58 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 824 bytes |
コンパイル時間 | 630 ms |
コンパイル使用メモリ | 73,852 KB |
最終ジャッジ日時 | 2025-01-30 19:26:16 |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 32 WA * 1 |
ソースコード
#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; } else { d = d * 10 + stoi( c ); } } } const string answer = A[0] < A[1] ? "NO" : "YES"; cout << answer << endl; return 0; }