#2789
cb3
Se consideră un șir de numere naturale nenule a[1], a[2], ..., a[n]
. Asupra șirului se efectuează Q
interogări de forma: care este numărul maxim de elemente ale șirului a căror sumă nu depășește valoarea S
?
Cerință
Trebuie să răspundeți la cele Q
interogări.
Problema | cb3 | Operații I/O |
cb3.in /cb3.out
|
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #42430519 | Utilizator | |
Fișier | cb3.cpp | Dimensiune | 891 B |
Data încărcării | 06 Martie 2023, 10:33 | Scor / rezultat | Eroare de compilare |
cb3.cpp:3:1: error: stray '\302' in program using namespace std; ifstream cin("cb3.in"); ^ cb3.cpp:3:1: error: stray '\240' in program cb3.cpp:4:1: error: stray '\302' in program ofstream cout("cb3.out"); int n,v[10001],q; int main() ^ cb3.cpp:4:1: error: stray '\240' in program cb3.cpp:4:1: error: stray '\302' in program cb3.cpp:4:1: error: stray '\240' in program cb3.cpp:6:1: error: stray '\302' in program cin >> n >> q; ^ cb3.cpp:6:1: error: stray '\240' in program cb3.cpp:6:1: error: stray '\302' in program cb3.cpp:6:1: error: stray '\240' in program cb3.cpp:6:1: error: stray '\302' in program cb3.cpp:6:1: error: stray '\240' in program cb3.cpp:7:1: error: stray '\302' in program for(int i=1;i<=n;i++) ^ cb3.cpp:7:1: error: stray '\240' in program cb3.cpp:7:1: error: stray '\302' in program cb3.cpp:7:1: error: stray '\240' in program cb3.cpp:7:1: error: stray '\302' in program cb3.cpp:7:1: error: stray '\240' in program cb3.cpp:8:1: error: stray '\302' in program cin >> v[i]; ^ cb3.cpp:8:1: error: stray '\240' in program cb3.cpp:8:1: error: stray '\302' in program cb3.cpp:8:1: error: stray '\240' in program cb3.cpp:8:1: error: stray '\302' in program cb3.cpp:8:1: error: stray '\240' in program cb3.cpp:8:1: error: stray '\302' in program cb3.cpp:8:1: error: stray '\240' in program cb3.cpp:8:1: error: stray '\302' in program cb3.cpp:8:1: error: stray '\240' in program cb3.cpp:8:1: error: stray '\302' in program cb3.cpp:8:1: error: stray '\240' in program cb3.cpp:8:1: error: stray '\302' in program cb3.cpp:8:1: error: stray '\240' in program cb3.cpp:9:1: error: stray '\302' in program sort(v+1,v+n+1); ^ cb3.cpp:9:1: error: stray '\240' in program cb3.cpp:9:1: error: stray '\302' in program cb3.cpp:9:1: error: stray '\240' in program cb3.cpp:9:1: error: stray '\302' in program cb3.cpp:9:1: error: stray '\240' in program cb3.cpp:10:1: error: stray '\302' in program for(int i=1;i<=n;i++) ^ cb3.cpp:10:1: error: stray '\240' in program cb3.cpp:10:1: error: stray '\302' in program cb3.cpp:10:1: error: stray '\240' in program cb3.cpp:10:1: error: stray '\302' in program cb3.cpp:10:1: error: stray '\240' in program cb3.cpp:11:1: error: stray '\302' in program v[i]+=v[i-1]; ^ cb3.cpp:11:1: error: stray '\240' in program cb3.cpp:11:1: error: stray '\302' in program cb3.cpp:11:1: error: stray '\240' in program cb3.cpp:11:1: error: stray '\302' in program cb3.cpp:11:1: error: stray '\240' in program cb3.cpp:11:1: error: stray '\302' in program cb3.cpp:11:1: error: stray '\240' in program cb3.cpp:11:1: error: stray '\302' in program cb3.cpp:11:1: error: stray '\240' in program cb3.cpp:11:1: error: stray '\302' in program cb3.cpp:11:1: error: stray '\240' in program cb3.cpp:11:1: error: stray '\302' in program cb3.cpp:11:1: error: stray '\240' in program cb3.cpp:12:1: error: stray '\302' in program for(int i=1;i<=q;i++) ^ cb3.cpp:12:1: error: stray '\240' in program cb3.cpp:12:1: error: stray '\302' in program cb3.cpp:12:1: error: stray '\240' in program cb3.cpp:12:1: error: stray '\302' in program cb3.cpp:12:1: error: stray '\240' in program cb3.cpp:13:1: error: stray '\302' in program { ^ cb3.cpp:13:1: error: stray '\240' in program cb3.cpp:13:1: error: stray '\302' in program cb3.cpp:13:1: error: stray '\240' in program cb3.cpp:13:1: error: stray '\302' in program cb3.cpp:13:1: error: stray '\240' in program cb3.cpp:14:1: error: stray '\302' in program int x,st,dr,mij; ^ cb3.cpp:14:1: error: stray '\240' in program cb3.cpp:14:1: error: stray '\302' in program cb3.cpp:14:1: error: stray '\240' in program cb3.cpp:14:1: error: stray '\302' in program cb3.cpp:14:1: error: stray '\240' in program cb3.cpp:14:1: error: stray '\302' in program cb3.cpp:14:1: error: stray '\240' in program cb3.cpp:14:1: error: stray '\302' in program cb3.cpp:14:1: error: stray '\240' in program cb3.cpp:14:1: error: stray '\302' in program cb3.cpp:14:1: error: stray '\240' in program cb3.cpp:14:1: error: stray '\302' in program cb3.cpp:14:1: error: stray '\240' in program cb3.cpp:15:1: error: stray '\302' in program cin >> x; ^ cb3.cpp:15:1: error: stray '\240' in program cb3.cpp:15:1: error: stray '\302' in program cb3.cpp:15:1: error: stray '\240' in program cb3.cpp:15:1: error: stray '\302' in program cb3.cpp:15:1: error: stray '\240' in program cb3.cpp:15:1: error: stray '\302' in program cb3.cpp:15:1: error: stray '\240' in program cb3.cpp:15:1: error: stray '\302' in program cb3.cpp:15:1: error: stray '\240' in program cb3.cpp:15:1: error: stray '\302' in program cb3.cpp:15:1: error: stray '\240' in program cb3.cpp:15:1: error: stray '\302' in program cb3.cpp:15:1: error: stray '\240' in program cb3.cpp:16:1: error: stray '\302' in program st=1,dr=n; ^ cb3.cpp:16:1: error: stray '\240' in program cb3.cpp:16:1: error: stray '\302' in program cb3.cpp:16:1: error: stray '\240' in program cb3.cpp:16:1: error: stray '\302' in program cb3.cpp:16:1: error: stray '\240' in program cb3.cpp:16:1: error: stray '\302' in program cb3.cpp:16:1: error: stray '\240' in program cb3.cpp:16:1: error: stray '\302' in program cb3.cpp:16:1: error: stray '\240' in program cb3.cpp:16:1: error: stray '\302' in program cb3.cpp:16:1: error: stray '\240' in program cb3.cpp:16:1: error: stray '\302' in program cb3.cpp:16:1: error: stray '\240' in program cb3.cpp:17:1: error: stray '\302' in program while(st<=dr) ^ cb3.cpp:17:1: error: stray '\240' in program cb3.cpp:17:1: error: stray '\302' in program cb3.cpp:17:1: error: stray '\240' in program cb3.cpp:17:1: error: stray '\302' in program cb3.cpp:17:1: error: stray '\240' in program cb3.cpp:17:1: error: stray '\302' in program cb3.cpp:17:1: error: stray '\240' in program cb3.cpp:17:1: error: stray '\302' in program cb3.cpp:17:1: error: stray '\240' in program cb3.cpp:17:1: error: stray '\302' in program cb3.cpp:17:1: error: stray '\240' in program cb3.cpp:17:1: error: stray '\302' in program cb3.cpp:17:1: error: stray '\240' in program cb3.cpp:18:1: error: stray '\302' in program { ^ cb3.cpp:18:1: error: stray '\240' in program cb3.cpp:18:1: error: stray '\302' in program cb3.cpp:18:1: error: stray '\240' in program cb3.cpp:18:1: error: stray '\302' in program cb3.cpp:18:1: error: stray '\240' in program cb3.cpp:18:1: error: stray '\302' in program cb3.cpp:18:1: error: stray '\240' in program cb3.cpp:18:1: error: stray '\302' in program cb3.cpp:18:1: error: stray '\240' in program cb3.cpp:18:1: error: stray '\302' in program cb3.cpp:18:1: error: stray '\240' in program cb3.cpp:18:1: error: stray '\302' in program cb3.cpp:18:1: error: stray '\240' in program cb3.cpp:19:1: error: stray '\302' in program mij=(st+dr)/2; ^ cb3.cpp:19:1: error: stray '\240' in program cb3.cpp:19:1: error: stray '\302' in program cb3.cpp:19:1: error: stray '\240' in program cb3.cpp:19:1: error: stray '\302' in program cb3.cpp:19:1: error: stray '\240' in program cb3.cpp:19:1: error: stray '\302' in program cb3.cpp:19:1: error: stray '\240' in program cb3.cpp:19:1: error: stray '\302' in program cb3.cpp:19:1: error: stray '\240' in program cb3.cpp:19:1: error: stray '\302' in program cb3.cpp:19:1: error: stray '\240' in program cb3.cpp:19:1: error: stray '\302' in program cb3.cpp:19:1: error: stray '\240' in program cb3.cpp:19:1: error: stray '\302' in program cb3.cpp:19:1: error: stray '\240' in program cb3.cpp:19:1: error: stray '\302' in program cb3.cpp:19:1: error: stray '\240' in program cb3.cpp:19:1: error: stray '\302' in program cb3.cpp:19:1: error: stray '\240' in program cb3.cpp:19:1: error: stray '\302' in program cb3.cpp:19:1: error: stray '\240' in program cb3.cpp:20:1: error: stray '\302' in program if(v[mij]==x) ^ cb3.cpp:20:1: error: stray '\240' in program cb3.cpp:20:1: error: stray '\302' in program cb3.cpp:20:1: error: stray '\240' in program cb3.cpp:20:1: error: stray '\302' in program cb3.cpp:20:1: error: stray '\240' in program cb3.cpp:20:1: error: stray '\302' in program cb3.cpp:20:1: error: stray '\240' in program cb3.cpp:20:1: error: stray '\302' in program cb3.cpp:20:1: error: stray '\240' in program cb3.cpp:20:1: error: stray '\302' in program cb3.cpp:20:1: error: stray '\240' in program cb3.cpp:20:1: error: stray '\302' in program cb3.cpp:20:1: error: stray '\240' in program cb3.cpp:20:1: error: stray '\302' in program cb3.cpp:20:1: error: stray '\240' in program cb3.cpp:20:1: error: stray '\302' in program cb3.cpp:20:1: error: stray '\240' in program cb3.cpp:20:1: error: stray '\302' in program cb3.cpp:20:1: error: stray '\240' in program cb3.cpp:20:1: error: stray '\302' in program cb3.cpp:20:1: error: stray '\240' in program cb3.cpp:21:1: error: stray '\302' in program { ^ cb3.cpp:21:1: error: stray '\240' in program cb3.cpp:21:1: error: stray '\302' in program cb3.cpp:21:1: error: stray '\240' in program cb3.cpp:21:1: error: stray '\302' in program cb3.cpp:21:1: error: stray '\240' in program cb3.cpp:21:1: error: stray '\302' in program cb3.cpp:21:1: error: stray '\240' in program cb3.cpp:21:1: error: stray '\302' in program cb3.cpp:21:1: error: stray '\240' in program cb3.cpp:21:1: error: stray '\302' in program cb3.cpp:21:1: error: stray '\240' in program cb3.cpp:21:1: error: stray '\302' in program cb3.cpp:21:1: error: stray '\240' in program cb3.cpp:21:1: error: stray '\302' in program cb3.cpp:21:1: error: stray '\240' in program cb3.cpp:21:1: error: stray '\302' in program cb3.cpp:21:1: error: stray '\240' in program cb3.cpp:21:1: error: stray '\302' in program cb3.cpp:21:1: error: stray '\240' in program cb3.cpp:21:1: error: stray '\302' in program cb3.cpp:21:1: error: stray '\240' in program cb3.cpp:22:1: error: stray '\302' in program cout << mij << '\n'; ^ cb3.cpp:22:1: error: stray '\240' in program cb3.cpp:22:1: error: stray '\302' in program cb3.cpp:22:1: error: stray '\240' in program cb3.cpp:22:1: error: stray '\302' in program cb3.cpp:22:1: error: stray '\240' in program cb3.cpp:22:1: error: stray '\302' in program cb3.cpp:22:1: error: stray '\240' in program cb3.cpp:22:1: error: stray '\302' in program cb3.cpp:22:1: error: stray '\240' in program cb3.cpp:22:1: error: stray '\302' in program cb3.cpp:22:1: error: stray '\240' in program cb3.cpp:22:1: error: stray '\302' in program cb3.cpp:22:1: error: stray '\240' in program cb3.cpp:22:1: error: stray '\302' in program cb3.cpp:22:1: error: stray '\240' in program cb3.cpp:22:1: error: stray '\302' in program cb3.cpp:22:1: error: stray '\240' in program cb3.cpp:22:1: error: stray '\302' in program cb3.cpp:22:1: error: stray '\240' in program cb3.cpp:22:1: error: stray '\302' in program cb3.cpp:22:1: error: stray '\240' in program cb3.cpp:22:1: error: stray '\302' in program cb3.cpp:22:1: error: stray '\240' in program cb3.cpp:22:1: error: stray '\302' in program cb3.cpp:22:1: error: stray '\240' in program cb3.cpp:22:1: error: stray '\302' in program cb3.cpp:22:1: error: stray '\240' in program cb3.cpp:22:1: error: stray '\302' in program cb3.cpp:22:1: error: stray '\240' in program cb3.cpp:23:1: error: stray '\302' in program break; ^ cb3.cpp:23:1: error: stray '\240' in program cb3.cpp:23:1: error: stray '\302' in program cb3.cpp:23:1: error: stray '\240' in program cb3.cpp:23:1: error: stray '\302' in program cb3.cpp:23:1: error: stray '\240' in program cb3.cpp:23:1: error: stray '\302' in program cb3.cpp:23:1: error: stray '\240' in program cb3.cpp:23:1: error: stray '\302' in program cb3.cpp:23:1: error: stray '\240' in program cb3.cpp:23:1: error: stray '\302' in program cb3.cpp:23:1: error: stray '\240' in program cb3.cpp:23:1: error: stray '\302' in program cb3.cpp:23:1: error: stray '\240' in program cb3.cpp:23:1: error: stray '\302' in program cb3.cpp:23:1: error: stray '\240' in program cb3.cpp:23:1: error: stray '\302' in program cb3.cpp:23:1: error: stray '\240' in program cb3.cpp:23:1: error: stray '\302' in program cb3.cpp:23:1: error: stray '\240' in program cb3.cpp:23:1: error: stray '\302' in program cb3.cpp:23:1: error: stray '\240' in program cb3.cpp:23:1: error: stray '\302' in program cb3.cpp:23:1: error: stray '\240' in program cb3.cpp:23:1: error: stray '\302' in program cb3.cpp:23:1: error: stray '\240' in program cb3.cpp:23:1: error: stray '\302' in program cb3.cpp:23:1: error: stray '\240' in program cb3.cpp:23:1: error: stray '\302' in program cb3.cpp:23:1: error: stray '\240' in program cb3.cpp:24:1: error: stray '\302' in program } ^ cb3.cpp:24:1: error: stray '\240' in program cb3.cpp:24:1: error: stray '\302' in program cb3.cpp:24:1: error: stray '\240' in program cb3.cpp:24:1: error: stray '\302' in program cb3.cpp:24:1: error: stray '\240' in program cb3.cpp:24:1: error: stray '\302' in program cb3.cpp:24:1: error: stray '\240' in program cb3.cpp:24:1: error: stray '\302' in program cb3.cpp:24:1: error: stray '\240' in program cb3.cpp:24:1: error: stray '\302' in program cb3.cpp:24:1: error: stray '\240' in program cb3.cpp:24:1: error: stray '\302' in program cb3.cpp:24:1: error: stray '\240' in program cb3.cpp:24:1: error: stray '\302' in program cb3.cpp:24:1: error: stray '\240' in program cb3.cpp:24:1: error: stray '\302' in program cb3.cpp:24:1: error: stray '\240' in program cb3.cpp:24:1: error: stray '\302' in program cb3.cpp:24:1: error: stray '\240' in program cb3.cpp:24:1: error: stray '\302' in program cb3.cpp:24:1: error: stray '\240' in program cb3.cpp:25:1: error: stray '\302' in program if(x<v[mij]) dr=mij-1; ^ cb3.cpp:25:1: error: stray '\240' in program cb3.cpp:25:1: error: stray '\302' in program cb3.cpp:25:1: error: stray '\240' in program cb3.cpp:25:1: error: stray '\302' in program cb3.cpp:25:1: error: stray '\240' in program cb3.cpp:25:1: error: stray '\302' in program cb3.cpp:25:1: error: stray '\240' in program cb3.cpp:25:1: error: stray '\302' in program cb3.cpp:25:1: error: stray '\240' in program cb3.cpp:25:1: error: stray '\302' in program cb3.cpp:25:1: error: stray '\240' in program cb3.cpp:25:1: error: stray '\302' in program cb3.cpp:25:1: error: stray '\240' in program cb3.cpp:25:1: error: stray '\302' in program cb3.cpp:25:1: error: stray '\240' in program cb3.cpp:25:1: error: stray '\302' in program cb3.cpp:25:1: error: stray '\240' in program cb3.cpp:25:1: error: stray '\302' in program cb3.cpp:25:1: error: stray '\240' in program cb3.cpp:25:1: error: stray '\302' in program cb3.cpp:25:1: error: stray '\240' in program cb3.cpp:26:1: error: stray '\302' in program else st=mij+1; ^ cb3.cpp:26:1: error: stray '\240' in program cb3.cpp:26:1: error: stray '\302' in program cb3.cpp:26:1: error: stray '\240' in program cb3.cpp:26:1: error: stray '\302' in program cb3.cpp:26:1: error: stray '\240' in program cb3.cpp:26:1: error: stray '\302' in program cb3.cpp:26:1: error: stray '\240' in program cb3.cpp:26:1: error: stray '\302' in program cb3.cpp:26:1: error: stray '\240' in program cb3.cpp:26:1: error: stray '\302' in program cb3.cpp:26:1: error: stray '\240' in program cb3.cpp:26:1: error: stray '\302' in program cb3.cpp:26:1: error: stray '\240' in program cb3.cpp:26:1: error: stray '\302' in program cb3.cpp:26:1: error: stray '\240' in program cb3.cpp:26:1: error: stray '\302' in program cb3.cpp:26:1: error: stray '\240' in program cb3.cpp:26:1: error: stray '\302' in program cb3.cpp:26:1: error: stray '\240' in program cb3.cpp:26:1: error: stray '\302' in program cb3.cpp:26:1: error: stray '\240' in program cb3.cpp:27:1: error: stray '\302' in program } ^ cb3.cpp:27:1: error: stray '\240' in program cb3.cpp:27:1: error: stray '\302' in program cb3.cpp:27:1: error: stray '\240' in program cb3.cpp:27:1: error: stray '\302' in program cb3.cpp:27:1: error: stray '\240' in program cb3.cpp:27:1: error: stray '\302' in program cb3.cpp:27:1: error: stray '\240' in program cb3.cpp:27:1: error: stray '\302' in program cb3.cpp:27:1: error: stray '\240' in program cb3.cpp:27:1: error: stray '\302' in program cb3.cpp:27:1: error: stray '\240' in program cb3.cpp:27:1: error: stray '\302' in program cb3.cpp:27:1: error: stray '\240' in program cb3.cpp:28:1: error: stray '\302' in program if(st>dr) cout << dr << '\n'; ^ cb3.cpp:28:1: error: stray '\240' in program cb3.cpp:28:1: error: stray '\302' in program cb3.cpp:28:1: error: stray '\240' in program cb3.cpp:28:1: error: stray '\302' in program cb3.cpp:28:1: error: stray '\240' in program cb3.cpp:28:1: error: stray '\302' in program cb3.cpp:28:1: error: stray '\240' in program cb3.cpp:28:1: error: stray '\302' in program cb3.cpp:28:1: error: stray '\240' in program cb3.cpp:28:1: error: stray '\302' in program cb3.cpp:28:1: error: stray '\240' in program cb3.cpp:28:1: error: stray '\302' in program cb3.cpp:28:1: error: stray '\240' in program cb3.cpp:29:1: error: stray '\302' in program } ^ cb3.cpp:29:1: error: stray '\240' in program cb3.cpp:29:1: error: stray '\302' in program cb3.cpp:29:1: error: stray '\240' in program cb3.cpp:29:1: error: stray '\302' in program cb3.cpp:29:1: error: stray '\240' in program cb3.cpp:30:1: error: stray '\302' in program return 0; ^ cb3.cpp:30:1: error: stray '\240' in program cb3.cpp:30:1: error: stray '\302' in program cb3.cpp:30:1: error: stray '\240' in program cb3.cpp:30:1: error: stray '\302' in program cb3.cpp:30:1: error: stray '\240' in program
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema cb3 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ă.