結果
問題 | No.637 X: Yet Another FizzBuzz Problem |
ユーザー |
![]() |
提出日時 | 2021-09-10 11:25:08 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 1,000 ms |
コード長 | 331 bytes |
コンパイル時間 | 1,489 ms |
コンパイル使用メモリ | 161,392 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2025-01-02 20:12:11 |
合計ジャッジ時間 | 2,798 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 30 |
ソースコード
#include <bits/stdc++.h> using namespace std; using ll=long long; ll mod=1000000007; ll INF=1LL<<60; int main() { int ans=0; for(int i=0;i<5;i++){ string S; cin >> S; int A=stoi(S); if(A%3!=0 && A%5!=0){ ans+=S.size(); } else if(A%3==0 && A%5==0){ ans+=8; } else{ ans+=4; } } cout << ans << endl; }