結果
| 問題 |
No.345 最小チワワ問題
|
| コンテスト | |
| ユーザー |
めうめう🎒
|
| 提出日時 | 2016-03-13 21:28:04 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 699 bytes |
| コンパイル時間 | 818 ms |
| コンパイル使用メモリ | 73,620 KB |
| 実行使用メモリ | 6,948 KB |
| 最終ジャッジ日時 | 2024-09-25 11:38:37 |
| 合計ジャッジ時間 | 1,732 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 29 |
コンパイルメッセージ
main.cpp: In function ‘int bfs(int, int)’:
main.cpp:22:1: warning: no return statement in function returning non-void [-Wreturn-type]
22 | }
| ^
ソースコード
#include <algorithm>
#include <cstdio>
#include <iostream>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
using namespace std;
#define ll long long
#define INF (1 << 30)
#define INFLL (1LL << 60)
string str;
int bfs(int now,int how){
int a,b;
}
int main() {
cin >> str;
int ans = INF;
for(int i = 0;i < str.size();i++){
if(str[i] == 'c'){
int how = 0;
for(int j = i;j < str.size();j++){
if(str[j] == 'w') how++;
if(how == 2) {
ans = min(ans,j-i+1);
break;
}
}
}
}
//cout << INF << endl;
if(ans == INF) cout << "-1" << endl;
else cout << ans << endl;
return 0;
}
めうめう🎒