結果
問題 | No.637 X: Yet Another FizzBuzz Problem |
ユーザー |
|
提出日時 | 2020-02-15 13:50:59 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 1,000 ms |
コード長 | 487 bytes |
コンパイル時間 | 1,636 ms |
コンパイル使用メモリ | 167,232 KB |
実行使用メモリ | 6,824 KB |
最終ジャッジ日時 | 2024-10-06 13:48:48 |
合計ジャッジ時間 | 2,362 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 30 |
ソースコード
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main(){ int a,ans=0; for(int i=0;i<5;i++){ cin>>a; if(a%3==0 and a%5==0){ ans+=8; } else if(a%3==0 or a%5==0){ ans+=4; } else{ if(1<=a and a<=9){ ans++; } else if(10<=a and a<=99){ ans+=2; } else ans+=3; } } cout<<ans<<endl; }