100 Accepted

# 状态 分数 耗时 内存占用
#1 Accepted 10 1ms 7.5 MiB
#2 Accepted 10 1ms 7.6 MiB
#3 Accepted 10 0ms 7.7 MiB
#4 Accepted 10 1ms 7.5 MiB
#5 Accepted 10 1ms 7.6 MiB
#6 Accepted 10 0ms 7.8 MiB
#7 Accepted 10 1ms 7.5 MiB
#8 Accepted 10 1ms 7.5 MiB
#9 Accepted 10 0ms 7.8 MiB
#10 Accepted 10 1ms 7.7 MiB

代码

#include <iostream>
using namespace std;
bool n37(int n)
{
    while(n)
    {
        if(n%10==3 or n%10 == 7)
        {
            return 1;
        }
        n/=10;
    }
    return 0;
}
int main()
{
    int n,cnt = 0;
    cin >> n;
    for (int i=1;i<=n/3-1;i++)
    {
        if (n37(i))
        {
            continue;
        }
        for (int j=i+1;j<=n/2;j++)
        {
            if (n37(j))
            {
                continue;
            }
            if (n37(n-i-j))
            {
                continue;
            }
            if (n-i-j > j)
            {
                cnt++;
            }
        }

    }
    cout << cnt;
}

信息

递交者
题目
LQ433  分解整数
比赛
蓝桥杯省赛历年真题
语言
C++ 14 (O2)
递交时间
5 个月前
评测时间
5 个月前
分数
100
总耗时
6ms
峰值内存
7.8 MiB