結果
| 問題 | No.346 チワワ数え上げ問題 |
| コンテスト | |
| ユーザー |
testestest
|
| 提出日時 | 2016-02-26 22:24:06 |
| 言語 | C90 (gcc 12.4.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 142 bytes |
| 記録 | |
| コンパイル時間 | 159 ms |
| コンパイル使用メモリ | 29,124 KB |
| 最終ジャッジ日時 | 2026-02-23 20:47:51 |
|
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | -- * 3 |
| other | AC * 2 WA * 18 TLE * 1 -- * 2 |
コンパイルメッセージ
main.c: In function ‘main’:
main.c:6:4: warning: incompatible implicit declaration of built-in function ‘printf’ [-Wbuiltin-declaration-mismatch]
6 | m=!printf("%ld",m);
| ^~~~~~
main.c:1:1: note: include ‘<stdio.h>’ or provide a declaration of ‘printf’
+++ |+#include <stdio.h>
1 | char s[100010];
/usr/bin/ld: /tmp/ccjHMHGK.o: in function `main':
main.c:(.text.startup+0x12): 警告: the `gets' function is dangerous and should not be used.
ソースコード
char s[100010];
long m,t,i,j;
main(){
gets(s);
for(i=0;s[i];m=t*(t-1)/2,i++)for(t=0,j=i;s[i]=='c'&&s[++j];)t+=s[j]=='w';
m=!printf("%ld",m);
}
testestest