結果

問題 No.910 素数部分列
ユーザー beet
提出日時 2019-10-18 21:28:03
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 477 bytes
コンパイル時間 1,760 ms
コンパイル使用メモリ 191,872 KB
最終ジャッジ日時 2025-01-07 22:38:00
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 22 WA * 28
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;
using Int = long long;
template<typename T1,typename T2> inline void chmin(T1 &a,T2 b){if(a>b) a=b;}
template<typename T1,typename T2> inline void chmax(T1 &a,T2 b){if(a<b) a=b;}

//INSERT ABOVE HERE
signed main(){
  Int n;
  string s;
  cin>>n>>s;
  Int ans=0,one=0;
  for(char c:s){
    if(c=='1') one++;
    if(c=='9') if(one) ans++,one--;
    if(c=='3'||c=='5'||c=='7') ans++;
  }
  ans+=one/2;
  cout<<ans<<endl;
  return 0;
}
0