Detalii evaluare #64676005

Rezumat problemă

Cei m cowboys și cei n aliens s-au întâlnit în vestul sălbatic și, păstrând tradiția locului, s-au așezat în șir indian. Cum cowboys erau gazde primitoare și în special foarte precaute, s-au gândit că între doi cowboys consecutivi ar fi bine să fie cel mult un alien (din motive de securitate). De asemenea primul și ultimul din șir să fie cawboys. Dilema care s-a ivit a fost numărul de moduri în care s-ar putea așeza în șir indian ținând cont de condițiile de securitate impuse.

Detalii

Problema CowboysAndAliens Operații I/O cowboysandaliens.in/cowboysandaliens.out
Limita timp 0.1 secunde Limita memorie Total: 64 MB / Stivă 8 MB
Id soluție #64676005 Utilizator Somodi Vlad (10ticles)
Fișier cowboysandaliens.cpp Dimensiune 7.15 KB
Data încărcării 22 Mai 2026, 02:52 Scor/rezultat 100 puncte

Evaluare

Mesaj compilare

cowboysandaliens.cpp: In function ‘long long unsigned int putere(int, int)’:
cowboysandaliens.cpp:27:12: warning: comparison of integer expressions of different signedness: ‘int’ and ‘long long unsigned int’ [-Wsign-compare]
   27 |   while (b > produs) {
      |          ~~^~~~~~~~
cowboysandaliens.cpp:32:16: warning: comparison of integer expressions of different signedness: ‘long long unsigned int’ and ‘int’ [-Wsign-compare]
   32 |     if (produs <= b) {
      |         ~~~~~~~^~~~
cowboysandaliens.cpp: In function ‘int PB_ceva()’:
cowboysandaliens.cpp:124:21: warning: comparison of integer expressions of different signedness: ‘int’ and ‘size_t’ {aka ‘long unsigned int’} [-Wsign-compare]
  124 |   for (int i = 0; i < strlen(n); i++) {
      |                   ~~^~~~~~~~~~~
cowboysandaliens.cpp:125:13: warning: array subscript has type ‘char’ [-Wchar-subscripts]
  125 |     freq[n[i]]++;
      |          ~~~^
cowboysandaliens.cpp:128:14: warning: array subscript has type ‘char’ [-Wchar-subscripts]
  128 |     if (freq[i] > 1) {
      |              ^
cowboysandaliens.cpp:129:37: warning: array subscript has type ‘char’ [-Wchar-subscripts]
  129 |       suma /= Permutari_cu_mod(freq[i]);
      |                                     ^
cowboysandaliens.cpp:121:7: warning: unused variable ‘k’ [-Wunused-variable]
  121 |   int k;
      |       ^
cowboysandaliens.cpp: In function ‘int descompunere_factori_factoriale()’:
cowboysandaliens.cpp:141:33: warning: comparison of integer expressions of different signedness: ‘int’ and ‘long long unsigned int’ [-Wsign-compare]
  141 |   for (int i = max(b, c) + 1; i <= a; i++) {
      |                               ~~^~~~
cowboysandaliens.cpp:152:21: warning: comparison of integer expressions of different signedness: ‘int’ and ‘const long long unsigned int’ [-Wsign-compare]
  152 |   for (int i = 2; i <= min(b, c); i++) {
      |                   ~~^~~~~~~~~~~~
cowboysandaliens.cpp:165:1: warning: no return statement in function returning non-void [-Wreturn-type]
  165 | }
      | ^
cowboysandaliens.cpp: In function ‘int ma2in()’:
cowboysandaliens.cpp:172:33: warning: comparison of integer expressions of different signedness: ‘int’ and ‘long long unsigned int’ [-Wsign-compare]
  172 |   for (int i = max(b, c) + 1; i <= a; i++) {
      |                               ~~^~~~
cowboysandaliens.cpp:179:21: warning: comparison of integer expressions of different signedness: ‘int’ and ‘const long long unsigned int’ [-Wsign-compare]
  179 |   for (int i = 2; i <= min(b, c); i++) {
      |                   ~~^~~~~~~~~~~~
cowboysandaliens.cpp:169:27: warning: unused variable ‘cntc’ [-Wunused-variable]
  169 |   int cnta = 0, cntb = 0, cntc = 0;
      |                           ^~~~
cowboysandaliens.cpp:192:1: warning: no return statement in function returning non-void [-Wreturn-type]
  192 | }
      | ^
cowboysandaliens.cpp: In function ‘int pb_3630_30_limita_de_timp_depasita()’:
cowboysandaliens.cpp:234:27: warning: comparison of integer expressions of different signedness: ‘long long int’ and ‘long long unsigned int’ [-Wsign-compare]
  234 |   for (long long i = 1; i <= n; i++) {
      |                         ~~^~~~
cowboysandaliens.cpp:241:1: warning: no return statement in function returning non-void [-Wreturn-type]
  241 | }
      | ^
cowboysandaliens.cpp: In function ‘int pb_1297()’:
cowboysandaliens.cpp:258:1: warning: no return statement in function returning non-void [-Wreturn-type]
  258 | }
      | ^
cowboysandaliens.cpp: In function ‘int veverita_programare_dinamica()’:
cowboysandaliens.cpp:289:1: warning: no return statement in function returning non-void [-Wreturn-type]
  289 | }
      | ^
cowboysandaliens.cpp: In function ‘int pb_3589()’:
cowboysandaliens.cpp:319:1: warning: no return statement in function returning non-void [-Wreturn-type]
  319 | }
      | ^
cowboysandaliens.cpp: In function ‘int pb_2011_50()’:
cowboysandaliens.cpp:334:1: warning: no return statement in function returning non-void [-Wreturn-type]
  334 | }
      | ^
cowboysandaliens.cpp: In function ‘int prob4812()’:
cowboysandaliens.cpp:229:1: warning: control reaches end of non-void function [-Wreturn-type]
  229 | }
      | ^

Rezultat evaluare

Test Timp Mesaj evaluare Scor posibil Scor obținut
1 0.001 secunde OK. 10 10 Exemplu
2 0.001 secunde OK. 10 10
3 0.002 secunde OK. 10 10
4 0.002 secunde OK. 10 10
5 0.001 secunde OK. 10 10
6 0.002 secunde OK. 10 10
7 0.003 secunde OK. 10 10
8 0.008 secunde OK. 10 10
9 0.009 secunde OK. 10 10
10 0.01 secunde OK. 10 10
Punctaj total 100

Cum funcționează evaluarea?

www.pbinfo.ro permite evaluarea a două tipuri de probleme:

  • probleme la care rezolvarea presupune scrierea unui program complet
  • probleme la care rezolvarea presupune scrierea unei secvențe de program - câteva instrucțiuni, o listă de declarații, una sau mai multe funcții, etc.

Problema CowboysAndAliens face parte din prima categorie. Soluția propusă de tine va fi evaluată astfel:

  • Programul sursă este compilat folosind compilatorul corespunzător. Dacă în urma compilării se obțin erori sau avertismente, acestea sunt afișate în această pagină.
  • Dacă programul a fost compilat, executabilul obținut va fi rulat, furnizându-i-se unul sau mai multe seturi de date de intrare, în concordanță cu restricțiile specifice problemei. Pentru fiecare set de date se obține un anumit punctaj, în raport cu corectitudinea soluției tale.

Suma punctajelor acordate pe testele utilizate pentru verificare este 100. Astfel, soluția ta poate obține cel mult 100 de puncte, caz în care se poate considera corectă.

Du-te sus!