Submission #3596009
Source Code Expand
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int N = sc.nextInt(); int M = sc.nextInt(); int a[] = new int[M]; int b[] = new int[M]; for (int i = 0; i < M; i++) { a[i] = sc.nextInt(); b[i] = sc.nextInt(); } int load[] = new int[N]; for (int i = 0; i < M; i++) { for (int j = 0; j < N; j++) { if(a[i] == j+1 ) { load[j]++; } if (b[i] == j+1) { load[j]++; } } } for (int i = 0; i < N; i++) { System.out.println(load[i]); } } }
Submission Info
Submission Time | |
---|---|
Task | B - Counting Roads |
User | akizora |
Language | Java8 (OpenJDK 1.8.0) |
Score | 200 |
Code Size | 617 Byte |
Status | AC |
Exec Time | 121 ms |
Memory | 21844 KB |
Judge Result
Set Name | Sample | All | ||||
---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 200 / 200 | ||||
Status |
|
|
Set Name | Test Cases |
---|---|
Sample | sample_01.txt, sample_02.txt, sample_03.txt |
All | sample_01.txt, sample_02.txt, sample_03.txt, subtask_1_1.txt, subtask_1_2.txt, subtask_1_3.txt, subtask_1_4.txt, subtask_1_5.txt, subtask_1_6.txt, subtask_1_7.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
sample_01.txt | AC | 103 ms | 18644 KB |
sample_02.txt | AC | 104 ms | 21204 KB |
sample_03.txt | AC | 104 ms | 18772 KB |
subtask_1_1.txt | AC | 107 ms | 18900 KB |
subtask_1_2.txt | AC | 107 ms | 20820 KB |
subtask_1_3.txt | AC | 107 ms | 19412 KB |
subtask_1_4.txt | AC | 108 ms | 21588 KB |
subtask_1_5.txt | AC | 114 ms | 19540 KB |
subtask_1_6.txt | AC | 121 ms | 21076 KB |
subtask_1_7.txt | AC | 112 ms | 21844 KB |