QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#189270#3716. Simple ArithmeticCidoai#WA 3ms1444kbC++20639b2023-09-27 07:37:552023-09-27 07:37:56

Judging History

你现在查看的是最新测评结果

  • [2023-09-27 07:37:56]
  • 评测
  • 测评结果:WA
  • 用时:3ms
  • 内存:1444kb
  • [2023-09-27 07:37:55]
  • 提交

answer

#include<cstdio>
typedef long long ll;
typedef __int128 Ln;
inline ll read(){
	ll x=0;
	int f=0,ch=0;
	while(ch<48||ch>57) f=(ch=='-'),ch=getchar();
	while(ch>47&&ch<58) x=(x<<3)+(x<<1)+(ch&15),ch=getchar();
	return f?-x:x;
}
inline void write(Ln x,char end='\n'){
	if(x==0){
		putchar('0');
		putchar(end);
		return;
	}
	if(x<0) putchar('-'),x=-x;
	int ch[70]={0},cnt=0;
	while(x){
		ch[cnt++]=(int)(x%10);
		x/=10;
	}
	while(cnt--) putchar(ch[cnt]+48);
	putchar(end);
}
int main(){
	ll x,y;
	while(~scanf("%lld%lld",&x,&y)){
		Ln a=x,b=y;
		Ln ans=a/b;
		if(b*ans>a) ans--;
		write(ans);
	}
	return 0;
}

详细

Test #1:

score: 0
Wrong Answer
time: 3ms
memory: 1444kb

input:

3 2
3 -2
-9223372036854775808 1
-9223372036854775808 -1
9223372036854775807 1
9223372036854775807 -1
-9223372036854775808 2
-9223372036854775808 -2
9223372036854775807 2
9223372036854775807 -2
-2076046199237518199 8895005889588087898
-3939164353449408 -1673591601308294572
236330652387008908 24746725...

output:

1
-1
-9223372036854775808
9223372036854775808
9223372036854775807
-9223372036854775807
-4611686018427387904
4611686018427387904
4611686018427387903
-4611686018427387903
-1
-1
0
0
0
2
-1
0
0
-2
0
-1
0
-1
0
-1
-36
-1
0
2
-1
7
0
7
0
0
-2
-1
-1
1
8
-1
0
0
-2
0
-4
-6
0
-1
-2
0
0
-1
-11
-1
2
0
10
7
-1
-1
...

result:

wrong answer 2nd words differ - expected: '-2', found: '-1'