結果

問題 No.637 X: Yet Another FizzBuzz Problem
ユーザー どらら
提出日時 2018-04-01 17:04:13
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 1,000 ms
コード長 583 bytes
コンパイル時間 1,525 ms
コンパイル使用メモリ 168,784 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-06-28 19:02:39
合計ジャッジ時間 2,432 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 30
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
#define REP(i,a,n) for(int i=(a); i<(int)(n); i++)
#define rep(i,n) REP(i,0,n)
#define FOR(it,c) for(__typeof((c).begin()) it=(c).begin(); it!=(c).end(); ++it)
#define ALLOF(c) (c).begin(), (c).end()
typedef long long ll;
typedef unsigned long long ull;

int solve(int a){
  if(a%3 == 0 && a%5 == 0) return 8;
  if(a%3 == 0 || a%5 == 0) return 4;
  stringstream ss;
  ss << a;
  return ss.str().size();
}


int main(){
  int ret = 0;
  rep(i,5){
    int a;
    cin >> a;
    ret += solve(a);
  }

  cout << ret << endl;
  
  return 0;
}
0