Submission #1122533

#TimeUsernameProblemLanguageResultExecution timeMemory
1122533Mousa_AboubakerBouquet (EGOI24_bouquet)C++20
Compilation error
0 ms0 KiB
#include <iostream> #include <vector> #include <queue> #include <stack> #include <set> #include <map> #include <unordered_map> #include <unordered_set> #include <algorithm> #include <deque> #include <climits> #include <cmath> #include <numeric> #include <string> #include <bitset> #include <assert.h> #include <iomanip> using namespace std; template <typename T> using pqg = priority_queue<T, vector<T>, greater<T>>; #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace __gnu_pbds; template <typename T> using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>; const long long infl = 1e18 + 1; const int inf = 1e9 + 1; const int mod1 = 1e9 + 7; const int mod2 = 998244353; const long double eps = 1e-7; const int mod = mod1; int add(int a, int b) { return (a + b) % mod; } int sub(int a, int b) { return (a - b + mod) % mod; } int mul(int a, int b) { return (int)((long long)a * b % mod); } int pwr(int a, int b = mod - 2) { int res = 1; for(; b > 0; b >>= 1, a = mul(a, a)) if(b & 1) res = mul(res, a); return res; } void solve() { int n; cin >> n; vector<pair<int, int>> a(n); for(auto &[f, s]: a) cin >> f >> s; cout << n / (a.front.first + 1); } int main() { ios::sync_with_stdio(false); cin.tie(nullptr); int t = 1; // cin >> t; while (t--) { solve(); cout << (t ? "\n" : ""); } }

Compilation message (stderr)

Main.cpp: In function 'void solve()':
Main.cpp:57:24: error: invalid use of member function 'std::vector<_Tp, _Alloc>::const_reference std::vector<_Tp, _Alloc>::front() const [with _Tp = std::pair<int, int>; _Alloc = std::allocator<std::pair<int, int> >; std::vector<_Tp, _Alloc>::const_reference = const std::pair<int, int>&]' (did you forget the '()' ?)
   57 |         cout << n / (a.front.first + 1);
      |                      ~~^~~~~
      |                             ()
Main.cpp:57:30: error: expected ')' before 'first'
   57 |         cout << n / (a.front.first + 1);
      |                     ~        ^~~~~
      |                              )