結果
問題 |
No.2035 Tunnel
|
ユーザー |
|
提出日時 | 2022-08-12 22:53:38 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 751 bytes |
コンパイル時間 | 2,276 ms |
コンパイル使用メモリ | 202,688 KB |
最終ジャッジ日時 | 2025-01-30 21:39:16 |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 4 WA * 1 TLE * 23 |
ソースコード
#include <bits/stdc++.h> using namespace std; int main() { int a; string s; cin >> a >> s; set<int> se; for(int i=1; i<=a; i++){ if(s[i-1]=='#'){ se.insert(i); } } int cnt=0; while (se.size()) { /* for(auto k :se){ cout << k << " "; } cout << endl;*/ set<int> tmp; if(se.count(a)) se.erase(a); for(auto k : se ){ if(!se.count(k+1)) { tmp.insert(k+1); } else { tmp.insert(k); } } /* cout << tmp.size() << " ;" << endl; */ se = tmp; cnt++; } cout << cnt << endl; }