|
| 1 | +#include <bits/stdc++.h> |
| 2 | +using namespace std; |
| 3 | +#ifdef ONLINE_JUDGE |
| 4 | +#define DISABLE_STACK_SIZE_CHANGE |
| 5 | +#endif |
| 6 | +#ifndef DISABLE_STACK_SIZE_CHANGE |
| 7 | +#include <sys/resource.h> |
| 8 | +#endif |
| 9 | +typedef long long ll; |
| 10 | +const ll MOD = 1000000007; |
| 11 | +#define pb push_back |
| 12 | +#define ff first |
| 13 | +#define ss second |
| 14 | +#define nl "\n" |
| 15 | +unordered_map<int,vector<int>>adj; |
| 16 | +unordered_map<int,bool>visi; |
| 17 | +#define set_bits(x) __builtin_popcountll(x) |
| 18 | +#define all(x) (x).begin(), (x).end() |
| 19 | +#define debug(x) cerr<<#x<<" "<<x<<endl; |
| 20 | +#define loop(i,a,b) for(int i=(a);i<(b);i++) |
| 21 | +#define print(x) for(auto it:(x)) cout<<(it)<<" "; cout<<endl; |
| 22 | +#define showadj for (auto it : adj) { cout << it.ff << " ->"; for (auto i : it.ss) cout << i << " "; cout << endl; } |
| 23 | +template<typename T> T gcd(T a, T b) { return b ? gcd(b, a % b) : a; } |
| 24 | +template<typename T> T binpow(T base,T power,T mod){ ll ans=1; base = base % mod;while(power){if(power&1) ans=(ans*base)%mod; base=((base*base)%mod); power>>=1;}return ans;} |
| 25 | + |
| 26 | +class demo |
| 27 | +{ |
| 28 | + int a,b; |
| 29 | +public: |
| 30 | + //default constructor called |
| 31 | + demo() |
| 32 | + { |
| 33 | + a=10; |
| 34 | + b=20; |
| 35 | + } |
| 36 | +}; |
| 37 | +class demo2 |
| 38 | +{ |
| 39 | + int c; |
| 40 | +public: |
| 41 | + |
| 42 | +} |
| 43 | +//default constructor |
| 44 | +demo2::demo2() |
| 45 | +{ |
| 46 | + c=10; |
| 47 | +} |
| 48 | + |
| 49 | + |
| 50 | +class paraconst |
| 51 | +{ |
| 52 | + int a,b; |
| 53 | +public: |
| 54 | + //parametized constructor |
| 55 | + paraconst(int n,int m) |
| 56 | + { |
| 57 | + a=n; |
| 58 | + b=m; |
| 59 | + } |
| 60 | +}; |
| 61 | +class cupy |
| 62 | +{ |
| 63 | + int a; |
| 64 | +public: |
| 65 | + cupy() |
| 66 | + { |
| 67 | + a=10; |
| 68 | + }//copy constructor use to copy the obj to other obj of ssame class |
| 69 | + //cupy a; cupy b(a); like this data is copied; |
| 70 | + cupy(cupy&temp) |
| 71 | + { |
| 72 | + a=temp.a; |
| 73 | + } |
| 74 | +} |
| 75 | +int main() |
| 76 | +{ |
| 77 | + ios_base::sync_with_stdio(0);cin.tie(0); |
| 78 | + #ifndef DISABLE_STACK_SIZE_CHANGE |
| 79 | + rlimit rlim; |
| 80 | + if (getrlimit(RLIMIT_STACK, &rlim) != 0) {return 1;} |
| 81 | + rlim.rlim_cur = 1024 * 1024 * 1024; |
| 82 | + if (setrlimit(RLIMIT_STACK, &rlim) != 0) {return 2;} |
| 83 | + #endif |
| 84 | + |
| 85 | + |
| 86 | +} |
| 87 | + |
0 commit comments