結果
| 問題 | No.293 4>7の世界 |
| コンテスト | |
| ユーザー |
tak
|
| 提出日時 | 2019-06-26 01:03:43 |
| 言語 | F# (F# 4.0) |
| 結果 |
AC
|
| 実行時間 | 58 ms / 2,000 ms |
| コード長 | 896 bytes |
| 記録 | |
| コンパイル時間 | 9,615 ms |
| コンパイル使用メモリ | 188,908 KB |
| 実行使用メモリ | 29,692 KB |
| 最終ジャッジ日時 | 2024-06-23 14:43:59 |
| 合計ジャッジ時間 | 9,710 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 20 |
コンパイルメッセージ
復元対象のプロジェクトを決定しています... /home/judge/data/code/main.fsproj を復元しました (255 ms)。 MSBuild のバージョン 17.9.6+a4ecab324 (.NET) main -> /home/judge/data/code/bin/Release/net8.0/main.dll main -> /home/judge/data/code/bin/Release/net8.0/publish/
ソースコード
module Yuki
open System
let solve a b =
let rec isA ax bx =
match ax, bx with
| 7L :: _, 4L :: _ ->
false
| 4L :: _, 7L :: _ ->
true
| a :: ax, b :: bx ->
if a > b then true
elif a < b then false
else isA ax bx
| ax, [] -> failwith ""
| [], bx -> failwith ""
let a' = string a
let b' = string b
if a'.Length > b'.Length then
a
elif a'.Length < b'.Length then
b
else
let a'' = a'.ToCharArray() |> Array.map (string>>int64) |> Array.toList
let b'' = b'.ToCharArray() |> Array.map (string>>int64) |> Array.toList
if isA a'' b'' then
a
else
b
let A, B =
let t =
Console.ReadLine().Split()
|> Array.map int64
t.[0], t.[1]
solve A B
|> Console.WriteLine
tak