結果
問題 |
No.1943 消えたAGCT(1)
|
ユーザー |
|
提出日時 | 2022-05-20 23:06:55 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
TLE
|
実行時間 | - |
コード長 | 697 bytes |
コンパイル時間 | 885 ms |
コンパイル使用メモリ | 76,224 KB |
実行使用メモリ | 10,624 KB |
最終ジャッジ日時 | 2024-09-20 09:30:07 |
合計ジャッジ時間 | 4,416 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 9 TLE * 1 -- * 17 |
ソースコード
#include <iostream> #include <vector> #include <string> #include <algorithm> #include <cmath> #define rep(i,n) for(i=0; i<n; ++i) #define in(a) cin >> a #define out(a,b) cout << a << b using namespace std; using lint = long long; int main(void){ int i, j, k, y, n, cnt=0, sum=0,c=0; in(n); string s, t="AGCT"; in(s); vector<bool> x(n,true); while(1){ rep(i,n){ rep(j,4){ if(s[i]==t[j]&&x[i]){ c++; } } } if(c==0) break; //x[c-1]=false; rep(i,n){ if(x[i]) sum++; if(sum == c) {x[i]=false; break;} } sum=0; c=0; cnt++; } out(cnt,endl); return 0; }