Submission #51714

# Submission time Handle Problem Language Result Execution time Memory
51714 2018-06-20T07:53:07 Z tincamatei Detecting Molecules (IOI16_molecules) C++14
Compilation error
0 ms 0 KB
#include<bits/stdc++.h>
#ifdef EVAL
#include "molecules.h"
#endif

using namespace std;

const int MAX_N = 200000;
long long _sp[1+MAX_N], *sp = _sp + 1;

vector<int> find_subset(int l, int u, vector<int> w) {
    int n, lx, rx;
    vector<int> result;
    n = w.size();
    lx = 2, rx = 1;
    
    sort(w.begin(), w.end());
    
    for(int i = 0; i < n; ++i) {
        sp[i] = sp[i - 1] + w[i];
        for(int j = -1; j < i; ++j)
            if(l <= sp[i] - sp[j] && sp[i] - sp[j] <= u) {
                lx = j + 1;
                rx = i;
            }
    }
    
    for(lx = lx + 1; lx <= rx; ++lx)
        result.push_back(lx);
    return result;
}

#ifndef EVAL
int main() {
    int n, l, u;
    assert(3 == scanf("%d %d %d", &n, &l, &u));
    std::vector<int> w(n);
    for (int i = 0; i < n; i++)
        assert(1 == scanf("%d", &w[i]));
    std::vector<int> result = find_subset(l, u, w);
    
    
    printf("%d\n", (int)result.size());
    for (int i = 0; i < (int)result.size(); i++)
        printf("%d%c", result[i], " \n"[i == (int)result.size() - 1]);
}
#endif

Compilation message

molecules.cpp:23:2: error: stray '\302' in program
                 lx = j + 1;
  ^
molecules.cpp:23:3: error: stray '\240' in program
                 lx = j + 1;
   ^
molecules.cpp:23:5: error: stray '\302' in program
                 lx = j + 1;
     ^
molecules.cpp:23:6: error: stray '\240' in program
                 lx = j + 1;
      ^
molecules.cpp:23:8: error: stray '\302' in program
                 lx = j + 1;
        ^
molecules.cpp:23:9: error: stray '\240' in program
                 lx = j + 1;
         ^
molecules.cpp:23:11: error: stray '\302' in program
                 lx = j + 1;
           ^
molecules.cpp:23:12: error: stray '\240' in program
                 lx = j + 1;
            ^
molecules.cpp:23:14: error: stray '\302' in program
                 lx = j + 1;
              ^
molecules.cpp:23:15: error: stray '\240' in program
                 lx = j + 1;
               ^
molecules.cpp:23:17: error: stray '\302' in program
                 lx = j + 1;
                 ^
molecules.cpp:23:18: error: stray '\240' in program
                 lx = j + 1;
                  ^
molecules.cpp:23:20: error: stray '\302' in program
                 lx = j + 1;
                    ^
molecules.cpp:23:21: error: stray '\240' in program
                 lx = j + 1;
                     ^
molecules.cpp:23:23: error: stray '\302' in program
                 lx = j + 1;
                       ^
molecules.cpp:23:24: error: stray '\240' in program
                 lx = j + 1;
                        ^
molecules.cpp:23:31: error: stray '\302' in program
                 lx = j + 1;
                               ^
molecules.cpp:23:32: error: stray '\240' in program
                 lx = j + 1;
                                ^