Compile Error
foo.cc:31:1: error: 'concept' does not name a type; did you mean 'const'? 31 | concept Container = std::ranges::range<T> && requires { typename T::value_type; } && !same_as<T,string>; | ^~~~~~~ | const foo.cc:31:1: note: 'concept' only available with '-std=c++20' or '-fconcepts' foo.cc:31:86: error: expected unqualified-id before '!' token 31 | concept Container = std::ranges::range<T> && requires { typename T::value_type; } && !same_as<T,string>; | ^ foo.cc:32:11: error: 'Container' has not been declared 32 | template <Container C> | ^~~~~~~~~ foo.cc:33:34: error: 'C' has not been declared 33 | istream& operator>>(istream& is, C& c) { | ^ foo.cc: In function 'std::istream& operator>>(std::istream&, int&)': foo.cc:34:23: error: there are no arguments to 'begin' that depend on a template parameter, so a declaration of 'begin' must be available [-fpermissive] 34 | for (auto& elem : c) is >> elem; | ^ foo.cc:34:23: note: (if you use '-fpermissive', G++ will accept your code, but allowing the use of an undeclared name is deprecated) foo.cc:34:23: error: there are no arguments to 'end' that depend on a template parameter, so a declaration of 'end' must be available [-fpermissive] foo.cc: At global scope: foo.cc:37:11: error: 'Container' has not been declared 37 | template <Container C> | ^~~~~~~~~ foo.cc:38:34: error: 'C' has not been declared 38 | ostream& operator<<(ostream& os, C& c) { | ^ foo.cc: In function 'std::ostream& operator<<(std::ostream&, int&)': foo.cc:39:22: error: request for member 'begin' in 'c', which is of non-class type 'int' 39 | for (auto it = c.begin(); it != c.end(); it++) os << *it << (next(it) == c.end()?"":" "); | ^~~~~ foo.cc:39:39: error: request for member 'end' in 'c', which is of non-class type 'int' 39 | for (auto it = c.begin(); it != c.end(); it++) os << *it << (next(it) == c.end()?"":" "); | ^~~ foo.cc:39:80: error: request for member 'end' in 'c', which is of non-class type 'int' 39 | for (auto it = c.begin(); it != c.end(); it++) os << *it << (next(it) == c.end()?"":" "); | ^~~
Code
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair<ll,ll> pll;
typedef pair<ld,ld> pld;
typedef vector<ll> vll;
typedef vector<ld> vld;
typedef vector<pll> vpll;
typedef vector<pld> vpld;
#define int ll
#define all(it) it.begin(),it.end()
#define ord_set(T) tree<T,null_type,less<T>,rb_tree_tag,tree_order_statistics_node_update>
template<class... T>
constexpr auto mmin(T... a){return min(initializer_list<common_type_t<T...>>{a...});}
template<class... T>
constexpr auto mmax(T... a){return max(initializer_list<common_type_t<T...>>{a...});}
template<class t,class u>
ostream& operator<<(ostream& os,const pair<t,u>& p){return os<<p.first<<' '<<p.second;}
template<class t,class u>
istream& operator>>(istream& is,pair<t,u>& p){return is >> p.first >> p.second;}
template <typename T>
concept Container = std::ranges::range<T> && requires { typename T::value_type; } && !same_as<T,string>;
template <Container C>
istream& operator>>(istream& is, C& c) {
for (auto& elem : c) is >> elem;
return is;
}
template <Container C>
ostream& operator<<(ostream& os, C& c) {
for (auto it = c.begin(); it != c.end(); it++) os << *it << (next(it) == c.end()?"":" ");
return os;
}
template<class T, class... Ts>
void print(const T& a, const Ts&... b){
cout << a;
(cout << ... << (cout << ' ', b));
cout << '\n';
}
void work(){
int a,b,c;
cin >> a >> b >> c;
cout << max(0LL,a-c) << ' ' << b - max(0LL,c-a) << '\n';
}
int32_t main(){
cin.tie(NULL);
ios_base::sync_with_stdio(false);
int n;
cin >> n;
while (n--) work();
return 0;
}
Information
- Submit By
- Type
- Submission
- Problem
- P1187 Ticket Battle: Hridoy vs Kamona
- Language
- C++17 (G++ 13.2.0)
- Submit At
- 2025-04-06 22:14:43
- Judged At
- 2025-04-06 22:14:43
- Judged By
- Score
- 0
- Total Time
- 0ms
- Peak Memory
- 0 Bytes