結果

問題 No.2560 A_1 < A_2 < ... < A_N
ユーザー ducktail
提出日時 2023-12-04 01:09:22
言語 Scheme
(Gauche-0.9.15)
結果
AC  
実行時間 457 ms / 2,000 ms
コード長 494 bytes
コンパイル時間 145 ms
コンパイル使用メモリ 5,120 KB
実行使用メモリ 20,864 KB
最終ジャッジ日時 2024-09-26 22:36:19
合計ジャッジ時間 6,180 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 15
権限があれば一括ダウンロードができます

ソースコード

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