社区讨论
求助!90分,#6 RE了
P1042[NOIP 2003 普及组] 乒乓球参与者 2已保存回复 4
讨论操作
快速查看讨论及其快照的属性,并进行相关操作。
- 当前回复
- 4 条
- 当前快照
- 1 份
- 快照标识符
- @mi6ypwzq
- 此快照首次捕获于
- 2025/11/20 13:00 4 个月前
- 此快照最后确认于
- 2025/11/20 13:00 4 个月前
CPP
#include<cstdio>
#include<iostream>
#include<cstring>
#include<algorithm>
#include<cstdlib>
#include<cmath>
#define ll long long
#define re register int
using namespace std;
inline void read(int &x)
{
int f(1);
char ch=getchar();
x=0;
while(ch<'0'||ch>'9')
{
if(ch=='-')
f=-1;
ch=getchar();
}
while(ch>='0'&&ch<='9')
{
x=x*10+ch-'0';
ch=getchar();
}
x=f=1?x:-x;
}
int w11,l11,print11[2505][2],tot11=1,k11,
w21,l21,print21[2505][2],tot21=1,k21;
int main()
{
//freopen("a.in","r",stdin);
//freopen("a.out","w",stdout);
ios::sync_with_stdio(0);
cin.tie(0),cout.tie(0);
char ch;
while(cin>>ch)
{
if(ch=='E')
{
for(re i(1);i<=tot11;++i)
printf("%d:%d\n",print11[i][0],print11[i][1]);
puts("");
for(re i(1);i<=tot21;++i)
printf("%d:%d\n",print21[i][0],print21[i][1]);
return 0;
}
if(ch=='W')
{
++k11,++k21,
++print11[tot11][0],
++print21[tot21][0];
}
else if(ch=='L')
{
++k11,++k21,
++print11[tot11][1],
++print21[tot21][1];
}
if((print11[tot11][0]>=11||print11[tot11][1]>=11)&&abs(print11[tot11][0]-print11[tot11][1])>=2)k11=0,++tot11;
if((print21[tot21][0]>=21||print21[tot21][1]>=21)&&abs(print21[tot21][0]-print21[tot21][1])>=2)k21=0,++tot21;
}
}
回复
共 4 条回复,欢迎继续交流。
正在加载回复...