結果
問題 | No.2035 Tunnel |
ユーザー |
![]() |
提出日時 | 2023-07-09 08:15:03 |
言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 11 ms / 2,000 ms |
コード長 | 541 bytes |
コンパイル時間 | 2,850 ms |
コンパイル使用メモリ | 244,916 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-07-23 04:55:48 |
合計ジャッジ時間 | 4,534 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 28 |
ソースコード
#include<bits/stdc++.h> using namespace std; using ll=long long; using pp=pair<int,int>; #define sr string #define vc vector #define db double #define fi first #define se second #define rep(i,n) for(int i=0;i<(int)n;i++) #define pb push_back #define all(v) v.begin(),v.end() #define pque priority_queue #define bpc(a) __builtin_popcount(a) int main(){ int n;sr s;cin>>n>>s; int ans=-1; int last=-20; for(int i=n-1;i>=0;i--)if(s[i]=='#'){ int now=n-i; if(now<=last+1)now=last+2; ans=max(ans,now); last=now; } cout<<ans; }