private: char chess[8][8]; public: friend bool beTheSame(Step a, Step b); friend istream& operator>>(istream& input, Step& s); char* operator[](int index) { return chess[index]; } }; bool beTheSame(Step a, Step b) { for (int i = 0; i < 8; i++) for (int j = ...
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<<...
Here is a Java code that can solve the problem you provided: importjava.util.*;publicclassMain{publicstaticvoidmain(String[]args){Scannersc=newScanner(System.in);intn=sc.nextInt();sc.nextLine();Map<String,Integer>map=newHashMap<>();for(inti=0;i<n;i++){StringBuildersb=newStringBuilder(...