結果

問題 No.910 素数部分列
ユーザー le_panda_noir
提出日時 2020-05-31 11:29:40
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 329 bytes
コンパイル時間 787 ms
コンパイル使用メモリ 66,688 KB
最終ジャッジ日時 2025-01-10 20:01:33
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 4 WA * 46
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
using namespace std;
#define rep(i,n) for(int i=0,_i=(n);i<_i;++i)

int main() {
  int N; string S;
  cin >> N >> S;
  int one = 0,
      ans = 0;
  rep(i, N) {
    if (S[i] == '3' || S[i] == '5' || S[i] == '7')
      ++ans;
    if (S[i] == '1')
      ++one;
  }
  cout << ans + one / 2 << endl;
  return 0;
}
0