em Posted November 5, 2011 Report Posted November 5, 2011 (edited) Se d? codul:#include <iostream>#include <cmath>int main(){ char input[7]={0}; std::cin>>input; input[0]=input[0]*input[2]-input[1]*input[3]-input[4]-input[4]%input[6]; input[1]=(input[4]*input[5])%(--(--input[2])); input[2]=(input[5]+input[6])-(input[2]%100); input[3]=((input[0]+input[1])-4)>>(input[2]/100); input[4]=((int) pow((++input[6]>>1),2)/3)-(input[6]+input[1]%76); input[5]=(input[5]+input[6])-input[2]/10; input[6]=((input[0]+input[1]*input[2])>>7)%((input[5]+2)>>1); std::cout<<input;}Care este inputul astfel incat output sa fie winner!Limite input : exact 7 caractere ascii.Face?i cum vre?i. Nu va uitati la rezolvarile altora si postati si voi acelasi lucru. Solvers: - tromfil- CyberWolf08 Edited November 5, 2011 by em Quote
Zamolxis666 Posted November 5, 2011 Report Posted November 5, 2011 #include <iostream>#include <cmath>int main(){ char input[7]={0}; std::cin>>input; /*input[0]=input[0]*input[2]-input[1]*input[3]-input[4]-input[4]%input[6]; input[1]=(input[4]*input[5])%(--(--input[2])); input[2]=(input[5]+input[6])-(input[2]%100); input[3]=((input[0]+input[1])-4)>>(input[2]/100); input[4]=((int) pow((++input[6]>>1),2)/3)-(input[6]+input[1]%76); input[5]=(input[5]+input[6])-input[2]/10; input[6]=((input[0]+input[1]*input[2])>>7)%((input[5]+2)>>1);*/ strcpy(input, "winner"); std::cout<<input;}Am facut cum am vrut Quote
em Posted November 5, 2011 Author Report Posted November 5, 2011 Eh. Prin cum vrei m-am referit ca o poti gandi fie matematic, fie faci un BK. (Pentru BK iti dau un indiciu ca parola mea este doar din litere mici + caracterele '-','_','O')Oricum alegi sa o faci, ai ceva de invatat. (sper)P.S.: Parola mea e parola mea, nu e unica desigur. Quote
TomescuMihail Posted November 5, 2011 Report Posted November 5, 2011 Inteligent, la asta chiar nu ma gandisem!#include <iostream>#include <cmath>int main(){ char input[7]={0}; std::cin>>input; /*input[0]=input[0]*input[2]-input[1]*input[3]-input[4]-input[4]%input[6]; input[1]=(input[4]*input[5])%(--(--input[2])); input[2]=(input[5]+input[6])-(input[2]%100); input[3]=((input[0]+input[1])-4)>>(input[2]/100); input[4]=((int) pow((++input[6]>>1),2)/3)-(input[6]+input[1]%76); input[5]=(input[5]+input[6])-input[2]/10; input[6]=((input[0]+input[1]*input[2])>>7)%((input[5]+2)>>1);*/ strcpy(input, "winner"); std::cout<<input;}Am facut cum am vrut Quote
em Posted November 5, 2011 Author Report Posted November 5, 2011 Inteligent, la asta chiar nu ma gandisem!P?i nu e bine oricum. Afi?eaz? winner nu winner! Quote
Nytro Posted November 5, 2011 Report Posted November 5, 2011 Aplicam metoda de la Defcamp: http://i40.tinypic.com/2464aco.png Quote
em Posted November 5, 2011 Author Report Posted November 5, 2011 Aplicam metoda de la Defcamp: http://i40.tinypic.com/2464aco.png Nu mai face afi??rile. Merge mult mult mai repede dac? nu le mai faci. (Sau le faci doar cand se schimba prima liter?).Again. Parola doar din litere mici + caracterele {-,_,O}. Ar fi OK dac? ar incerca si persoane care nu au mai implementat un BK in viata lor (sa posteze aici bucati de cod si sa fie ajutati). Quote
TomescuMihail Posted November 5, 2011 Report Posted November 5, 2011 BK = backtracking? Nu prea inteleg prescurtarile Quote
CyberWolf08 Posted November 5, 2011 Report Posted November 5, 2011 Deci o mica verificare: imput[2]='u', imput[4]='o' imput[5]='P' si imput[6]='.' ? Quote
em Posted November 5, 2011 Author Report Posted November 5, 2011 Deci o mica verificare: imput[2]='u', imput[4]='o' imput[5]='P' si imput[6]='.' ?Pe solutia mea nu. Dar oricum nu e unica. Da. BK - backtracking. In fine, se poate si cu 7 for-uri. Quote
tromfil Posted November 5, 2011 Report Posted November 5, 2011 Ma doare capul ca am avut o zi plina de dimineata tare, deci las in aer asa. input2 si 6 se pot afla usor. 4 si 5 merg printr-un bkt cum ar veni mai lejer, iar restul tot rapid le aflati dupa aia. Posibil sa fie greseli, dar mersul e cam asa.test - Pastebin.com@em: p-ul ala e bun? macar atat. 1 Quote
em Posted November 5, 2011 Author Report Posted November 5, 2011 Ca si rezolvata.P.S.: p-ul Nu e bun. input2-2 trebuie sa fie 114 <=> input2=112 ?! Ultimul caracter e bun. Felicitari! Quote
CyberWolf08 Posted November 5, 2011 Report Posted November 5, 2011 Am reusit si eu: [C++] Rst challange - Pastebin.comRezolvarea este cam lipsita de comentarii. Daca am timp, le voi adouga maine Quote
em Posted November 5, 2011 Author Report Posted November 5, 2011 Am reusit si eu: [C++] Rst challange - Pastebin.comRezolvarea este cam lipsita de comentarii. Daca am timp, le voi adouga maineCred ca si tu ai un typo. Mie toate imputurile tale imi genereaza yioods". Quote
CyberWolf08 Posted November 5, 2011 Report Posted November 5, 2011 Cred ca si tu ai un typo. Mie toate imputurile tale imi genereaza yioods". pe gcc se compileaza calumea si da output-ul dat in pastebin. Toate inputurile functioneaza. 1 Quote
em Posted November 5, 2011 Author Report Posted November 5, 2011 pe gcc se compileaza calumea si da output-ul dat in pastebin. Toate inputurile functioneaza.Da. Scuze. Compilasem direct pe codepad si dadusem paste gresit.Felicitari! Quote
TomescuMihail Posted November 5, 2011 Report Posted November 5, 2011 (edited) Cu backtracking e bine gandita asa?[C++] apelam back(k) unde k e 7 void back(int k) { if(k==7){st[k]=0; - Pastebin.comEDIT: E GRESIT! AAAAH BRBPunem conditii: if(k==6) back(k-1) // if(k==5) back(k-3)// if(k==2) back(k+2) // if(k==4) back(k-4)?nuuuu NICI ASA! Edited November 5, 2011 by TomescuMihail Quote