跳到正文

个人记录

代码

longyitongxue约 2 分钟
原文
文章信息与版本

文章信息

发布
2025年3月23日
收录
2025年12月12日
更新
2026年11月16日
篇幅
约 2 分钟

版本

  1. v1当前
C++
#include "testlib.h"

int main(int argc, char* argv[]) {
    registerTestlibCmd(argc, argv);
    int input=inf.readInt();
    if(input==1){
    	long long a=ouf.readLong(),b=ouf.readLong();
		if(a>=2147483648ll||a<-2147483648ll||b>=2147483648ll||b<-2147483648ll)quitf(_wa, "The answer is wrong: a and b must be in [-2^31,2^31-1].");
		if(a+b>=2147483648ll||a+b<-2147483648ll)quitf(_ok, "The answer is correct.");
		else quitf(_wa, "The answer is wrong. Your a is %lld, b is %lld. You can\'t WA the answer.",a,b);
	}else if(input==2){
		int kkk=ouf.readInt();
		if(kkk>=200000)quitf(_ok, "The answer is correct.");
		else quitf(_wa, "The answer is wrong. You can't TLE the answer.");
	}else{
		quitf(_wa, "The answer is wrong: Please input 1 or 2.");
	}
}
原文