結果
| 問題 |
No.1362 [Zelkova 8th Tune] Black Sheep
|
| コンテスト | |
| ユーザー |
Nachia
|
| 提出日時 | 2021-01-22 21:28:31 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 16 ms / 1,000 ms |
| コード長 | 328 bytes |
| コンパイル時間 | 2,130 ms |
| コンパイル使用メモリ | 192,796 KB |
| 最終ジャッジ日時 | 2025-01-18 03:42:07 |
|
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 38 |
ソースコード
#include<bits/stdc++.h>
using namespace std;
using LL = long long;
using ULL = unsigned long long;
#define rep(i,n) for(int i=0; i<(n); i++)
int main() {
string S; cin>>S; S+=S;
pair<int,char> ans;
rep(i,S.size()/2) if(S[i]!=S[i+1]&&S[i]!=S[i+2]) ans={i,S[i]};
cout<<(ans.first+1)<<" "<<ans.second<<endl;
return 0;
}
Nachia