Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //http://codeforces.com/contest/699/problem/B
- //Language: Kotlin
- fun main(args: Array<String>) {
- val (n, m) = readLine()!!.split(" ").map(String::toInt);
- val list: MutableList<Pair<Int, Int>> = mutableListOf();
- for (i in 1..n) {
- readLine()!!.mapIndexed {i, c -> Pair(i, c)}.filter {it.second == '*'}.map{Pair(i, it.first + 1)}.toCollection(list)
- }
- for (i in 1..n) {
- val j = list.filter {it.first != i}.map {it.second}.distinct()
- if (j.count() < 2) {
- println("YES\n$i ${j.getOrElse(0, {1})}")
- return;
- }
- }
- println("NO")
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement