#1424
Smartphone
Andrei este elev în clasa a V-a și își dorește mult un smartphone. Tatăl său știe de acest lucru și s-a gândit să-i facă o bucurie de ziua lui. Așa că a hotărât să-l ducă într-un magazin de telefoane să-și aleagă unul.
Fiecare telefon este inscripţionat cu un număr ce reprezintă performanţa acestuia. Cu cât numărul este mai mare, cu atât telefonul este mai bun. Andrei l-a dorit pe cel mai performant (cu numărul cel mai mare) dar tatăl lui i l-a cumpărat pe al doilea ca performanță.
Dându-se numărul n
de smatphone-uri și performanța fiecăruia, să se determine:
1. Numărul cu care este inscripționat telefonul dorit de Andrei;
2. Numărul cu care este inscripționat telefonul pe care l-a primit Andrei.
Problema | Smartphone | Operații I/O |
smartphone.in /smartphone.out
|
---|---|---|---|
Limita timp | 0.5 secunde | Limita memorie |
Total: 64 MB
/
Stivă 10 MB
|
Id soluție | #9692063 | Utilizator | |
Fișier | smartphone.cpp | Dimensiune | 635 B |
Data încărcării | 22 Mai 2018, 20:03 | Scor / rezultat | Eroare de compilare |
smartphone.cpp:1:9: error: #include expects "FILENAME" or <FILENAME> #include <bits/stdc++.h> ^ smartphone.cpp:2:1: error: stray '\302' in program using namespace std; ^ smartphone.cpp:2:1: error: stray '\240' in program smartphone.cpp:2:1: error: stray '\302' in program smartphone.cpp:2:1: error: stray '\240' in program smartphone.cpp:3:1: error: stray '\302' in program int n, i, maxx, z, x, k, v[10005]; ^ smartphone.cpp:3:1: error: stray '\240' in program smartphone.cpp:3:1: error: stray '\302' in program smartphone.cpp:3:1: error: stray '\240' in program smartphone.cpp:3:1: error: stray '\302' in program smartphone.cpp:3:1: error: stray '\240' in program smartphone.cpp:3:1: error: stray '\302' in program smartphone.cpp:3:1: error: stray '\240' in program smartphone.cpp:3:1: error: stray '\302' in program smartphone.cpp:3:1: error: stray '\240' in program smartphone.cpp:3:1: error: stray '\302' in program smartphone.cpp:3:1: error: stray '\240' in program smartphone.cpp:3:1: error: stray '\302' in program smartphone.cpp:3:1: error: stray '\240' in program smartphone.cpp:4:1: error: stray '\302' in program int main() ^ smartphone.cpp:4:1: error: stray '\240' in program smartphone.cpp:6:1: error: stray '\302' in program ifstream f("smartphone.in"); ^ smartphone.cpp:6:1: error: stray '\240' in program smartphone.cpp:6:1: error: stray '\302' in program smartphone.cpp:6:1: error: stray '\240' in program smartphone.cpp:6:1: error: stray '\302' in program smartphone.cpp:6:1: error: stray '\240' in program smartphone.cpp:6:1: error: stray '\302' in program smartphone.cpp:6:1: error: stray '\240' in program smartphone.cpp:6:1: error: stray '\302' in program smartphone.cpp:6:1: error: stray '\240' in program smartphone.cpp:7:1: error: stray '\302' in program ofstream g("smartphone.out"); ^ smartphone.cpp:7:1: error: stray '\240' in program smartphone.cpp:7:1: error: stray '\302' in program smartphone.cpp:7:1: error: stray '\240' in program smartphone.cpp:7:1: error: stray '\302' in program smartphone.cpp:7:1: error: stray '\240' in program smartphone.cpp:7:1: error: stray '\302' in program smartphone.cpp:7:1: error: stray '\240' in program smartphone.cpp:7:1: error: stray '\302' in program smartphone.cpp:7:1: error: stray '\240' in program smartphone.cpp:8:1: error: stray '\302' in program f >> k >> n; ^ smartphone.cpp:8:1: error: stray '\240' in program smartphone.cpp:8:1: error: stray '\302' in program smartphone.cpp:8:1: error: stray '\240' in program smartphone.cpp:8:1: error: stray '\302' in program smartphone.cpp:8:1: error: stray '\240' in program smartphone.cpp:8:1: error: stray '\302' in program smartphone.cpp:8:1: error: stray '\240' in program smartphone.cpp:8:1: error: stray '\302' in program smartphone.cpp:8:1: error: stray '\240' in program smartphone.cpp:8:1: error: stray '\302' in program smartphone.cpp:8:1: error: stray '\240' in program smartphone.cpp:8:1: error: stray '\302' in program smartphone.cpp:8:1: error: stray '\240' in program smartphone.cpp:8:1: error: stray '\302' in program smartphone.cpp:8:1: error: stray '\240' in program smartphone.cpp:9:1: error: stray '\302' in program for(i = 1; i <= n; i ++) ^ smartphone.cpp:9:1: error: stray '\240' in program smartphone.cpp:9:1: error: stray '\302' in program smartphone.cpp:9:1: error: stray '\240' in program smartphone.cpp:9:1: error: stray '\302' in program smartphone.cpp:9:1: error: stray '\240' in program smartphone.cpp:9:1: error: stray '\302' in program smartphone.cpp:9:1: error: stray '\240' in program smartphone.cpp:9:1: error: stray '\302' in program smartphone.cpp:9:1: error: stray '\240' in program smartphone.cpp:9:1: error: stray '\302' in program smartphone.cpp:9:1: error: stray '\240' in program smartphone.cpp:9:1: error: stray '\302' in program smartphone.cpp:9:1: error: stray '\240' in program smartphone.cpp:9:1: error: stray '\302' in program smartphone.cpp:9:1: error: stray '\240' in program smartphone.cpp:9:1: error: stray '\302' in program smartphone.cpp:9:1: error: stray '\240' in program smartphone.cpp:9:1: error: stray '\302' in program smartphone.cpp:9:1: error: stray '\240' in program smartphone.cpp:9:1: error: stray '\302' in program smartphone.cpp:9:1: error: stray '\240' in program smartphone.cpp:10:1: error: stray '\302' in program { ^ smartphone.cpp:10:1: error: stray '\240' in program smartphone.cpp:10:1: error: stray '\302' in program smartphone.cpp:10:1: error: stray '\240' in program smartphone.cpp:10:1: error: stray '\302' in program smartphone.cpp:10:1: error: stray '\240' in program smartphone.cpp:10:1: error: stray '\302' in program smartphone.cpp:10:1: error: stray '\240' in program smartphone.cpp:11:1: error: stray '\302' in program f >> v[i]; ^ smartphone.cpp:11:1: error: stray '\240' in program smartphone.cpp:11:1: error: stray '\302' in program smartphone.cpp:11:1: error: stray '\240' in program smartphone.cpp:11:1: error: stray '\302' in program smartphone.cpp:11:1: error: stray '\240' in program smartphone.cpp:11:1: error: stray '\302' in program smartphone.cpp:11:1: error: stray '\240' in program smartphone.cpp:11:1: error: stray '\302' in program smartphone.cpp:11:1: error: stray '\240' in program smartphone.cpp:11:1: error: stray '\302' in program smartphone.cpp:11:1: error: stray '\240' in program smartphone.cpp:11:1: error: stray '\302' in program smartphone.cpp:11:1: error: stray '\240' in program smartphone.cpp:11:1: error: stray '\302' in program smartphone.cpp:11:1: error: stray '\240' in program smartphone.cpp:11:1: error: stray '\302' in program smartphone.cpp:11:1: error: stray '\240' in program smartphone.cpp:11:1: error: stray '\302' in program smartphone.cpp:11:1: error: stray '\240' in program smartphone.cpp:12:1: error: stray '\302' in program if(v[i] > maxx) maxx = v[i]; ^ smartphone.cpp:12:1: error: stray '\240' in program smartphone.cpp:12:1: error: stray '\302' in program smartphone.cpp:12:1: error: stray '\240' in program smartphone.cpp:12:1: error: stray '\302' in program smartphone.cpp:12:1: error: stray '\240' in program smartphone.cpp:12:1: error: stray '\302' in program smartphone.cpp:12:1: error: stray '\240' in program smartphone.cpp:12:1: error: stray '\302' in program smartphone.cpp:12:1: error: stray '\240' in program smartphone.cpp:12:1: error: stray '\302' in program smartphone.cpp:12:1: error: stray '\240' in program smartphone.cpp:12:1: error: stray '\302' in program smartphone.cpp:12:1: error: stray '\240' in program smartphone.cpp:12:1: error: stray '\302' in program smartphone.cpp:12:1: error: stray '\240' in program smartphone.cpp:12:1: error: stray '\302' in program smartphone.cpp:12:1: error: stray '\240' in program smartphone.cpp:12:1: error: stray '\302' in program smartphone.cpp:12:1: error: stray '\240' in program smartphone.cpp:12:1: error: stray '\302' in program smartphone.cpp:12:1: error: stray '\240' in program smartphone.cpp:12:1: error: stray '\302' in program smartphone.cpp:12:1: error: stray '\240' in program smartphone.cpp:12:1: error: stray '\302' in program smartphone.cpp:12:1: error: stray '\240' in program smartphone.cpp:13:1: error: stray '\302' in program } ^ smartphone.cpp:13:1: error: stray '\240' in program smartphone.cpp:13:1: error: stray '\302' in program smartphone.cpp:13:1: error: stray '\240' in program smartphone.cpp:13:1: error: stray '\302' in program smartphone.cpp:13:1: error: stray '\240' in program smartphone.cpp:13:1: error: stray '\302' in program smartphone.cpp:13:1: error: stray '\240' in program smartphone.cpp:14:1: error: stray '\302' in program if(k == 1) { g << maxx; return 0; } ^ smartphone.cpp:14:1: error: stray '\240' in program smartphone.cpp:14:1: error: stray '\302' in program smartphone.cpp:14:1: error: stray '\240' in program smartphone.cpp:14:1: error: stray '\302' in program smartphone.cpp:14:1: error: stray '\240' in program smartphone.cpp:14:1: error: stray '\302' in program smartphone.cpp:14:1: error: stray '\240' in program smartphone.cpp:14:1: error: stray '\302' in program smartphone.cpp:14:1: error: stray '\240' in program smartphone.cpp:14:1: error: stray '\302' in program smartphone.cpp:14:1: error: stray '\240' in program smartphone.cpp:14:1: error: stray '\302' in program smartphone.cpp:14:1: error: stray '\240' in program smartphone.cpp:14:1: error: stray '\302' in program smartphone.cpp:14:1: error: stray '\240' in program smartphone.cpp:14:1: error: stray '\302' in program smartphone.cpp:14:1: error: stray '\240' in program smartphone.cpp:14:1: error: stray '\302' in program smartphone.cpp:14:1: error: stray '\240' in program smartphone.cpp:14:1: error: stray '\302' in program smartphone.cpp:14:1: error: stray '\240' in program smartphone.cpp:14:1: error: stray '\302' in program smartphone.cpp:14:1: error: stray '\240' in program smartphone.cpp:14:1: error: stray '\302' in program smartphone.cpp:14:1: error: stray '\240' in program smartphone.cpp:15:1: error: stray '\302' in program for(i = 1; i <= n; i ++) ^ smartphone.cpp:15:1: error: stray '\240' in program smartphone.cpp:15:1: error: stray '\302' in program smartphone.cpp:15:1: error: stray '\240' in program smartphone.cpp:15:1: error: stray '\302' in program smartphone.cpp:15:1: error: stray '\240' in program smartphone.cpp:15:1: error: stray '\302' in program smartphone.cpp:15:1: error: stray '\240' in program smartphone.cpp:15:1: error: stray '\302' in program smartphone.cpp:15:1: error: stray '\240' in program smartphone.cpp:15:1: error: stray '\302' in program smartphone.cpp:15:1: error: stray '\240' in program smartphone.cpp:15:1: error: stray '\302' in program smartphone.cpp:15:1: error: stray '\240' in program smartphone.cpp:15:1: error: stray '\302' in program smartphone.cpp:15:1: error: stray '\240' in program smartphone.cpp:15:1: error: stray '\302' in program smartphone.cpp:15:1: error: stray '\240' in program smartphone.cpp:15:1: error: stray '\302' in program smartphone.cpp:15:1: error: stray '\240' in program smartphone.cpp:15:1: error: stray '\302' in program smartphone.cpp:15:1: error: stray '\240' in program smartphone.cpp:16:1: error: stray '\302' in program { ^ smartphone.cpp:16:1: error: stray '\240' in program smartphone.cpp:16:1: error: stray '\302' in program smartphone.cpp:16:1: error: stray '\240' in program smartphone.cpp:16:1: error: stray '\302' in program smartphone.cpp:16:1: error: stray '\240' in program smartphone.cpp:16:1: error: stray '\302' in program smartphone.cpp:16:1: error: stray '\240' in program smartphone.cpp:17:1: error: stray '\302' in program if(v[i] != maxx && v[i] > z) z = v[i]; ^ smartphone.cpp:17:1: error: stray '\240' in program smartphone.cpp:17:1: error: stray '\302' in program smartphone.cpp:17:1: error: stray '\240' in program smartphone.cpp:17:1: error: stray '\302' in program smartphone.cpp:17:1: error: stray '\240' in program smartphone.cpp:17:1: error: stray '\302' in program smartphone.cpp:17:1: error: stray '\240' in program smartphone.cpp:17:1: error: stray '\302' in program smartphone.cpp:17:1: error: stray '\240' in program smartphone.cpp:17:1: error: stray '\302' in program smartphone.cpp:17:1: error: stray '\240' in program smartphone.cpp:17:1: error: stray '\302' in program smartphone.cpp:17:1: error: stray '\240' in program smartphone.cpp:17:1: error: stray '\302' in program smartphone.cpp:17:1: error: stray '\240' in program smartphone.cpp:17:1: error: stray '\302' in program smartphone.cpp:17:1: error: stray '\240' in program smartphone.cpp:17:1: error: stray '\302' in program smartphone.cpp:17:1: error: stray '\240' in program smartphone.cpp:17:1: error: stray '\302' in program smartphone.cpp:17:1: error: stray '\240' in program smartphone.cpp:17:1: error: stray '\302' in program smartphone.cpp:17:1: error: stray '\240' in program smartphone.cpp:17:1: error: stray '\302' in program smartphone.cpp:17:1: error: stray '\240' in program smartphone.cpp:17:1: error: stray '\302' in program smartphone.cpp:17:1: error: stray '\240' in program smartphone.cpp:17:1: error: stray '\302' in program smartphone.cpp:17:1: error: stray '\240' in program smartphone.cpp:17:1: error: stray '\302' in program smartphone.cpp:17:1: error: stray '\240' in program smartphone.cpp:17:1: error: stray '\302' in program smartphone.cpp:17:1: error: stray '\240' in program smartphone.cpp:18:1: error: stray '\302' in program } ^ smartphone.cpp:18:1: error: stray '\240' in program smartphone.cpp:18:1: error: stray '\302' in program smartphone.cpp:18:1: error: stray '\240' in program smartphone.cpp:18:1: error: stray '\302' in program smartphone.cpp:18:1: error: stray '\240' in program smartphone.cpp:18:1: error: stray '\302' in program smartphone.cpp:18:1: error: stray '\240' in program smartphone.cpp:19:1: error: stray '\302' in program if(k == 2) g << z; ^ smartphone.cpp:19:1: error: stray '\240' in program smartphone.cpp:19:1: error: stray '\302' in program smartphone.cpp:19:1: error: stray '\240' in program smartphone.cpp:19:1: error: stray '\302' in program smartphone.cpp:19:1: error: stray '\240' in program smartphone.cpp:19:1: error: stray '\302' in program smartphone.cpp:19:1: error: stray '\240' in program smartphone.cpp:19:1: error: stray '\302' in program smartphone.cpp:19:1: error: stray '\240' in program smartphone.cpp:19:1: error: stray '\302' in program smartphone.cpp:19:1: error: stray '\240' in program smartphone.cpp:19:1: error: stray '\302' in program smartphone.cpp:19:1: error: stray '\240' in program smartphone.cpp:19:1: error: stray '\302' in program smartphone.cpp:19:1: error: stray '\240' in program smartphone.cpp:19:1: error: stray '\302' in program smartphone.cpp:19:1: error: stray '\240' in program smartphone.cpp:20:1: error: stray '\302' in program f.close(); ^ smartphone.cpp:20:1: error: stray '\240' in program smartphone.cpp:20:1: error: stray '\302' in program smartphone.cpp:20:1: error: stray '\240' in program smartphone.cpp:20:1: error: stray '\302' in program smartphone.cpp:20:1: error: stray '\240' in program smartphone.cpp:20:1: error: stray '\302' in program smartphone.cpp:20:1: error: stray '\240' in program smartphone.cpp:21:1: error: stray '\302' in program g.close(); ^ smartphone.cpp:21:1: error: stray '\240' in program smartphone.cpp:21:1: error: stray '\302' in program smartphone.cpp:21:1: error: stray '\240' in program smartphone.cpp:21:1: error: stray '\302' in program smartphone.cpp:21:1: error: stray '\240' in program smartphone.cpp:21:1: error: stray '\302' in program smartphone.cpp:21:1: error: stray '\240' in program smartphone.cpp:22:1: error: stray '\302' in program return 0; ^ smartphone.cpp:22:1: error: stray '\240' in program smartphone.cpp:22:1: error: stray '\302' in program smartphone.cpp:22:1: error: stray '\240' in program smartphone.cpp:22:1: error: stray '\302' in program smartphone.cpp:22:1: error: stray '\240' in program smartphone.cpp:22:1: error: stray '\302' in program smartphone.cpp:22:1: error: stray '\240' in program smartphone.cpp:22:1: error: stray '\302' in program smartphone.cpp:22:1: error: stray '\240' in program smartphone.cpp: In function 'int main()': smartphone.cpp:6:9: error: 'ifstream' was not declared in this scope ifstream f("smartphone.in"); ^ smartphone.cpp:6:19: error: expected ';' before 'f' ifstream f("smartphone.in"); ^ smartphone.cpp:7:9: error: 'ofstream' was not declared in this scope ofstream g("smartphone.out"); ^ smartphone.cpp:7:19: error: expected ';' before 'g' ofstream g("smartphone.out"); ^ smartphone.cpp:8:9: error: 'f' was not declared in this scope f >> k >> n; ^ smartphone.cpp:14:26: error: 'g' was not declared in this scope if(k == 1) { g << maxx; return 0; } ^ smartphone.cpp:19:23: error: 'g' was not declared in this scope if(k == 2) g << z; ^ smartphone.cpp:21:9: error: 'g' was not declared in this scope g.close(); ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Smartphone 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ă.