結果
問題 |
No.637 X: Yet Another FizzBuzz Problem
|
ユーザー |
![]() |
提出日時 | 2020-07-02 04:21:16 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 1,000 ms |
コード長 | 486 bytes |
コンパイル時間 | 1,501 ms |
コンパイル使用メモリ | 165,328 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-09-14 14:29:36 |
合計ジャッジ時間 | 2,664 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 30 |
ソースコード
#include<bits/stdc++.h> using namespace std; using ll=long long; #define rep2(i, a, n) for(int i = (a); i < (n); i++) #define rep(i, n) rep2(i,0,n) int main(){ cin.tie(nullptr);ios_base::sync_with_stdio(false); int a,cnt=0; rep(i,5){ cin>>a; if(a%5==0&&a%3==0){ cnt+=8; }else if(a%5==0||a%3==0){ cnt+=4; }else{ int hoge=0,shake=a; while(shake>0){ shake/=10; hoge++; } cnt+=hoge; } } cout<<cnt<<endl; }