結果
問題 | No.1362 [Zelkova 8th Tune] Black Sheep |
ユーザー |
|
提出日時 | 2021-01-22 22:05:24 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 32 ms / 1,000 ms |
コード長 | 453 bytes |
コンパイル時間 | 1,805 ms |
コンパイル使用メモリ | 200,596 KB |
最終ジャッジ日時 | 2025-01-18 04:23:54 |
ジャッジサーバーID (参考情報) |
judge4 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 38 |
ソースコード
#define _USE_MATH_DEFINES #include <bits/stdc++.h> using namespace std; signed main() { ios::sync_with_stdio(false); cin.tie(0); string s; cin >> s; map<char, int> cnt; for (auto& ch : s) cnt[ch]++; char target = '?'; for (auto p :cnt) if (p.second == 1) target = p.first; assert(target != '?'); for (int i = 0; i < (int) s.size(); i++) { if (s[i] == target) { cout << i + 1 << " " << target << endl; } } return 0; }