#317
SumMax
Se dă o matrice pătratică cu n
lini şi n
coloane şi elemente numere naturale distincte. Determinaţi cea mai mare sumă a n
elemente din matrice, cu proprietatea că oricare două elemente se află pe linii şi coloane distincte.
Problema | SumMax | Operații I/O |
summax.in /summax.out
|
---|---|---|---|
Limita timp | 0.75 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #14980005 | Utilizator | |
Fișier | summax.cpp | Dimensiune | 839 B |
Data încărcării | 27 Martie 2019, 00:28 | Scor / rezultat | Eroare de compilare |
summax.cpp:4:13: warning: ISO C99 requires whitespace after the macro name [enabled by default] #define NMax=15; ^ summax.cpp:12:1: error: stray '\302' in program for(int i = 1; i <= n; i++) ^ summax.cpp:12:1: error: stray '\240' in program summax.cpp:12:1: error: stray '\302' in program summax.cpp:12:1: error: stray '\240' in program summax.cpp:12:1: error: stray '\302' in program summax.cpp:12:1: error: stray '\240' in program summax.cpp:13:1: error: stray '\302' in program for(int j = 1; j <= n; j++) { ^ summax.cpp:13:1: error: stray '\240' in program summax.cpp:13:1: error: stray '\302' in program summax.cpp:13:1: error: stray '\240' in program summax.cpp:13:1: error: stray '\302' in program summax.cpp:13:1: error: stray '\240' in program summax.cpp:13:1: error: stray '\302' in program summax.cpp:13:1: error: stray '\240' in program summax.cpp:13:1: error: stray '\302' in program summax.cpp:13:1: error: stray '\240' in program summax.cpp:13:1: error: stray '\302' in program summax.cpp:13:1: error: stray '\240' in program summax.cpp:13:1: error: stray '\302' in program summax.cpp:13:1: error: stray '\240' in program summax.cpp:14:1: error: stray '\302' in program x[k] = v[i][j]; ^ summax.cpp:14:1: error: stray '\240' in program summax.cpp:14:1: error: stray '\302' in program summax.cpp:14:1: error: stray '\240' in program summax.cpp:14:1: error: stray '\302' in program summax.cpp:14:1: error: stray '\240' in program summax.cpp:14:1: error: stray '\302' in program summax.cpp:14:1: error: stray '\240' in program summax.cpp:14:1: error: stray '\302' in program summax.cpp:14:1: error: stray '\240' in program summax.cpp:14:1: error: stray '\302' in program summax.cpp:14:1: error: stray '\240' in program summax.cpp:14:1: error: stray '\302' in program summax.cpp:14:1: error: stray '\240' in program summax.cpp:14:1: error: stray '\302' in program summax.cpp:14:1: error: stray '\240' in program summax.cpp:14:1: error: stray '\302' in program summax.cpp:14:1: error: stray '\240' in program summax.cpp:14:1: error: stray '\302' in program summax.cpp:14:1: error: stray '\240' in program summax.cpp:14:1: error: stray '\302' in program summax.cpp:14:1: error: stray '\240' in program summax.cpp:16:1: error: stray '\302' in program if(!c[j] && !l[i]) { ^ summax.cpp:16:1: error: stray '\240' in program summax.cpp:16:1: error: stray '\302' in program summax.cpp:16:1: error: stray '\240' in program summax.cpp:16:1: error: stray '\302' in program summax.cpp:16:1: error: stray '\240' in program summax.cpp:16:1: error: stray '\302' in program summax.cpp:16:1: error: stray '\240' in program summax.cpp:16:1: error: stray '\302' in program summax.cpp:16:1: error: stray '\240' in program summax.cpp:16:1: error: stray '\302' in program summax.cpp:16:1: error: stray '\240' in program summax.cpp:16:1: error: stray '\302' in program summax.cpp:16:1: error: stray '\240' in program summax.cpp:16:1: error: stray '\302' in program summax.cpp:16:1: error: stray '\240' in program summax.cpp:16:1: error: stray '\302' in program summax.cpp:16:1: error: stray '\240' in program summax.cpp:16:1: error: stray '\302' in program summax.cpp:16:1: error: stray '\240' in program summax.cpp:16:1: error: stray '\302' in program summax.cpp:16:1: error: stray '\240' in program summax.cpp:17:1: error: stray '\302' in program c[j] = l[i] = 1; ^ summax.cpp:17:1: error: stray '\240' in program summax.cpp:17:1: error: stray '\302' in program summax.cpp:17:1: error: stray '\240' in program summax.cpp:17:1: error: stray '\302' in program summax.cpp:17:1: error: stray '\240' in program summax.cpp:17:1: error: stray '\302' in program summax.cpp:17:1: error: stray '\240' in program summax.cpp:17:1: error: stray '\302' in program summax.cpp:17:1: error: stray '\240' in program summax.cpp:17:1: error: stray '\302' in program summax.cpp:17:1: error: stray '\240' in program summax.cpp:17:1: error: stray '\302' in program summax.cpp:17:1: error: stray '\240' in program summax.cpp:17:1: error: stray '\302' in program summax.cpp:17:1: error: stray '\240' in program summax.cpp:17:1: error: stray '\302' in program summax.cpp:17:1: error: stray '\240' in program summax.cpp:17:1: error: stray '\302' in program summax.cpp:17:1: error: stray '\240' in program summax.cpp:17:1: error: stray '\302' in program summax.cpp:17:1: error: stray '\240' in program summax.cpp:17:1: error: stray '\302' in program summax.cpp:17:1: error: stray '\240' in program summax.cpp:17:1: error: stray '\302' in program summax.cpp:17:1: error: stray '\240' in program summax.cpp:17:1: error: stray '\302' in program summax.cpp:17:1: error: stray '\240' in program summax.cpp:17:1: error: stray '\302' in program summax.cpp:17:1: error: stray '\240' in program summax.cpp:18:1: error: stray '\302' in program if(k == n) sol = max(sol, accumulate(x + 1, x + n + 1, 0)); ^ summax.cpp:18:1: error: stray '\240' in program summax.cpp:18:1: error: stray '\302' in program summax.cpp:18:1: error: stray '\240' in program summax.cpp:18:1: error: stray '\302' in program summax.cpp:18:1: error: stray '\240' in program summax.cpp:18:1: error: stray '\302' in program summax.cpp:18:1: error: stray '\240' in program summax.cpp:18:1: error: stray '\302' in program summax.cpp:18:1: error: stray '\240' in program summax.cpp:18:1: error: stray '\302' in program summax.cpp:18:1: error: stray '\240' in program summax.cpp:18:1: error: stray '\302' in program summax.cpp:18:1: error: stray '\240' in program summax.cpp:18:1: error: stray '\302' in program summax.cpp:18:1: error: stray '\240' in program summax.cpp:18:1: error: stray '\302' in program summax.cpp:18:1: error: stray '\240' in program summax.cpp:18:1: error: stray '\302' in program summax.cpp:18:1: error: stray '\240' in program summax.cpp:18:1: error: stray '\302' in program summax.cpp:18:1: error: stray '\240' in program summax.cpp:18:1: error: stray '\302' in program summax.cpp:18:1: error: stray '\240' in program summax.cpp:18:1: error: stray '\302' in program summax.cpp:18:1: error: stray '\240' in program summax.cpp:18:1: error: stray '\302' in program summax.cpp:18:1: error: stray '\240' in program summax.cpp:18:1: error: stray '\302' in program summax.cpp:18:1: error: stray '\240' in program summax.cpp:19:1: error: stray '\302' in program else back(k + 1); ^ summax.cpp:19:1: error: stray '\240' in program summax.cpp:19:1: error: stray '\302' in program summax.cpp:19:1: error: stray '\240' in program summax.cpp:19:1: error: stray '\302' in program summax.cpp:19:1: error: stray '\240' in program summax.cpp:19:1: error: stray '\302' in program summax.cpp:19:1: error: stray '\240' in program summax.cpp:19:1: error: stray '\302' in program summax.cpp:19:1: error: stray '\240' in program summax.cpp:19:1: error: stray '\302' in program summax.cpp:19:1: error: stray '\240' in program summax.cpp:19:1: error: stray '\302' in program summax.cpp:19:1: error: stray '\240' in program summax.cpp:19:1: error: stray '\302' in program summax.cpp:19:1: error: stray '\240' in program summax.cpp:19:1: error: stray '\302' in program summax.cpp:19:1: error: stray '\240' in program summax.cpp:19:1: error: stray '\302' in program summax.cpp:19:1: error: stray '\240' in program summax.cpp:19:1: error: stray '\302' in program summax.cpp:19:1: error: stray '\240' in program summax.cpp:19:1: error: stray '\302' in program summax.cpp:19:1: error: stray '\240' in program summax.cpp:19:1: error: stray '\302' in program summax.cpp:19:1: error: stray '\240' in program summax.cpp:19:1: error: stray '\302' in program summax.cpp:19:1: error: stray '\240' in program summax.cpp:19:1: error: stray '\302' in program summax.cpp:19:1: error: stray '\240' in program summax.cpp:20:1: error: stray '\302' in program c[j] = l[i] = 0; ^ summax.cpp:20:1: error: stray '\240' in program summax.cpp:20:1: error: stray '\302' in program summax.cpp:20:1: error: stray '\240' in program summax.cpp:20:1: error: stray '\302' in program summax.cpp:20:1: error: stray '\240' in program summax.cpp:20:1: error: stray '\302' in program summax.cpp:20:1: error: stray '\240' in program summax.cpp:20:1: error: stray '\302' in program summax.cpp:20:1: error: stray '\240' in program summax.cpp:20:1: error: stray '\302' in program summax.cpp:20:1: error: stray '\240' in program summax.cpp:20:1: error: stray '\302' in program summax.cpp:20:1: error: stray '\240' in program summax.cpp:20:1: error: stray '\302' in program summax.cpp:20:1: error: stray '\240' in program summax.cpp:20:1: error: stray '\302' in program summax.cpp:20:1: error: stray '\240' in program summax.cpp:20:1: error: stray '\302' in program summax.cpp:20:1: error: stray '\240' in program summax.cpp:20:1: error: stray '\302' in program summax.cpp:20:1: error: stray '\240' in program summax.cpp:20:1: error: stray '\302' in program summax.cpp:20:1: error: stray '\240' in program summax.cpp:20:1: error: stray '\302' in program summax.cpp:20:1: error: stray '\240' in program summax.cpp:20:1: error: stray '\302' in program summax.cpp:20:1: error: stray '\240' in program summax.cpp:20:1: error: stray '\302' in program summax.cpp:20:1: error: stray '\240' in program summax.cpp:21:1: error: stray '\302' in program } ^ summax.cpp:21:1: error: stray '\240' in program summax.cpp:21:1: error: stray '\302' in program summax.cpp:21:1: error: stray '\240' in program summax.cpp:21:1: error: stray '\302' in program summax.cpp:21:1: error: stray '\240' in program summax.cpp:21:1: error: stray '\302' in program summax.cpp:21:1: error: stray '\240' in program summax.cpp:21:1: error: stray '\302' in program summax.cpp:21:1: error: stray '\240' in program summax.cpp:21:1: error: stray '\302' in program summax.cpp:21:1: error: stray '\240' in program summax.cpp:21:1: error: stray '\302' in program summax.cpp:21:1: error: stray '\240' in program summax.cpp:21:1: error: stray '\302' in program summax.cpp:21:1: error: stray '\240' in program summax.cpp:21:1: error: stray '\302' in program summax.cpp:21:1: error: stray '\240' in program summax.cpp:21:1: error: stray '\302' in program summax.cpp:21:1: error: stray '\240' in program summax.cpp:21:1: error: stray '\302' in program summax.cpp:21:1: error: stray '\240' in program summax.cpp:22:1: error: stray '\302' in program } ^ summax.cpp:22:1: error: stray '\240' in program summax.cpp:22:1: error: stray '\302' in program summax.cpp:22:1: error: stray '\240' in program summax.cpp:22:1: error: stray '\302' in program summax.cpp:22:1: error: stray '\240' in program summax.cpp:22:1: error: stray '\302' in program summax.cpp:22:1: error: stray '\240' in program summax.cpp:22:1: error: stray '\302' in program summax.cpp:22:1: error: stray '\240' in program summax.cpp:22:1: error: stray '\302' in program summax.cpp:22:1: error: stray '\240' in program summax.cpp:22:1: error: stray '\302' in program summax.cpp:22:1: error: stray '\240' in program summax.cpp:27:1: error: stray '\302' in program cin >> n; ^ summax.cpp:27:1: error: stray '\240' in program summax.cpp:27:1: error: stray '\302' in program summax.cpp:27:1: error: stray '\240' in program summax.cpp:27:1: error: stray '\302' in program summax.cpp:27:1: error: stray '\240' in program summax.cpp:28:1: error: stray '\302' in program for(int i = 1; i <= n; i++) ^ summax.cpp:28:1: error: stray '\240' in program summax.cpp:28:1: error: stray '\302' in program summax.cpp:28:1: error: stray '\240' in program summax.cpp:28:1: error: stray '\302' in program summax.cpp:28:1: error: stray '\240' in program summax.cpp:29:1: error: stray '\302' in program for(int j = 1; j <= n; j++) ^ summax.cpp:29:1: error: stray '\240' in program summax.cpp:29:1: error: stray '\302' in program summax.cpp:29:1: error: stray '\240' in program summax.cpp:29:1: error: stray '\302' in program summax.cpp:29:1: error: stray '\240' in program summax.cpp:29:1: error: stray '\302' in program summax.cpp:29:1: error: stray '\240' in program summax.cpp:29:1: error: stray '\302' in program summax.cpp:29:1: error: stray '\240' in program summax.cpp:29:1: error: stray '\302' in program summax.cpp:29:1: error: stray '\240' in program summax.cpp:29:1: error: stray '\302' in program summax.cpp:29:1: error: stray '\240' in program summax.cpp:30:1: error: stray '\302' in program cin >> v[i][j]; ^ summax.cpp:30:1: error: stray '\240' in program summax.cpp:30:1: error: stray '\302' in program summax.cpp:30:1: error: stray '\240' in program summax.cpp:30:1: error: stray '\302' in program summax.cpp:30:1: error: stray '\240' in program summax.cpp:30:1: error: stray '\302' in program summax.cpp:30:1: error: stray '\240' in program summax.cpp:30:1: error: stray '\302' in program summax.cpp:30:1: error: stray '\240' in program summax.cpp:30:1: error: stray '\302' in program summax.cpp:30:1: error: stray '\240' in program summax.cpp:30:1: error: stray '\302' in program summax.cpp:30:1: error: stray '\240' in program summax.cpp:30:1: error: stray '\302' in program summax.cpp:30:1: error: stray '\240' in program summax.cpp:30:1: error: stray '\302' in program summax.cpp:30:1: error: stray '\240' in program summax.cpp:30:1: error: stray '\302' in program summax.cpp:30:1: error: stray '\240' in program summax.cpp:30:1: error: stray '\302' in program summax.cpp:30:1: error: stray '\240' in program summax.cpp:31:1: error: stray '\302' in program back(1); ^ summax.cpp:31:1: error: stray '\240' in program summax.cpp:31:1: error: stray '\302' in program summax.cpp:31:1: error: stray '\240' in program summax.cpp:31:1: error: stray '\302' in program summax.cpp:31:1: error: stray '\240' in program summax.cpp:32:1: error: stray '\302' in program cout << sol << '\n'; ^ summax.cpp:32:1: error: stray '\240' in program summax.cpp:32:1: error: stray '\302' in program summax.cpp:32:1: error: stray '\240' in program summax.cpp:32:1: error: stray '\302' in program summax.cpp:32:1: error: stray '\240' in program summax.cpp:33:1: error: stray '\302' in program return 0; ^ summax.cpp:33:1: error: stray '\240' in program summax.cpp:33:1: error: stray '\302' in program summax.cpp:33:1: error: stray '\240' in program summax.cpp:33:1: error: stray '\302' in program summax.cpp:33:1: error: stray '\240' in program summax.cpp:4:13: error: expected primary-expression before '=' token #define NMax=15; ^ summax.cpp:7:7: note: in expansion of macro 'NMax' int v[NMax][NMax], x[NMax]; ^ summax.cpp:4:16: error: expected ']' before ';' token #define NMax=15; ^ summax.cpp:7:7: note: in expansion of macro 'NMax' int v[NMax][NMax], x[NMax]; ^ summax.cpp:7:11: error: expected unqualified-id before ']' token int v[NMax][NMax], x[NMax]; ^ summax.cpp:7:17: error: expected unqualified-id before ']' token int v[NMax][NMax], x[NMax]; ^ summax.cpp:7:26: error: expected unqualified-id before ']' token int v[NMax][NMax], x[NMax]; ^ summax.cpp:4:13: error: expected primary-expression before '=' token #define NMax=15; ^ summax.cpp:8:8: note: in expansion of macro 'NMax' bool c[NMax], l[NMax]; ^ summax.cpp:4:16: error: expected ']' before ';' token #define NMax=15; ^ summax.cpp:8:8: note: in expansion of macro 'NMax' bool c[NMax], l[NMax]; ^ summax.cpp:8:12: error: expected unqualified-id before ']' token bool c[NMax], l[NMax]; ^ summax.cpp:8:21: error: expected unqualified-id before ']' token bool c[NMax], l[NMax]; ^ summax.cpp: In function 'void back(int)': summax.cpp:14:24: error: 'x' was not declared in this scope x[k] = v[i][j]; ^ summax.cpp:14:31: error: 'v' was not declared in this scope x[k] = v[i][j]; ^ summax.cpp:16:28: error: 'c' was not declared in this scope if(!c[j] && !l[i]) { ^ summax.cpp:16:37: error: 'l' was not declared in this scope if(!c[j] && !l[i]) { ^ summax.cpp: In function 'int main()': summax.cpp:30:31: error: 'v' was not declared in this scope cin >> v[i][j]; ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema SumMax 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ă.