結果
問題 |
No.293 4>7の世界
|
ユーザー |
![]() |
提出日時 | 2015-10-23 22:32:03 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 479 bytes |
コンパイル時間 | 669 ms |
コンパイル使用メモリ | 55,800 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-12-30 11:02:29 |
合計ジャッジ時間 | 1,675 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 20 |
ソースコード
#include<iostream> #include<string> int main() { std::string a, b; std::cin >> a >> b; std::string c = a, d = b; for (int i = 0; i < a.length(); i++) { if (a[i] == '4' && b[i] == '7') { c[i] = '7'; d[i] = '4'; } else if (a[i] == '7'&& b[i] == '4') { c[i] = '4'; d[i] = '7'; } } long long e = std::stoi(c); long long f = std::stoi(d); if (e > f) { std::cout << a << std::endl; return 0; } else { std::cout << b << std::endl; return 0; } }