結果
問題 | No.293 4>7の世界 |
ユーザー |
![]() |
提出日時 | 2021-11-04 21:06:37 |
言語 | D (dmd 2.109.1) |
結果 |
RE
|
実行時間 | - |
コード長 | 898 bytes |
コンパイル時間 | 2,478 ms |
コンパイル使用メモリ | 205,496 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-06-22 13:05:29 |
合計ジャッジ時間 | 2,938 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 18 WA * 1 RE * 1 |
ソースコード
import std;void main() {long A, B;readf("%d %d\n", A, B);long N = A.to!real.log10.floor.to!long;long M = B.to!real.log10.floor.to!long;if (N > M) {A.writeln;}else if (N < M) {B.writeln;}else {long C = A, D = B;long E = 10 ^^ N;while (C > 0) {long c = C / E, d = D / E;if (c == 4 && d == 7) {A.writeln;break;}else if (c == 7 && d == 4) {B.writeln;break;}else {if (c > d) {A.writeln;break;}else if (c < d) {B.writeln;break;}}C %= E, D %= E;E /= 10;}}}