Submission #819047

#TimeUsernameProblemLanguageResultExecution timeMemory
819047GangstaDetecting Molecules (IOI16_molecules)C++14
0 / 100
1 ms212 KiB
/* ID: didarco1 LANG: C++17 TASK: */ // a >> b = a / pow(2,b) // a << b = a * pow(2,b) #include <bits/stdc++.h> #define ll long long int #define pb push_back #define sz size() #define ss second #define ff first #define N 200001 #define pii pair<int,int> using namespace std; //ll _, x, n; vector<int> find_subset(int l, int u, vector<int> w){ int x = w[0], uly = 0, kici = 0, den = 0, sum = 0, n = w.sz; vector<int> result; result.resize(n); for(int i = 1; i < n; i++){ if(w[i] == x + 1) uly++; else if(w[i] == x - 1) kici++; else if(w[i] == x) den++; } if(den + 1 == n){ int x = l/w[0], m; if(x * w[0] == l and x <= n) m = x; else if(x * w[0] < l and (x+1) * w[0] <= u and x < n) m = x+1; else m = 0; for(int i = 0; i < m; i++) result[i] = i; return result; } return result; } //int main(){ // int l, u, n; // cin >> n >> l >> u; // vector <int> w; // w.resize(n); // for(int i = 0; i < n; i++){ // cin >> w[i]; // } // for(auto i : find_subset(l,u,w)) cout << i << ' '; //}

Compilation message (stderr)

molecules.cpp: In function 'std::vector<int> find_subset(int, int, std::vector<int>)':
molecules.cpp:22:44: warning: unused variable 'sum' [-Wunused-variable]
   22 |  int x = w[0], uly = 0, kici = 0, den = 0, sum = 0, n = w.sz;
      |                                            ^~~
#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...