結果
問題 |
No.1943 消えたAGCT(1)
|
ユーザー |
![]() |
提出日時 | 2022-05-20 21:34:26 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 20 ms / 2,000 ms |
コード長 | 342 bytes |
コンパイル時間 | 1,459 ms |
コンパイル使用メモリ | 172,284 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-09-20 07:26:05 |
合計ジャッジ時間 | 2,602 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 27 |
ソースコード
#include <bits/stdc++.h> using namespace std; const char c[] = {'A', 'C', 'G', 'T'}; int main() { set<int> st; for (int i = 0; i < 4; i++) { st.insert(c[i]); } int N; cin >> N; string S; cin >> S; int ans = 0; for (int i = 0; i < N; i++) { if (st.count(S[i])) { ans = i + 1; } } cout << ans << endl; }