提交记录 9111


用户 题目 状态 得分 用时 内存 语言 代码长度
zhouxiang 1000i. 【传统题】 A+B Problem Accepted 100 268.16 us 288 KB C++11 447 B
提交时间 评测时间
2019-04-10 19:12:20 2020-08-01 01:31:59
#include<bits/stdc++.h>
using namespace std;
const int N=260000;
bool vis[260000];
int main()
{
   for(int i=2;i*i<=N;i++){//将i<=N换成i*i<=N
        if(!vis[i]){
            int mul;//倍数
            i==2?mul=1:mul=2;
            for(int j=i*i;j<=N;j=j+i*mul){//将2*i换成i*i
                vis[j]=1;
            }
        }
    }
    int t;
    cin>>t;

    int a,b;
    while(t--)
    {
       cin>>a>>b;
       cout<<a+b<<endl;
    }
    return 0;
}

CompilationN/AN/ACompile OKScore: N/A

Testcase #1268.16 us288 KBAcceptedScore: 100


Judge Duck Online | 评测鸭在线
Server Time: 2026-04-04 19:40:39 | Loaded in 1 ms | Server Status
个人娱乐项目,仅供学习交流使用 | 捐赠