求助
查看原帖
求助
578078
xietengyi楼主2024/11/8 21:10

为什么

printf("\n")

在vjudge上报错

Idleness limit exceeded on test 1

而使用

cout<<endl

Accepted

求助qwq

部分代码 0分

#include <bits/stdc++.h>
using namespace std;
······
	for (int i=1;i<=cnt;++i) {
		······
		printf("B %lld\n",p[i]);
		······
				printf("A %lld\n",j);
		······
			printf("A 1\n");
			······
						printf("A %lld\n",q);
						······			
	printf("C %lld\n",res);	
	return 0;
}

部分代码 AC

#include <bits/stdc++.h>
using namespace std;
······
	for (int i=1;i<=cnt;++i) {
		······
		printf("B %lld",p[i]);
		cout<<endl;
		······
				printf("A %lld",j);
				cout<<endl;
		······
			printf("A 1");
			cout<<endl;
			······
						printf("A %lld",q);
						cout<<endl;
						······			
	printf("C %lld",res);
  	cout<<endl;
	return 0;
}
2024/11/8 21:10
加载中...