Submission #973719

#TimeUsernameProblemLanguageResultExecution timeMemory
973719NemanjaSo2005Detecting Molecules (IOI16_molecules)C++17
19 / 100
1 ms604 KiB
#include<bits/stdc++.h>#include "molecules.h" #define ll long long using namespace std;ll N,zbir;struct slog{ int org,vred;}sniz[5000005];bool cmp(slog a,slog b){ return a.vred<b.vred;}vector<int> find_subset(int L, int R, vector<int> niz){ N=niz.size(); for(int i=1;i<=N;i++){ sniz[i].org=i-1; sniz[i].vred=niz[i-1]; } //sort(sniz+1,sniz+1+N,cmp); int i=1,j=1; zbir=sniz[1].vred; while(j<=N){ if(i>j) break; if(zbir<L){ j++; zbir+=sniz[j].vred; } else if(zbir>R){ zbir-=sniz[i].vred; i++; } if(zbir<=R and zbir>=L){ niz.clear(); for(int k=i;k<=j;k++) niz.push_back(sniz[k].org); return niz; } } niz.clear(); return niz;}

Compilation message (stderr)

molecules.cpp:2:24: warning: extra tokens at end of #include directive
    2 | #include<bits/stdc++.h>#include "molecules.h"
      |                        ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...