結果

問題 No.182 新規性の虜
ユーザー subsn
提出日時 2023-06-13 14:28:19
言語 C
(gcc 13.3.0)
結果
AC  
実行時間 697 ms / 5,000 ms
コード長 620 bytes
コンパイル時間 1,433 ms
コンパイル使用メモリ 28,928 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-06-13 03:35:08
合計ジャッジ時間 5,356 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 27
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<stdio.h>
#define same 1000000001

int main(void) {
	int N, count = 0;
	int b;
	int hash[100][10001];
	int hashcount[100] = { 0 };
	int check;
	scanf("%d", &N);
	for (int i = 0; i < N; i++) {
		scanf("%d", &b);
		hash[b % 10][hashcount[b % 10]] = b;
		hashcount[b % 10]++;
	}
	for (int i = 0; i < 100; i++) {
		for (int j = 0; j<hashcount[i]; j++) {
			if (hash[i][j] == same) {
				continue;
			}
			check = 1;
			for (int k = j + 1; k <= hashcount[i]; k++) {
				if (hash[i][j] == hash[i][k]) {
					hash[i][k] = same;
					check = 0;
				}
			}
			if (check) {
				count++;
			}
		}
	}
	printf("%d", count);
}
0