Submission #196968

#TimeUsernameProblemLanguageResultExecution timeMemory
196968BasilhijazArranging 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 += i - (cnt * 2); 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
            cnt++;
            ^
shoes.java:10: error: class, interface, or enum expected
        }
        ^
shoes.java:13: error: class, interface, or enum expected
}
^
11 errors