Submission #411995

#TimeUsernameProblemLanguageResultExecution timeMemory
411995mosiashvililukaCounting Mushrooms (IOI20_mushrooms)C++14
10 / 100
306 ms572 KiB
#include "mushrooms.h" #include<bits/stdc++.h> using namespace std; int a,b,c,d,e,i,j,ii,jj,zx,xc,A,B,T=200; string QWE; vector <int> vA,vB,vv; /*int use_machine(vector <int> q){ int we=0; for(int qw=1; qw<q.size(); qw++){ if(QWE[q[qw]]!=QWE[q[qw-1]]){ we++; } } return we; }*/ int count_mushrooms(int n) { a=n; vA.push_back(0); A++; for(i=1; i<a; i++){ //if(vA.size()>=T||vB.size()>=T) break; vv.clear();vv.push_back(0);vv.push_back(i); c=use_machine(vv); if(c==0){ vA.push_back(i); A++; }else{ vB.push_back(i); B++; } } return A; } /*int main(){ ios_base::sync_with_stdio(false),cin.tie(0),cout.tie(0); //cin>>a; cin>>QWE; cout<<count_mushrooms(QWE.size()); return 0; }*/
#Verdict Execution timeMemoryGrader output
Fetching results...