#4069
Se dau două numere naturale n k. Considerăm graful complet cu n noduri, etichetate de la 1 la n. Din acesta eliminăm toate muchiile (i,j) cu proprietatea că i și j dau același rest la împărțirea cu k.
Afișati matricea de adiacență a grafului parțial obținut.
| Problema | GrafComplet | Operații I/O |
tastatură/ecran
|
|---|---|---|---|
| Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #64784978 | Utilizator | |
| Fișier | grafcomplet.cpp | Dimensiune | 347 B |
| Data încărcării | 31 Mai 2026, 09:32 | Scor/rezultat | Eroare de compilare |
grafcomplet.cpp: In function ‘int main()’: grafcomplet.cpp:7:24: error: expected ‘)’ before ‘;’ token 7 | for (i=1; i<=n; i++;) | ~ ^ | ) grafcomplet.cpp:7:5: warning: this ‘for’ clause does not guard... [-Wmisleading-indentation] 7 | for (i=1; i<=n; i++;) | ^~~ grafcomplet.cpp:7:25: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘for’ 7 | for (i=1; i<=n; i++;) | ^ grafcomplet.cpp:7:25: error: expected primary-expression before ‘)’ token grafcomplet.cpp:8:22: warning: statement has no effect [-Wunused-value] 8 | for (j=i+1; j<=n; j++) | ~^~~ grafcomplet.cpp:8:30: error: expected ‘;’ before ‘)’ token 8 | for (j=i+1; j<=n; j++) | ^ | ; grafcomplet.cpp:11:24: error: expected ‘)’ before ‘;’ token 11 | for (i=1; i<=n; i++;) | ~ ^ | ) grafcomplet.cpp:11:5: warning: this ‘for’ clause does not guard... [-Wmisleading-indentation] 11 | for (i=1; i<=n; i++;) | ^~~ grafcomplet.cpp:11:25: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘for’ 11 | for (i=1; i<=n; i++;) | ^ grafcomplet.cpp:11:25: error: expected primary-expression before ‘)’ token
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema GrafComplet face parte din prima categorie. Soluția propusă de tine va fi evaluată astfel:
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ă.