結果
| 問題 | No.1362 [Zelkova 8th Tune] Black Sheep |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2021-01-22 21:52:13 |
| 言語 | C++14 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 3 ms / 1,000 ms |
| コード長 | 380 bytes |
| 記録 | |
| コンパイル時間 | 422 ms |
| コンパイル使用メモリ | 40,064 KB |
| 実行使用メモリ | 6,400 KB |
| 最終ジャッジ日時 | 2026-06-02 09:05:16 |
| 合計ジャッジ時間 | 2,112 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 38 |
ソースコード
#include <cstdio>
#include <cstring>
char s[500005];
int main(){
scanf("%s",s+1);
int n = strlen(s+1);
int cnt = 0;
int find = -1;
for(int i = 2; i <= n; i++){
if(s[i]!=s[1]){
if(find==-1) find = i;
cnt++;
}
}
if(cnt==n-1) printf("%d %c\n",1,s[1]);
else printf("%d %c\n",find,s[find]);
return 0;
}