結果
問題 | No.1362 [Zelkova 8th Tune] Black Sheep |
ユーザー |
|
提出日時 | 2021-01-22 21:42:30 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 18 ms / 1,000 ms |
コード長 | 346 bytes |
コンパイル時間 | 1,812 ms |
コンパイル使用メモリ | 195,664 KB |
最終ジャッジ日時 | 2025-01-18 04:02:40 |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 38 |
ソースコード
#include<bits/stdc++.h> //#include<atcoder/all> //using namespace atcoder; using namespace std; using ll = long long; int main(){ string s; cin >> s; string t = s; sort(t.begin(),t.end()); char x; if(t[0]==t[1])x = t.back(); else x = t.front(); for(int i = 0;i<s.size();i++){ if(x==s[i]){ cout<<i+1<<' '; cout<<x<<endl; } } }