#4203
În planul xOy
se găsesc n
puncte de coordonate numere naturale, nu neapărat aflate pe poziții distincte. Pentru fiecare punct din plan de coordonate (x, y)
trebuie să spuneți câte alte puncte au coordonatele (p, q)
cu proprietatea că 0 ≤ p < x
și 0 ≤ q ≤ y
(atenție, p
este strict mai mic decât x
, iar q
este mai mic sau egal cu y
).
Folclorul informatic
Problema | NumberOfPoints | Operații I/O |
![]() numberofpoints.in /numberofpoints.out
|
---|---|---|---|
Limita timp | 0.3 secunde | Limita memorie |
Total: 128 MB
/
Stivă 64 MB
|
Id soluție | #55118822 | Utilizator | |
Fișier | numberofpoints.cpp | Dimensiune | 1.03 KB |
Data încărcării | 26 Decembrie 2024, 23:43 | Scor / rezultat | Eroare de compilare |
numberofpoints.cpp:9:25: error: 'int y1' redeclared as different kind of symbol int n,a,b,c,d,x,x1,x2,y,y1,y2,aib[dim],sol[nmax]; ^ In file included from /usr/include/features.h:374:0, from /usr/include/i386-linux-gnu/c++/4.8/bits/os_defines.h:39, from /usr/include/i386-linux-gnu/c++/4.8/bits/c++config.h:426, from /usr/include/c++/4.8/iosfwd:38, from /usr/include/c++/4.8/ios:38, from /usr/include/c++/4.8/istream:38, from /usr/include/c++/4.8/fstream:38, from numberofpoints.cpp:1: /usr/include/i386-linux-gnu/bits/mathcalls.h:241:1: error: previous declaration of 'double y1(double)' __MATHCALL (y1,, (_Mdouble_)); ^ numberofpoints.cpp: In function 'int main()': numberofpoints.cpp:23:23: error: cannot bind 'std::basic_istream<char>::__istream_type {aka std::basic_istream<char>}' lvalue to 'std::basic_istream<char>&&' cin>>n>>a>>b>>c>>d>>x1>>y1>>x2>>y2; ^ In file included from /usr/include/c++/4.8/fstream:38:0, from numberofpoints.cpp:1: /usr/include/c++/4.8/istream:872:5: error: initializing argument 1 of 'std::basic_istream<_CharT, _Traits>& std::operator>>(std::basic_istream<_CharT, _Traits>&&, _Tp&) [with _CharT = char; _Traits = std::char_traits<char>; _Tp = double(double)throw ()]' operator>>(basic_istream<_CharT, _Traits>&& __is, _Tp& __x) ^ numberofpoints.cpp:24:28: error: invalid user-defined conversion from '<brace-enclosed initializer list>' to 'std::vector<std::pair<std::pair<int, int>, int> >::value_type&& {aka std::pair<std::pair<int, int>, int>&&}' [-fpermissive] v.push_back({{y1,x1},1}); ^ In file included from /usr/include/c++/4.8/bits/stl_algobase.h:64:0, from /usr/include/c++/4.8/bits/char_traits.h:39, from /usr/include/c++/4.8/ios:40, from /usr/include/c++/4.8/istream:38, from /usr/include/c++/4.8/fstream:38, from numberofpoints.cpp:1: /usr/include/c++/4.8/bits/stl_pair.h:112:26: note: candidate is: constexpr std::pair<_T1, _T2>::pair(const _T1&, const _T2&) [with _T1 = std::pair<int, int>; _T2 = int] <near match> _GLIBCXX_CONSTEXPR pair(const _T1& __a, const _T2& __b) ^ /usr/include/c++/4.8/bits/stl_pair.h:112:26: note: no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'const std::pair<int, int>&' numberofpoints.cpp:24:28: error: invalid user-defined conversion from '<brace-enclosed initializer list>' to 'const std::pair<int, int>&' [-fpermissive] v.push_back({{y1,x1},1}); ^ In file included from /usr/include/c++/4.8/bits/stl_algobase.h:64:0, from /usr/include/c++/4.8/bits/char_traits.h:39, from /usr/include/c++/4.8/ios:40, from /usr/include/c++/4.8/istream:38, from /usr/include/c++/4.8/fstream:38, from numberofpoints.cpp:1: /usr/include/c++/4.8/bits/stl_pair.h:112:26: note: candidate is: constexpr std::pair<_T1, _T2>::pair(const _T1&, const _T2&) [with _T1 = int; _T2 = int] <near match> _GLIBCXX_CONSTEXPR pair(const _T1& __a, const _T2& __b) ^ /usr/include/c++/4.8/bits/stl_pair.h:112:26: note: no known conversion for argument 1 from 'double(double)throw ()' to 'const int&' numberofpoints.cpp:24:28: error: invalid conversion from 'double (*)(double)throw ()' to 'const int&' [-fpermissive] v.push_back({{y1,x1},1}); ^ In file included from /usr/include/c++/4.8/bits/stl_algobase.h:64:0, from /usr/include/c++/4.8/bits/char_traits.h:39, from /usr/include/c++/4.8/ios:40, from /usr/include/c++/4.8/istream:38, from /usr/include/c++/4.8/fstream:38, from numberofpoints.cpp:1: /usr/include/c++/4.8/bits/stl_pair.h:112:26: error: initializing argument 1 of 'constexpr std::pair<_T1, _T2>::pair(const _T1&, const _T2&) [with _T1 = int; _T2 = int]' [-fpermissive] _GLIBCXX_CONSTEXPR pair(const _T1& __a, const _T2& __b) ^ numberofpoints.cpp:24:28: error: conversion to non-const reference type 'std::vector<std::pair<std::pair<int, int>, int> >::value_type&& {aka struct std::pair<std::pair<int, int>, int>&&}' from rvalue of type 'std::pair<std::pair<int, int>, int>' [-fpermissive] v.push_back({{y1,x1},1}); ^ numberofpoints.cpp:29:15: error: invalid operands of types 'double(double)throw ()' and 'int' to binary 'operator*' y=(y1*a+y2*b+c)%d+1; ^ numberofpoints.cpp:31:17: error: assignment of function 'double y1(double)' x1=x2,y1=y2; ^ numberofpoints.cpp:31:17: error: cannot convert 'int' to 'double(double)throw ()' in assignment
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema NumberOfPoints 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ă.