結果
| 問題 |
No.457 (^^*)
|
| コンテスト | |
| ユーザー |
rickytheta
|
| 提出日時 | 2016-12-08 00:22:30 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 591 bytes |
| コンパイル時間 | 1,665 ms |
| コンパイル使用メモリ | 159,568 KB |
| 実行使用メモリ | 6,820 KB |
| 最終ジャッジ日時 | 2024-11-28 04:25:13 |
| 合計ジャッジ時間 | 2,346 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 5 WA * 15 |
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:16:8: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
16 | scanf("%s",s);
| ~~~~~^~~~~~~~
ソースコード
#include <bits/stdc++.h>
using namespace std;
typedef int _loop_int;
#define REP(i,n) for(_loop_int i=0;i<(_loop_int)(n);++i)
// O(n)
int dp[2][6][12525];
char s[12525];
char t[2][1252] = {"(*^^)", "(^^*)"};
int n;
int main(){
scanf("%s",s);
n = strlen(s);
int ans[2] = {};
REP(i,n)REP(x,2)REP(j,5){
if(t[x][j] == s[i]){
if(j==0){
dp[x][j+1][i+1] += 1;
}else if(j==4){
ans[x]++;
}else{
dp[x][j+1][i+1] += dp[x][j][i];
}
}else{
dp[x][j][i+1] += dp[x][j][i];
}
}
printf("%d %d\n",ans[0],ans[1]);
return 0;
}
rickytheta