結果

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

ソースコード

diff #

#include <bits/stdc++.h>
#include<iostream>
#include<map>
#include<vector>
#include <algorithm>
#include<math.h>
#include <iomanip>
#include<set>
#include <numeric>
#include<string>
using namespace std;

int main()
{
    string s;
    cin >> s;
    string same="";
    if (s[0] == s[1]) same += s[0];
    else if (s[0] == s[2]) same += s[0];
    else if (s[1] == s[2]) same += s[1];
    for (int i = 0; i < s.size(); i++){
        if (s[i] != same[0]){
            cout << i + 1 << " " << s[i] << endl;
            break;
        } 
    }
}
0