Submission #196971

#TimeUsernameProblemLanguageResultExecution timeMemory
196971BasilhijazArranging Shoes (IOI19_shoes)Java
Compilation error
0 ms0 KiB
#include "shoes.h" #include <bits/stdc++.h> using namespace std; long long count_swaps(std::vector<int> s) { int cnt = 0; long long swaps = 0; for(int i = 0; i < s.size(); i++){ if(s[i] < 0){ swaps += abs(i - (cnt * 2)); for(int j = 0; j < s.size(); j++){ if(s[j] == s[i]*-1){ swaps += abs((cnt+1)*2 - j); } if(i > j){ if((cnt+1)*2 > j){ swaps--; } else{ swaps++; } } } cnt++; } } return swaps; }

Compilation message (stderr)

shoes.java:1: error: illegal character: '#'
#include "shoes.h"
^
shoes.java:1: error: class, interface, or enum expected
#include "shoes.h"
         ^
shoes.java:2: error: illegal character: '#'
#include <bits/stdc++.h>
^
shoes.java:4: error: class, interface, or enum expected
long long count_swaps(std::vector<int> s) {
^
shoes.java:5: error: class, interface, or enum expected
    int cnt = 0; long long swaps = 0;
                 ^
shoes.java:6: error: class, interface, or enum expected
    for(int i = 0; i < s.size(); i++){
    ^
shoes.java:6: error: class, interface, or enum expected
    for(int i = 0; i < s.size(); i++){
                   ^
shoes.java:6: error: class, interface, or enum expected
    for(int i = 0; i < s.size(); i++){
                                 ^
shoes.java:9: error: class, interface, or enum expected
            for(int j = 0; j < s.size(); j++){
            ^
shoes.java:9: error: class, interface, or enum expected
            for(int j = 0; j < s.size(); j++){
                           ^
shoes.java:9: error: class, interface, or enum expected
            for(int j = 0; j < s.size(); j++){
                                         ^
shoes.java:12: error: class, interface, or enum expected
                }
                ^
shoes.java:16: error: class, interface, or enum expected
                    }
                    ^
shoes.java:19: error: class, interface, or enum expected
                    }
                    ^
shoes.java:23: error: class, interface, or enum expected
        }
        ^
shoes.java:26: error: class, interface, or enum expected
}
^
16 errors