Submission #169560


Source Code Expand

Copy
function Main(input) {
	input = input.split("\n");
	var ans = 0;
	var i,j,x;
	var a = [];
	for(i=1;i<=input[0];i++){
		a[i-1] = input[i]; 
	}
	a.sort(function(x,y){return x-y;});
	for(i=input[0]-1;i>=0;i--){
		x = 0;
		for(j=i+1;a[j]==a[i];j++){
			x++;
		}
		for(j=i-1;j>=0;j--){
			if(a[i]%a[j]==0){x++;}
		}
		ans += ( (x/2 | 0)+1 )/(x+1);
	}
	console.log(ans);
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));

Submission Info

Submission Time
Task C - コイン
User putrat
Language JavaScript (Node.js 0.6.12)
Score 100
Code Size 443 Byte
Status
Exec Time 422 ms
Memory 11088 KB

Judge Result

Set Name Score / Max Score Test Cases
Sample 0 / 0 sample_01.txt, sample_02.txt, sample_03.txt
Subtask1 99 / 99 subtask1_01.txt, subtask1_02.txt, subtask1_03.txt, subtask1_04.txt, subtask1_05.txt, subtask1_06.txt, subtask1_07.txt, subtask1_08.txt, subtask1_09.txt, subtask1_10.txt, subtask1_11.txt, subtask1_12.txt, subtask1_13.txt, subtask1_14.txt, subtask1_15.txt, subtask1_16.txt, subtask1_17.txt, subtask1_18.txt, subtask1_19.txt, subtask1_20.txt
Subtask2 1 / 1 subtask1_01.txt, subtask1_02.txt, subtask1_03.txt, subtask1_04.txt, subtask1_05.txt, subtask1_06.txt, subtask1_07.txt, subtask1_08.txt, subtask1_09.txt, subtask1_10.txt, subtask1_11.txt, subtask1_12.txt, subtask1_13.txt, subtask1_14.txt, subtask1_15.txt, subtask1_16.txt, subtask1_17.txt, subtask1_18.txt, subtask1_19.txt, subtask1_20.txt, subtask2_01.txt, subtask2_02.txt, subtask2_03.txt, subtask2_04.txt, subtask2_05.txt, subtask2_06.txt, subtask2_07.txt, subtask2_08.txt, subtask2_09.txt, subtask2_10.txt, subtask2_11.txt, subtask2_12.txt, subtask2_13.txt, subtask2_14.txt, subtask2_15.txt, subtask2_16.txt, subtask2_17.txt, subtask2_18.txt, subtask2_19.txt, subtask2_20.txt
Case Name Status Exec Time Memory
sample_01.txt 422 ms 11088 KB
sample_02.txt 163 ms 10956 KB
sample_03.txt 159 ms 10952 KB
subtask1_01.txt 166 ms 10952 KB
subtask1_02.txt 165 ms 10956 KB
subtask1_03.txt 161 ms 10956 KB
subtask1_04.txt 159 ms 10956 KB
subtask1_05.txt 162 ms 10944 KB
subtask1_06.txt 160 ms 10956 KB
subtask1_07.txt 161 ms 10988 KB
subtask1_08.txt 161 ms 11080 KB
subtask1_09.txt 161 ms 10956 KB
subtask1_10.txt 159 ms 10952 KB
subtask1_11.txt 173 ms 10960 KB
subtask1_12.txt 162 ms 10956 KB
subtask1_13.txt 162 ms 10956 KB
subtask1_14.txt 162 ms 10952 KB
subtask1_15.txt 160 ms 10948 KB
subtask1_16.txt 161 ms 10960 KB
subtask1_17.txt 161 ms 10956 KB
subtask1_18.txt 159 ms 10960 KB
subtask1_19.txt 162 ms 10956 KB
subtask1_20.txt 157 ms 10952 KB
subtask2_01.txt 159 ms 10944 KB
subtask2_02.txt 161 ms 10944 KB
subtask2_03.txt 165 ms 10956 KB
subtask2_04.txt 162 ms 10960 KB
subtask2_05.txt 161 ms 10952 KB
subtask2_06.txt 163 ms 11072 KB
subtask2_07.txt 163 ms 11084 KB
subtask2_08.txt 163 ms 11080 KB
subtask2_09.txt 161 ms 10956 KB
subtask2_10.txt 162 ms 10948 KB
subtask2_11.txt 164 ms 11084 KB
subtask2_12.txt 165 ms 10956 KB
subtask2_13.txt 161 ms 11076 KB
subtask2_14.txt 161 ms 11024 KB
subtask2_15.txt 163 ms 11084 KB
subtask2_16.txt 161 ms 10952 KB
subtask2_17.txt 162 ms 11084 KB
subtask2_18.txt 166 ms 11080 KB
subtask2_19.txt 164 ms 10960 KB
subtask2_20.txt 162 ms 11084 KB