Task: | Kortit |
Sender: | TapaniS |
Submission time: | 2020-09-25 20:37:54 +0300 |
Language: | Java |
Status: | READY |
Result: | 0 |
group | verdict | score |
---|---|---|
#1 | WRONG ANSWER | 0 |
#2 | WRONG ANSWER | 0 |
test | verdict | time | group | |
---|---|---|---|---|
#1 | WRONG ANSWER | 0.23 s | 1, 2 | details |
#2 | WRONG ANSWER | 0.36 s | 2 | details |
Code
import java.util.*; public class kortit { public static void main(String[] args) { Scanner input = new Scanner(System.in); int tests = input.nextInt(); int[] ans = new int[tests]; int card = 0; for (int k = 0; k < tests; k++) { int qty = input.nextInt() / 2; int winners = 0; for (int i = 0; i < qty; i++) { card = input.nextInt(); if (card > (winners + i + 1)) { winners++; } } ans[k] = winners; } for (int i = 0; i < tests; i++) { System.out.println(ans[i]); } input.close(); } }