結果
問題 |
No.667 Mice's Luck(ネズミ達の運)
|
ユーザー |
![]() |
提出日時 | 2019-08-19 13:26:29 |
言語 | C (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 98 ms / 2,000 ms |
コード長 | 628 bytes |
コンパイル時間 | 336 ms |
コンパイル使用メモリ | 29,696 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-10-04 04:40:58 |
合計ジャッジ時間 | 2,902 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 10 |
コンパイルメッセージ
main.c: In function 'main': main.c:8:14: warning: implicit declaration of function 'getchar_unlocked' [-Wimplicit-function-declaration] 8 | #define gc() getchar_unlocked() | ^~~~~~~~~~~~~~~~ main.c:21:21: note: in expansion of macro 'gc' 21 | c = gc(); | ^~
ソースコード
// yukicoder: No.667 Mice's Luck(ネズミ達の運) // bal4u 2019.8.19 #include <stdio.h> //// 入出力関係 #if 1 #define gc() getchar_unlocked() #else #define gc() getchar() #endif char S[100005]; int main() { int i, c, n, m, ok; ok = 0, n = 0; for (n = 0; ; n++) { c = gc(); if (c == 'o') S[n] = 1, ok++; else if (c < ' ') break; } m = n; for (i = 0; i < n; i++) { printf("%.12lf\n", 100.0*ok / m); m--; if (S[i]) ok--; if (ok == 0) goto NG; else if (ok == m) goto OK; } return 0; NG: while (++i < n) puts( "0.000000000000"); return 0; OK: while (++i < n) puts("100.000000000000"); return 0; }