結果
| 問題 | No.182 新規性の虜 |
| コンテスト | |
| ユーザー |
Elk
|
| 提出日時 | 2018-05-27 15:23:59 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0 + boost 1.89.0) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 635 bytes |
| 記録 | |
| コンパイル時間 | 154 ms |
| コンパイル使用メモリ | 22,784 KB |
| 実行使用メモリ | 8,608 KB |
| 最終ジャッジ日時 | 2024-06-28 19:07:17 |
| 合計ジャッジ時間 | 22,404 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 21 TLE * 1 -- * 5 |
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:7:10: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
7 | scanf("%d\n", &N);
| ~~~~~^~~~~~~~~~~~
main.cpp:9:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
9 | scanf("%d", &A[i]);
| ~~~~~^~~~~~~~~~~~~
ソースコード
#include <stdio.h>
int main(){
int N, i, j, cnt = 0, new_n = 0;
int A[100000];
scanf("%d\n", &N);
for(i = 0; i < N; i++){
scanf("%d", &A[i]);
}
for(i = 0; i < N; i++){
for(j = 0; j < N; j++){
if(A[i] != A[j]){
cnt++;
//printf("i %d j %d cnt %d\n", i, j, cnt);
}else if(i != j){
break;
}
if(cnt == N - 1){
new_n++;
//printf("new i %d j %d\n", i, j);
break;
}
}
cnt = 0;
}
printf("%d\n", new_n);
return 0;
}
Elk