結果
問題 | No.637 X: Yet Another FizzBuzz Problem |
ユーザー |
![]() |
提出日時 | 2018-02-16 11:23:24 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 1,000 ms |
コード長 | 578 bytes |
コンパイル時間 | 492 ms |
コンパイル使用メモリ | 61,184 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-06-28 18:57:49 |
合計ジャッジ時間 | 1,391 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 30 |
ソースコード
#include<iostream> #include<math.h> #include<string> #include<algorithm> using namespace std; #define rep0(n) for(int i=0;i<n;i++) #define rep(n) for(int i=1;i<=n;i++) double const pi=3.1415926535; int printint(int n){ cout<<n<<endl; return 0; } int prints(string s){ cout<<s<<endl; return 0; } int main(){ int a[5]; rep0(5)cin>>a[i]; int ans=0; rep0(5){ if(a[i]%3==0){ if(a[i]%5==0)ans+=8; else ans+=4; } else{ if(a[i]%5==0)ans+=4; else{ if(a[i]<=9)ans++; else if(a[i]<=99)ans+=2; else ans+=3; } } } printint(ans); return 0; }