結果

問題 No.2210 equence Squence Seuence
ユーザー laneguelanegue
提出日時 2023-02-10 23:03:14
言語 D
(dmd 2.106.1)
結果
WA  
実行時間 -
コード長 533 bytes
コンパイル時間 596 ms
コンパイル使用メモリ 91,956 KB
実行使用メモリ 16,452 KB
最終ジャッジ日時 2023-09-04 19:50:32
合計ジャッジ時間 3,397 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,376 KB
testcase_01 AC 1 ms
4,376 KB
testcase_02 AC 1 ms
4,384 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 AC 26 ms
7,372 KB
testcase_07 AC 67 ms
16,452 KB
testcase_08 WA -
testcase_09 AC 1 ms
4,376 KB
testcase_10 AC 2 ms
4,380 KB
testcase_11 AC 2 ms
4,380 KB
testcase_12 AC 1 ms
4,376 KB
testcase_13 AC 83 ms
12,984 KB
testcase_14 AC 84 ms
12,912 KB
testcase_15 AC 85 ms
14,612 KB
testcase_16 AC 82 ms
12,984 KB
testcase_17 WA -
testcase_18 AC 1 ms
4,376 KB
testcase_19 AC 2 ms
4,376 KB
testcase_20 WA -
testcase_21 AC 2 ms
4,376 KB
testcase_22 WA -
testcase_23 AC 61 ms
14,848 KB
testcase_24 AC 45 ms
8,788 KB
testcase_25 AC 54 ms
12,408 KB
testcase_26 AC 72 ms
13,820 KB
testcase_27 AC 20 ms
6,532 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import std.stdio;
import std.string;
import std.conv;
import std.algorithm;
import std.range;

void main(){
  auto s = readln.chomp.split.to!(int[]);
  auto N = s[0];
  auto K = s[1];
  auto A = readln.chomp.split.to!(int[]);
  auto c = 0;
  auto r = 0;
  for(auto i = 0; i < N - 1; i++){
    if(A[i] >= A[i + 1]){
      c++;
    }else{
      r++;
    }
    if(c == K || r == N - K + 1){
      writeln((A[0 .. i] ~ A[i + 1 .. $]).to!(string[]).join(" "));
      return;
    }
  }
  writeln(A[0 .. $ - 1].to!(string[]).join(" "));
}

0