結果

問題 No.667 Mice's Luck(ネズミ達の運)
ユーザー SKanayaSKanaya
提出日時 2018-03-28 22:12:36
言語 C++11
(gcc 13.3.0)
結果
AC  
実行時間 71 ms / 2,000 ms
コード長 268 bytes
コンパイル時間 325 ms
コンパイル使用メモリ 24,192 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-06-25 13:19:51
合計ジャッジ時間 2,427 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 10
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:5:8: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    5 |   scanf("%s",S);
      |   ~~~~~^~~~~~~~

ソースコード

diff #

#include <stdio.h>
#include <string.h>
int main() {
  char S[100001]="";
  scanf("%s",S);
  int N=strlen(S), No=0;
  for(int i=0;i<N;i++)
    if(S[i]=='o') No++;
  for(int i=0;i<N;i++) {
    printf("%.7f\n",No/(N-i+0.)*100.);
    if(S[i]=='o') No--;
  }
  return 0;
}
0