CSP题解|202305-1 重复局面|100分

#include <bits/stdc++.h>
using namespace std;

int main(){
	int n;cin>>n;
	map<string,int>mp;
	while(n--){
		//n为步数
		int row=8;
		string s="";
		while(row--){
			string temp;
			cin>>temp;
			s+=temp;	
		} 
		if(mp.find(s)==mp.end()){
			cout<<1<<endl;
			mp[s]=1;
		}else{
			mp[s]++;
			cout<<mp[s]<<endl;
		}
	}
} 

13行本来用getline,一直0分,换成cin就AC了...

全部评论

相关推荐

点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务