結果
| 問題 |
No.1362 [Zelkova 8th Tune] Black Sheep
|
| コンテスト | |
| ユーザー |
夕叢霧香(ゆうむらきりか)
|
| 提出日時 | 2021-01-22 22:32:26 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 51 ms / 1,000 ms |
| コード長 | 493 bytes |
| コンパイル時間 | 940 ms |
| コンパイル使用メモリ | 77,740 KB |
| 最終ジャッジ日時 | 2025-01-18 04:48:02 |
|
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 38 |
ソースコード
#include<algorithm>
#include<cassert>
#include<iostream>
#include<vector>
using namespace std;
typedef long long lint;
typedef vector<int>vi;
typedef pair<int,int>pii;
#define rep(i,n)for(int i=0;i<(int)(n);++i)
int main(){
string s;cin>>s;
string t=s;
sort(t.begin(),t.end());
t.erase(unique(t.begin(),t.end()),t.end());
for(char c:t){
int a=0;
int idx=-1;
rep(i,s.size())if(s[i]==c)a++,idx=i+1;
if(a==1){
cout<<idx<<" "<<c<<endl;
return 0;
}
}
}
夕叢霧香(ゆうむらきりか)