/ SeriousOJ /

Record Detail

Runtime Error


  
# Status Time Cost Memory Cost
#1 Wrong Answer 1ms 532.0 KiB
#2 Wrong Answer 1ms 536.0 KiB
#3 Wrong Answer 1ms 364.0 KiB
#4 Wrong Answer 1ms 532.0 KiB
#5 Wrong Answer 1ms 532.0 KiB
#6 Runtime Error *** stack smashing detected ***: terminated 1ms 532.0 KiB
#7 Runtime Error *** stack smashing detected ***: terminated 4ms 532.0 KiB
#8 Runtime Error 1ms 536.0 KiB
#9 Runtime Error 1ms 432.0 KiB

Code

#include <bits/stdc++.h>

using namespace std;

int main() {
    int n;
    cin>>n;
    string s;cin>>s;
    int count = 0;
        for (int i = 0; i < n- 1;i++) {
            for (int j = i + 1; j < n;j++) {
                string temp = s; 
                swap(temp[i], temp[j]); 
                if (temp == s) {
                    count++; 
                }
            }
        }

    return 0;
}

Information

Submit By
Type
Submission
Problem
P1038 Do not touch my string
Contest
Brain Booster #3
Language
C++20 (G++ 13.2.0)
Submit At
2024-05-06 15:56:17
Judged At
2024-10-03 13:51:06
Judged By
Score
0
Total Time
4ms
Peak Memory
536.0 KiB