結果

問題 No.182 新規性の虜
ユーザー butsurizuki
提出日時 2016-11-30 17:36:38
言語 C90
(gcc 12.3.0)
結果
AC  
実行時間 1,190 ms / 5,000 ms
コード長 541 bytes
コンパイル時間 304 ms
コンパイル使用メモリ 21,504 KB
実行使用メモリ 10,752 KB
最終ジャッジ日時 2024-12-27 11:16:41
合計ジャッジ時間 8,467 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 27
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c: In function ‘main’:
main.c:5:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    5 |         scanf("%d",&n);
      |         ^~~~~~~~~~~~~~
main.c:7:17: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    7 |                 scanf("%d",&t);
      |                 ^~~~~~~~~~~~~~

ソースコード

diff #

#include <stdio.h>

int main(void){
	int i,j,n,t,k,r = 0,c,a[16][131072] = {0},ap[16] = {0},al[131072],bl[131072],blc=0,con;
	scanf("%d",&n);
	for(i = 1;i <= n;i++){
		scanf("%d",&t);
		al[i] = t;
		k = t % 10;
		a[k][(ap[k])] = t;
		ap[k]++;
	}
	for(i = 1;i <= n;i++){
		con = 0;
		k = al[i] % 10;
		c = 0;
		for(j = 0;j < blc;j++){
			if(bl[j] == al[i]){con++;break;}
		}
		if(con){continue;}
		for(j = 0;j < ap[k];j++){
			if(al[i] == a[k][j]){c++;}
		}
		if(c == 1){r++;}
		else{bl[blc] = al[i];blc++;}
	}
	printf("%d\n",r);
	return 0;
}
0