結果
問題 | No.313 π |
ユーザー |
|
提出日時 | 2015-12-19 00:29:59 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 854 bytes |
コンパイル時間 | 376 ms |
コンパイル使用メモリ | 55,740 KB |
実行使用メモリ | 6,948 KB |
最終ジャッジ日時 | 2024-09-16 08:47:28 |
合計ジャッジ時間 | 2,047 ms |
ジャッジサーバーID (参考情報) |
judge6 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | WA * 2 |
other | WA * 32 |
コンパイルメッセージ
main.cpp: In function ‘int main()’: main.cpp:22:10: warning: ignoring return value of ‘FILE* freopen(const char*, const char*, FILE*)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 22 | freopen("sample_01.txt","r",stdin); | ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~ main.cpp:23:8: warning: ignoring return value of ‘char* fgets(char*, int, FILE*)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 23 | fgets(s,1000000,stdin); | ~~~~~^~~~~~~~~~~~~~~~~
ソースコード
#include <iostream>#include <cstdio>#define REP(i,a,b) for(i=a;i<b;i++)#define rep(i,n) REP(i,0,n)#define MOD1 1000000007;#define MOD2 1000007using namespace std;typedef long long ll;typedef unsigned long long ull;typedef long double ld;/* ここからが本編 *//* */int main(){int i;int n,x;FILE *fp;static char s[1000000];int before,after;int a[] = {20104,20063,19893+1,20010-1,19874,20199,19898,20163,19956,19841 };freopen("sample_01.txt","r",stdin);fgets(s,1000000,stdin);for(i=0;s[i];i++) {a[s[i]-'0']--;}for(i=0;i<10;i++) {if(a[i] == 1) before = i;if(a[i] == -1) after = i;}printf("%d %d\n",before,after);/*fgets(s,2000000,fp);printf("a[] = {");printf("%d",a[0]);for(i=1;i<10;i++) {printf(",%d",a[i]);}printf(" }\n");*/return 0;}