Submission #1735165
Source Code Expand
import java.util.*; class Main{ public static void main(String[] args){ Scanner sc = new Scanner(System.in); int N = sc.nextInt(); int count = 0; int a[] = new int[N+1]; for(int i = 1;i <= N;i++){ a[i] = sc.nextInt(); } for(int i = 1;i <= N;i++){ if(i == a[i]){ count++; i++; } } System.out.println(count); } }
Submission Info
Submission Time | |
---|---|
Task | D - Derangement |
User | suesue |
Language | Java8 (OpenJDK 1.8.0) |
Score | 400 |
Code Size | 620 Byte |
Status | AC |
Exec Time | 445 ms |
Memory | 51464 KB |
Judge Result
Set Name | Sample | All | ||||
---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 400 / 400 | ||||
Status |
|
|
Set Name | Test Cases |
---|---|
Sample | 0_000.txt, 0_001.txt, 0_002.txt, 0_003.txt |
All | 0_000.txt, 0_001.txt, 0_002.txt, 0_003.txt, 1_004.txt, 1_005.txt, 1_006.txt, 1_007.txt, 1_008.txt, 1_009.txt, 1_010.txt, 1_011.txt, 1_012.txt, 1_013.txt, 1_014.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
0_000.txt | AC | 98 ms | 21844 KB |
0_001.txt | AC | 103 ms | 21332 KB |
0_002.txt | AC | 97 ms | 23252 KB |
0_003.txt | AC | 97 ms | 18644 KB |
1_004.txt | AC | 100 ms | 21588 KB |
1_005.txt | AC | 445 ms | 48816 KB |
1_006.txt | AC | 444 ms | 51464 KB |
1_007.txt | AC | 410 ms | 47780 KB |
1_008.txt | AC | 415 ms | 47776 KB |
1_009.txt | AC | 434 ms | 49740 KB |
1_010.txt | AC | 436 ms | 50416 KB |
1_011.txt | AC | 428 ms | 50556 KB |
1_012.txt | AC | 431 ms | 50884 KB |
1_013.txt | AC | 435 ms | 50920 KB |
1_014.txt | AC | 425 ms | 48116 KB |