結果

問題 No.1362 [Zelkova 8th Tune] Black Sheep
コンテスト
ユーザー hatsuka_iwa
提出日時 2021-01-24 22:16:29
言語 C++14
(gcc 15.2.0 + boost 1.89.0)
コンパイル:
g++-15 -O2 -lm -std=c++14 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
CE  
(最新)
AC  
(最初)
実行時間 -
コード長 646 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 19 ms
最終ジャッジ日時 2026-03-04 21:47:12
合計ジャッジ時間 361 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
コンパイルエラー時のメッセージ・ソースコードは、提出者また管理者しか表示できないようにしております。(リジャッジ後のコンパイルエラーは公開されます)
ただし、clay言語の場合は開発者のデバッグのため、公開されます。

コンパイルメッセージ
0820e9ec14d6
[/j_bin/judge_tool judge 40000 ../CompileMemory.txt /dev/null sud /dev/null _ g++-15 -O2 -lm -std=c++14 -Wuninitialized -DONLINE_JUDGE -o a.out main.cpp]
strconv.Atoi: parsing "../CompileMemory.txt": invalid syntax
goroutine 1 [running]:
runtime/debug.Stack()
	/home/yuki2006/go/pkg/mod/golang.org/toolchain@v0.0.1-go1.25.0.linux-amd64/src/runtime/debug/stack.go:26 +0x5e
main.main.func1()
	/home/yuki2006/gopath/src/yukicoder/judge/main.go:22 +0x57
panic({0x7d6880?, 0xc0000f6240?})
	/home/yuki2006/go/pkg/mod/golang.org/toolchain@v0.0.1-go1.25.0.linux-amd64/src/runtime/panic.go:783 +0x132
main.judgeMain({0xc000012150, 0x5?, 0x0?})
	/home/yuki2006/gopath/src/yukicoder/judge/judge_linux.go:121 +0x4b1
main.main()
	/home/yuki2006/gopath/src/yukicoder/judge/main.go:97 +0x277

ソースコード

diff #
raw source code

#include <bits/stdc++.h>
using namespace std;

int main() {
  string S;
  cin >> S;
  tuple<char, int, int, bool> A, B;
  get<0>(A) = S.at(0);
  get<1>(A) = 1;
  get<2>(A) = 1;
  get<3>(A) = true;

  for (int i = 1; i < (int)S.size(); i++) {
    if (S.at(i) != get<0>(A) && get<3>(B) == false) {
      get<0>(B) = S.at(i);
      get<1>(B) = i + 1;
      get<2>(B) = 1;
      get<3>(B) = true;
    }
    else if (S.at(i) != get<0>(A) && get<3>(B) == true)
      get<2>(B)++;
    else
      get<2>(A)++;
  }

  if (get<2>(A) > get<2>(B))
    cout << get<1>(B) << ' ' << get<0>(B) << endl;
  else
    cout << get<1>(A) << ' ' << get<0>(A) << endl;
}
0