結果
問題 | No.293 4>7の世界 |
ユーザー |
![]() |
提出日時 | 2016-01-28 01:25:36 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 3 ms / 2,000 ms |
コード長 | 632 bytes |
コンパイル時間 | 770 ms |
コンパイル使用メモリ | 60,508 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-12-30 11:49:52 |
合計ジャッジ時間 | 1,765 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 20 |
ソースコード
#include <iostream> #include <vector> #include <string> #include <algorithm> using namespace std; int main() { cin.tie(0); ios::sync_with_stdio(false); string a, b; cin >> a >> b; if(a.length() > b.length()) { cout << a << endl; } else if(a.length() < b.length()) { cout << b << endl; } else { for(int i = 0; i < a.length(); i++) { if(a[i] != b[i]) { if(a[i] == '4' && b[i] == '7') { cout << a << endl; } else if(a[i] == '7' && b[i] == '4') { cout << b << endl; } else if(a[i] > b[i]) { cout << a << endl; } else { cout << b << endl; } break; } } } }