Submission #1369779

#TimeUsernameProblemLanguageResultExecution timeMemory
1369779altayeb_132Arranging Shoes (IOI19_shoes)C++20
Compilation error
0 ms0 KiB
#include "shoes.h"
#include<bits/stdc++.h>
using namespace std;


long long count_swaps(vector<int> s) {
    int n = s.size();
    int vis[n] = {};
    int ans = 0;
    for (int i = 0; i < n; i++) {

        for (int j = i - 1; j >= 0; j--) {
            if (s[j] = -s[i] && !vis[j]) {
                if (s[j`] > 0)
                    ans++;
                ans += i - j;
                vis[i] = 1;
                vis[j] = 1;
                break;
            }
        }
    }
    return ans;
}

// int main() {
//     int n = 4;
//     assert(1 == scanf("%d", &n));
//     vector<int> S(2 * n);
//     for (int i = 0; i < 2 * n; i++)
//         assert(1 == scanf("%d", &S[i]));
//     fclose(stdin);
//
//     long long result = count_swaps(S);
//
//     printf("%lld\n", result);
//     fclose(stdout);
//     return 0;
// }

Compilation message (stderr)

shoes.cpp:14:24: error: stray '`' in program
   14 |                 if (s[j`] > 0)
      |                        ^