結果

問題 No.203 ゴールデン・ウィーク(1)
コンテスト
ユーザー severrabaen
提出日時 2019-01-07 11:32:57
言語 C++11
(gcc 15.2.0 + boost 1.89.0)
コンパイル:
g++-15 -O2 -lm -std=gnu++11 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
WA  
(最新)
AC  
(最初)
実行時間 -
コード長 561 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 774 ms
コンパイル使用メモリ 102,928 KB
実行使用メモリ 6,400 KB
最終ジャッジ日時 2026-05-12 22:32:04
合計ジャッジ時間 1,567 ms
ジャッジサーバーID
(参考情報)
judge3_1 / judge1_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 28 WA * 1
権限があれば一括ダウンロードができます
コンパイルメッセージ
In file included from /home/linuxbrew/.linuxbrew/Cellar/gcc/15.2.0_1/include/c++/15/string:53,
                 from /home/linuxbrew/.linuxbrew/Cellar/gcc/15.2.0_1/include/c++/15/bits/locale_classes.h:42,
                 from /home/linuxbrew/.linuxbrew/Cellar/gcc/15.2.0_1/include/c++/15/bits/ios_base.h:43,
                 from /home/linuxbrew/.linuxbrew/Cellar/gcc/15.2.0_1/include/c++/15/ios:46,
                 from /home/linuxbrew/.linuxbrew/Cellar/gcc/15.2.0_1/include/c++/15/bits/ostream.h:43,
                 from /home/linuxbrew/.linuxbrew/Cellar/gcc/15.2.0_1/include/c++/15/ostream:42,
                 from /home/linuxbrew/.linuxbrew/Cellar/gcc/15.2.0_1/include/c++/15/iostream:43,
                 from main.cpp:1:
In function 'const _Tp& std::max(const _Tp&, const _Tp&) [with _Tp = int]',
    inlined from 'int main()' at main.cpp:27:12:
/home/linuxbrew/.linuxbrew/Cellar/gcc/15.2.0_1/include/c++/15/bits/stl_algobase.h:263:7: warning: 'ans' is used uninitialized [-Wuninitialized]
  263 |       if (__a < __b)
      |       ^~
main.cpp: In function 'int main()':
main.cpp:23:13: note: 'ans' was declared here
   23 |         int ans, cou = 0;
      |             ^~~

ソースコード

diff #
raw source code

#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <stdio.h>
#include <cstring>
#include <queue>
#include <stack>
#include <functional>
#include <math.h>
#include <iomanip>
using namespace std;
#define Would
#define you
const int INF = 999999999;
const int MOD = 1e9 + 7;

int main() {
	char a[14];
	for (int i = 0; i < 14; ++i) { cin >> a[i]; }
	int ans, cou = 0;
	for (int i = 0; i < 14; ++i) {
		if (a[i] == 'x') { cou = 0; }
		else { ++cou; }
		ans = max(ans, cou);
	}
	cout << ans << endl;
}
0