output
stringlengths
52
181k
instruction
stringlengths
296
182k
#include <bits/stdc++.h> using namespace std; int t,n,m,k; bool d[200500]; int main() { cin>>t; while (t--) { cin>>n>>k>>m; k=(k-1)/2; for (int i=1; i<=n; ++i) d[i]=1; for (int i=0; i<m; ++i) { int t; scanf("%d",&t); d[t]=0; } if ((n-m)%(2*k)) { cout<<"NO\n"; continue; } for (int i=1,t=0; i<=n...
### Prompt Create a solution in CPP for the following problem: Let's denote the median of a sequence s with odd length as the value in the middle of s if we sort s in non-decreasing order. For example, let s = [1, 2, 5, 7, 2, 3, 12]. After sorting, we get sequence [1, 2, 2, \underline{3}, 5, 7, 12], and the median is...
#include<iostream> #include<cstdio> #include<cstring> #include<string> #include<vector> #include<cmath> #include<algorithm> #include<map> #include<queue> #include<deque> #include<iomanip> #include<tuple> #include<cassert> #include<set> #include<complex> #include<numeric> #include<functional> using namespace std; typede...
### Prompt Construct a CPP code solution to the problem outlined: Let's denote the median of a sequence s with odd length as the value in the middle of s if we sort s in non-decreasing order. For example, let s = [1, 2, 5, 7, 2, 3, 12]. After sorting, we get sequence [1, 2, 2, \underline{3}, 5, 7, 12], and the median...
#include<bits/stdc++.h> using namespace std; namespace Sakurajima_Mai{ #define ms(a) memset(a,0,sizeof(a)) #define repi(i,a,b) for(int i=a,bbb=b;i<=bbb;++i)//attention reg int or reg ll ? #define repd(i,a,b) for(int i=a,bbb=b;i>=bbb;--i) #define reps(s) for(int i=head[s],v=e[i].to;i;i=e[i].nxt,v=e[i].to) #define ...
### Prompt Please create a solution in cpp to the following problem: Let's denote the median of a sequence s with odd length as the value in the middle of s if we sort s in non-decreasing order. For example, let s = [1, 2, 5, 7, 2, 3, 12]. After sorting, we get sequence [1, 2, 2, \underline{3}, 5, 7, 12], and the med...
#include <bits/stdc++.h> int main() { std::ios::sync_with_stdio(false); int T; std::cin>>T; for(; T; -- T) { int N, K, M; std::cin >> N >> K >> M; std::vector<bool> is(N + 1, false); for (int i = 1; i <= M; ++ i) { int x; std::cin >> x; is[x] = true; } if (N == M) { std::cout << "YES" << '\...
### Prompt Construct a CPP code solution to the problem outlined: Let's denote the median of a sequence s with odd length as the value in the middle of s if we sort s in non-decreasing order. For example, let s = [1, 2, 5, 7, 2, 3, 12]. After sorting, we get sequence [1, 2, 2, \underline{3}, 5, 7, 12], and the median...
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef vector<int> vi; typedef vector<vi> vvi; typedef vector<ll> vl; typedef vector<vl> vvl; double pi = acos(-1); #define tezi ios_base::sync_with_stdio(false);\ cin.tie(0);\ cout.tie(0); #define FOR(i...
### Prompt Please provide a cpp coded solution to the problem described below: Let's denote the median of a sequence s with odd length as the value in the middle of s if we sort s in non-decreasing order. For example, let s = [1, 2, 5, 7, 2, 3, 12]. After sorting, we get sequence [1, 2, 2, \underline{3}, 5, 7, 12], a...
#include <bits/stdc++.h> using namespace std; /*<DEBUG>*/ #define tem template <typename #define can_shift(_X_, ...) enable_if_t<sizeof test<_X_>(0) __VA_ARGS__ 8, debug&> operator<<(T i) #define _op debug& operator<< tem C > auto test(C *x) -> decltype(cerr << *x, 0LL); tem C > char test(...); tem C > struct itr{C b...
### Prompt Create a solution in CPP for the following problem: Let's denote the median of a sequence s with odd length as the value in the middle of s if we sort s in non-decreasing order. For example, let s = [1, 2, 5, 7, 2, 3, 12]. After sorting, we get sequence [1, 2, 2, \underline{3}, 5, 7, 12], and the median is...
#include <bits/stdc++.h> using namespace std; const int N = 200010; int n, k, m, b[N]; int main() { int t; scanf("%d", &t); while (t){ t--; scanf("%d%d%d", &n, &k, &m); for (int i=0; i<m; i++) scanf("%d", b+i); if ((n-m)%(k-1)) printf("NO\n"); else { bool ok = 0; for (int i=0; i<m; i++...
### Prompt Create a solution in Cpp for the following problem: Let's denote the median of a sequence s with odd length as the value in the middle of s if we sort s in non-decreasing order. For example, let s = [1, 2, 5, 7, 2, 3, 12]. After sorting, we get sequence [1, 2, 2, \underline{3}, 5, 7, 12], and the median is...
#include <bits/stdc++.h> #define int long long #define pii pair<int, int> #define x1 x1228 #define y1 y1228 #define left left228 #define right right228 #define pb push_back #define eb emplace_back #define mp make_pair ...
### Prompt Your task is to create a Cpp solution to the following problem: Let's denote the median of a sequence s with odd length as the value in the middle of s if we sort s in non-decreasing order. For example, let s = [1, 2, 5, 7, 2, 3, 12]. After sorting, we get sequence [1, 2, 2, \underline{3}, 5, 7, 12], and t...
#ifdef Prateek #include "Prateek.h" #else #include <bits/stdc++.h> using namespace std; #define debug(...) 42 #endif #define F first #define S second #define pb push_back #define int ll #define f(i,x,n) for(int i=x;i<n;i++) #define all(c) c.begin(),c.end() using ll = long long; const int MOD = 1e9+7, N = 1e5 + ...
### Prompt Develop a solution in cpp to the problem described below: Let's denote the median of a sequence s with odd length as the value in the middle of s if we sort s in non-decreasing order. For example, let s = [1, 2, 5, 7, 2, 3, 12]. After sorting, we get sequence [1, 2, 2, \underline{3}, 5, 7, 12], and the med...
#include <bits/stdc++.h> #define fi first #define se second #define ll long long #define dl double long using namespace std; const int N = 5e5 + 7; const long long mod = 1e9 + 7; mt19937 rng(chrono::steady_clock::now().time_since_epoch().count()); void solve() { int n,k,m; cin >> n >> k >> m; vector < ...
### Prompt Create a solution in CPP for the following problem: Let's denote the median of a sequence s with odd length as the value in the middle of s if we sort s in non-decreasing order. For example, let s = [1, 2, 5, 7, 2, 3, 12]. After sorting, we get sequence [1, 2, 2, \underline{3}, 5, 7, 12], and the median is...
#include<cstdio> #include<algorithm> using namespace std; int b[200005]; void slove(){ int n,k,m; scanf("%d%d%d",&n,&k,&m); for(int i=1;i<=m;i++){ scanf("%d",&b[i]); } if((n-m)%(k-1)!=0){ printf("NO\n"); return ; }else{ for(int i=1;i<=m;i++){ if(b[i]-i>=k/2&&n-b[i]-m+i>=k/2){ printf("YES\n"); ...
### Prompt Develop a solution in Cpp to the problem described below: Let's denote the median of a sequence s with odd length as the value in the middle of s if we sort s in non-decreasing order. For example, let s = [1, 2, 5, 7, 2, 3, 12]. After sorting, we get sequence [1, 2, 2, \underline{3}, 5, 7, 12], and the med...
#include <bits/stdc++.h> using namespace std; int a[200010]; int main() { ios::sync_with_stdio(false); int T; cin>>T; while(T--) { int n,k,m; cin>>n>>k>>m; for(int i=1;i<=n;i++) a[i]=1; for(int x,i=1;i<=m;i++) cin>>x,a[x]=0; if((n-m)%(k-1)!=0) { cout<<"NO"<<endl; continue; } int cn...
### Prompt In CPP, your task is to solve the following problem: Let's denote the median of a sequence s with odd length as the value in the middle of s if we sort s in non-decreasing order. For example, let s = [1, 2, 5, 7, 2, 3, 12]. After sorting, we get sequence [1, 2, 2, \underline{3}, 5, 7, 12], and the median i...
#define f first #define s second #define loop(a,b) for(int i=a;i<b;i++) #define vi vector<int> #define vvi vector<vi> #define vl vector<ll> #define vvl vector<vector<ll> > #define mp make_pair #define pb push_back #define ppb pop_back #define ll long long #define pii pair<int,int> #define vpii vector<pair<int,int> > #d...
### Prompt Please create a solution in cpp to the following problem: Let's denote the median of a sequence s with odd length as the value in the middle of s if we sort s in non-decreasing order. For example, let s = [1, 2, 5, 7, 2, 3, 12]. After sorting, we get sequence [1, 2, 2, \underline{3}, 5, 7, 12], and the med...
#include <bits/stdc++.h> #define F first #define S second #define ll long long #define pi acos(-1.0) #define pb push_back #define mp make_pair #define lb printf("\n"); #define INF 1000000000000000000 #define LES -1000000000000000000 using namespace std; //---------------All Solution Functions Start Here--------------/...
### Prompt Generate a CPP solution to the following problem: The time on the planet Lapituletti goes the same way it goes on Earth but a day lasts h hours and each hour lasts m minutes. The inhabitants of that planet use digital clocks similar to earth ones. Clocks display time in a format HH:MM (the number of hours ...
#include <bits/stdc++.h> #define MAX_N 300001 #define MAX_M 10001 #define MAX_C 10001 #define MAX 500 #define pii pair<int, int> #define pdi pair<double, int> #define pid pair<int, double> #define pll pair<ll, ll> #define pli pair<ll, int> #define INF 987654321 #define vi vector<int> #define sq(x) ((x) * (x)) #define ...
### Prompt In cpp, your task is to solve the following problem: The time on the planet Lapituletti goes the same way it goes on Earth but a day lasts h hours and each hour lasts m minutes. The inhabitants of that planet use digital clocks similar to earth ones. Clocks display time in a format HH:MM (the number of hou...
#include<bits/stdc++.h> using namespace std; #define rep(i,k,n) for(i=k;i<n;i++) #define repr(i,k,n) for(i=k;i>=n;i--) #define inf(i,s) for(i=s;;i++) #define ll long long #define pb(i) push_back(i) #define pop pop_back(); #define all(s) s.begin(),s.end() #define maxl 92...
### Prompt Your task is to create a cpp solution to the following problem: The time on the planet Lapituletti goes the same way it goes on Earth but a day lasts h hours and each hour lasts m minutes. The inhabitants of that planet use digital clocks similar to earth ones. Clocks display time in a format HH:MM (the nu...
#pragma GCC optimize ("unroll-loops") #pragma GCC optimize ("O3", "omit-frame-pointer","inline") #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2,tune=native") #include <bits/stdc++.h> using namespace std; /***********************************************/ /* Dear online judge: * I've read the pro...
### Prompt Please provide a CPP coded solution to the problem described below: The time on the planet Lapituletti goes the same way it goes on Earth but a day lasts h hours and each hour lasts m minutes. The inhabitants of that planet use digital clocks similar to earth ones. Clocks display time in a format HH:MM (th...
/****************************************************************************** Welcome to GDB Online. GDB online is an online compiler and debugger tool for C, C++, Python, PHP, Ruby, C#, VB, Perl, Swift, Prolog, Javascript, Pascal, HTML, CSS, JS Code, Compile, Run and Debug online from anywhere in world. *********...
### Prompt Generate a cpp solution to the following problem: The time on the planet Lapituletti goes the same way it goes on Earth but a day lasts h hours and each hour lasts m minutes. The inhabitants of that planet use digital clocks similar to earth ones. Clocks display time in a format HH:MM (the number of hours ...
#include <iostream> #include <algorithm> #include <utility> #include <vector> #include <unordered_map> using namespace std; int h, m; unordered_map<int, int> mp; bool is_valid(int hour, int minute) { int a, b, c, d; unordered_map<int, int>::iterator it_a, it_b, it_c, it_d; ...
### Prompt Create a solution in CPP for the following problem: The time on the planet Lapituletti goes the same way it goes on Earth but a day lasts h hours and each hour lasts m minutes. The inhabitants of that planet use digital clocks similar to earth ones. Clocks display time in a format HH:MM (the number of hour...
#include <bits/stdc++.h> #include <string> using namespace std; using ll=long long; int h,m; int r[10]={0,1,5,-1,-1,2,-1,-1,8,-1}; bool check(int a,int b){ if(r[a%10]==-1 || r[a/10]==-1 || r[b%10]==-1 || r[b/10]==-1) return false; return r[a%10]*10+r[a/10]<m && r[b%10]*10+r[b/10]<h; } void solve(){ int a...
### Prompt Please create a solution in cpp to the following problem: The time on the planet Lapituletti goes the same way it goes on Earth but a day lasts h hours and each hour lasts m minutes. The inhabitants of that planet use digital clocks similar to earth ones. Clocks display time in a format HH:MM (the number o...
/* AUTHOR: ADVAY AGGARWAL INSTITUTION: IIIT DHARWAD */ #include<bits/stdc++.h> using namespace std; #define mod 1000000007 //1e9+7 ans%mod #define ll long long int #define test_cases(x) int x; cin>>x; while(x--) #define vi vector<int> #define setbits(x) __builtin_popcountll(x) #define endl "\n" void starter...
### Prompt Please provide a Cpp coded solution to the problem described below: The time on the planet Lapituletti goes the same way it goes on Earth but a day lasts h hours and each hour lasts m minutes. The inhabitants of that planet use digital clocks similar to earth ones. Clocks display time in a format HH:MM (th...
#include<bits/stdc++.h> using namespace std; typedef long long ll; typedef unsigned int uint; const int maxn = 1e7 + 10; const int N = 3e4 + 10; const int INF = 0x3f3f3f3f; const int mod = 1e9 + 7;; int t; int h,m; char hh[3]; char mm[3]; int num[10]; char s[10]; bool check(int num) { if((num % 10 == 1 || num % 10 ==...
### Prompt Create a solution in cpp for the following problem: The time on the planet Lapituletti goes the same way it goes on Earth but a day lasts h hours and each hour lasts m minutes. The inhabitants of that planet use digital clocks similar to earth ones. Clocks display time in a format HH:MM (the number of hour...
#include<bits/stdc++.h> using namespace std; #define ll long long #define endl ("\n") void solve() { ll h,m; cin>>h>>m; string s; cin>>s; ll H = (s[0]-'0')*10 + s[1]-'0'; ll M = (s[3]-'0')*10 + s[4]-'0'; ll a[] = {0,1,5,-1,-1,2,-1,-1,8,-1}; for(ll i=H;i<h;i++) { for(ll j=0;j...
### Prompt Construct a CPP code solution to the problem outlined: The time on the planet Lapituletti goes the same way it goes on Earth but a day lasts h hours and each hour lasts m minutes. The inhabitants of that planet use digital clocks similar to earth ones. Clocks display time in a format HH:MM (the number of h...
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int, int> pii; typedef pair<ll, ll> pll; #define INF 987654321 ll gcd(ll a, ll b) { for (; b; a %= b, swap(a, b)); return a; } int h[3], m[3]; int H, M; int chk[5] = { 3, 4, 6, 7, 9 }; bool Check(void) { bool hasAns = true; for (i...
### Prompt Please create a solution in cpp to the following problem: The time on the planet Lapituletti goes the same way it goes on Earth but a day lasts h hours and each hour lasts m minutes. The inhabitants of that planet use digital clocks similar to earth ones. Clocks display time in a format HH:MM (the number o...
#include <bits/stdc++.h> #include <complex> #include <queue> #include <set> #include <unordered_set> #include <list> #include <chrono> #include <random> #include <iostream> #include <algorithm> #include <cmath> #include <string> #include <vector> #include <map> #include <unordered_map> #include <stack> #include <ioma...
### Prompt Construct a cpp code solution to the problem outlined: The time on the planet Lapituletti goes the same way it goes on Earth but a day lasts h hours and each hour lasts m minutes. The inhabitants of that planet use digital clocks similar to earth ones. Clocks display time in a format HH:MM (the number of h...
#include "bits/stdc++.h" #pragma GCC optimize("Ofast") #pragma GCC target("avx,avx2,fma") // #pragma GCC optimization ("O3") // #pragma GCC optimization ("unroll-loops") // #include <ext/pb_ds/assoc_container.hpp> // #include <ext/pb_ds/tree_policy.hpp> // using namespace __gnu_pbds; //#include <boost/multiprecision/cp...
### Prompt Please provide a CPP coded solution to the problem described below: The time on the planet Lapituletti goes the same way it goes on Earth but a day lasts h hours and each hour lasts m minutes. The inhabitants of that planet use digital clocks similar to earth ones. Clocks display time in a format HH:MM (th...
#include<iostream> #include<cstdio> using namespace std; int T; string s; int h,m; int x,y; int fl[10]={0,1,5,-1,-1,2,-1,-1,8,-1}; void print(int x,int y) { cout<<x/10<<x%10<<":"<<y/10<<y%10<<endl; } void add(int &x,int &y) { y++; if(y==m) y=0,x++; if(x==h) x=0; } int op(int x,int y) { int a=x/10,...
### Prompt Generate a Cpp solution to the following problem: The time on the planet Lapituletti goes the same way it goes on Earth but a day lasts h hours and each hour lasts m minutes. The inhabitants of that planet use digital clocks similar to earth ones. Clocks display time in a format HH:MM (the number of hours ...
// BABITHA'S CODE.// #include<bits/stdc++.h> using namespace std; #define int long long #define int_max 9223372036854775807 #define float double #define pii pair<int, int> #define fl(i, a, b) for (int i = a; i < b; i++) #define dy(a, n) int *a = new int[n] #define mii map<int, int> #define vec(a) vector<a> #define M...
### Prompt Generate a cpp solution to the following problem: The time on the planet Lapituletti goes the same way it goes on Earth but a day lasts h hours and each hour lasts m minutes. The inhabitants of that planet use digital clocks similar to earth ones. Clocks display time in a format HH:MM (the number of hours ...
#include <iostream> #include <vector> #include <unordered_map> using namespace std; #define ll long long int #define VEC vector<ll> #define PAIR pair<ll, ll> #define VECP vector<PAIR> #define mp(a, b) make_pair(a, b) #define pb(a) push_back(a) #define rep(st, n) for (ll i = st; i < n; i++) #define repr(st, n) for (ll...
### Prompt Generate a CPP solution to the following problem: The time on the planet Lapituletti goes the same way it goes on Earth but a day lasts h hours and each hour lasts m minutes. The inhabitants of that planet use digital clocks similar to earth ones. Clocks display time in a format HH:MM (the number of hours ...
#include<bits/stdc++.h> using namespace std; #include<cstring> #include<vector> typedef long long int ll; typedef long double ld; typedef double db; ll solve(ll i,ll h) { ll a[10]={0,1,5,-1,-1,2,-1,-1,8,-1}; ll b=i/10,c=i%10; if( a[b]!=-1 && a[c]!=-1 ) { ll ch= 10*( a[c] )+a[b]; ...
### Prompt Your challenge is to write a cpp solution to the following problem: The time on the planet Lapituletti goes the same way it goes on Earth but a day lasts h hours and each hour lasts m minutes. The inhabitants of that planet use digital clocks similar to earth ones. Clocks display time in a format HH:MM (th...
#include <bits/stdc++.h> using namespace std; #define MOD 1000000007 bool check(int a){ if(a==0 || a==1 || a==2 || a==5 || a==8) return true; return false; } int mirror(int a){ if(a==0) return 0; if(a==1) return 1; if(a==2) return 5; if(a==5) return 2; if(a==8) return 8; return 0; } int main(){ #ifndef ONLINE_...
### Prompt In Cpp, your task is to solve the following problem: The time on the planet Lapituletti goes the same way it goes on Earth but a day lasts h hours and each hour lasts m minutes. The inhabitants of that planet use digital clocks similar to earth ones. Clocks display time in a format HH:MM (the number of hou...
#include<bits/stdc++.h> #define int long long #define double long double #define sz(x) (int)(x).size() #define all(x) (x).begin(),(x).end() #define pb push_back #define x first #define y second using namespace std; using pi = pair<int,int>; const int inf = 0x3f3f3f3f3f3f3f3f; const int minf = 0xc0c0c0c0c0c0c0c0; inlin...
### Prompt Your task is to create a Cpp solution to the following problem: The time on the planet Lapituletti goes the same way it goes on Earth but a day lasts h hours and each hour lasts m minutes. The inhabitants of that planet use digital clocks similar to earth ones. Clocks display time in a format HH:MM (the nu...
#include<bits/stdc++.h> using namespace std; typedef long long ll; int rev(int x){ vector<int> v; for(int i=0;i<2;i++){ int d=x%10; x/=10; if(d!=0&&d!=1&&d!=2&&d!=5&&d!=8){ return -1; } if(d==2||d==5) d^=2^5; v.push_back(d); } return v[0]*10+v...
### Prompt Construct a CPP code solution to the problem outlined: The time on the planet Lapituletti goes the same way it goes on Earth but a day lasts h hours and each hour lasts m minutes. The inhabitants of that planet use digital clocks similar to earth ones. Clocks display time in a format HH:MM (the number of h...
#include <algorithm> #include <cassert> #include <climits> #include <cmath> #include <complex> #include <iomanip> #include <iostream> #include <iterator> #include <list> #include <map> #include <numeric> #include <queue> #include <set> #include <stack> #include <tuple> #include <vector> #define LSOne(S) ((S) & -(S)) ...
### Prompt Construct a cpp code solution to the problem outlined: The time on the planet Lapituletti goes the same way it goes on Earth but a day lasts h hours and each hour lasts m minutes. The inhabitants of that planet use digital clocks similar to earth ones. Clocks display time in a format HH:MM (the number of h...
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef long double ld; typedef pair<ll, ll> pll; typedef pair<ld, ld> pld; typedef pair<string, string> pss; typedef vector<ll> vll; typedef vector<ld> vld; typedef vector<pll> vpll; typedef vector<pld> vpld; typedef vector<vll> vvll; typedef ...
### Prompt In Cpp, your task is to solve the following problem: The time on the planet Lapituletti goes the same way it goes on Earth but a day lasts h hours and each hour lasts m minutes. The inhabitants of that planet use digital clocks similar to earth ones. Clocks display time in a format HH:MM (the number of hou...
#include<bits/stdc++.h> using namespace std; #define gc getchar_unlocked #define ll long long #define PI 3.1415926535897932384626 #define pb push_back //#define mp make_pair #define F first #define S second #define fast ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0); typedef pair<int, int> pi; typedef pair<ll, l...
### Prompt Please formulate a cpp solution to the following problem: The time on the planet Lapituletti goes the same way it goes on Earth but a day lasts h hours and each hour lasts m minutes. The inhabitants of that planet use digital clocks similar to earth ones. Clocks display time in a format HH:MM (the number o...
#include <bits/stdc++.h> using namespace std; #define fi first #define se second #define ii pair<int,int> #define vi vector<int> #define vii vector<ii> #define fora(i,a,b) for(int i=a;i<=b;++i) #define forb(i,a,b) for(int i=a;i>=b;--i) #define pb push_back #define all(a) a.begin(),a.end() bool conv(int x) { if (x ...
### Prompt Your task is to create a CPP solution to the following problem: The time on the planet Lapituletti goes the same way it goes on Earth but a day lasts h hours and each hour lasts m minutes. The inhabitants of that planet use digital clocks similar to earth ones. Clocks display time in a format HH:MM (the nu...
//Flower_On_Stone #include <bits/stdc++.h> using namespace std; const int MIRROR[] = {0, 1, 5, -1, -1, 2, -1, -1, 8, -1}; int test, h, m; string strClock; int hour, minute; int toInt(char ch) { return ch - '0'; } string toString(int x) { string resuft = ""; for (int i = 1; i <= 2; i++) { resuft...
### Prompt Construct a cpp code solution to the problem outlined: The time on the planet Lapituletti goes the same way it goes on Earth but a day lasts h hours and each hour lasts m minutes. The inhabitants of that planet use digital clocks similar to earth ones. Clocks display time in a format HH:MM (the number of h...
#include <bits/stdc++.h> #define fi first #define se second #define rep(i,n) for(int i = 0; i < (n); ++i) #define rrep(i,n) for(int i = 1; i <= (n); ++i) #define drep(i,n) for(int i = (n)-1; i >= 0; --i) #define srep(i,s,t) for (int i = s; i < t; ++i) #define rng(a) a.begin(),a.end() #define rrng(a) a.rbegin(),a.rend()...
### Prompt Please create a solution in Cpp to the following problem: The time on the planet Lapituletti goes the same way it goes on Earth but a day lasts h hours and each hour lasts m minutes. The inhabitants of that planet use digital clocks similar to earth ones. Clocks display time in a format HH:MM (the number o...
#include<bits/stdc++.h> using namespace std; #define pb push_back #define ll long long int int ara[] = {0, 1, 5, 0, 0, 2, 0, 0, 8}; bool valid(int n, int &x) { int a = n % 10; n /= 10; int b = n % 10; if ((a == 0 || a == 1 || a == 2 || a == 5 || a == 8) && (b == 0 || b == 1 || b == 2 || b == 5 || b == 8)) { x...
### Prompt Please create a solution in CPP to the following problem: The time on the planet Lapituletti goes the same way it goes on Earth but a day lasts h hours and each hour lasts m minutes. The inhabitants of that planet use digital clocks similar to earth ones. Clocks display time in a format HH:MM (the number o...
#include <iostream> #include <bits/stdc++.h> #define ll long long using namespace std; void test_case() { int h, m; cin >> h >> m; int r[10] = { 0, 1, 5, -1, -1, 2, -1, -1, 8, -1}; string s, s1, s2; cin >> s; int x = (s[0] - '0') * 10 + s[1] - '0', y = (s[3] - '0') * 10 + s[4] - '0'; while...
### Prompt Your task is to create a CPP solution to the following problem: The time on the planet Lapituletti goes the same way it goes on Earth but a day lasts h hours and each hour lasts m minutes. The inhabitants of that planet use digital clocks similar to earth ones. Clocks display time in a format HH:MM (the nu...
#include<bits/stdc++.h> using namespace std; int main() { int t; cin >> t; while(t--) { string s; char check[5]={'0','1','2','5','8'}; int h,m; cin >> h >> m; cin >> s; int sum1 = 0,sum2=0; int i; for( i=0;i<s.size();i++) { if(s[i]==':') break; ...
### Prompt Please create a solution in Cpp to the following problem: The time on the planet Lapituletti goes the same way it goes on Earth but a day lasts h hours and each hour lasts m minutes. The inhabitants of that planet use digital clocks similar to earth ones. Clocks display time in a format HH:MM (the number o...
#include <bits/stdc++.h> using namespace std; #define ll long long #define pb push_back #define mp make_pair #define mt make_tuple #define ff first #define ss second #define M1 1000000007 #define M2 998244353 #define fl(i,a,b) for(ll i=a;i<b;i++) #define bfl(i,a,b) for(ll i=b-1;i>=a;i--) #define f(i,n) for(int i=...
### Prompt Your challenge is to write a Cpp solution to the following problem: The time on the planet Lapituletti goes the same way it goes on Earth but a day lasts h hours and each hour lasts m minutes. The inhabitants of that planet use digital clocks similar to earth ones. Clocks display time in a format HH:MM (th...
#include <bits/stdc++.h> using namespace std; template <typename A, typename B> string to_string(pair<A, B> p); string to_string(const char& ch) { return "'" + string(1, ch) + "'"; } string to_string(const string& s) { return '"' + s + '"'; } string to_string(const char* s) { return to_string((string) s); } string to_...
### Prompt Please provide a Cpp coded solution to the problem described below: The time on the planet Lapituletti goes the same way it goes on Earth but a day lasts h hours and each hour lasts m minutes. The inhabitants of that planet use digital clocks similar to earth ones. Clocks display time in a format HH:MM (th...
#include<cstdio> using namespace std; int tim[26]={0,0,1,2,5,8,10,11,12,15,18,20,21,22,25,28,50,51,52,55,58,80,81,82,85,88}; int flc[26]={0,0,10,50,20,80,1,11,51,21,81,5,15,55,25,85,2,12,52,22,82,8,18,58,28,88}; int amax,bmax; int finda(int v) { while(1) { if(tim[v]>=amax) v=1; if(flc[v]<bmax) return v; v=v%25+...
### Prompt Please formulate a CPP solution to the following problem: The time on the planet Lapituletti goes the same way it goes on Earth but a day lasts h hours and each hour lasts m minutes. The inhabitants of that planet use digital clocks similar to earth ones. Clocks display time in a format HH:MM (the number o...
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef vector<long long> vl; #define pll pair<ll, ll> #define vpl vector<pll> #define vb vector<bool> #define PB push_back #define MP make_pair #define ln "\n" #define forn(i,e) for(ll i=0; i<e; i++) #define forsn(i,s,e) for(ll i=s; i<e; i++) #define ...
### Prompt Generate a cpp solution to the following problem: The time on the planet Lapituletti goes the same way it goes on Earth but a day lasts h hours and each hour lasts m minutes. The inhabitants of that planet use digital clocks similar to earth ones. Clocks display time in a format HH:MM (the number of hours ...
#include <bits/stdc++.h> using namespace std; int h, m, h1, h0, m1, m0, hh, mm; int a[10] = {0, 1, 5, -1, -1, 2, -1, -1, 8, -1}; bool Chk(int x1, int x0, int y1, int y0) { if(y1 == -1 || y0 == -1) return false; if(y1 > x1) return false; if(y1 == x1) return y0 < x0; return true; } bool Check() { int hh1 = hh / 10,...
### Prompt Create a solution in cpp for the following problem: The time on the planet Lapituletti goes the same way it goes on Earth but a day lasts h hours and each hour lasts m minutes. The inhabitants of that planet use digital clocks similar to earth ones. Clocks display time in a format HH:MM (the number of hour...
#include <bits/stdc++.h> using namespace std; #define int long long #define ld long double #define pii pair<int,int> #define pf push_front #define pb push_back #define ub upper_bound #define lb lower_bound #define ppb pop_bac...
### Prompt Please create a solution in cpp to the following problem: The time on the planet Lapituletti goes the same way it goes on Earth but a day lasts h hours and each hour lasts m minutes. The inhabitants of that planet use digital clocks similar to earth ones. Clocks display time in a format HH:MM (the number o...
#include <bits/stdc++.h> #include <unordered_set> using namespace std; ///// Change default type here :D ///// typedef long long num; ////////////////////////////// void PrintBool(bool a); num a, b, c, d, e, f, g, h, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z; // Does not contain i and j string s1, s2, t1; vector...
### Prompt Create a solution in CPP for the following problem: The time on the planet Lapituletti goes the same way it goes on Earth but a day lasts h hours and each hour lasts m minutes. The inhabitants of that planet use digital clocks similar to earth ones. Clocks display time in a format HH:MM (the number of hour...
//Bismillahir Rahmanir Raheem #include<bits/stdc++.h> using namespace std; typedef pair<int,int>pii; #define sf(x) scanf("%d",&x) #define sfl(x) scanf("%lld",&x) #define lli long long int #define ll64 int64_t #define pb push_back #define fio ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL); #define frr(i...
### Prompt Your challenge is to write a CPP solution to the following problem: The time on the planet Lapituletti goes the same way it goes on Earth but a day lasts h hours and each hour lasts m minutes. The inhabitants of that planet use digital clocks similar to earth ones. Clocks display time in a format HH:MM (th...
# include <bits/stdc++.h> typedef long long ll; typedef long double ld; using namespace std; int rc(char c) { switch(c) { case '0': return 0; case '1': return 1; case '2': return 5; case '5': return 2; case '8': return 8; } return -1; } int helper(int tm, int lmt, int x) { int d, result = ...
### Prompt Construct a Cpp code solution to the problem outlined: The time on the planet Lapituletti goes the same way it goes on Earth but a day lasts h hours and each hour lasts m minutes. The inhabitants of that planet use digital clocks similar to earth ones. Clocks display time in a format HH:MM (the number of h...
#include <bits/stdc++.h> using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(0); long long tt; cin >> tt; vector<long long> mmm(10); mmm[0] = 0; mmm[1] = 1; mmm[2] = 5; mmm[3] = -1; mmm[4] = -1; mmm[5] = 2; mmm[6] = -1; mmm[7] = -1; mmm[8] = 8; mmm[9] = -1; auto Chec...
### Prompt Please create a solution in Cpp to the following problem: The time on the planet Lapituletti goes the same way it goes on Earth but a day lasts h hours and each hour lasts m minutes. The inhabitants of that planet use digital clocks similar to earth ones. Clocks display time in a format HH:MM (the number o...
#include <iostream> #include <vector> #include <algorithm> #include <cmath> #include <queue> #include <string> #include <map> #include <set> #include <stack> #include <tuple> #include <deque> #include <array> #include <numeric> #include <bitset> #include <iomanip> #include <cassert> #include <chrono> #include <random> ...
### Prompt Your challenge is to write a cpp solution to the following problem: The time on the planet Lapituletti goes the same way it goes on Earth but a day lasts h hours and each hour lasts m minutes. The inhabitants of that planet use digital clocks similar to earth ones. Clocks display time in a format HH:MM (th...
#include <bits/stdc++.h> using namespace std; #define DIM 1000007 long long t, h, m, hh, mm, res, v; string s; bool cor(long long h1, long long m1){ swap(h1, m1); long long hh1, hh2, mm1, mm2; hh2 = h1/10; hh1 = h1%10; mm2 = m1/10; mm1 = m1%10; if(hh2==3 || hh2==4 || hh2==6 || hh2==7...
### Prompt Your task is to create a CPP solution to the following problem: The time on the planet Lapituletti goes the same way it goes on Earth but a day lasts h hours and each hour lasts m minutes. The inhabitants of that planet use digital clocks similar to earth ones. Clocks display time in a format HH:MM (the nu...
#include <algorithm> #include <iostream> #include <map> #include <set> #include <string> #include <vector> using namespace std; int H, M; bool mirror(int h, int m) { string sh = to_string(h); string sm = to_string(m); if (h < 10) sh = "0" + sh; if (m < 10) sm = "0" + sm; reverse(sh.begin(), sh.end()); rever...
### Prompt Develop a solution in cpp to the problem described below: The time on the planet Lapituletti goes the same way it goes on Earth but a day lasts h hours and each hour lasts m minutes. The inhabitants of that planet use digital clocks similar to earth ones. Clocks display time in a format HH:MM (the number o...
#include<bits/stdc++.h> using namespace std; #define ll long long #define vi vector<int> #define ii pair<int,int> #define vii vector<ii> #define si set<int> #define msi map<string,int> #define sp " " const int inf = 2e9; const int MX = 30; const int mod = 1e9+7; int arr[10]={0,1,5,-1,-1,2,-1,-1,8,-1}; int h,m; st...
### Prompt Please formulate a Cpp solution to the following problem: The time on the planet Lapituletti goes the same way it goes on Earth but a day lasts h hours and each hour lasts m minutes. The inhabitants of that planet use digital clocks similar to earth ones. Clocks display time in a format HH:MM (the number o...
#include <bits/stdc++.h> typedef long long ll; #define f(i,a,n) for(long long i=a;i<n;i++) using namespace std; int MM[10]={1,1,1,0,0,1,0,0,1,0}; bool mirror(string s) { for(int i=0;i<2;i++) { if(MM[s[i]-'0']==0) return false; } return true; } bool valid(string s,ll mirrorlimit,ll selflimit) { ...
### Prompt Your task is to create a Cpp solution to the following problem: The time on the planet Lapituletti goes the same way it goes on Earth but a day lasts h hours and each hour lasts m minutes. The inhabitants of that planet use digital clocks similar to earth ones. Clocks display time in a format HH:MM (the nu...
#include<iostream> #include<string> #include<algorithm> #include<cstdio> #include<cstring> #include<cmath> #include<map> #include <queue> #include<sstream> #include <stack> #include <set> #include <bitset> #include<vector> #define FAST ios::sync_with_stdio(false) #define abs(a) ((a)>=0?(a):-(a)) #define sz(x) ((int)(x)...
### Prompt In CPP, your task is to solve the following problem: The time on the planet Lapituletti goes the same way it goes on Earth but a day lasts h hours and each hour lasts m minutes. The inhabitants of that planet use digital clocks similar to earth ones. Clocks display time in a format HH:MM (the number of hou...
#include<bits/stdc++.h> #define ll long long using namespace std; int mirror[10] = {0, 1, 5, 9999, 9999, 2, 9999, 9999, 8, 9999}; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); int t; cin >> t; while(t--) { int h, m, h1, h2, m1, m2; string s; cin >> h >> m >...
### Prompt Your task is to create a cpp solution to the following problem: The time on the planet Lapituletti goes the same way it goes on Earth but a day lasts h hours and each hour lasts m minutes. The inhabitants of that planet use digital clocks similar to earth ones. Clocks display time in a format HH:MM (the nu...
#include<cstdio> #include<iostream> #include<cstring> #include<algorithm> #include<cmath> using namespace std; const int N = 55; int t; int h, m; char s[10]; int valid[110] = { 0,1,2,5,8,10,11,12,15,18,20,21,22,25,28,50,51,52,55,58,80,81,82,85,88,100};//25 int find(int x) { int l = 0, r = 25; while (l < r) { in...
### Prompt Your task is to create a cpp solution to the following problem: The time on the planet Lapituletti goes the same way it goes on Earth but a day lasts h hours and each hour lasts m minutes. The inhabitants of that planet use digital clocks similar to earth ones. Clocks display time in a format HH:MM (the nu...
#include<bits/stdc++.h> using namespace std; int c[12]; bool check(int h, int m, int hh, int mm){ int h2 = hh % 10; hh /= 10; int h1 = hh % 10; int m2 = mm % 10; mm /= 10; int m1 = mm % 10; if (c[h1] == -1 || c[h2] == -1 || c[m1] == -1 || c[m2] == -1) return false; int hh1 = h1, hh2 = h2; h1 = c[m2]; h2 = c...
### Prompt Please create a solution in CPP to the following problem: The time on the planet Lapituletti goes the same way it goes on Earth but a day lasts h hours and each hour lasts m minutes. The inhabitants of that planet use digital clocks similar to earth ones. Clocks display time in a format HH:MM (the number o...
#include <bits/stdc++.h> using namespace std; #define ll long long #define fastio \ ios_base::sync_with_stdio(false); \ cin.tie(0); \ cout.tie(0) #define scl(n) scanf("%lld", &n) #define pcl(n) printf("%lld\n", n) #define pcl1(n) printf("%lld ", n) #define nln pr...
### Prompt Create a solution in cpp for the following problem: The time on the planet Lapituletti goes the same way it goes on Earth but a day lasts h hours and each hour lasts m minutes. The inhabitants of that planet use digital clocks similar to earth ones. Clocks display time in a format HH:MM (the number of hour...
#include <iostream> #include <string> #include <vector> using namespace std; int t; char num[5] = {'0', '1', '2', '5', '8'}; int h, m; string s; vector<string> times; string reverse(string str) { string res; for (int i = str.size() - 1; i >= 0; i--) { if(str[i] == '2') res += '5'; ...
### Prompt Your challenge is to write a Cpp solution to the following problem: The time on the planet Lapituletti goes the same way it goes on Earth but a day lasts h hours and each hour lasts m minutes. The inhabitants of that planet use digital clocks similar to earth ones. Clocks display time in a format HH:MM (th...
#include<bits/stdc++.h> using namespace std; const int maxn=2e5+10; const int mod=998244353; #define ll long long #define ull unsigned long long #define pi pair<int,ll> #define fi first #define sc second #define pb push_back int h,m; int check(int x) { int hour=x/m; int minute=x-hour*m; hour%=h; minute...
### Prompt Your challenge is to write a cpp solution to the following problem: The time on the planet Lapituletti goes the same way it goes on Earth but a day lasts h hours and each hour lasts m minutes. The inhabitants of that planet use digital clocks similar to earth ones. Clocks display time in a format HH:MM (th...
// LAZY_LAD_69 using namespace std; #include<bits/stdc++.h> //DEFINE #define fastio ios_base::sync_with_stdio(false);cin.tie(NULL); #define ll long long int #define nl "\n" #define forf(i,a,n) for(ll i=a;i<=n;i++) #define forb(i,b,n) for(ll i=b;i>=n;i--) #define pb pu...
### Prompt Please provide a cpp coded solution to the problem described below: The time on the planet Lapituletti goes the same way it goes on Earth but a day lasts h hours and each hour lasts m minutes. The inhabitants of that planet use digital clocks similar to earth ones. Clocks display time in a format HH:MM (th...
#pragma GCC optimize("Ofast") #pragma GCC optimization("unroll-loops") #pragma GCC target("avx,avx2,fma") #include <bits/stdc++.h> using namespace std; #define ll long long int #define deb(x) cout << #x << " " << x << endl; #define mod 1000000007 #define mod2 998244353 #define fast std::ios::sync_with_stdio(false), cin...
### Prompt Please create a solution in cpp to the following problem: The time on the planet Lapituletti goes the same way it goes on Earth but a day lasts h hours and each hour lasts m minutes. The inhabitants of that planet use digital clocks similar to earth ones. Clocks display time in a format HH:MM (the number o...
#include <bits/stdc++.h> using namespace std; vector < int > go = {0, 1, 5, -1, -1, 2, -1, -1, 8, -1}; int inf = 1e9 + 7; int get(int x) { string s = to_string(x); if ((int)s.size() == 1) s = "0" + s; string answ = ""; for (int i = 1; i >= 0; --i) { if (go[s[i] - '0'] == -1) return inf; ...
### Prompt Develop a solution in CPP to the problem described below: The time on the planet Lapituletti goes the same way it goes on Earth but a day lasts h hours and each hour lasts m minutes. The inhabitants of that planet use digital clocks similar to earth ones. Clocks display time in a format HH:MM (the number o...
#include <bits/stdc++.h> using namespace std; typedef pair<int, int> pii; #define int long long int bool isvalid( int H, int M, int h, int m ) { string hour = to_string(M); string minu = to_string(H); reverse(hour.begin(), hour.end()); reverse(minu.begin(), minu.end()); if( hour.length() == 1 ) ...
### Prompt Construct a Cpp code solution to the problem outlined: The time on the planet Lapituletti goes the same way it goes on Earth but a day lasts h hours and each hour lasts m minutes. The inhabitants of that planet use digital clocks similar to earth ones. Clocks display time in a format HH:MM (the number of h...
#include<iostream> #include<cstdio> #include<algorithm> #include<cstring> #include<cmath> #include<string> #include<map> #include<queue> #include<vector> #include<iomanip> typedef long long ll; #define re register //#define inf INT32_MAX //_LINE_ _TIME_ _DATE_ using namespace std; const int M = 9e4 + 5; const int N =...
### Prompt Construct a Cpp code solution to the problem outlined: The time on the planet Lapituletti goes the same way it goes on Earth but a day lasts h hours and each hour lasts m minutes. The inhabitants of that planet use digital clocks similar to earth ones. Clocks display time in a format HH:MM (the number of h...
#include <iostream> #include <vector> #include <iterator> #include <unordered_map> #include <map> #include <algorithm> #include <utility> #include <string> #include <stack> #include <set> using namespace std; typedef long long ll; set<int> st, stc; bool checksym(int h1, int h2, int m1, int m2, int h, int m){ i...
### Prompt In Cpp, your task is to solve the following problem: The time on the planet Lapituletti goes the same way it goes on Earth but a day lasts h hours and each hour lasts m minutes. The inhabitants of that planet use digital clocks similar to earth ones. Clocks display time in a format HH:MM (the number of hou...
// God put a smile upon your face <3 #include <bits/stdc++.h> #define slld(longvalue) scanf("%lld", &longvalue) #define ll long long #define ull unsigned long long #define pll pair < long long, long long > #define fastio ios_base:: sync_with_stdio(false); cin.tie(0); cout.tie(0) #define pb push_back #define bug ...
### Prompt In cpp, your task is to solve the following problem: The time on the planet Lapituletti goes the same way it goes on Earth but a day lasts h hours and each hour lasts m minutes. The inhabitants of that planet use digital clocks similar to earth ones. Clocks display time in a format HH:MM (the number of hou...
/* Powered by C++11. Author : Alex_Wei. */ #include <bits/stdc++.h> using namespace std; //#pragma GCC optimize(3) //#define int long long using uint = unsigned int; using ll = long long; using ull = unsigned long long; using db = double; using ld = long double; using pii = pair <int,int>; using pll = pair <ll,ll>...
### Prompt Your challenge is to write a Cpp solution to the following problem: The time on the planet Lapituletti goes the same way it goes on Earth but a day lasts h hours and each hour lasts m minutes. The inhabitants of that planet use digital clocks similar to earth ones. Clocks display time in a format HH:MM (th...
#include <map> #include <set> #include <cmath> #include <ctime> #include <queue> #include <stack> #include <bitset> #include <cstdio> #include <string> #include <random> #include <vector> #include <climits> #include <cstring> #include <cstdio> #include <numeric> #include <iostream> #include <algorithm> #include <functi...
### Prompt Your challenge is to write a cpp solution to the following problem: The time on the planet Lapituletti goes the same way it goes on Earth but a day lasts h hours and each hour lasts m minutes. The inhabitants of that planet use digital clocks similar to earth ones. Clocks display time in a format HH:MM (th...
#include<bits/stdc++.h> using namespace std; #define F first #define S second #define ll long long #define lld long double #define vc vector<ll> #define pb push_back #define all(a) a.begin(),a.end() const ll MOD=(1e9 +7); typedef pair<ll,ll>pairs; ll power(ll a, ll b){ll res=1;a=a%MOD;while(b>0){if(b&1){res=(res*a)%MOD...
### Prompt Please provide a Cpp coded solution to the problem described below: The time on the planet Lapituletti goes the same way it goes on Earth but a day lasts h hours and each hour lasts m minutes. The inhabitants of that planet use digital clocks similar to earth ones. Clocks display time in a format HH:MM (th...
#include <bits/stdc++.h> using namespace std; map<int, int> M = {{0, 0}, {1, 1}, {2, 5}, {3, -1}, {4, -1}, {5, 2}, {6, -1}, {7, -1}, {8, 8}, {9, -1...
### Prompt Generate a CPP solution to the following problem: The time on the planet Lapituletti goes the same way it goes on Earth but a day lasts h hours and each hour lasts m minutes. The inhabitants of that planet use digital clocks similar to earth ones. Clocks display time in a format HH:MM (the number of hours ...
#include<bits/stdc++.h> using namespace std; #define ll long long #define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); int main() { IOS ll t; cin>>t; while(t--) { ll h,m; cin>>h>>m; string s; cin>>s; ll h1=(s[0]-'0')*10+(s[1]-'0'),m1=(s[3]-'0')*10+(s[4]-'0')...
### Prompt Your task is to create a Cpp solution to the following problem: The time on the planet Lapituletti goes the same way it goes on Earth but a day lasts h hours and each hour lasts m minutes. The inhabitants of that planet use digital clocks similar to earth ones. Clocks display time in a format HH:MM (the nu...
#include <bits/stdc++.h> #define FOR(ii,aa,bb) for(int ii=aa;ii<bb;ii++) #define for0(ii,bb) FOR(ii,0,bb) #define for1(ii,bb) FOR(ii,1,bb+1) #define pb push_back #define mp make_pair #define st first #define nd second #define pii pair<int,int> #define piii pair<pii,int> #define sp " " #define nl "\n" #define all(x) x.b...
### Prompt Create a solution in CPP for the following problem: The time on the planet Lapituletti goes the same way it goes on Earth but a day lasts h hours and each hour lasts m minutes. The inhabitants of that planet use digital clocks similar to earth ones. Clocks display time in a format HH:MM (the number of hour...
#include <bits/stdc++.h> using namespace std; #define mp make_pair #define pb push_back typedef long long ll; ll f[10 + 7] = {0, 1, 5, INT_MAX, INT_MAX, 2, INT_MAX, INT_MAX, 8, INT_MAX}; void solve(){ int h, m, H, M, g, s, before; scanf("%d %d", &h, &m); scanf("%d:%d", &H, &M); before = H; do{ ...
### Prompt Develop a solution in CPP to the problem described below: The time on the planet Lapituletti goes the same way it goes on Earth but a day lasts h hours and each hour lasts m minutes. The inhabitants of that planet use digital clocks similar to earth ones. Clocks display time in a format HH:MM (the number o...
#include "bits/stdc++.h" using namespace std; using ll = long long; using pii = pair <int, int>; using pll = pair <ll, ll>; #define FIO() ios_base::sync_with_stdio(0);cin.tie(NULL); string orig = "0123456789"; string nw = "015xx2xx8x"; map <char, char> mp; int main() { FIO(); for (int i = 0; i < 10; i++) ...
### Prompt Create a solution in CPP for the following problem: The time on the planet Lapituletti goes the same way it goes on Earth but a day lasts h hours and each hour lasts m minutes. The inhabitants of that planet use digital clocks similar to earth ones. Clocks display time in a format HH:MM (the number of hour...
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef long double ld; #define int ll int h, m; int inv(int x) { if (x == 0) return 0; if (x == 1) return 1; if (x == 2) return 5; if (x == 3) return -1; if (x == 4) return -1; if (x == 5) return 2; if (x == 6) return -1; if (x == ...
### Prompt In cpp, your task is to solve the following problem: The time on the planet Lapituletti goes the same way it goes on Earth but a day lasts h hours and each hour lasts m minutes. The inhabitants of that planet use digital clocks similar to earth ones. Clocks display time in a format HH:MM (the number of hou...
#include<bits/stdc++.h> using namespace std; int main(){ int t; cin>>t; while(t--){ int h,m; cin>>h>>m; string s; cin>>s; int hh, mm; hh = (s[0]-'0')*10+(s[1]-'0'); mm = (s[3]-'0')*10+(s[4]-'0'); int a,b; bool flag=fal...
### Prompt Please formulate a CPP solution to the following problem: The time on the planet Lapituletti goes the same way it goes on Earth but a day lasts h hours and each hour lasts m minutes. The inhabitants of that planet use digital clocks similar to earth ones. Clocks display time in a format HH:MM (the number o...
#include<bits/stdc++.h> #include<iostream> #include<cstdio> #include<algorithm> #include<cmath> #include<cstring> #include<stack> using namespace std; inline bool read(int &num) { char in;bool IsN=false;in=getchar(); if(in==EOF) return false; while(in!='-'&&(in<'0'||in>'9')) in=getchar(); if(in=='-'){ ...
### Prompt Your challenge is to write a cpp solution to the following problem: The time on the planet Lapituletti goes the same way it goes on Earth but a day lasts h hours and each hour lasts m minutes. The inhabitants of that planet use digital clocks similar to earth ones. Clocks display time in a format HH:MM (th...
#include <bits/stdc++.h> using namespace std; #define ll long long #define dbg puts("It's Just Begining.Wait For The End!!!!!\n") #define CHECK(x) cout << (#x) << " is " << (x) <<"\n"; #define endl printf("\n") #define pi acos(-1) typedef pair<ll,ll> pii; #define pb push_back #define ms(a,b) memset(a, b, sizeof(a)) #de...
### Prompt Develop a solution in cpp to the problem described below: The time on the planet Lapituletti goes the same way it goes on Earth but a day lasts h hours and each hour lasts m minutes. The inhabitants of that planet use digital clocks similar to earth ones. Clocks display time in a format HH:MM (the number o...
#include<bits/stdc++.h> using namespace std; typedef long long ll; inline ll rd(){ char c=getchar();ll s=0;bool f=1; for(;c<'0'||c>'9';c=getchar())if(c=='-')f=0; for(;c>='0'&&c<='9';c=getchar())s=(s<<3)+(s<<1)+(c^48); return f?s:~(s-1); } inline void wt1(ll x){if(x>=10)wt1(x/10);putchar('0'+x%10);} inline void w...
### Prompt Create a solution in CPP for the following problem: The time on the planet Lapituletti goes the same way it goes on Earth but a day lasts h hours and each hour lasts m minutes. The inhabitants of that planet use digital clocks similar to earth ones. Clocks display time in a format HH:MM (the number of hour...
#include<bits/stdc++.h> using namespace std; typedef long long ll; int mod = 1e9+7; #define vi vector<int> #define pb push_back #define ff first #define ss second #define pi pair<int,int> #define all(v) (v).begin(),(v).end() #define mk(arr,n,type) type *arr=new type[n]; #define rrep(i, n) for(int i=n-1;i>=0;i--) #def...
### Prompt Generate a CPP solution to the following problem: The time on the planet Lapituletti goes the same way it goes on Earth but a day lasts h hours and each hour lasts m minutes. The inhabitants of that planet use digital clocks similar to earth ones. Clocks display time in a format HH:MM (the number of hours ...
#include <bits/stdc++.h> using namespace std; #define mod (int)1e9+7 #define MOD 998244353 #define ll long long #define mp make_pair #define deb(x) cout<< x << endl #define F first #define S second #def...
### Prompt In CPP, your task is to solve the following problem: The time on the planet Lapituletti goes the same way it goes on Earth but a day lasts h hours and each hour lasts m minutes. The inhabitants of that planet use digital clocks similar to earth ones. Clocks display time in a format HH:MM (the number of hou...
#include<bits/stdc++.h> #define FOR(i,a,b) for(int i=(a),i##z=(b);i<=i##z;i++) #define temT template<typename T> #define temT12 template<typename T1,typename T2> #define fi first #define se second using namespace std; typedef pair<int,int> pii; temT void clearDS(T &x){ T y; swap(x,y); } int T,H,M; int a[4],b[4]; voi...
### Prompt Your task is to create a CPP solution to the following problem: The time on the planet Lapituletti goes the same way it goes on Earth but a day lasts h hours and each hour lasts m minutes. The inhabitants of that planet use digital clocks similar to earth ones. Clocks display time in a format HH:MM (the nu...
#include <bits/stdc++.h> using namespace std; int main() { #ifndef ONLINE_JUDGE freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout); #endif int t; cin >> t; while (t--) { int h, m; cin >> h >> m; string time; cin >> time; ...
### Prompt Please create a solution in cpp to the following problem: The time on the planet Lapituletti goes the same way it goes on Earth but a day lasts h hours and each hour lasts m minutes. The inhabitants of that planet use digital clocks similar to earth ones. Clocks display time in a format HH:MM (the number o...
#include <bits/stdc++.h> #define int long long using namespace std; int t, h, m; char trash; int refdigit(int d) { if (d == 0) return 0; if (d == 1) return 1; if (d == 2) return 5; if (d == 3) return -1; if (d == 4) return -1; if (d == 5) return 2; if (d == 6) return -1; if (d == 7) r...
### Prompt In cpp, your task is to solve the following problem: The time on the planet Lapituletti goes the same way it goes on Earth but a day lasts h hours and each hour lasts m minutes. The inhabitants of that planet use digital clocks similar to earth ones. Clocks display time in a format HH:MM (the number of hou...
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef unsigned long long ull; typedef vector<vector<int>> graph; #define pii pair <ll, ll> //#define int ll #define double long double #define all(x) x.begin(), x.end() #define rall(x) x.rbegin(), x.rend() #define PI acos(-1.0) #define F first #de...
### Prompt Please provide a Cpp coded solution to the problem described below: The time on the planet Lapituletti goes the same way it goes on Earth but a day lasts h hours and each hour lasts m minutes. The inhabitants of that planet use digital clocks similar to earth ones. Clocks display time in a format HH:MM (th...
#include<bits/stdc++.h> using namespace std; #define ll int long long #define mp make_pair //#define for(i,n) for(int i=0;i<n;i++) #define F first #define S second #define fast ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); #define N 1000000007 #define pq priority queue #define pb push_back #define pf...
### Prompt In Cpp, your task is to solve the following problem: The time on the planet Lapituletti goes the same way it goes on Earth but a day lasts h hours and each hour lasts m minutes. The inhabitants of that planet use digital clocks similar to earth ones. Clocks display time in a format HH:MM (the number of hou...
#include <bits/stdc++.h> using namespace std; #define ll long long #define pll pair<ll, ll> int rf[10], h, m; bool isValid(string s) { int n = s.size(); for(char &x : s) { if(x == ':') continue; if(rf[x - '0'] == -1) return false; else { x = '0' + rf[x - '0']; ...
### Prompt Develop a solution in Cpp to the problem described below: The time on the planet Lapituletti goes the same way it goes on Earth but a day lasts h hours and each hour lasts m minutes. The inhabitants of that planet use digital clocks similar to earth ones. Clocks display time in a format HH:MM (the number o...
// || || |____| // // || || || // // \\__// || // #include<bits/stdc++.h> #pragma GCC optimize("Ofast") #pragma GCC target("avx,avx2,fma") #pragma GCC optimization ("unroll-loops") typedef long long int ll; typedef long double ld; #include <bitset> #define F first #define S second #define I insert #defin...
### Prompt Develop a solution in CPP to the problem described below: The time on the planet Lapituletti goes the same way it goes on Earth but a day lasts h hours and each hour lasts m minutes. The inhabitants of that planet use digital clocks similar to earth ones. Clocks display time in a format HH:MM (the number o...
#include <iostream> #include <cstring> #include <cstdio> #include <algorithm> #include <queue> #include <unordered_map> #define x first #define y second using namespace std; typedef pair<int, int> PII; const int N = 100010; int n, m; int s[] = {0, 1, 2, 5, 8}; bool get(int n) { for (int i = 0; i <= 4; i ++ ) ...
### Prompt Please create a solution in CPP to the following problem: The time on the planet Lapituletti goes the same way it goes on Earth but a day lasts h hours and each hour lasts m minutes. The inhabitants of that planet use digital clocks similar to earth ones. Clocks display time in a format HH:MM (the number o...
#include<bits/stdc++.h> using namespace std; int findnext(int value){ int checkarr[10]={0,1,5,-1,-1,2,-1,-1,8,-1}; int tens = value/10; int ones = value%10; if(checkarr[tens]!=-1 && checkarr[ones]!=-1){ return checkarr[ones]*10+checkarr[tens]; } else{ return -1; } } void ch...
### Prompt Please create a solution in cpp to the following problem: The time on the planet Lapituletti goes the same way it goes on Earth but a day lasts h hours and each hour lasts m minutes. The inhabitants of that planet use digital clocks similar to earth ones. Clocks display time in a format HH:MM (the number o...
#include<bits/stdc++.h> using namespace std; string s; int n,m=0,a,b,a1[3],b1[3]; char c; int main(){ cin>>n; for(int i=1;i<=n;i++){ int d=0,e=0; int flag=1; cin>>a>>b; cin>>s; for(int j=0;j<=1;j++){ d*=10; d+=(s[j]-'0'); } for(int j=3;j<=4;j++){ e*=10; e+=(s[j]-'0'); } for(int j=1;j<=a*...
### Prompt Your challenge is to write a cpp solution to the following problem: The time on the planet Lapituletti goes the same way it goes on Earth but a day lasts h hours and each hour lasts m minutes. The inhabitants of that planet use digital clocks similar to earth ones. Clocks display time in a format HH:MM (th...
#include<bits/stdc++.h> using namespace std; int lh, lm, hh, mm; map<int, int> mi; int mp[10] = {0,1,2,5,8}; inline void init() { mi[0] = 0; mi[1] = 1; mi[2] = 5; mi[5] = 2; mi[8] = 8; } bool judge(int a, int b, int c, int d) {//判断时间是否符合题意 if(a * 10 + b >= lh) return false; if(c * 10 + d >= lm) return false; re...
### Prompt In Cpp, your task is to solve the following problem: The time on the planet Lapituletti goes the same way it goes on Earth but a day lasts h hours and each hour lasts m minutes. The inhabitants of that planet use digital clocks similar to earth ones. Clocks display time in a format HH:MM (the number of hou...
#include <bits/stdc++.h> using namespace std; bool t[10000]; void solve(void) { int h, m, HH, MM, i, j, l; scanf("%d %d %d:%d", &h, &m, &HH, &MM); memset(t, false, sizeof(t)); for (i = 0; i < h; i++) for (j = 0; j < m; j++) { string p = to_string(i / 10) + to_string(i % 10) + to_string(j / 10) + to_str...
### Prompt Develop a solution in Cpp to the problem described below: The time on the planet Lapituletti goes the same way it goes on Earth but a day lasts h hours and each hour lasts m minutes. The inhabitants of that planet use digital clocks similar to earth ones. Clocks display time in a format HH:MM (the number o...
#include<bits/stdc++.h> using namespace std; typedef long long ll; typedef long double ld; const ll INF = 9223372036854775807; const ll MOD = 1000000007; const long double PI = acos(-1); #define pb push_back #define mp make_pair #define all(v) v.begin(), v.end() #define o0(a) cout<<a<<" " #define o1(a) cout<<a<<"\n" #d...
### Prompt Generate a Cpp solution to the following problem: The time on the planet Lapituletti goes the same way it goes on Earth but a day lasts h hours and each hour lasts m minutes. The inhabitants of that planet use digital clocks similar to earth ones. Clocks display time in a format HH:MM (the number of hours ...
#include <bits/stdc++.h> using namespace std; #define time cerr << "time taken : " << (float)clock() / CLOCKS_PER_SEC << " secs" << endl; #define fast \ ios_base::sync_with_stdio(false); \ cin.tie(NULL); #define endl "\n" #define mem1(a) memset(a,-1,sizeof(a)) ; typedef unsigned long long ...
### Prompt Create a solution in cpp for the following problem: The time on the planet Lapituletti goes the same way it goes on Earth but a day lasts h hours and each hour lasts m minutes. The inhabitants of that planet use digital clocks similar to earth ones. Clocks display time in a format HH:MM (the number of hour...