結果
問題 | No.293 4>7の世界 |
ユーザー |
![]() |
提出日時 | 2015-10-23 22:35:11 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 445 bytes |
コンパイル時間 | 1,785 ms |
コンパイル使用メモリ | 157,940 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-12-30 11:06:35 |
合計ジャッジ時間 | 3,108 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 20 |
ソースコード
#include<bits/stdc++.h>using namespace std;typedef long long ll;#define int long longsigned main(){int A, B;cin >> A >> B;int cA = A, cB = B;for (int w = 1; w < 1e10; w *= 10){int a = A / w % 10, b = B / w % 10;int plusA = 0, plusB = 0;if (a == 4 && b == 7) plusA = 3, plusB = -3;if (a == 7 && b == 4) plusA = -3, plusB = 3;cA += w * plusA; cB += w * plusB;}printf("%lld\n", (cA > cB) ? A : B);return 0;}