結果
問題 |
No.313 π
|
ユーザー |
|
提出日時 | 2015-12-19 00:30:36 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 856 bytes |
コンパイル時間 | 480 ms |
コンパイル使用メモリ | 53,748 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-09-16 08:47:30 |
合計ジャッジ時間 | 1,574 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 WA * 1 |
other | WA * 32 |
コンパイルメッセージ
main.cpp: In function ‘int main()’: 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 1000007 using 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; }