Submission #54171059


Source Code Expand

import Math.*, collection.{mutable as M,*}, java.util.{StringTokenizer as ST}
def nst = ST(io.Source.stdin.mkString); var st:ST=_; def nex = st.nextToken
@main def main = {st=nst; System.out.println(solution)}
def solution =
  val n = nex.toInt
  val k = nex.toLong
  val as = Array.fill(n)(nex.toLong).sorted
  val ans =
    if k>0 then Seq("Yes",as.mkString(" ")).mkString("\n")
    else if as.reverse.scanLeft(0L)(_+_).exists(_<k) then "No"
    else Seq("Yes",as.reverse.mkString(" ")).mkString("\n")
  ans
end solution

Submission Info

Submission Time
Task A - Partition
User defplus
Language Scala 3.3.0 (Scala Native 0.4.14)
Score 300
Code Size 534 Byte
Status AC
Exec Time 193 ms
Memory 107960 KiB

Compile Error

[info] welcome to sbt 1.9.2 (Private Build Java 20.0.1)
[info] loading settings for project main-build from plugins.sbt ...
[info] loading project definition from /judge/main/project
[info] loading settings for project main from build.sbt ...
[info] set current project to main (in build file:/judge/main/)
[info] Defining offline
[info] The new value will be used by updateConfiguration
[info] Reapplying settings...
[info] set current project to main (in build file:/judge/main/)
[info] compiling 1 Scala source to /judge/main/target/scala-3.3.0/classes ...
[info] done compiling
[info] Linking (2840 ms)
[info] Checking intermediate code (quick) (170 ms)
[info] Discovered 820 classes and 5045 methods
[info] Optimizing (release-fast mode) (6126 ms)
[info] Generating intermediate code (3635 ms)
[info] Produced 1 files
[info] Compiling to native code (15315 ms)
[info] Total (28266 ms)
[success] Total time: 37 s, completed Jun 2, 2024, 12:45:00 PM

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 300 / 300
Status
AC × 3
AC × 48
Set Name Test Cases
Sample 00-sample-001.txt, 00-sample-002.txt, 00-sample-003.txt
All 00-sample-001.txt, 00-sample-002.txt, 00-sample-003.txt, 01-handmade-001.txt, 01-handmade-002.txt, 01-handmade-003.txt, 01-handmade-004.txt, 01-handmade-005.txt, 01-handmade-006.txt, 01-handmade-007.txt, 01-handmade-008.txt, 01-handmade-009.txt, 01-handmade-010.txt, 01-handmade-011.txt, 01-handmade-012.txt, 01-handmade-013.txt, 01-handmade-014.txt, 01-handmade-015.txt, 01-handmade-016.txt, 01-handmade-017.txt, 01-handmade-018.txt, 01-handmade-019.txt, 01-handmade-020.txt, 01-handmade-021.txt, 01-handmade-022.txt, 01-handmade-023.txt, 01-handmade-024.txt, 01-handmade-025.txt, 02-random-001.txt, 02-random-002.txt, 02-random-003.txt, 02-random-004.txt, 02-random-005.txt, 02-random-006.txt, 02-random-007.txt, 02-random-008.txt, 02-random-009.txt, 02-random-010.txt, 02-random-011.txt, 02-random-012.txt, 02-random-013.txt, 02-random-014.txt, 02-random-015.txt, 02-random-016.txt, 02-random-017.txt, 02-random-018.txt, 02-random-019.txt, 02-random-020.txt
Case Name Status Exec Time Memory
00-sample-001.txt AC 1 ms 4096 KiB
00-sample-002.txt AC 1 ms 4108 KiB
00-sample-003.txt AC 1 ms 4204 KiB
01-handmade-001.txt AC 1 ms 4144 KiB
01-handmade-002.txt AC 1 ms 4184 KiB
01-handmade-003.txt AC 1 ms 4192 KiB
01-handmade-004.txt AC 1 ms 4192 KiB
01-handmade-005.txt AC 1 ms 4060 KiB
01-handmade-006.txt AC 1 ms 4256 KiB
01-handmade-007.txt AC 1 ms 4100 KiB
01-handmade-008.txt AC 1 ms 4276 KiB
01-handmade-009.txt AC 1 ms 4172 KiB
01-handmade-010.txt AC 1 ms 4220 KiB
01-handmade-011.txt AC 1 ms 4268 KiB
01-handmade-012.txt AC 1 ms 4228 KiB
01-handmade-013.txt AC 1 ms 4160 KiB
01-handmade-014.txt AC 1 ms 4200 KiB
01-handmade-015.txt AC 161 ms 107432 KiB
01-handmade-016.txt AC 129 ms 94196 KiB
01-handmade-017.txt AC 176 ms 107916 KiB
01-handmade-018.txt AC 70 ms 38784 KiB
01-handmade-019.txt AC 142 ms 73348 KiB
01-handmade-020.txt AC 91 ms 38672 KiB
01-handmade-021.txt AC 67 ms 38736 KiB
01-handmade-022.txt AC 48 ms 22548 KiB
01-handmade-023.txt AC 109 ms 73404 KiB
01-handmade-024.txt AC 193 ms 107868 KiB
01-handmade-025.txt AC 167 ms 73308 KiB
02-random-001.txt AC 2 ms 4204 KiB
02-random-002.txt AC 1 ms 4184 KiB
02-random-003.txt AC 1 ms 4272 KiB
02-random-004.txt AC 1 ms 4044 KiB
02-random-005.txt AC 1 ms 4228 KiB
02-random-006.txt AC 1 ms 4168 KiB
02-random-007.txt AC 1 ms 4272 KiB
02-random-008.txt AC 1 ms 4172 KiB
02-random-009.txt AC 1 ms 4228 KiB
02-random-010.txt AC 1 ms 4164 KiB
02-random-011.txt AC 95 ms 38724 KiB
02-random-012.txt AC 61 ms 38800 KiB
02-random-013.txt AC 184 ms 107960 KiB
02-random-014.txt AC 98 ms 38912 KiB
02-random-015.txt AC 38 ms 21460 KiB
02-random-016.txt AC 10 ms 8428 KiB
02-random-017.txt AC 35 ms 21520 KiB
02-random-018.txt AC 69 ms 38632 KiB
02-random-019.txt AC 131 ms 73220 KiB
02-random-020.txt AC 168 ms 73280 KiB