結果

問題 No.637 X: Yet Another FizzBuzz Problem
ユーザー cureskol
提出日時 2020-04-05 16:38:12
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 1,000 ms
コード長 322 bytes
コンパイル時間 1,803 ms
コンパイル使用メモリ 168,928 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-07-03 08:14:15
合計ジャッジ時間 2,319 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 30
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

int f(int a){
  int cnt=0;
  while(a){
    cnt++;
    a/=10;
  }
  return cnt;
}

signed main(){
  int ans=0;
  vector<int> v(5);
  for(int i=0;i<5;i++)cin>>v[i];
  for(int p:v){
    if(p%3==0)ans+=4;
    if(p%5==0)ans+=4;
    if(p%3&&p%5)ans+=f(p);
  }
  cout<<ans<<endl;
}
0