刚用USACO,求救
  • 板块灌水区
  • 楼主osfly
  • 当前回复3
  • 已保存回复3
  • 发布时间2021/11/6 07:22
  • 上次更新2023/11/4 01:19:42
查看原帖
刚用USACO,求救
339299
osfly楼主2021/11/6 07:22

CHAPTER 1的Your Ride Is Here,文件内容为:

/* Use the slash-star style comments or the system won't see your
   identification information */
/*
ID: oyyskki1
TASK: test
LANG: C++                 
*/
/* LANG can be C++11 or C++14 for those more recent releases */
#include<iostream>
#include<string.h>
#include<cstdio> 
using namespace std;
string a1,b1;
long long a2=1,b2=1;
int main()
{
	freopen("ride.in","r",stdin);
	freopen("ride.out","w",stdout);
	cin>>a1>>b1;
	for(unsigned short i=0;i<a1.size();i++)
	{
		a2*=a1[i]-'@';
	}
	for(unsigned short i=0;i<b1.size();i++)
	{
		b2*=b1[i]-'@';
	}
	a2%=47;
	b2%=47;
	if(a2==b2) cout<<"GO"; 
	else cout<<"STAY";
	fclose(stdin);
	fclose(stdout);
	return 0;
}

lg注释freopen,A掉了

USACO:

> Run 1: Execution error: Your program had this runtime error:
        Illegal file open (ride.in). The program ran for 0.004 CPU seconds
        before the error. It used 1360 KB of memory. 

        ------ Data for Run 1 [length=4 bytes] ------
        1 1 
        ----------------------------

不会用,求救

2021/11/6 07:22
加载中...