結果
| 問題 |
No.79 過小評価ダメ・ゼッタイ
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2017-05-14 00:16:04 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 9 ms / 5,000 ms |
| コード長 | 819 bytes |
| コンパイル時間 | 518 ms |
| コンパイル使用メモリ | 30,592 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-06-26 08:13:08 |
| 合計ジャッジ時間 | 1,366 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 22 |
コンパイルメッセージ
main.cpp: In function ‘int main(int, char**)’:
main.cpp:27:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
27 | scanf("%d", &N);
| ~~~~~^~~~~~~~~~
main.cpp:35:22: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
35 | scanf("%d", &idx);
| ~~~~~^~~~~~~~~~~~
ソースコード
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#define READ_BUFSIZE ( 1024 )
#define READ_DELIMITER ( " " )
int main(int argc, char *argv[])
{
/*
char szRead[READ_BUFSIZE] = "";
int OutList[1] = { 0 };
//char* pOutList[2] = {0};
split( szRead, READ_BUFSIZE, READ_DELIMITER, OutList);
int N = OutList[0];
int* pOutList2 = new int[N];
char* pszRead = new char[N * 2];
split(pszRead, N * 2, READ_DELIMITER, pOutList2);
*/
int N = 0;
scanf("%d", &N);
int Level[7] = { 0 }; //レベル毎にカウントする
int idx = 0;
for (int i = 0; i < N; i++)
{
scanf("%d", &idx);
Level[idx]++;
}
int max = Level[0];
int mid = 0;
for (int j = 1; j <= 6; j++)
{
if (max <= Level[j])
{
max = Level[j];
mid = j;
}
}
printf("%d\n", mid);
return 0;
}