結果
問題 | No.313 π |
ユーザー |
![]() |
提出日時 | 2017-07-25 17:00:22 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 490 ms / 5,000 ms |
コード長 | 403 bytes |
コンパイル時間 | 1,367 ms |
コンパイル使用メモリ | 158,736 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-10-09 17:09:25 |
合計ジャッジ時間 | 19,978 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 32 |
コンパイルメッセージ
main.cpp:5:1: warning: ISO C++ forbids declaration of ‘main’ with no type [-Wreturn-type] 5 | main(){ | ^~~~ main.cpp: In function ‘int main()’: main.cpp:6:10: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 6 | scanf("%s",S); | ~~~~~^~~~~~~~
ソースコード
#include<bits/stdc++.h>int cnt[10];int count[] = {20104,20063,19892,20011,19874,20199,19898,20163,19956,19841};char S[200003];main(){scanf("%s",S);for(int i = 0;i < strlen(S);i++){if(S[i]=='.')continue;cnt[S[i]-'0']++;}int a,b;for(int i = 0;i < 10;i++){if(cnt[i]>count[i])a = i;if(cnt[i]<count[i])b = i;}printf("%d %d\n",a,b);}