Submission #1173445

#TimeUsernameProblemLanguageResultExecution timeMemory
1173445sodooDetecting Molecules (IOI16_molecules)C++20
Compilation error
0 ms0 KiB
#include "molecules.h" #include <bits/stdc++.h> using namespace s td; #define ll int #define ss second #define ff first #define pb push_back #define endl "\n" vector<int> find_subset(int l, int u, vector<int> w) { ll x=w.size(),sum=0; vector<pair<ll,ll> > v; vector<int> s; for(ll i=0;i<w.size();i++){ v.pb({w[i],i}); } sort(v.begin(),v.end()); for(ll i=0;i<v.size();i++){ll j=0; sum+=v[i].ff; if(sum>=l && sum<=u){ for(ll t=j;t<=i;t++){ s.pb(v[t].ss); } break; } while(sum>u){ sum-=v[j].ff; j++; } if(sum>=l && sum<=u){ for(ll t=j;t<=i;t++){ s.pb(v[t].ss); } break; } } return s; }

Compilation message (stderr)

molecules.cpp:3:17: error: 's' is not a namespace-name
    3 | using namespace s       td;
      |                 ^
molecules.cpp:3:24: error: expected ';' before 'td'
    3 | using namespace s       td;
      |                        ^~~
      |                        ;
molecules.cpp:3:25: error: 'td' does not name a type; did you mean 'tm'?
    3 | using namespace s       td;
      |                         ^~
      |                         tm
molecules.cpp:9:1: error: 'vector' does not name a type
    9 | vector<int> find_subset(int l, int u, vector<int> w) {
      | ^~~~~~
molecules.h:1:9: warning: #pragma once in main file
    1 | #pragma once
      |         ^~~~
molecules_c.h:1:9: warning: #pragma once in main file
    1 | #pragma once
      |         ^~~~