結果
| 問題 |
No.182 新規性の虜
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2021-07-26 17:28:37 |
| 言語 | C (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 629 ms / 5,000 ms |
| コード長 | 620 bytes |
| コンパイル時間 | 545 ms |
| コンパイル使用メモリ | 29,696 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-07-22 08:22:46 |
| 合計ジャッジ時間 | 4,551 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 27 |
ソースコード
#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);
}