結果
| 問題 |
No.313 π
|
| コンテスト | |
| ユーザー |
FF256grhy
|
| 提出日時 | 2015-12-06 00:25:34 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 5,000 ms |
| コード長 | 450 bytes |
| コンパイル時間 | 211 ms |
| コンパイル使用メモリ | 22,144 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-09-14 14:55:03 |
| 合計ジャッジ時間 | 1,348 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 32 |
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:10:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
10 | scanf("%s", s);
| ~~~~~^~~~~~~~~
ソースコード
#include <stdio.h>
#define DEG 200002
char s[DEG + 1];
int counter[10];
int num[10] = {20104, 20063, 19892, 20011, 19874, 20199, 19898, 20163, 19956, 19841};
int main(void) {
scanf("%s", s);
int i;
for(i = 0; i < DEG; i++) {
if(i != 1) { counter[ s[i] - '0' ]++; }
}
for(i = 0; i < 10; i++) {
if(counter[i] > num[i]) { printf("%d ", i); }
}
for(i = 0; i < 10; i++) {
if(counter[i] < num[i]) { printf("%d\n", i); }
}
return 0;
}
FF256grhy