跳到正文

cute_

1078846

窝系呆萌小玖 16岁小孩

在洛谷打开
资料、奖项与版本

资料

编号
1078846
抓取

奖项

2024 CSP-J
一等奖
2024 CSP-S
二等奖

版本

  1. v2当前
  2. v1

获奖信息 & OI 程序设计能力 与本人实力严重不符

2023CSP:

CSP-J1: 66.5

CSP-S1: 57

CSP-S2: 30

2024CSP:

CSP-J1: 85

CSP-S1: 52

CSP-J2: 260

CSP-S2: 120

2025CSP:

CSP-S1: 60

CSP-S2: 29

2026CSP:

CSP-S1: 60.5

CSP-S2: 105

C++










#include<bits/stdc++.h>
using namespace std;
int q;
int n;
int pu[100001];
int po[100001];
stack <int> s;
int t1;
int t2;
int main(){
	cin>>q;
	while(q--){
		cin>>n;
		for(int i=1;i<=n;i++){
			cin>>pu[i];
		}
		for(int i=1;i<=n;i++){
			cin>>po[i];
		}
		t1=0;
		t2=0;
		s.push(pu[++t1]);
		while(t1<n){
			if()
		}
	}
}//4387












#include<bits/stdc++.h>
using namespace std;
int t;
int n;
int ans;
string name;
int len;
int c;
int l;
int main(){
	cin>>t;
	for(int i=1;i<=t;i++){
		cin>>name;
		cin>>n;
		ans=0;
		c=-1;
		len=name.size();
		name=' '+name;
		for(int i=1;i<=len;i++){
			if((name[i]!='a'&&name[i]!='e'&&name[i]!='i'&&name[i]!='o'&&name[i]!='u')){
				l++;
				if(c>=n){
					l=i-n+1;
				}
			}
			else{
				c=0;
			}
			if(l!=-1){
				ans+=(l+1);
			}
		}
		cout<<"Case #"<<i<<": "<<ans<<endl;
	}
}//13291





























#include<bits/stdc++.h>
using namespace std;
int c;
int n;
int m;
int h;
int w;
string x;
int main(){
	cin>>c;
	for(int i=1;i<=c;i++){
		int ibhl=1000001;
		int ibhr=0;
		int ibwl=1000001;
		int ibwr=0;
		int nbhl=1000001;
		int nbhr=0;
		int nbwl=1000001;
		int nbwr=0;
		int f=0;
		cin>>n;
		while(n--){
			cin>>h;
			cin>>w;
			getline(cin,x);
			if(x==" BIRD"){
				f=1;
				ibhl=min(ibhl,h);
				ibhr=max(ibhr,h);
				ibwl=min(ibwl,w);
				ibwr=max(ibwr,w);
			}
			if(x==" NOT BIRD"){
				nbhl=min(nbhl,h);
				nbhr=max(nbhr,h);
				nbwl=min(nbwl,w);
				nbwr=max(nbwr,w);
			}
		}
		if(f){
			if(nbhl>ibhr){
				nbhr=1000001;
			}
			if(nbwl>ibwr){
				nbwr=1000001;
			}
			if(nbhr<ibhl){
				nbhl=0;
			}
			if(nbwr<ibwl){
				nbwl=0;
			}
		}
		cout<<ibhl<<" "<<ibhr<<" "<<ibwl<<" "<<ibwr<<endl<<nbhl<<" "<<nbhr<<" "<<nbwl<<" "<<nbwr<<endl;
		cout<<"Case #"<<i<<" "<<endl;
		cin>>m;
		while(m--){
			cin>>h;
			cin>>w;
			if(h>=ibhl&&h<=ibhr&&w>=ibwl&&w<=ibwr){
				cout<<"BIRD"<<endl;
			}
			else if{
				if(ibhl==ibhr){
					if(h==ibhl){
						cout<<
					}
				}
			}((h>=nbhl&&h<=nbhr)||(w>=nbwl&&w<=nbwr)){
				cout<<"NOT BIRD"<<endl;
			}
			else{
				cout<<"UNKNOWN"<<endl;
			}
		}
	}
}






























#include<bits/stdc++.h>
using namespace std;
int m;
int n;
int x[1001];
int y[1001];
int h[1000001];
int k;
int main(){
	cin>>n;
	while(n--){
		k=0;
		cin>>m;
		for(int i=1;i<=m;i++){
			cin>>x[i];
			cin>>y[i];
			for(int j=1;j<i;j++){
				h[++k]=x[i]*1000+y[i];
			}
		}
		
	}
	cout<<ans;
}







https://www.luogu.com.cn/discuss/1162100














#include<bits/stdc++.h>
using namespace std;
int a;
int b;
int c;
int d;
int e;
int f;
int g;
int k;
//int a[100];
int num[5];
int sz[30][5]={0,0,0,0,0,0,1,2,3,4,0,1,2,4,3,0,1,3,2,4,0,1,3,4,2,0,1,4,2,3,0,1,4,3,2,0,2,1,3,4,0,2,1,4,3,0,2,3,1,4,0,2,3,4,1,0,2,4,1,3,0,2,4,3,1,0,3,1,2,4,0,3,1,4,2,0,3,2,1,4,0,3,2,4,1,0,3,4,1,2,0,3,4,2,1,0,4,1,2,3,0,4,1,3,2,0,4,2,1,3,0,4,2,3,1,0,4,3,1,2,0,4,3,2,1,};
int fh[70][4]={0,0,0,0,0,1,1,1,0,1,1,2,0,1,1,3,0,1,1,4,0,1,2,1,0,1,2,2,0,1,2,3,0,1,2,4,0,1,3,1,0,1,3,2,0,1,3,3,0,1,3,4,0,1,4,1,0,1,4,2,0,1,4,3,0,1,4,4,0,2,1,1,0,2,1,2,0,2,1,3,0,2,1,4,0,2,2,1,0,2,2,2,0,2,2,3,0,2,2,4,0,2,3,1,0,2,3,2,0,2,3,3,0,2,3,4,0,2,4,1,0,2,4,2,0,2,4,3,0,2,4,4,0,3,1,1,0,3,1,2,0,3,1,3,0,3,1,4,0,3,2,1,0,3,2,2,0,3,2,3,0,3,2,4,0,3,3,1,0,3,3,2,0,3,3,3,0,3,3,4,0,3,4,1,0,3,4,2,0,3,4,3,0,3,4,4,0,4,1,1,0,4,1,2,0,4,1,3,0,4,1,4,0,4,2,1,0,4,2,2,0,4,2,3,0,4,2,4,0,4,3,1,0,4,3,2,0,4,3,3,0,4,3,4,0,4,4,1,0,4,4,2,0,4,4,3,0,4,4,4};
//int used[10];
int check(int x,int y,int z){
	if(x==1){
		if(a>b){
			return 0;
		}
		e=a+b;
	}
	if(x==2){
		e=a-b;
	}
	if(x==3){
		e=a*b;
	}
	if(x==4){
		if(a<b){
			return 0;
		}
		if(a%b!=0){
			return 0;
		}
		e=a/b;
	}
	if(y==1){
		if(e>c){
			return 0;
		}
		f=e+c;
	}
	if(y==2){
		f=e-c;
	}
	if(y==3){
		f=e*c;
	}
	if(y==4){
		if(e<c){
			return 0;
		}
		if(e%c!=0){
			return 0;
		}
		f=e/c;
	}
	if(z==1){
		if(f>d){
			return 0;
		}
		g=f+d;
	}
	if(z==2){
		g=f-d;
	}
	if(z==3){
		g=f*d;
	}
	if(z==4){
		if(f<d){
			return 0;
		}
		if(f%d!=0){
			return 0;
		}
		g=e/c;
	}
	if(g==24){
		return 1;
	}
	return 0;
}
int cout_(i,j){
	
}
//int dfs(int step){
//	if(step==5){
//		cout<<"0,"<<a[1]<<','<<a[2]<<','<<a[3]<<','<<a[4];
//		return 0;
//	}
//	for(int i=1;i<=4;i++){
//		if(used[i]==0){
//			a[step]=i;
//			used[i]=1;
//			dfs(step+1);
//			used[i]=0;
//		}
//	}
//}
//int dfs(int step){
//	if(step==4){
//		cout<<"0,"<<a[1]<<','<<a[2]<<','<<a[3]<<',';
//		return 0;
//	}
//	for(int i=1;i<=4;i++){
//		a[step]=i;
//		dfs(step+1);
//	}
//}
int main(){
	for(int i=1;i<=4;i++){
		cin>>num[i];
	}
//	dfs(1);
//	for(int i=1;i<=24;i++){
//		for(int j=1;j<=4;j++){
//			cout<<sz[i][j]<<" ";
//		}
//		cout<<endl;
//	}
//	for(int i=1;i<=64;i++){
//		for(int j=1;j<=3;j++){
//			cout<<fh[i][j]<<" ";
//		}
//		cout<<endl;
//	}
	for(int i=1;i<=24;i++){
		a=sz[i][1];
		b=sz[i][2];
		c=sz[i][3];
		d=sz[i][4];
		for(int j=1;j<=64;j++){
			e=0;
			f=0;
			g=0;
			if(check(fh[j][1],fh[j][2],fh[j][3])){
				cout_(i,j);
				return 0;
			}
		}
	}
	cout<<"No answer!";
}




















#include<bits/stdc++.h>
using namespace std;
int p1;
int p2;
int p3;
string s;
int len;
int wz[1001];
int k;
char l;
char r;
int main(){
	cin>>p1;
	cin>>p2;
	cin>>p3;
	cin>>s;
	lens=s.size();
	s=' '+s;
	if(p1==1){
		for(int i=1;i<=len;i++){
			if(s[i]>='A'&&s[i]<='Z'){
				s[i]-='A';
				s[i]+='a';
			}
		}
	}
	if(p1==2){
		for(int i=1;i<=len;i++){
			if(s[i]>='a'&&s[i]<='z'){
				s[i]-='a';
				s[i]+='A';
			}
		}
	}
	for(int i=1;i<=len;i++){
		if(s[i]=='-'){
			wz[++k]=i;
		}
	}
	for(int i=1;i<=k;i++){
//		for(int j=wz[i-1]+1;j<=wz[i]-1;j++){
//			cout<<s[j];
//		}
		l=s[wz[i]-1];
		r=s[wz[i]+1];
		if(((l>='a'&&l<='z')||(l>='A'&&l<='Z')&&(r>=0&&r<=9))||((r>='a'&&r<='z')||(r>='A'&&r<='Z')&&(l>=0&&l<=9))){
			cout<<'-';
		}
		else if((l>=0&&l<=9)&&(r>=0&&r<=9)){
			if(p1==1){
				
			}
		}
//		cout<<l<<" "<<r<<"   ";
	}
}





#include <bits/stdc++.h>
using namespace std;
int n;
int m;
int a[1000010];
int qzh[1000010];
int cas;
int k;
int add;
int z;

int l;
int r;
int mid;
int p;
int cmp(int x,int y){
	return x>y;
}
int found(){
	l=1;
	r=n;
	p=n+1;
	while(l<=r){
        mid=(l+r)/2;
        if (a[mid]+add>=0){
			p=mid;
			r=mid-1;
		}
        else l=mid+1;
    }
    return p;
}
int main(){
	cin>>n;
	cin>>m;
	for(int i=1;i<=n;i++){
		cin>>a[i];
	}
	sort(a+1,a+n+1,cmp);
	for(int i=1;i<=n;i++){
		qzh[i]+=a[i]+qzh[i-1];
	}
	for(int i=1;i<=n;i++){
		cout<<a[i]<<" ";
	}
	cout<<endl;
	for(int i=1;i<=n;i++){
		cout<<qzh[i]<<" ";
	}
	cout<<endl;
	while(m--){
		cin>>cas;
		if(cas==1){
			cin>>k;
			add+=k;
		}
		if(cas==2){
			if(a[1]+add<=0){
				cout<<0<<endl;
			}
			else{
				z=found();
				cout<<z<<"   ";
				cout<<a[z]+add*(n-z+1)<<endl;
			}
		}
	}
}










#include<bits/stdc++.h>
using namespace std;
int n;
int m;
char a[11][100001];
int _;
int main(){
	cin>>n;
	cin>>m;
	for(int i=1;i<=n;i++){
		for(int j=1;j<=m;j++){
			cin>>a[i][j];
		}
	}
	for(int j=1;j<=m;j++){
		a[n+1][j]='-';
	}
	for(int i=1;i<=m;i++){
		_=n+1;
		for(int j=n;j>=1;j--){
			if(a[j][i]>='A'&&a[j][i]<='Z'){
				a[_-1][i]=a[j][i];
				a[j][i]='.';
				_=j+1;
			}
			else if(a[j][i]=='-'){
				_=j;
			}
		}
	}
	cout<<endl;
	for(int i=1;i<=n;i++){
		for(int j=1;j<=m;j++){
			cout<<a[i][j];
		}
		cout<<endl;
	}
}//T681127 [语言月赛 202510] 下落模拟






#include<bits/stdc++.h>
using namespace std;
int t;
int n;
int a[300005];
int max1;
int max2;
int v;
int find(){
	for()
}
int main(){
	cin>>t;
	while(t--){
		cin>>n;
		for(int i=1;i<=n;i++){
			cin>>a[i];
		}
		sort(a+1;a+n+1);
		int v=find();
	}
}
P14444


#include<bits/stdc++.h>
using namespace std;
int m;
int r;
int map[5][5]={-1,-1,-1,-1,-1, -1,7,8,9,-1, -1,4,5,6,-1, -1,1,2,3,-1, -1,0,-1,-1,-1};
//int next[10][10];
//int num[10]={1,3,3,2,3,4,3,2,3,2};
int ans;
int dfs(int x,int y,int step,int k){
	if(map[x][y]==-1){
		return 0;
	}
	k*=10;
	k+=map[x][y];
	if(k==)
	dfs(x,y,step+1)
	k/=10;
}
int main(){
//	next[0][1]=1;
//	next[1][1]=0;
//	next[1][2]=2;
//	next[1][3]=4;
//	next[2][1]=1;
//	next[2][2]=3;
//	next[2][3]=5;
//	next[3][1]=2;
//	next[3][2]=6;
//	next[4][1]=1;
//	next[4][2]=5;
//	next[4][3]=7;
//	next[5][1]=2;
//	next[5][2]=4;
//	next[5][3]=6;
//	next[5][4]=8;
//	next[6][1]=3;
//	next[6][2]=5;
//	next[6][3]=9;
//	next[7][1]=4;
//	next[7][2]=8;
//	next[8][1]=5;
//	next[8][2]=7;
//	next[8][3]=9;
//	next[9][1]=6;
//	next[9][2]=8;
	cin>>m;
	cin>>r;
	dfs(1,2,0,0);
	cout<<ans;
}




#include<bits/stdc++.h>
using namespace std;
int a,b,c,d;
int t[13];
int x,y,z;
int check(){
	int q=x;
	int w=y;
	int e=z;
	for(int i=1;i<=9;i++){
		t[i]=0;
	}
	while(q){
		t[q%10]=1;
		q/=10;
	}
	while(w){
		t[w%10]=1;
		w/=10;
	}
	while(e){
		t[e%10]=1;
		e/=10;
	}
	for(int i=1;i<=9;i++){
		if(t[i]==0){
			return 0;
		}
	}
	return 1;
}
int main(){
	cin>>a>>b>>c;
	d=a+b+c;
	for(int i=1;i<=9;i++){
		for(int j=1;j<=9;j++){
			for(int k=1;k<=9;k++){
				x=i*100+j*10+k;
				if(x%d==0){
					y=x/a*b;
					z=x/a*c;
					if(y>=100&&y<=999&&z>=100&&z<=999){
						if(check()){
							cout<<x<<" "<<y<<" "<<z<<endl;
						}
					}
				}
			}
		}
	}
}
key=9
共 2 篇
  1. 个人记录
  2. 题解

    题解:P13368 [GCJ 2011 #1B] RPI

    总体思路 本题需要通过三种不同的算法,分别算出三种不同的胜率,wp,owp,oowp ,然后运用公式求出 RPI 。 首先我们要知道,胜率=胜场/比赛总场=胜场/(胜场+败场+平场)本题没有打平的情况,忽略平场,即 本题通过这个公式的使用和拓展以完成程序。 定义 WP(胜率)是你…