Submission #154785


Source Code Expand

#include <algorithm>
#include <bitset>
#include <cctype>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>
using namespace std;

bool contains_three(int n) {
    while (n > 0) {
        if (n % 10 == 3) {
            return true;
        }
        n /= 10;
    }
    return false;
}

int main() {
    int n;
    cin >> n;
    if (n % 3 == 0 || contains_three(n)) {
        cout << "YES" << endl;
    } else {
        cout << "NO" << endl;
    }
}

Submission Info

Submission Time
Task A - 世界のFizzBuzz
User itiut
Language C++11 (GCC 4.8.1)
Score 100
Code Size 783 Byte
Status AC
Exec Time 33 ms
Memory 924 KB

Judge Result

Set Name All
Score / Max Score 100 / 100
Status
AC × 9
Set Name Test Cases
All test_1.txt, test_2.txt, test_3.txt, test_4.txt, test_5.txt, test_6.txt, test_7.txt, test_8.txt, test_9.txt
Case Name Status Exec Time Memory
sample_01.txt AC 23 ms 924 KB
sample_02.txt AC 21 ms 920 KB
sample_03.txt AC 21 ms 832 KB
test_1.txt AC 33 ms 796 KB
test_2.txt AC 20 ms 916 KB
test_3.txt AC 20 ms 772 KB
test_4.txt AC 20 ms 772 KB
test_5.txt AC 20 ms 916 KB
test_6.txt AC 20 ms 776 KB
test_7.txt AC 20 ms 776 KB
test_8.txt AC 20 ms 920 KB
test_9.txt AC 21 ms 916 KB