結果

問題 No.1362 [Zelkova 8th Tune] Black Sheep
ユーザー chacoder1chacoder1
提出日時 2021-02-05 21:53:20
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 16 ms / 1,000 ms
コード長 500 bytes
コンパイル時間 2,589 ms
コンパイル使用メモリ 192,300 KB
最終ジャッジ日時 2025-01-18 12:16:08
ジャッジサーバーID
(参考情報)
judge1 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 38
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i,n) for(ll i=0;i<n;i++)

int main(){
  string s;
  cin>>s;
  char c,d;
  int len=s.length();
  if(s.at(0)==s.at(1)){
    c=s.at(0);
    for(int i=0;i<len;i++){
      if(s.at(i) != c){
        cout<<i+1<<" "<<s.at(i)<<endl;
        return 0;
      }
    }
  }
  else{
    if(s.at(2)==s.at(0)){
      cout<<2<<" "<<s.at(1)<<endl;
      return 0;
    }
    else{
      cout<<1<<" "<<s.at(0)<<endl;
    }
  }
  return 0;
}
0