Submission #14575511


Source Code Expand

#include<bits/stdc++.h>
using namespace std;
#define step(i, s, n, d) for(int i=s; i<n; i+=d)
#define FOR(i,s,n) step(i,s,n,1)
#define rep(i,n) FOR(i,0,n)
#define ll long long
typedef pair<int, int> P;

int main(){
    ll n;
    ll res = 0;
    cin >> n;
    rep(i, n+1) {
        if(i % 15 != 0 && i % 5 != 0 && i % 3 != 0) {
            res += i;
        }
    }
    cout << res << endl;
}

Submission Info

Submission Time
Task B - FizzBuzz Sum
User KeitaKishida0811
Language C++ (GCC 9.2.1)
Score 200
Code Size 411 Byte
Status AC
Exec Time 10 ms
Memory 3632 KiB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 200 / 200
Status
AC × 2
AC × 15
Set Name Test Cases
Sample sample_01, sample_02
All hand_01, hand_02, random_01, random_02, random_03, random_04, random_05, random_06, random_07, random_08, random_09, random_10, random_11, sample_01, sample_02
Case Name Status Exec Time Memory
hand_01 AC 10 ms 3516 KiB
hand_02 AC 2 ms 3592 KiB
random_01 AC 4 ms 3588 KiB
random_02 AC 6 ms 3632 KiB
random_03 AC 3 ms 3520 KiB
random_04 AC 2 ms 3400 KiB
random_05 AC 2 ms 3564 KiB
random_06 AC 3 ms 3388 KiB
random_07 AC 2 ms 3548 KiB
random_08 AC 3 ms 3628 KiB
random_09 AC 3 ms 3584 KiB
random_10 AC 3 ms 3628 KiB
random_11 AC 4 ms 3616 KiB
sample_01 AC 2 ms 3632 KiB
sample_02 AC 4 ms 3548 KiB