結果

問題 No.455 冬の大三角
ユーザー 💕💖💞💕💖💞
提出日時 2018-06-28 15:54:00
言語 Kotlin
(1.9.23)
結果
WA  
実行時間 -
コード長 1,123 bytes
コンパイル時間 11,681 ms
コンパイル使用メモリ 443,192 KB
実行使用メモリ 96,988 KB
最終ジャッジ日時 2024-04-30 18:59:17
合計ジャッジ時間 30,938 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 278 ms
56,908 KB
testcase_01 AC 273 ms
57,000 KB
testcase_02 AC 278 ms
57,092 KB
testcase_03 AC 274 ms
57,000 KB
testcase_04 AC 276 ms
57,048 KB
testcase_05 AC 278 ms
56,992 KB
testcase_06 AC 272 ms
56,984 KB
testcase_07 AC 269 ms
56,992 KB
testcase_08 AC 527 ms
96,988 KB
testcase_09 AC 270 ms
56,992 KB
testcase_10 AC 271 ms
57,032 KB
testcase_11 AC 276 ms
56,936 KB
testcase_12 AC 266 ms
56,908 KB
testcase_13 AC 275 ms
56,896 KB
testcase_14 AC 279 ms
56,848 KB
testcase_15 AC 279 ms
57,052 KB
testcase_16 AC 283 ms
57,000 KB
testcase_17 AC 273 ms
57,004 KB
testcase_18 AC 280 ms
56,880 KB
testcase_19 AC 280 ms
57,024 KB
testcase_20 AC 277 ms
56,900 KB
testcase_21 AC 272 ms
56,904 KB
testcase_22 AC 275 ms
56,892 KB
testcase_23 AC 270 ms
56,944 KB
testcase_24 AC 282 ms
56,924 KB
testcase_25 AC 280 ms
56,904 KB
testcase_26 AC 281 ms
57,000 KB
testcase_27 AC 275 ms
57,020 KB
testcase_28 AC 280 ms
57,072 KB
testcase_29 AC 344 ms
57,264 KB
testcase_30 AC 308 ms
57,252 KB
testcase_31 AC 410 ms
67,712 KB
testcase_32 AC 301 ms
57,244 KB
testcase_33 AC 350 ms
57,148 KB
testcase_34 AC 288 ms
57,064 KB
testcase_35 AC 334 ms
56,952 KB
testcase_36 AC 313 ms
57,148 KB
testcase_37 AC 312 ms
57,020 KB
testcase_38 AC 291 ms
57,036 KB
testcase_39 AC 339 ms
57,152 KB
testcase_40 AC 319 ms
57,180 KB
testcase_41 AC 316 ms
57,108 KB
testcase_42 AC 297 ms
57,192 KB
testcase_43 AC 306 ms
57,068 KB
testcase_44 AC 301 ms
57,208 KB
testcase_45 AC 342 ms
57,260 KB
testcase_46 AC 303 ms
57,192 KB
testcase_47 AC 301 ms
57,080 KB
testcase_48 AC 292 ms
57,132 KB
testcase_49 WA -
testcase_50 AC 279 ms
56,940 KB
testcase_51 AC 294 ms
57,224 KB
testcase_52 AC 292 ms
57,232 KB
testcase_53 AC 287 ms
57,176 KB
testcase_54 AC 293 ms
57,080 KB
testcase_55 WA -
testcase_56 AC 298 ms
57,036 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.kt:1:10: warning: parameter 'args' is never used
fun main(args:Array<String>) {
         ^

ソースコード

diff #

fun main(args:Array<String>) {
  val (h, w) = readLine()!!.split(" ").map(String::toInt)
  val xs = (1..h).map {
    readLine()!!.toList().toMutableList()
  }
  outer@for( hstart in (0..h-1) ) {
    for( wstart in (0..w-1) ) {
      val copy = xs.map { it.toMutableList() }

      copy[hstart][wstart] = '*'
      if( copy.flatten().filter { it == '*' }.size != 3 ) continue

      val triples = mutableListOf<Pair<Int,Int>>()
      copy.mapIndexed { height, copy_line ->
        copy_line.mapIndexed { width, char ->
          if( char == '*' ) triples.add( Pair(height, width) )
        }
      }
      if( ( triples[0].first == triples[1].first && triples[1].first == triples[2].first ) ||
          ( triples[0].second == triples[1].second && triples[1].second == triples[2].second ) ) continue

     // 単位ベクトルを作成
     val (x, y) = Pair( triples[1].first.toDouble()/triples[0].first, triples[1].second.toDouble()/triples[0].second )

     if( triples[2].first.toDouble()/x == triples[2].second.toDouble()/y) continue

      copy.map { it.joinToString("").run(::println) }
      break@outer
    }
  }
}
0