0 Time Exceeded

# 状态 分数 耗时 内存占用
#1 Time Exceeded 0 ≥1332ms ≥7.4 MiB
#2 Time Exceeded 0 ≥1332ms ≥7.7 MiB
#3 Time Exceeded 0 ≥1333ms ≥7.7 MiB
#4 Time Exceeded 0 ≥1333ms ≥7.8 MiB
#5 Time Exceeded 0 ≥1332ms ≥7.5 MiB
#6 Time Exceeded 0 ≥1333ms ≥7.8 MiB
#7 Time Exceeded 0 ≥1333ms ≥7.6 MiB
#8 Time Exceeded 0 ≥1333ms ≥7.7 MiB
#9 Time Exceeded 0 ≥1332ms ≥7.5 MiB
#10 Time Exceeded 0 ≥1331ms ≥7.4 MiB

代码

#include <bits/stdc++.h>
using namespace std;
int main()
{
    int n,num=0;
    cin>>n;
    for(int i=1;i<=n;i++)
    {
        while(i>0)
        {
            if(i%10==1)
            {
                num++;
            }
        }
    }
    cout<<num;
}

信息

递交者
题目
DJKS309  数1的个数
比赛
2024年3月等考一级题单
语言
C++ 98
递交时间
11 个月前
评测时间
11 个月前
分数
0
总耗时
≥13324ms
峰值内存
≥7.8 MiB