結果
問題 | No.346 チワワ数え上げ問題 |
ユーザー |
|
提出日時 | 2017-01-10 12:06:52 |
言語 | C90 (gcc 12.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 269 bytes |
コンパイル時間 | 453 ms |
コンパイル使用メモリ | 20,992 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-12-18 00:22:11 |
合計ジャッジ時間 | 942 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 23 |
コンパイルメッセージ
main.c: In function ‘main’: main.c:8:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 8 | scanf("%s",s); | ^~~~~~~~~~~~~
ソースコード
#include <stdio.h>#include <string.h>int main(void) {int l,i;unsigned long long int c=0,cw=0,r=0;char s[131072];scanf("%s",s);l = strlen(s);for(i = 0;i < l;i++){if(s[i] == 'c'){c++;}if(s[i] == 'w'){r+=cw;cw+=c;}}printf("%llu\n",r);return 0;}