#2534
Bogdan
Se dă un șir de n
elemente, numere naturale. Problema constă în două operații:
1 i val
: Elementul de pe poziția i
se înlocuiește cu valoarea val
.
2 i j
: Stabiliți dacă secvența [i,j]
, din șirul curent, este ordonată crescător.
Problema | Bogdan | Operații I/O |
bogdan.in /bogdan.out
|
---|---|---|---|
Limita timp | 0.2 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #54972531 | Utilizator | |
Fișier | bogdan.cpp | Dimensiune | 1.78 KB |
Data încărcării | 14 Decembrie 2024, 11:30 | Scor / rezultat | Eroare de compilare |
bogdan.cpp: In function 'void build(int, int, int)': bogdan.cpp:17:12: error: expected ')' before 'node' build( 2 node, le, mid ); ^ bogdan.cpp: In function 'int main()': bogdan.cpp:53:7: error: no match for 'operator=' (operand types are 'FILE {aka _IO_FILE}' and 'FILE* {aka _IO_FILE*}') fin = fopen( "bogdan.in", "r" ); ^ bogdan.cpp:53:7: note: candidates are: In file included from /usr/include/stdio.h:74:0, from /usr/include/c++/4.8/cstdio:42, from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:46, from bogdan.cpp:1: /usr/include/libio.h:245:8: note: _IO_FILE& _IO_FILE::operator=(const _IO_FILE&) struct _IO_FILE { ^ /usr/include/libio.h:245:8: note: no known conversion for argument 1 from 'FILE* {aka _IO_FILE*}' to 'const _IO_FILE&' /usr/include/libio.h:245:8: note: _IO_FILE& _IO_FILE::operator=(_IO_FILE&&) /usr/include/libio.h:245:8: note: no known conversion for argument 1 from 'FILE* {aka _IO_FILE*}' to '_IO_FILE&&' bogdan.cpp:54:8: error: no match for 'operator=' (operand types are 'FILE {aka _IO_FILE}' and 'FILE* {aka _IO_FILE*}') fout = fopen( "bogdan.out", "w" ); ^ bogdan.cpp:54:8: note: candidates are: In file included from /usr/include/stdio.h:74:0, from /usr/include/c++/4.8/cstdio:42, from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:46, from bogdan.cpp:1: /usr/include/libio.h:245:8: note: _IO_FILE& _IO_FILE::operator=(const _IO_FILE&) struct _IO_FILE { ^ /usr/include/libio.h:245:8: note: no known conversion for argument 1 from 'FILE* {aka _IO_FILE*}' to 'const _IO_FILE&' /usr/include/libio.h:245:8: note: _IO_FILE& _IO_FILE::operator=(_IO_FILE&&) /usr/include/libio.h:245:8: note: no known conversion for argument 1 from 'FILE* {aka _IO_FILE*}' to '_IO_FILE&&' bogdan.cpp:56:25: error: cannot convert 'FILE {aka _IO_FILE}' to 'FILE* {aka _IO_FILE*}' for argument '1' to 'int fscanf(FILE*, const char*, ...)' fscanf( fin, "%d", &n ); ^ bogdan.cpp:58:30: error: cannot convert 'FILE {aka _IO_FILE}' to 'FILE* {aka _IO_FILE*}' for argument '1' to 'int fscanf(FILE*, const char*, ...)' fscanf( fin, "%d", &v[i] ); ^ bogdan.cpp:59:24: error: too many arguments to function 'void build(int, int, int)' build( 1, 1, n - 1, v); ^ bogdan.cpp:11:6: note: declared here void build( int node, int le, int ri ){ ^ bogdan.cpp:60:25: error: cannot convert 'FILE {aka _IO_FILE}' to 'FILE* {aka _IO_FILE*}' for argument '1' to 'int fscanf(FILE*, const char*, ...)' fscanf( fin, "%d", &q ); ^ bogdan.cpp:62:45: error: cannot convert 'FILE {aka _IO_FILE}' to 'FILE* {aka _IO_FILE*}' for argument '1' to 'int fscanf(FILE*, const char*, ...)' fscanf( fin, "%d%d%d" , &o, &ind, & val ); ^ bogdan.cpp:72:31: error: cannot convert 'FILE {aka _IO_FILE}' to 'FILE* {aka _IO_FILE*}' for argument '1' to 'int fprintf(FILE*, const char*, ...)' fprintf( fout, "DA\n" ); ^ bogdan.cpp:76:33: error: cannot convert 'FILE {aka _IO_FILE}' to 'FILE* {aka _IO_FILE*}' for argument '1' to 'int fprintf(FILE*, const char*, ...)' fprintf( fout, "DA\n" ); ^ bogdan.cpp:78:33: error: cannot convert 'FILE {aka _IO_FILE}' to 'FILE* {aka _IO_FILE*}' for argument '1' to 'int fprintf(FILE*, const char*, ...)' fprintf( fout, "NU\n" ); ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Bogdan 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ă.