結果

問題 No.2560 A_1 < A_2 < ... < A_N
ユーザー ducktailducktail
提出日時 2023-12-04 01:09:22
言語 Scheme
(Gauche-0.9.14)
結果
AC  
実行時間 479 ms / 2,000 ms
コード長 494 bytes
コンパイル時間 108 ms
コンパイル使用メモリ 6,676 KB
実行使用メモリ 20,864 KB
最終ジャッジ日時 2023-12-04 01:09:28
合計ジャッジ時間 6,036 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 26 ms
16,000 KB
testcase_01 AC 337 ms
20,864 KB
testcase_02 AC 408 ms
20,864 KB
testcase_03 AC 327 ms
20,864 KB
testcase_04 AC 388 ms
20,864 KB
testcase_05 AC 430 ms
20,864 KB
testcase_06 AC 453 ms
20,864 KB
testcase_07 AC 450 ms
20,864 KB
testcase_08 AC 451 ms
20,864 KB
testcase_09 AC 452 ms
20,864 KB
testcase_10 AC 479 ms
20,864 KB
testcase_11 AC 26 ms
16,128 KB
testcase_12 AC 28 ms
16,384 KB
testcase_13 AC 27 ms
16,128 KB
testcase_14 AC 26 ms
16,128 KB
testcase_15 AC 29 ms
16,768 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

(define (main args)
  (let1 t (read)
        (do [(i t (- i 1))]
            [(zero? i)]
          (let* ([n (read)]
                 [x (read)]
                 [wa (quotient (* n (+ n 1)) 2)]
                 [d (- x wa)])
            (cond [(negative? d) (print -1)]
                  [else (do [(j 1 (+ j 1))]
                            [(= j n)]
                          (display j)
                          (display " "))
                        (print (+ n d))])
            )))
  0)
0