結果

問題 No.1362 [Zelkova 8th Tune] Black Sheep
ユーザー Kou0406
提出日時 2025-02-28 10:57:16
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 13 ms / 1,000 ms
コード長 490 bytes
コンパイル時間 923 ms
コンパイル使用メモリ 71,848 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2025-02-28 10:57:19
合計ジャッジ時間 3,082 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 38
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
#include<map>
#include<cassert>
#define rep(i,n) for(i=0;i<(int)(n);i++)
using namespace std;
typedef long long ll;
typedef unsigned long long ull;

string s;

int main(){
    int i,j;
    cin>>s;
    map<char,int> dict;
    rep(i,3)dict[s[i]]++;
    if(s[0]==s[1]){
        rep(i,s.length())if(s[i]!=s[0])break;
        printf("%d %c\n",i+1,s[i]);
    }else{
        if(dict[s[0]]==1)printf("%d %c\n",1,s[0]);
        else printf("%d %c\n",2,s[1]);
    }
    return 0;
}
0