提出 #624851
ソースコード 拡げる
import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner s = new Scanner(System.in);
int N = s.nextInt();
int[] a = new int[N];
for(int i=0; i<N; i++) {
a[i] = s.nextInt();
}
int cnt=1;
for(int i=0; i<a.length-1; i++) {
for(int j=0; j<i-1; j++) {
if(a[j]>a[j+1]) {
int tmp = a[j];
a[j] = a[j+1];
a[j+1] = tmp;
cnt++;
}
}
}
System.out.println(cnt);
}
}
提出情報
| 提出日時 | |
|---|---|
| 問題 | B - ディスコ社内ツアー |
| ユーザ | takasumiu |
| 言語 | Java8 (OpenJDK 1.8.0) |
| 得点 | 0 |
| コード長 | 655 Byte |
| 結果 | WA |
| 実行時間 | 2045 ms |
| メモリ | 44540 KiB |
ジャッジ結果
| セット名 | Sample | Small | Permutation | All | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 得点 / 配点 | 0 / 0 | 0 / 20 | 0 / 10 | 0 / 70 | ||||||||||||||||||||
| 結果 |
|
|
|
|
| セット名 | テストケース |
|---|---|
| Sample | 00_example_01.txt, 00_example_02.txt, 00_example_03.txt, 00_example_04.txt |
| Small | 00_example_01.txt, 00_example_02.txt, 00_example_03.txt, 00_example_04.txt, 10_rand_01.txt, 10_rand_02.txt, 10_rand_03.txt, 10_rand_04.txt, 10_rand_05.txt, 10_rand_06.txt, 10_rand_07.txt, 10_rand_08.txt, 20_perm_01.txt, 20_perm_02.txt, 20_perm_03.txt, 20_perm_04.txt, 20_perm_05.txt, 20_perm_06.txt, 20_perm_07.txt, 20_perm_08.txt, 30_hand_01.txt, 30_hand_02.txt, 30_hand_03.txt, 30_hand_04.txt, 30_hand_05.txt, 30_hand_06.txt |
| Permutation | 00_example_01.txt, 00_example_02.txt, 00_example_03.txt, 20_perm_01.txt, 20_perm_02.txt, 20_perm_03.txt, 20_perm_04.txt, 20_perm_05.txt, 20_perm_06.txt, 20_perm_07.txt, 20_perm_08.txt, 30_hand_01.txt, 30_hand_02.txt, 60_perm_01.txt, 60_perm_02.txt, 60_perm_03.txt, 60_perm_04.txt, 60_perm_05.txt, 60_perm_06.txt, 60_perm_07.txt, 60_perm_08.txt, 70_hand_01.txt, 70_hand_02.txt |
| All | 00_example_01.txt, 00_example_02.txt, 00_example_03.txt, 00_example_04.txt, 10_rand_01.txt, 10_rand_02.txt, 10_rand_03.txt, 10_rand_04.txt, 10_rand_05.txt, 10_rand_06.txt, 10_rand_07.txt, 10_rand_08.txt, 20_perm_01.txt, 20_perm_02.txt, 20_perm_03.txt, 20_perm_04.txt, 20_perm_05.txt, 20_perm_06.txt, 20_perm_07.txt, 20_perm_08.txt, 30_hand_01.txt, 30_hand_02.txt, 30_hand_03.txt, 30_hand_04.txt, 30_hand_05.txt, 30_hand_06.txt, 50_rand_01.txt, 50_rand_02.txt, 50_rand_03.txt, 50_rand_04.txt, 50_rand_05.txt, 50_rand_06.txt, 50_rand_07.txt, 50_rand_08.txt, 60_perm_01.txt, 60_perm_02.txt, 60_perm_03.txt, 60_perm_04.txt, 60_perm_05.txt, 60_perm_06.txt, 60_perm_07.txt, 60_perm_08.txt, 70_hand_01.txt, 70_hand_02.txt, 70_hand_03.txt, 70_hand_04.txt, 70_hand_05.txt, 70_hand_06.txt |
| ケース名 | 結果 | 実行時間 | メモリ |
|---|---|---|---|
| 00_example_01.txt | WA | 502 ms | 29108 KiB |
| 00_example_02.txt | AC | 408 ms | 28996 KiB |
| 00_example_03.txt | WA | 422 ms | 29056 KiB |
| 00_example_04.txt | AC | 444 ms | 28976 KiB |
| 10_rand_01.txt | WA | 433 ms | 29272 KiB |
| 10_rand_02.txt | WA | 423 ms | 29204 KiB |
| 10_rand_03.txt | WA | 422 ms | 29056 KiB |
| 10_rand_04.txt | WA | 429 ms | 28972 KiB |
| 10_rand_05.txt | WA | 429 ms | 28984 KiB |
| 10_rand_06.txt | WA | 453 ms | 29196 KiB |
| 10_rand_07.txt | WA | 431 ms | 29108 KiB |
| 10_rand_08.txt | WA | 405 ms | 29084 KiB |
| 20_perm_01.txt | WA | 395 ms | 29160 KiB |
| 20_perm_02.txt | WA | 426 ms | 29224 KiB |
| 20_perm_03.txt | WA | 413 ms | 29100 KiB |
| 20_perm_04.txt | WA | 404 ms | 29036 KiB |
| 20_perm_05.txt | WA | 426 ms | 29024 KiB |
| 20_perm_06.txt | WA | 406 ms | 29104 KiB |
| 20_perm_07.txt | WA | 398 ms | 29060 KiB |
| 20_perm_08.txt | WA | 387 ms | 29076 KiB |
| 30_hand_01.txt | AC | 405 ms | 29216 KiB |
| 30_hand_02.txt | WA | 393 ms | 29248 KiB |
| 30_hand_03.txt | AC | 395 ms | 29192 KiB |
| 30_hand_04.txt | WA | 413 ms | 29132 KiB |
| 30_hand_05.txt | WA | 388 ms | 29200 KiB |
| 30_hand_06.txt | WA | 404 ms | 29136 KiB |
| 50_rand_01.txt | TLE | 2042 ms | 42980 KiB |
| 50_rand_02.txt | TLE | 2042 ms | 44296 KiB |
| 50_rand_03.txt | TLE | 2043 ms | 44184 KiB |
| 50_rand_04.txt | TLE | 2043 ms | 43440 KiB |
| 50_rand_05.txt | WA | 1866 ms | 42576 KiB |
| 50_rand_06.txt | WA | 439 ms | 29472 KiB |
| 50_rand_07.txt | WA | 833 ms | 40368 KiB |
| 50_rand_08.txt | TLE | 2042 ms | 43356 KiB |
| 60_perm_01.txt | TLE | 2041 ms | 43776 KiB |
| 60_perm_02.txt | TLE | 2042 ms | 43796 KiB |
| 60_perm_03.txt | TLE | 2041 ms | 43504 KiB |
| 60_perm_04.txt | TLE | 2042 ms | 43540 KiB |
| 60_perm_05.txt | WA | 1947 ms | 42432 KiB |
| 60_perm_06.txt | WA | 558 ms | 29580 KiB |
| 60_perm_07.txt | WA | 829 ms | 40636 KiB |
| 60_perm_08.txt | TLE | 2043 ms | 43436 KiB |
| 70_hand_01.txt | TLE | 2043 ms | 43712 KiB |
| 70_hand_02.txt | TLE | 2044 ms | 43600 KiB |
| 70_hand_03.txt | TLE | 2041 ms | 44356 KiB |
| 70_hand_04.txt | TLE | 2043 ms | 43880 KiB |
| 70_hand_05.txt | TLE | 2042 ms | 43692 KiB |
| 70_hand_06.txt | TLE | 2045 ms | 44540 KiB |