Submission #58001292


Source Code Expand

main=do l<-f<$>readLn;mapM print$length l:l
f 0=[]
f n=last[i:f(n-3^i)|i<-[0..10],3^i<=n]

Submission Info

Submission Time
Task B - 3^A
User cojna
Language Haskell (GHC 9.4.5)
Score 200
Code Size 91 Byte
Status AC
Exec Time 1 ms
Memory 6740 KiB

Compile Error

app/Main.hs:1:1: warning: [-Wmissing-signatures]
    Top-level binding with no type signature: main :: IO [()]
  |
1 | main=do l<-f<$>readLn;mapM print$length l:l
  | ^^^^

app/Main.hs:1:12: warning: [-Wtype-defaults]
    • Defaulting the type variable ‘a0’ to type ‘Integer’ in the following constraints
        (Num a0) arising from a use of ‘f’ at app/Main.hs:1:12
        (Ord a0) arising from a use of ‘f’ at app/Main.hs:1:12
        (Read a0) arising from a use of ‘readLn’ at app/Main.hs:1:16-21
    • In the first argument of ‘(<$>)’, namely ‘f’
      In a stmt of a 'do' block: l <- f <$> readLn
      In the expression:
        do l <- f <$> readLn
           mapM print $ length l : l
  |
1 | main=do l<-f<$>readLn;mapM print$length l:l
  |            ^

app/Main.hs:2:1: warning: [-Wmissing-signatures]
    Top-level binding with no type signature:
      f :: (Num t, Integral b, Ord t) => t -> [b]
  |
2 | f 0=[]
  | ^

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 200 / 200
Status
AC × 3
AC × 51
Set Name Test Cases
Sample 00_sample_100.txt, 00_sample_59048.txt, 00_sample_6.txt
All 00_sample_100.txt, 00_sample_59048.txt, 00_sample_6.txt, 01_small_1.txt, 01_small_10.txt, 01_small_11.txt, 01_small_2.txt, 01_small_3.txt, 01_small_4.txt, 01_small_5.txt, 01_small_7.txt, 01_small_8.txt, 01_small_9.txt, 02_large_39365.txt, 02_large_52487.txt, 02_large_56861.txt, 02_large_58319.txt, 02_large_58805.txt, 02_large_58967.txt, 02_large_59021.txt, 02_large_59039.txt, 02_large_59045.txt, 02_large_98414.txt, 03_handmade_100000.txt, 03_handmade_78732.txt, 03_handmade_98409.txt, 03_handmade_98412.txt, 03_handmade_98413.txt, 03_handmade_98415.txt, 03_handmade_99144.txt, 03_handmade_99870.txt, 03_handmade_99871.txt, 03_handmade_99872.txt, 03_handmade_99873.txt, 03_handmade_99953.txt, 03_handmade_99954.txt, 03_handmade_99981.txt, 03_handmade_99990.txt, 03_handmade_99997.txt, 03_handmade_99998.txt, 03_handmade_99999.txt, 04_random_11273.txt, 04_random_16808.txt, 04_random_27545.txt, 04_random_37710.txt, 04_random_43659.txt, 04_random_50074.txt, 04_random_50879.txt, 04_random_75250.txt, 04_random_77924.txt, 04_random_8931.txt
Case Name Status Exec Time Memory
00_sample_100.txt AC 1 ms 6688 KiB
00_sample_59048.txt AC 1 ms 6668 KiB
00_sample_6.txt AC 1 ms 6692 KiB
01_small_1.txt AC 1 ms 6464 KiB
01_small_10.txt AC 1 ms 6460 KiB
01_small_11.txt AC 1 ms 6728 KiB
01_small_2.txt AC 1 ms 6692 KiB
01_small_3.txt AC 1 ms 6660 KiB
01_small_4.txt AC 1 ms 6668 KiB
01_small_5.txt AC 1 ms 6464 KiB
01_small_7.txt AC 1 ms 6668 KiB
01_small_8.txt AC 1 ms 6700 KiB
01_small_9.txt AC 1 ms 6636 KiB
02_large_39365.txt AC 1 ms 6672 KiB
02_large_52487.txt AC 1 ms 6668 KiB
02_large_56861.txt AC 1 ms 6740 KiB
02_large_58319.txt AC 1 ms 6668 KiB
02_large_58805.txt AC 1 ms 6720 KiB
02_large_58967.txt AC 1 ms 6708 KiB
02_large_59021.txt AC 1 ms 6704 KiB
02_large_59039.txt AC 1 ms 6500 KiB
02_large_59045.txt AC 1 ms 6672 KiB
02_large_98414.txt AC 1 ms 6508 KiB
03_handmade_100000.txt AC 1 ms 6696 KiB
03_handmade_78732.txt AC 1 ms 6628 KiB
03_handmade_98409.txt AC 1 ms 6696 KiB
03_handmade_98412.txt AC 1 ms 6688 KiB
03_handmade_98413.txt AC 1 ms 6736 KiB
03_handmade_98415.txt AC 1 ms 6704 KiB
03_handmade_99144.txt AC 1 ms 6704 KiB
03_handmade_99870.txt AC 1 ms 6656 KiB
03_handmade_99871.txt AC 1 ms 6448 KiB
03_handmade_99872.txt AC 1 ms 6728 KiB
03_handmade_99873.txt AC 1 ms 6704 KiB
03_handmade_99953.txt AC 1 ms 6656 KiB
03_handmade_99954.txt AC 1 ms 6676 KiB
03_handmade_99981.txt AC 1 ms 6704 KiB
03_handmade_99990.txt AC 1 ms 6640 KiB
03_handmade_99997.txt AC 1 ms 6684 KiB
03_handmade_99998.txt AC 1 ms 6484 KiB
03_handmade_99999.txt AC 1 ms 6712 KiB
04_random_11273.txt AC 1 ms 6688 KiB
04_random_16808.txt AC 1 ms 6644 KiB
04_random_27545.txt AC 1 ms 6604 KiB
04_random_37710.txt AC 1 ms 6696 KiB
04_random_43659.txt AC 1 ms 6680 KiB
04_random_50074.txt AC 1 ms 6652 KiB
04_random_50879.txt AC 1 ms 6712 KiB
04_random_75250.txt AC 1 ms 6468 KiB
04_random_77924.txt AC 1 ms 6720 KiB
04_random_8931.txt AC 1 ms 6636 KiB