#4201
Sume Cuantice
Prietenul vostru Turing va cere din nou ajutorul! Acesta isi doreste un calculator cuantic pentru a calcula o suma colosala, imposibila pentru orice om. Momentan nu dispune de resursele materiale si financiare pentru a lucra la nivel cuantic asa ca va cere ajutorul vostru in sarcina sa.
Codeforces
Problema | Sume Cuantice | Operații I/O | tastatură/ecran |
---|---|---|---|
Limita timp | 0.15 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #37880783 | Utilizator | |
Fișier | sume_cuantice.cpp | Dimensiune | 2.74 KB |
Data încărcării | 23 Septembrie 2022, 09:55 | Scor / rezultat | Eroare de compilare |
sume_cuantice.cpp:1:7: error: expected nested-name-specifier before 'System' using System; ^ sume_cuantice.cpp:1:7: error: 'System' has not been declared sume_cuantice.cpp:2:7: error: expected nested-name-specifier before 'System' using System.Collections.Generic; ^ sume_cuantice.cpp:2:7: error: 'System' has not been declared sume_cuantice.cpp:2:13: error: expected ';' before '.' token using System.Collections.Generic; ^ sume_cuantice.cpp:2:13: error: expected unqualified-id before '.' token sume_cuantice.cpp:3:7: error: expected nested-name-specifier before 'AlgorithmicInputOutput' using AlgorithmicInputOutput; ^ sume_cuantice.cpp:3:7: error: 'AlgorithmicInputOutput' has not been declared sume_cuantice.cpp:11:16: error: expected ':' before 'void' public void r(out System.Int32 a) // +info ^ sume_cuantice.cpp:11:23: error: 'out' has not been declared public void r(out System.Int32 a) // +info ^ sume_cuantice.cpp:11:33: error: expected ',' or '...' before '.' token public void r(out System.Int32 a) // +info ^ sume_cuantice.cpp:40:16: error: expected ':' before 'void' public void r(out System.Int64 a) ^ sume_cuantice.cpp:40:23: error: 'out' has not been declared public void r(out System.Int64 a) ^ sume_cuantice.cpp:40:33: error: expected ',' or '...' before '.' token public void r(out System.Int64 a) ^ sume_cuantice.cpp:40:21: error: 'void AlgorithmicInputOutput::AIO::r(int)' cannot be overloaded public void r(out System.Int64 a) ^ sume_cuantice.cpp:11:21: error: with 'void AlgorithmicInputOutput::AIO::r(int)' public void r(out System.Int32 a) // +info ^ sume_cuantice.cpp:63:5: error: expected ';' after class definition } ^ sume_cuantice.cpp: In member function 'void AlgorithmicInputOutput::AIO::r(int)': sume_cuantice.cpp:13:13: error: 'a' was not declared in this scope a = 0; ^ sume_cuantice.cpp:14:20: error: request for member 'Int32' in 'System', which is of non-class type 'int' System.Int32 u = 32, c = 32; ^ sume_cuantice.cpp:14:26: error: expected ';' before 'u' System.Int32 u = 32, c = 32; ^ sume_cuantice.cpp:15:20: error: request for member 'Boolean' in 'System', which is of non-class type 'int' System.Boolean k = false; ^ sume_cuantice.cpp:15:28: error: expected ';' before 'k' System.Boolean k = false; ^ sume_cuantice.cpp:18:20: error: 'c' was not declared in this scope while (c < 48 || c > 57) ^ sume_cuantice.cpp:20:17: error: 'u' was not declared in this scope u = c; // cand "c" este o cifra, while-ul se opreste ^ sume_cuantice.cpp:22:28: error: request for member 'Console' in 'System', which is of non-class type 'int' c = System.Console.Read(); ^ sume_cuantice.cpp:25:13: error: 'k' was not declared in this scope k = (u == 45); ^ sume_cuantice.cpp:25:18: error: 'u' was not declared in this scope k = (u == 45); ^ sume_cuantice.cpp:30:20: error: 'c' was not declared in this scope while (c > 47 && c < 58) ^ sume_cuantice.cpp:32:44: error: 'checked' was not declared in this scope a = checked(a * 10 + c - 48); ^ sume_cuantice.cpp:33:28: error: request for member 'Console' in 'System', which is of non-class type 'int' c = System.Console.Read(); ^ sume_cuantice.cpp: In member function 'void AlgorithmicInputOutput::AIO::r(int)': sume_cuantice.cpp:42:13: error: 'a' was not declared in this scope a = 0; ^ sume_cuantice.cpp:43:20: error: request for member 'Int32' in 'System', which is of non-class type 'int' System.Int32 u = 32, c = 32; ^ sume_cuantice.cpp:43:26: error: expected ';' before 'u' System.Int32 u = 32, c = 32; ^ sume_cuantice.cpp:44:20: error: request for member 'Boolean' in 'System', which is of non-class type 'int' System.Boolean k = false; ^ sume_cuantice.cpp:44:28: error: expected ';' before 'k' System.Boolean k = false; ^ sume_cuantice.cpp:46:20: error: 'c' was not declared in this scope while (c < 48 || c > 57) ^ sume_cuantice.cpp:48:17: error: 'u' was not declared in this scope u = c; ^ sume_cuantice.cpp:49:28: error: request for member 'Console' in 'System', which is of non-class type 'int' c = System.Console.Read(); ^ sume_cuantice.cpp:52:13: error: 'k' was not declared in this scope k = (u == 45); ^ sume_cuantice.cpp:52:18: error: 'u' was not declared in this scope k = (u == 45); ^ sume_cuantice.cpp:54:20: error: 'c' was not declared in this scope while (c > 47 && c < 58) ^ sume_cuantice.cpp:56:45: error: request for member 'Convert' in 'System', which is of non-class type 'int' a = checked(a * 10 + System.Convert.ToInt64(c - 48)); ^ sume_cuantice.cpp:56:68: error: 'checked' was not declared in this scope a = checked(a * 10 + System.Convert.ToInt64(c - 48)); ^ sume_cuantice.cpp:57:28: error: request for member 'Console' in 'System', which is of non-class type 'int' c = System.Console.Read(); ^ sume_cuantice.cpp: At global scope: sume_cuantice.cpp:70:26: error: 'string' has not been declared static void Main(string[] args) ^ sume_cuantice.cpp:70:35: error: expected ',' or '...' before 'args' static void Main(string[] args) ^ sume_cuantice.cpp:101:5: error: expected ';' after class definition } ^ sume_cuantice.cpp: In static member function 'static void ConsoleApp2::Program::Main(int*)': sume_cuantice.cpp:72:13: error: 'UInt64' was not declared in this scope UInt64 total; ^ sume_cuantice.cpp:72:20: error: expected ';' before 'total' UInt64 total; ^ sume_cuantice.cpp:73:13: error: 'Int32' was not declared in this scope Int32 n, k, number, t = Int32.Parse(Console.ReadLine()); ^ sume_cuantice.cpp:73:19: error: expected ';' before 'n' Int32 n, k, number, t = Int32.Parse(Console.ReadLine()); ^ sume_cuantice.cpp:74:13: error: 'AIO' was not declared in this scope AIO cin = new AIO(); ^ sume_cuantice.cpp:74:13: note: suggested alternative: sume_cuantice.cpp:7:11: note: 'AlgorithmicInputOutput::AIO' class AIO ^ sume_cuantice.cpp:74:17: error: expected ';' before 'cin' AIO cin = new AIO(); ^ sume_cuantice.cpp:76:24: error: expected ';' before 'i1' for (Int32 i1 = 0; i1 < t; ++i1) ^ sume_cuantice.cpp:76:32: error: 'i1' was not declared in this scope for (Int32 i1 = 0; i1 < t; ++i1) ^ sume_cuantice.cpp:76:37: error: 't' was not declared in this scope for (Int32 i1 = 0; i1 < t; ++i1) ^ sume_cuantice.cpp:78:17: error: 'cin' was not declared in this scope cin.r(out n); ^ sume_cuantice.cpp:78:23: error: 'out' was not declared in this scope cin.r(out n); ^ sume_cuantice.cpp:79:27: error: expected ')' before 'k' cin.r(out k); ^ sume_cuantice.cpp:81:17: error: 'List' was not declared in this scope List<Int32> max = new List<Int32>(); ^ sume_cuantice.cpp:81:29: error: 'max' was not declared in this scope List<Int32> max = new List<Int32>(); ^ sume_cuantice.cpp:81:39: error: expected type-specifier before 'List' List<Int32> max = new List<Int32>(); ^ sume_cuantice.cpp:81:39: error: expected ';' before 'List' sume_cuantice.cpp:83:28: error: expected ';' before 'i2' for (Int32 i2 = 0; i2 < n; ++i2) ^ sume_cuantice.cpp:83:36: error: 'i2' was not declared in this scope for (Int32 i2 = 0; i2 < n; ++i2) ^ sume_cuantice.cpp:83:41: error: 'n' was not declared in this scope for (Int32 i2 = 0; i2 < n; ++i2) ^ sume_cuantice.cpp:85:31: error: expected ')' before 'number' cin.r(out number); ^ sume_cuantice.cpp:87:37: error: 'k' was not declared in this scope if (max.Count < k) ^ sume_cuantice.cpp:88:33: error: 'number' was not declared in this scope max.Add(number); ^ sume_cuantice.cpp:89:30: error: 'number' was not declared in this scope else if (number > max[i2 % k]) ^ sume_cuantice.cpp:93:17: error: 'total' was not declared in this scope total = 0; ^ sume_cuantice.cpp:95:26: error: 'var' was not declared in this scope foreach (var element in max) ^ sume_cuantice.cpp:95:44: error: 'foreach' was not declared in this scope foreach (var element in max) ^ sume_cuantice.cpp:96:21: error: expected ';' before 'total' total += Convert.ToUInt64(element); ^ sume_cuantice.cpp:98:17: error: 'Console' was not declared in this scope Console.WriteLine(total); ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Sume Cuantice 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ă.