Submission #1003766

#TimeUsernameProblemLanguageResultExecution timeMemory
1003766vjudge1Ekoeko (COCI21_ekoeko)C++17
0 / 110
1098 ms604 KiB
#include<bits/stdc++.h> using namespace std; #define int long long signed main(){ int n; cin >> n; string s; cin >> s; int ans=0; for(int i=0; i<n; i++){ int id=i+1; while(s[id]!=s[i]) id++; for(int j=id; j<i+n; j++) swap(s[j],s[j+1]), ans++; } cout << ans << '\n'; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...