我的系统出错了,程序运行正常,但 submittionhttp://www.spoj.com/problems/NITT

where i am going wrong on my system the program is running correctly but getting wrong answer on submittionhttp://www.spoj.com/problems/NITT2/

本文关键字:NITT www spoj com submittionhttp problems 错了 出错 系统 程序 运行      更新时间:2023-10-16

这是我的代码,我试图解决问题,但在提交时得到错误的答案

#include<iostream>
using namespace std;
int main()
{
    int t;
    cin>>t;
    while(t--)
    {
        long long int n;
        cin>>n;
        if(n%252==0)
            cout<<"Yes ";
        else
            cout<<"No ";
        if(n%525==0)
            cout<<"Yes";
        else
            cout<<"No";
        cout<<"n";
    }
    return 0;
}

我的系统上哪里出了问题,程序运行正常,但在提交 NITT2 时得到错误的答案,请帮助我哪里出错了......

您错过了其中一个问题陈述:

Each line contains one number N, whose divisibility is to be tested. 1 <= N <= 10^50000

具体1 <= N <= 10^50000

你正在把这行读成一个int;int的存储空间太小是轻描淡写的。 您有几个选择。 您可以使用某种数据类型,该数据类型可以存储至少 10^50000 并支持除法运算。另一种选择是找到一种更好的方法,以某种巧妙的方式直接针对数据字符串测试可分割条件。