output
stringlengths
52
181k
instruction
stringlengths
296
182k
#include <bits/stdc++.h> using namespace std; int main() { int n, k, i, j, tot = 0; scanf("%d%d", &n, &k); if (n * (n - 1) / 2 > k) { for (i = 1; i <= n && tot < n; i++) { for (j = i + 1; j <= n && tot < n; j++, tot++) { printf("%d %d\n", i, j); } } } else puts("no solution"); ...
### Prompt Develop a solution in cpp to the problem described below: Currently Tiny is learning Computational Geometry. When trying to solve a problem called "The Closest Pair Of Points In The Plane", he found that a code which gave a wrong time complexity got Accepted instead of Time Limit Exceeded. The problem is ...
#include <bits/stdc++.h> using namespace std; int main() { int n, k; scanf("%d", &n); scanf("%d", &k); int tComplexity = n * (n - 1) / 2; if (tComplexity > k) { for (int i = 0; i < n; i++) { printf("%d %d\n", 0, i); } } else printf("%s\n", "no solution"); return 0; }
### Prompt Please create a solution in Cpp to the following problem: Currently Tiny is learning Computational Geometry. When trying to solve a problem called "The Closest Pair Of Points In The Plane", he found that a code which gave a wrong time complexity got Accepted instead of Time Limit Exceeded. The problem is ...
#include <bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); long long t; t = 1; while (t--) { long long n, k, i; cin >> n >> k; if (k >= (n * (n - 1)) / 2) cout << "no solution"; else { long long a[n], b[n]; for (i = 0; i < n; i...
### Prompt Your challenge is to write a CPP solution to the following problem: Currently Tiny is learning Computational Geometry. When trying to solve a problem called "The Closest Pair Of Points In The Plane", he found that a code which gave a wrong time complexity got Accepted instead of Time Limit Exceeded. The p...
#include <bits/stdc++.h> using namespace std; int main() { int n, k; scanf("%d%d", &n, &k); if (n * (n - 1) / 2 > k) { for (int i = 0; i < n; i++) printf("0 %d\n", i); } else printf("no solution"); return 0; }
### Prompt Your challenge is to write a CPP solution to the following problem: Currently Tiny is learning Computational Geometry. When trying to solve a problem called "The Closest Pair Of Points In The Plane", he found that a code which gave a wrong time complexity got Accepted instead of Time Limit Exceeded. The p...
#include <bits/stdc++.h> using namespace std; long long n, k; int main() { cin >> n >> k; if (((n - 1) * n) / 2 <= k) { cout << "no solution" << endl; return 0; } for (int i = 0; i < n; i++) cout << 0 << " " << i << endl; return 0; }
### Prompt Your task is to create a CPP solution to the following problem: Currently Tiny is learning Computational Geometry. When trying to solve a problem called "The Closest Pair Of Points In The Plane", he found that a code which gave a wrong time complexity got Accepted instead of Time Limit Exceeded. The probl...
#include <bits/stdc++.h> int main() { int n, k; while (scanf("%d%d", &n, &k) != EOF) { if (k >= n * (n - 1) / 2) { printf("no solution\n"); } else { for (int i = 0; i < n; i++) { printf("0 %d\n", i); } } } return 0; }
### Prompt Your task is to create a Cpp solution to the following problem: Currently Tiny is learning Computational Geometry. When trying to solve a problem called "The Closest Pair Of Points In The Plane", he found that a code which gave a wrong time complexity got Accepted instead of Time Limit Exceeded. The probl...
#include <bits/stdc++.h> using namespace std; int main() { long long n, k; cin >> n >> k; if (n * (n - 1) / 2 <= k) { cout << "no solution" << endl; } else { for (int i = 0; i < n; i++) { cout << "0 " << i << endl; } } }
### Prompt Construct a cpp code solution to the problem outlined: Currently Tiny is learning Computational Geometry. When trying to solve a problem called "The Closest Pair Of Points In The Plane", he found that a code which gave a wrong time complexity got Accepted instead of Time Limit Exceeded. The problem is the...
#include <bits/stdc++.h> using namespace std; int main() { int n, k; cin >> n >> k; if (n * (n - 1) / 2 <= k) cout << "no solution"; else for (int i = 1; i <= n; i++) cout << "0 " << i << '\n'; }
### Prompt Please formulate a cpp solution to the following problem: Currently Tiny is learning Computational Geometry. When trying to solve a problem called "The Closest Pair Of Points In The Plane", he found that a code which gave a wrong time complexity got Accepted instead of Time Limit Exceeded. The problem is ...
#include <bits/stdc++.h> using namespace std; int main() { int n, k; scanf("%d %d", &n, &k); if (n * 1LL * (n - 1) / 2 <= k) printf("no solution\n"); else { for (int i = 0; i < n; i++) printf("%d %d\n", 0, i); } return 0; }
### Prompt Create a solution in cpp for the following problem: Currently Tiny is learning Computational Geometry. When trying to solve a problem called "The Closest Pair Of Points In The Plane", he found that a code which gave a wrong time complexity got Accepted instead of Time Limit Exceeded. The problem is the fo...
#include <bits/stdc++.h> using namespace std; int main() { int n, k, i; cin >> n >> k; if (k >= n * (n - 1) / 2) { cout << "no solution" << endl; return 0; } for (i = 1; i <= n; i++) cout << "0 " << i << endl; return 0; }
### Prompt Please provide a CPP coded solution to the problem described below: Currently Tiny is learning Computational Geometry. When trying to solve a problem called "The Closest Pair Of Points In The Plane", he found that a code which gave a wrong time complexity got Accepted instead of Time Limit Exceeded. The p...
#include <bits/stdc++.h> using namespace std; inline long long mod(long long n, long long m = (long long)(1e9 + 7)) { return (n % m + m) % m; } inline long long gcd(long long a, long long b) { return (b == 0LL) ? a : gcd(b, a % b); } inline long long modPow(long long a, long long b, long lon...
### Prompt Construct a cpp code solution to the problem outlined: Currently Tiny is learning Computational Geometry. When trying to solve a problem called "The Closest Pair Of Points In The Plane", he found that a code which gave a wrong time complexity got Accepted instead of Time Limit Exceeded. The problem is the...
#include <bits/stdc++.h> using namespace std; long long int modpow(long long int a, long long int n, long long int temp) { long long int res = 1; while (n > 0) { res = (res * res) % temp; if (n & 1) res = (res * a) % temp; n /= 2; } return res; } long long int gcd(long long int a, long long int b) {...
### Prompt Please formulate a CPP solution to the following problem: Currently Tiny is learning Computational Geometry. When trying to solve a problem called "The Closest Pair Of Points In The Plane", he found that a code which gave a wrong time complexity got Accepted instead of Time Limit Exceeded. The problem is ...
#include <bits/stdc++.h> int main() { int n, k, i; scanf("%d %d", &n, &k); if (k >= n * (n - 1) / 2) { puts("no solution"); } else { for (i = 0; i < n; i++) printf("0 %d\n", i); } return 0; }
### Prompt Construct a cpp code solution to the problem outlined: Currently Tiny is learning Computational Geometry. When trying to solve a problem called "The Closest Pair Of Points In The Plane", he found that a code which gave a wrong time complexity got Accepted instead of Time Limit Exceeded. The problem is the...
#include <bits/stdc++.h> using namespace std; int main() { int n, k; cin >> n >> k; if (n * (n - 1) / 2 > k) { for (int i = 0; i < n; i++) { printf("%d %d\n", 0, i); } } else { cout << "no solution"; } }
### Prompt Generate a Cpp solution to the following problem: Currently Tiny is learning Computational Geometry. When trying to solve a problem called "The Closest Pair Of Points In The Plane", he found that a code which gave a wrong time complexity got Accepted instead of Time Limit Exceeded. The problem is the foll...
#include <bits/stdc++.h> using namespace std; const int INFint = 2147483647; const long long INF = 9223372036854775807ll; const long long MOD = 1000000007ll; int main() { ios_base::sync_with_stdio(0); long long n, k; cin >> n >> k; if (n * (n - 1) / 2 <= k) { cout << "no solution" << endl; return 0; }...
### Prompt Please provide a Cpp coded solution to the problem described below: Currently Tiny is learning Computational Geometry. When trying to solve a problem called "The Closest Pair Of Points In The Plane", he found that a code which gave a wrong time complexity got Accepted instead of Time Limit Exceeded. The p...
#include <bits/stdc++.h> using namespace std; int main() { long long int t, i, j, n, k, mx; mx = 1000000000LL; cin >> n >> k; t = (n * (n - 1)) / 2; if (t <= k) { cout << "no solution"; } else { for (i = 0; i < n - 1; i++) { cout << "0 " << i << "\n"; } cout << mx << " " << mx; } r...
### Prompt Please create a solution in CPP to the following problem: Currently Tiny is learning Computational Geometry. When trying to solve a problem called "The Closest Pair Of Points In The Plane", he found that a code which gave a wrong time complexity got Accepted instead of Time Limit Exceeded. The problem is ...
#include <bits/stdc++.h> using namespace std; int main() { long n, k; cin >> n >> k; if (k >= n * (n - 1) / 2) { cout << "no solution"; return 0; } for (long i = 0; i < n; i++) cout << "0 " << i << endl; return 0; }
### Prompt Please formulate a cpp solution to the following problem: Currently Tiny is learning Computational Geometry. When trying to solve a problem called "The Closest Pair Of Points In The Plane", he found that a code which gave a wrong time complexity got Accepted instead of Time Limit Exceeded. The problem is ...
#include <bits/stdc++.h> int main() { int n, k; scanf("%d%d", &n, &k); if (k >= n * (n - 1) / 2) { printf("no solution\n"); return 0; } for (int i = 0; i < n; ++i) printf("0 %d\n", i); }
### Prompt Develop a solution in cpp to the problem described below: Currently Tiny is learning Computational Geometry. When trying to solve a problem called "The Closest Pair Of Points In The Plane", he found that a code which gave a wrong time complexity got Accepted instead of Time Limit Exceeded. The problem is ...
#include <bits/stdc++.h> using namespace std; int main() { int n, k; cin >> n >> k; if (n * (n - 1) / 2 <= k) { cout << "no solution"; } else { for (int i = 0; i < n; i++) cout << "0 " << i << "\n"; } return 0; }
### Prompt Please formulate a Cpp solution to the following problem: Currently Tiny is learning Computational Geometry. When trying to solve a problem called "The Closest Pair Of Points In The Plane", he found that a code which gave a wrong time complexity got Accepted instead of Time Limit Exceeded. The problem is ...
#include <bits/stdc++.h> using namespace std; int n, k, p1, p2; int main() { cin >> n >> k; int tot = 0; for (int i = 1; i <= n; ++i) for (int j = i + 1; j <= n; ++j) ++tot; if (tot > k) { for (int i = 0; i < n; ++i) { cout << 0 << ' ' << i << endl; } } else cout << "no solution" << endl...
### Prompt In cpp, your task is to solve the following problem: Currently Tiny is learning Computational Geometry. When trying to solve a problem called "The Closest Pair Of Points In The Plane", he found that a code which gave a wrong time complexity got Accepted instead of Time Limit Exceeded. The problem is the f...
#include <bits/stdc++.h> using namespace std; int main() { int n, k; cin >> n >> k; if (k >= (n * (n - 1)) / 2) { cout << "no solution"; return 0; } for (int i = 0; i < n; i++) { cout << 0 << ' ' << i << endl; } return 0; }
### Prompt Create a solution in Cpp for the following problem: Currently Tiny is learning Computational Geometry. When trying to solve a problem called "The Closest Pair Of Points In The Plane", he found that a code which gave a wrong time complexity got Accepted instead of Time Limit Exceeded. The problem is the fo...
#include <bits/stdc++.h> using namespace std; char a[1000]; void solve() { int n, k; while (scanf("%d%d", &n, &k) != EOF) { if (((1 + n - 1) * (n - 1) / 2) <= k) { printf("no solution\n"); continue; } else { int temp = 0; for (int i = 1; i <= n; i++) { printf("0 %d\n", i); ...
### Prompt Construct a CPP code solution to the problem outlined: Currently Tiny is learning Computational Geometry. When trying to solve a problem called "The Closest Pair Of Points In The Plane", he found that a code which gave a wrong time complexity got Accepted instead of Time Limit Exceeded. The problem is the...
#include <bits/stdc++.h> using namespace std; string c; int main() { int i, j, k, n, m, l; scanf("%d%d", &n, &k); if (n * (n - 1) / 2 <= k) { puts("no solution"); return 0; } for (i = 1; i <= n; i++) printf("%d %d\n", 0, i); return 0; }
### Prompt Generate a Cpp solution to the following problem: Currently Tiny is learning Computational Geometry. When trying to solve a problem called "The Closest Pair Of Points In The Plane", he found that a code which gave a wrong time complexity got Accepted instead of Time Limit Exceeded. The problem is the foll...
#include <bits/stdc++.h> using namespace std; struct node { int x; int y; }; node point[2000 + 10]; int n; int sum; void solve() { for (int i = 2; i <= n; ++i) { point[i].y = point[i - 1].y + 1; } for (int i = 1; i <= n; ++i) for (int j = i + 1; j <= n; ++j) ++sum; } int main() { int k; int tem; ...
### Prompt Please formulate a CPP solution to the following problem: Currently Tiny is learning Computational Geometry. When trying to solve a problem called "The Closest Pair Of Points In The Plane", he found that a code which gave a wrong time complexity got Accepted instead of Time Limit Exceeded. The problem is ...
#include <bits/stdc++.h> using namespace std; const long long N = 1e6 + 7; long long n, k; int32_t main() { ios_base::sync_with_stdio(false); cin.tie(NULL); cin >> n >> k; long long mx = n * (n - 1) / 2; if (k >= mx) return cout << "no solution", 0; long long y = 0; for (long long i = 1; i < n; i++, y += ...
### Prompt Develop a solution in cpp to the problem described below: Currently Tiny is learning Computational Geometry. When trying to solve a problem called "The Closest Pair Of Points In The Plane", he found that a code which gave a wrong time complexity got Accepted instead of Time Limit Exceeded. The problem is ...
#include <bits/stdc++.h> using namespace std; inline long long inp() { long long n = 0, s = 1; char p = getchar(); if (p == '-') s = -1; while ((p < '0' || p > '9') && p != EOF && p != '-') p = getchar(); if (p == '-') s = -1, p = getchar(); while (p >= '0' && p <= '9') { n = (n << 3) + (n << 1) + (p - ...
### Prompt Generate a cpp solution to the following problem: Currently Tiny is learning Computational Geometry. When trying to solve a problem called "The Closest Pair Of Points In The Plane", he found that a code which gave a wrong time complexity got Accepted instead of Time Limit Exceeded. The problem is the foll...
#include <bits/stdc++.h> int main() { int n, k; scanf("%d%d", &n, &k); if ((n * (n - 1) / 2) <= k) { printf("no solution\n"); } else { int i; for (i = 0; i < n; i++) { printf("0 %d\n", i); } } }
### Prompt Please provide a CPP coded solution to the problem described below: Currently Tiny is learning Computational Geometry. When trying to solve a problem called "The Closest Pair Of Points In The Plane", he found that a code which gave a wrong time complexity got Accepted instead of Time Limit Exceeded. The p...
#include <bits/stdc++.h> using namespace std; template <class T> inline T Max(T a, T b) { if (a > b) return a; else return b; } template <class T> inline T Min(T a, T b) { if (a < b) return a; else return b; } template <class T> inline T gcd(T a, T b) { if (a < 0) return gcd(-a, b); if (b < ...
### Prompt Please provide a Cpp coded solution to the problem described below: Currently Tiny is learning Computational Geometry. When trying to solve a problem called "The Closest Pair Of Points In The Plane", he found that a code which gave a wrong time complexity got Accepted instead of Time Limit Exceeded. The p...
#include <bits/stdc++.h> int x[2010], y[2010]; using namespace std; int main() { int n, k; cin >> n >> k; for (int i = 0; i < n; ++i) x[i] = 0, y[i] = i; int c = 0, tot = 0; int d = (1 << 29); for (int i = 0; i < n; ++i) { for (int j = i + 1; j < n; ++j) { tot++; int t = (x[j] - x[i]) * (x[j...
### Prompt Create a solution in Cpp for the following problem: Currently Tiny is learning Computational Geometry. When trying to solve a problem called "The Closest Pair Of Points In The Plane", he found that a code which gave a wrong time complexity got Accepted instead of Time Limit Exceeded. The problem is the fo...
#include <bits/stdc++.h> int main() { int cn = 0, i, n, k, p; scanf("%d%d", &n, &k); if (k >= (n * (n - 1)) / 2) { printf("no solution\n"); return (0); } p = n; while (p--) { printf("0 %d\n", cn); cn++; } return (0); }
### Prompt Please formulate a cpp solution to the following problem: Currently Tiny is learning Computational Geometry. When trying to solve a problem called "The Closest Pair Of Points In The Plane", he found that a code which gave a wrong time complexity got Accepted instead of Time Limit Exceeded. The problem is ...
#include <bits/stdc++.h> using namespace std; int n, k; int main() { cin >> n >> k; int temp = n * (n - 1) / 2; if (temp <= k) { cout << "no solution\n"; return 0; } for (int i = 0; i < n; i++) { cout << 0 << " " << i << endl; } return 0; }
### Prompt In cpp, your task is to solve the following problem: Currently Tiny is learning Computational Geometry. When trying to solve a problem called "The Closest Pair Of Points In The Plane", he found that a code which gave a wrong time complexity got Accepted instead of Time Limit Exceeded. The problem is the f...
#include <bits/stdc++.h> using namespace std; const int MAX = 2001; int N, K; int main() { scanf("%d%d", &N, &K); if (K >= N * (N - 1) / 2) { puts("no solution"); } else { for (int i = 0; i < N; i++) { printf("0 %d\n", i); } } return 0; }
### Prompt Please provide a Cpp coded solution to the problem described below: Currently Tiny is learning Computational Geometry. When trying to solve a problem called "The Closest Pair Of Points In The Plane", he found that a code which gave a wrong time complexity got Accepted instead of Time Limit Exceeded. The p...
#include <bits/stdc++.h> using namespace std; #pragma warning(disable : 4996) struct point { int x, y; }; int n, k; int dx[2010], dy[2010]; int tot; int sqr(int x) { return x * x; }; int imin(int a, int b) { if (a < b) return a; return b; }; void algo() { int d = 2100000000; for (int i = 0; i < n; i++) fo...
### Prompt Construct a CPP code solution to the problem outlined: Currently Tiny is learning Computational Geometry. When trying to solve a problem called "The Closest Pair Of Points In The Plane", he found that a code which gave a wrong time complexity got Accepted instead of Time Limit Exceeded. The problem is the...
#include <bits/stdc++.h> using namespace std; int main() { int n, i, k; int tot; cin >> n >> k; tot = (n * (n - 1)) / 2; if (tot <= k) { cout << "no solution\n"; return 0; } for (i = 0; i < n; i++) { cout << i << " " << i * 100000 << "\n"; } return 0; }
### Prompt Your task is to create a Cpp solution to the following problem: Currently Tiny is learning Computational Geometry. When trying to solve a problem called "The Closest Pair Of Points In The Plane", he found that a code which gave a wrong time complexity got Accepted instead of Time Limit Exceeded. The probl...
#include <bits/stdc++.h> using namespace std; int main() { long long n, k; cin >> n >> k; long long tot; tot = (n * (n - 1)) / 2; if (tot <= k) { cout << "no solution"; return 0; } for (int i = 0; i < n; i++) cout << 0 << " " << i << endl; return 0; }
### Prompt Your task is to create a CPP solution to the following problem: Currently Tiny is learning Computational Geometry. When trying to solve a problem called "The Closest Pair Of Points In The Plane", he found that a code which gave a wrong time complexity got Accepted instead of Time Limit Exceeded. The probl...
#include <bits/stdc++.h> using namespace std; int main() { int n, k; cin >> n >> k; int l = n * (n - 1); l /= 2; if (k >= l) { cout << "no solution\n"; return 0; } pair<int, int> p; vector<pair<int, int> > v; int a = 0, b = 0; for (int i = 0; i < n; i++) { p = make_pair(b, a); v.push...
### Prompt Create a solution in CPP for the following problem: Currently Tiny is learning Computational Geometry. When trying to solve a problem called "The Closest Pair Of Points In The Plane", he found that a code which gave a wrong time complexity got Accepted instead of Time Limit Exceeded. The problem is the fo...
#include <bits/stdc++.h> #pragma comment(linker, "/STACK:256777216") using namespace std; int main() { int n, k; cin >> n >> k; if (2 * k >= n * (n - 1)) { puts("no solution"); return 0; } for (int i = 1; i <= n; i++) { cout << 0 << " " << i << endl; } return 0; }
### Prompt Please create a solution in Cpp to the following problem: Currently Tiny is learning Computational Geometry. When trying to solve a problem called "The Closest Pair Of Points In The Plane", he found that a code which gave a wrong time complexity got Accepted instead of Time Limit Exceeded. The problem is ...
#include <bits/stdc++.h> using namespace std; int main() { int n, k; cin >> n >> k; int cnt = (n * (n - 1)) / 2; if (cnt <= k) cout << "no solution"; else { for (int i = 1; i <= n; i++) { cout << 0 << ' ' << i << '\n'; } } }
### Prompt Your task is to create a cpp solution to the following problem: Currently Tiny is learning Computational Geometry. When trying to solve a problem called "The Closest Pair Of Points In The Plane", he found that a code which gave a wrong time complexity got Accepted instead of Time Limit Exceeded. The probl...
#include <bits/stdc++.h> using namespace std; int main() { int t, n, k, ax, bx, tot; cin >> n >> k; tot = (n * (n + 1)) / 2 - n; if (tot <= k) cout << "no solution" << endl; else { for (int i = 1; i <= n; i++) { cout << 0 << " " << i << endl; } } return 0; }
### Prompt Your task is to create a cpp solution to the following problem: Currently Tiny is learning Computational Geometry. When trying to solve a problem called "The Closest Pair Of Points In The Plane", he found that a code which gave a wrong time complexity got Accepted instead of Time Limit Exceeded. The probl...
#include <bits/stdc++.h> using namespace std; unsigned long long mod = 1000000007; int main() { int nop, k; cin >> nop >> k; int max_possi = nop * (nop - 1); max_possi /= 2; if (k >= max_possi) cout << "no solution" << "\n"; else { int x = 0, y = 0; while (nop--) cout << x << " " << y++...
### Prompt Develop a solution in Cpp to the problem described below: Currently Tiny is learning Computational Geometry. When trying to solve a problem called "The Closest Pair Of Points In The Plane", he found that a code which gave a wrong time complexity got Accepted instead of Time Limit Exceeded. The problem is ...
#include <bits/stdc++.h> using namespace std; long long distance(long long x1, long long y1, long long x2, long long y2) { return sqrt(pow(x2 - x1, 2) + pow(y2 - y1, 2)); } int main() { long long n, k, d, x, y, tot = 0; cin >> n >> k; for (int i = 1; i <= n; i++) { for (int j = i + 1; j <= n; j++) { t...
### Prompt Construct a CPP code solution to the problem outlined: Currently Tiny is learning Computational Geometry. When trying to solve a problem called "The Closest Pair Of Points In The Plane", he found that a code which gave a wrong time complexity got Accepted instead of Time Limit Exceeded. The problem is the...
#include <bits/stdc++.h> using namespace std; int main() { int n, k; cin >> n >> k; if (n * (n - 1) <= 2 * k) cout << "no solution" << endl; else for (int y = 0; y < n; y++) { cout << 0 << " " << y << endl; } return 0; }
### Prompt Your task is to create a Cpp solution to the following problem: Currently Tiny is learning Computational Geometry. When trying to solve a problem called "The Closest Pair Of Points In The Plane", he found that a code which gave a wrong time complexity got Accepted instead of Time Limit Exceeded. The probl...
#include <bits/stdc++.h> using namespace std; long n, k; int main() { ios_base::sync_with_stdio(0); cin >> n >> k; if (n * (n - 1) / 2 <= k) cout << "no solution" << endl; else for (int i = 0; i < n; i++) cout << 0 << " " << i << endl; cin.get(); cin.get(); return 0; }
### Prompt Your challenge is to write a cpp solution to the following problem: Currently Tiny is learning Computational Geometry. When trying to solve a problem called "The Closest Pair Of Points In The Plane", he found that a code which gave a wrong time complexity got Accepted instead of Time Limit Exceeded. The p...
#include <bits/stdc++.h> using namespace std; int main() { int n, k; cin >> n >> k; int x = n - 1, tot = 0; tot = (x * (x + 1)) / 2; if (tot <= k) return cout << "no solution" << endl, 0; for (int i = 0; i < n; i++) cout << 1 << " " << i << endl; return 0; }
### Prompt Create a solution in CPP for the following problem: Currently Tiny is learning Computational Geometry. When trying to solve a problem called "The Closest Pair Of Points In The Plane", he found that a code which gave a wrong time complexity got Accepted instead of Time Limit Exceeded. The problem is the fo...
#include <bits/stdc++.h> using namespace std; int main() { int n, tot; scanf("%d%d", &n, &tot); if (n * (n - 1) / 2 <= tot) { printf("no solution"); return 0; } for (int i = 0; i < n; i++) printf("%d %d\n", 0, i); return 0; }
### Prompt Please provide a Cpp coded solution to the problem described below: Currently Tiny is learning Computational Geometry. When trying to solve a problem called "The Closest Pair Of Points In The Plane", he found that a code which gave a wrong time complexity got Accepted instead of Time Limit Exceeded. The p...
#include <bits/stdc++.h> using namespace std; int main() { int n, k; cin >> n >> k; int tot = (n) * (n - 1); tot /= 2; if (tot <= k) cout << "no solution" << endl; else { for (int i = 0; i < n; ++i) cout << 1 << " " << i + 1 << endl; } }
### Prompt Please create a solution in cpp to the following problem: Currently Tiny is learning Computational Geometry. When trying to solve a problem called "The Closest Pair Of Points In The Plane", he found that a code which gave a wrong time complexity got Accepted instead of Time Limit Exceeded. The problem is ...
#include <bits/stdc++.h> using namespace std; double distance(pair<int, int> a, pair<int, int> b) { return pow(a.first - b.first, 2.0) + pow(a.second - b.second, 2.0); } int gettot(vector<pair<int, int> > v) { sort(v.begin(), v.end()); double d = 1e100; int tot = 0; for (int i = 0; i < v.size(); i++) { fo...
### Prompt Your task is to create a Cpp solution to the following problem: Currently Tiny is learning Computational Geometry. When trying to solve a problem called "The Closest Pair Of Points In The Plane", he found that a code which gave a wrong time complexity got Accepted instead of Time Limit Exceeded. The probl...
#include <bits/stdc++.h> using namespace std; int main() { int n, k; cin >> n >> k; if ((n * (n - 1)) / 2 <= k) { cout << "no solution\n"; } else { for (int i = 0; i < n; i++) { cout << "0 " << i << endl; } } return 0; }
### Prompt Your challenge is to write a Cpp solution to the following problem: Currently Tiny is learning Computational Geometry. When trying to solve a problem called "The Closest Pair Of Points In The Plane", he found that a code which gave a wrong time complexity got Accepted instead of Time Limit Exceeded. The p...
#include <bits/stdc++.h> using namespace std; int main() { int i, j, n; long long k; while (~scanf("%d%I64d", &n, &k)) { long long t = (long long)n * (n - 1) / 2; if (k >= t) { printf("no solution\n"); continue; } int y = 1; for (i = 0; i < n; i++) printf("%d %d\n", 0, y), y++; }...
### Prompt Generate a cpp solution to the following problem: Currently Tiny is learning Computational Geometry. When trying to solve a problem called "The Closest Pair Of Points In The Plane", he found that a code which gave a wrong time complexity got Accepted instead of Time Limit Exceeded. The problem is the foll...
#include <bits/stdc++.h> using namespace std; const int N = 105; const int M = 505; const int MOD = int(1e9) + 7; const int INF = 0x3f3f3f3f; const double EPS = 1e-9; const double PI = acos(-1.0); const int dx[] = {-1, 1, 0, 0}; const int dy[] = {0, 0, -1, 1}; template <class T> inline T Min(T a, T b) { return a < b ...
### Prompt Please create a solution in cpp to the following problem: Currently Tiny is learning Computational Geometry. When trying to solve a problem called "The Closest Pair Of Points In The Plane", he found that a code which gave a wrong time complexity got Accepted instead of Time Limit Exceeded. The problem is ...
#include <bits/stdc++.h> using namespace std; int main() { int n, k; cin >> n >> k; if (n * (n - 1) / 2 <= k) cout << "no solution"; else for (int i = 0; i < n; ++i) cout << "0 " << i << endl; return 0; }
### Prompt Please formulate a CPP solution to the following problem: Currently Tiny is learning Computational Geometry. When trying to solve a problem called "The Closest Pair Of Points In The Plane", he found that a code which gave a wrong time complexity got Accepted instead of Time Limit Exceeded. The problem is ...
#include <bits/stdc++.h> int main() { int n, k, i; scanf("%d %d", &n, &k); if (k < n * (n - 1) / 2) { for (i = 0; i < n; i++) printf("%d %d\n", 0, 3 * i); } else puts("no solution"); return 0; }
### Prompt Your task is to create a Cpp solution to the following problem: Currently Tiny is learning Computational Geometry. When trying to solve a problem called "The Closest Pair Of Points In The Plane", he found that a code which gave a wrong time complexity got Accepted instead of Time Limit Exceeded. The probl...
#include <bits/stdc++.h> using namespace std; int main() { int n; long long k; cin >> n >> k; int ans = (n * (n - 1)) / 2; if (k >= ans) { cout << "no solution" << endl; return 0; } else { for (int i = 0; i < n; i++) { cout << 0 << ' ' << i << endl; } } }
### Prompt Develop a solution in Cpp to the problem described below: Currently Tiny is learning Computational Geometry. When trying to solve a problem called "The Closest Pair Of Points In The Plane", he found that a code which gave a wrong time complexity got Accepted instead of Time Limit Exceeded. The problem is ...
#include <bits/stdc++.h> using namespace std; int k, n; int main() { int i, j; scanf("%d%d", &n, &k); if (k >= (n * (n - 1) / 2)) puts("no solution"); else { for (i = 1; i <= n; ++i) printf("0 %d\n", i); } return 0; }
### Prompt Construct a Cpp code solution to the problem outlined: Currently Tiny is learning Computational Geometry. When trying to solve a problem called "The Closest Pair Of Points In The Plane", he found that a code which gave a wrong time complexity got Accepted instead of Time Limit Exceeded. The problem is the...
#include <bits/stdc++.h> using namespace std; string mirror = "AHIMOTUVWXY"; string letter = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; const int mxn = 1e6 + 5; const int mod = 1e9 + 7; int main() { long long n, m, i, j, k, x, y, t; cin >> n >> k; x = n * (n - 1) / 2; if (x <= k) { cout << "no solution" << endl; } els...
### Prompt Please create a solution in CPP to the following problem: Currently Tiny is learning Computational Geometry. When trying to solve a problem called "The Closest Pair Of Points In The Plane", he found that a code which gave a wrong time complexity got Accepted instead of Time Limit Exceeded. The problem is ...
#include <bits/stdc++.h> using namespace std; const int maxn = 100500; const int infi = (1 << 30); const long long infl = (1LL << 62); const double eps = 1e-9; const long long mod = 1000000007LL; const double pi = acos(-1.0); int n, k; int main() { cin >> n >> k; if (n * (n - 1) <= k * 2) { cout << "no solution...
### Prompt Please formulate a cpp solution to the following problem: Currently Tiny is learning Computational Geometry. When trying to solve a problem called "The Closest Pair Of Points In The Plane", he found that a code which gave a wrong time complexity got Accepted instead of Time Limit Exceeded. The problem is ...
#include <bits/stdc++.h> using namespace std; int main() { int n, k; scanf("%d %d", &n, &k); if ((n * (n - 1) / 2 <= k)) printf("no solution\n"); else { for (int i = 0; i < n; i++) printf("0 %d\n", i); } return 0; }
### Prompt Please formulate a CPP solution to the following problem: Currently Tiny is learning Computational Geometry. When trying to solve a problem called "The Closest Pair Of Points In The Plane", he found that a code which gave a wrong time complexity got Accepted instead of Time Limit Exceeded. The problem is ...
#include <bits/stdc++.h> using namespace std; const int INF = 0x3fffffff; const int PRIME = 999983; const int MOD = 1000000007; const int MULTI = 1000000007; const long double EPS = 1e-10; inline bool isodd(int x) { return x & 1; } inline bool isodd(long long x) { return x & 1; } int main(void) { int n, k; scanf("%...
### Prompt Please create a solution in cpp to the following problem: Currently Tiny is learning Computational Geometry. When trying to solve a problem called "The Closest Pair Of Points In The Plane", he found that a code which gave a wrong time complexity got Accepted instead of Time Limit Exceeded. The problem is ...
#include <bits/stdc++.h> using namespace std; int main() { int n, k; cin >> n >> k; if (n * (n - 1) / 2 <= k) { return cout << "no solution", 0; } for (int i = 0; i < 1; i++) { for (int j = 0; j < n; j++) { cout << i << " " << j << endl; } } return 0; }
### Prompt Develop a solution in cpp to the problem described below: Currently Tiny is learning Computational Geometry. When trying to solve a problem called "The Closest Pair Of Points In The Plane", he found that a code which gave a wrong time complexity got Accepted instead of Time Limit Exceeded. The problem is ...
#include <bits/stdc++.h> using namespace std; const long long mod = 1000000007; const double PI = 3.141592653589793238463; const int N = 2e5 + 100; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); ; int x, k; cin >> x >> k; if (x * (x - 1) / 2 <= k) { cout << "no solution\...
### Prompt Create a solution in CPP for the following problem: Currently Tiny is learning Computational Geometry. When trying to solve a problem called "The Closest Pair Of Points In The Plane", he found that a code which gave a wrong time complexity got Accepted instead of Time Limit Exceeded. The problem is the fo...
#include <bits/stdc++.h> using namespace std; long long n, k; int main() { long long cnt; while (cin >> n >> k) { cnt = n * (n - 1) / 2; if (cnt > k) { for (int i = 0; i < n; i++) cout << 0 << " " << i << endl; } else cout << "no solution" << endl; } return 0; }
### Prompt Your task is to create a cpp solution to the following problem: Currently Tiny is learning Computational Geometry. When trying to solve a problem called "The Closest Pair Of Points In The Plane", he found that a code which gave a wrong time complexity got Accepted instead of Time Limit Exceeded. The probl...
#include <bits/stdc++.h> int i, j, k, m, n; int main() { while (scanf("%d %d", &n, &k) == 2) { if (k >= n * (n - 1) / 2) { printf("no solution\n"); continue; } for (i = 1; i <= n; i++) printf("0 %d\n", i); } return 0; }
### Prompt In cpp, your task is to solve the following problem: Currently Tiny is learning Computational Geometry. When trying to solve a problem called "The Closest Pair Of Points In The Plane", he found that a code which gave a wrong time complexity got Accepted instead of Time Limit Exceeded. The problem is the f...
#include <bits/stdc++.h> using namespace std; int main() { int n, k; scanf("%d%d", &n, &k); if (((n - 1) * n) / 2 <= k) { printf("no solution\n"); } else { int ypos = 0; for (int i = 0; i < n; ++i) { printf("%d %d\n", i, ypos); ypos += (n + 1); } } return 0; }
### Prompt Develop a solution in Cpp to the problem described below: Currently Tiny is learning Computational Geometry. When trying to solve a problem called "The Closest Pair Of Points In The Plane", he found that a code which gave a wrong time complexity got Accepted instead of Time Limit Exceeded. The problem is ...
#include <bits/stdc++.h> using namespace std; const int dr[] = {-1, 0, 1, 0}; const int dc[] = {0, 1, 0, -1}; string FILE_NAME = "testcase.C"; string NAME; string itos(int n) { stringstream ss; ss << n; return ss.str(); } int main() { int n, k; cin >> n >> k; if (k >= n * (n - 1) / 2) { cout << "no solu...
### Prompt Develop a solution in cpp to the problem described below: Currently Tiny is learning Computational Geometry. When trying to solve a problem called "The Closest Pair Of Points In The Plane", he found that a code which gave a wrong time complexity got Accepted instead of Time Limit Exceeded. The problem is ...
#include <bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0); int n, k; cin >> n >> k; if (k >= n * (n - 1) / 2) cout << "no solution" << endl; else for (int i = 1; i <= n; i++) cout << 0 << " " << i << endl; return 0; }
### Prompt Construct a CPP code solution to the problem outlined: Currently Tiny is learning Computational Geometry. When trying to solve a problem called "The Closest Pair Of Points In The Plane", he found that a code which gave a wrong time complexity got Accepted instead of Time Limit Exceeded. The problem is the...
#include <bits/stdc++.h> using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(0); int n, k; cin >> n >> k; if (k >= n * (n - 1) / 2) { cout << "no solution"; return 0; } for (int i = 1; i <= n; i++) { cout << 0 << ' ' << i << "\n"; } return 0; }
### Prompt Your challenge is to write a cpp solution to the following problem: Currently Tiny is learning Computational Geometry. When trying to solve a problem called "The Closest Pair Of Points In The Plane", he found that a code which gave a wrong time complexity got Accepted instead of Time Limit Exceeded. The p...
#include <bits/stdc++.h> using namespace std; int main() { int i, j, k, n, m; while (cin >> n >> k) { if (n * (n - 1) / 2 <= k) { puts("no solution"); } else { for (i = 0; i < n; i++) printf("0 %d\n", i); } } return 0; }
### Prompt Please formulate a cpp solution to the following problem: Currently Tiny is learning Computational Geometry. When trying to solve a problem called "The Closest Pair Of Points In The Plane", he found that a code which gave a wrong time complexity got Accepted instead of Time Limit Exceeded. The problem is ...
#include <bits/stdc++.h> struct A { int x; int y; } p[2000]; double d; double min(double a, double b) { if (a > b) return b; else return a; } double distance(int ax, int ay, int bx, int by) { return sqrt((ax - bx) * (ax - bx) + (ay - by) * (ay - by)); } int main() { int i, j, n, k, tot; scanf("%d ...
### Prompt In Cpp, your task is to solve the following problem: Currently Tiny is learning Computational Geometry. When trying to solve a problem called "The Closest Pair Of Points In The Plane", he found that a code which gave a wrong time complexity got Accepted instead of Time Limit Exceeded. The problem is the f...
#include <bits/stdc++.h> using namespace std; int main() { int n, k; cin >> n >> k; if (k >= (n * n - n) / 2) puts("no solution"); else { for (int i = 0; i < n; i++) cout << 0 << " " << i << endl; } return 0; }
### Prompt Your task is to create a cpp solution to the following problem: Currently Tiny is learning Computational Geometry. When trying to solve a problem called "The Closest Pair Of Points In The Plane", he found that a code which gave a wrong time complexity got Accepted instead of Time Limit Exceeded. The probl...
#include <bits/stdc++.h> using namespace std; using pii = pair<long long, long long>; const long long INF = 1e18; void dprint(string s) { cout << "\n"; } void dprint() { cout << "\n"; } template <class T, class... U> void dprint(string s, T t, U... u) { long long w = s.find(','); cout << "[" << s.substr(0, w) << ":...
### Prompt Please provide a cpp coded solution to the problem described below: Currently Tiny is learning Computational Geometry. When trying to solve a problem called "The Closest Pair Of Points In The Plane", he found that a code which gave a wrong time complexity got Accepted instead of Time Limit Exceeded. The p...
#include <bits/stdc++.h> using namespace std; void OMG() { cout << "OMG>.< I don't know!\n"; } void W1() { cout << "Freda's\n"; } void W2() { cout << "Rainbow's\n"; } bool ff1(string S) { string A = ""; for (int i = 0; i < 5; i++) A += S[i]; return (A == "miao."); } bool ff2(string S) { string A = ""; for (in...
### Prompt Please create a solution in CPP to the following problem: Currently Tiny is learning Computational Geometry. When trying to solve a problem called "The Closest Pair Of Points In The Plane", he found that a code which gave a wrong time complexity got Accepted instead of Time Limit Exceeded. The problem is ...
#include <bits/stdc++.h> using namespace std; const int maxN = 2005; long long n, k, x[maxN] = {-3000}, y[maxN] = {-3000}, ans; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); cin >> n >> k; for (int i = 1; i < n; i++) { ans += i; x[i] = x[i - 1]; y[i] = y[i - 1] - 1; } if (ans <= ...
### Prompt Develop a solution in cpp to the problem described below: Currently Tiny is learning Computational Geometry. When trying to solve a problem called "The Closest Pair Of Points In The Plane", he found that a code which gave a wrong time complexity got Accepted instead of Time Limit Exceeded. The problem is ...
#include <bits/stdc++.h> using namespace std; static const int INF = 500000000; template <class T> void debug(T a, T b) { for (; a != b; ++a) cerr << *a << ' '; cerr << endl; } int n, k; int main() { cin >> n >> k; int maxi = n * (n - 1) / 2; if (k >= maxi) { puts("no solution"); return 0; } for (...
### Prompt Generate a CPP solution to the following problem: Currently Tiny is learning Computational Geometry. When trying to solve a problem called "The Closest Pair Of Points In The Plane", he found that a code which gave a wrong time complexity got Accepted instead of Time Limit Exceeded. The problem is the foll...
#include <bits/stdc++.h> using namespace std; char s[1001]; int co[200]; int len; struct p { char c; int num; int ap; bool operator<(const p& other) const { int t1, t2; t1 = num / ap; if (double(num) / ap > t1) { t1++; } t2 = other.num / other.ap; if (double(other.num) / other.ap >...
### Prompt Please provide a cpp coded solution to the problem described below: Piegirl is buying stickers for a project. Stickers come on sheets, and each sheet of stickers contains exactly n stickers. Each sticker has exactly one character printed on it, so a sheet of stickers can be described by a string of length ...
#include <bits/stdc++.h> using namespace std; string s; int tedad[300]; bool possible(int t, int n) { int len = 0; for (int i = 'a'; i <= 'z'; i++) { len += tedad[i] / t; if (tedad[i] % t != 0) len++; } return len <= n; } int bs(int first, int second, int n) { if (first == second) return first; int ...
### Prompt Please provide a CPP coded solution to the problem described below: Piegirl is buying stickers for a project. Stickers come on sheets, and each sheet of stickers contains exactly n stickers. Each sticker has exactly one character printed on it, so a sheet of stickers can be described by a string of length ...
#include <bits/stdc++.h> using namespace std; int main() { string a; int n; int freq[26] = {0}; cin >> a >> n; for (int i = 0; i < a.length(); i++) freq[a[i] - 'a']++; int lo = 1, hi = 1001; int ans = -1; while (lo <= hi) { int mid = (lo + hi) / 2; int need = 0; for (int i = 0; i < 26; i++) ...
### Prompt Your challenge is to write a cpp solution to the following problem: Piegirl is buying stickers for a project. Stickers come on sheets, and each sheet of stickers contains exactly n stickers. Each sticker has exactly one character printed on it, so a sheet of stickers can be described by a string of length ...
#include <bits/stdc++.h> using namespace std; #pragma comment(linker, "/STACK:64000000") int j, n, l, i, h, q1, q2, x, y, m, k, t, ans, p1, p2, ans1, ans2, a[1000500], q, d[1000500], p; string s, z; set<char> ss; void init() { cin >> s; n = s.size(); cin >> k; } void solve() { for (j = 1; j <= n; j++) { ...
### Prompt Please provide a CPP coded solution to the problem described below: Piegirl is buying stickers for a project. Stickers come on sheets, and each sheet of stickers contains exactly n stickers. Each sticker has exactly one character printed on it, so a sheet of stickers can be described by a string of length ...
#include <bits/stdc++.h> using namespace std; string s; int n; int cnt[256]; bool check(int x) { if (x == 0) return false; int sum = 0; for (char c = 'a'; c <= 'z'; ++c) { int d = cnt[c] / x + !!(cnt[c] % x); sum += d; } return sum <= n; } string get(int x) { string t = ""; for (char c = 'a'; c <=...
### Prompt Generate a cpp solution to the following problem: Piegirl is buying stickers for a project. Stickers come on sheets, and each sheet of stickers contains exactly n stickers. Each sticker has exactly one character printed on it, so a sheet of stickers can be described by a string of length n. Piegirl wants t...
#include <bits/stdc++.h> using namespace std; int main() { ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); int n; string s; cin >> s >> n; set<char> se(s.begin(), s.end()); if ((int)se.size() > n) { cout << "-1" << "\n"; } else { string str; map<char, int> x, y; for (int i =...
### Prompt Your challenge is to write a cpp solution to the following problem: Piegirl is buying stickers for a project. Stickers come on sheets, and each sheet of stickers contains exactly n stickers. Each sticker has exactly one character printed on it, so a sheet of stickers can be described by a string of length ...
#include <bits/stdc++.h> using namespace std; set<char> st; int a[26] = {0}; int main() { int n; string s; cin >> s >> n; for (auto c : s) { st.insert(c); a[c - 97]++; } if ((int)st.size() > n) { printf("-1\n"); return 0; } for (int i = 1; i <= 1000; ++i) { int co = 0; for (int j...
### Prompt In cpp, your task is to solve the following problem: Piegirl is buying stickers for a project. Stickers come on sheets, and each sheet of stickers contains exactly n stickers. Each sticker has exactly one character printed on it, so a sheet of stickers can be described by a string of length n. Piegirl want...
#include <bits/stdc++.h> using namespace std; template <class T> void PV(T a, T b) { while (a != b) cout << *a++ << " "; cout << endl; } template <class T> inline bool chmin(T &a, T b) { return a > b ? a = b, 1 : 0; } template <class T> inline bool chmax(T &a, T b) { return a < b ? a = b, 1 : 0; } const int inf...
### Prompt Generate a cpp solution to the following problem: Piegirl is buying stickers for a project. Stickers come on sheets, and each sheet of stickers contains exactly n stickers. Each sticker has exactly one character printed on it, so a sheet of stickers can be described by a string of length n. Piegirl wants t...
#include <bits/stdc++.h> using namespace std; string s; int n; int cnt[256]; bool check(int x) { int sum = 0; for (char c = 'a'; c <= 'z'; ++c) { int d = cnt[c] / x + !!(cnt[c] % x); sum += d; } return sum <= n; } string get(int x) { string t = ""; for (char c = 'a'; c <= 'z'; ++c) { int d = cnt...
### Prompt Construct a cpp code solution to the problem outlined: Piegirl is buying stickers for a project. Stickers come on sheets, and each sheet of stickers contains exactly n stickers. Each sticker has exactly one character printed on it, so a sheet of stickers can be described by a string of length n. Piegirl wa...
#include <bits/stdc++.h> using namespace std; string S; int N, L; map<char, int> ch; void read(); void solve(); bool test(int); void howdy(int); int main() { read(); solve(); return 0; } void read() { cin >> S >> N, L = int(S.length()); } void solve() { for (int i = 0; i < L; ++i) ++ch[S[i]]; if (int(ch.size(...
### Prompt Please create a solution in Cpp to the following problem: Piegirl is buying stickers for a project. Stickers come on sheets, and each sheet of stickers contains exactly n stickers. Each sticker has exactly one character printed on it, so a sheet of stickers can be described by a string of length n. Piegirl...
#include <bits/stdc++.h> using namespace std; int n; string str; map<char, int> mp; set<char> st; bool ok(int k) { int rem = n - int((st).size()); for (auto it = st.begin(); it != st.end(); it++) { char c = *it; int r = mp[c] - k; if (r <= 0) continue; int need = (r + k - 1) / k; if (need > rem)...
### Prompt Construct a Cpp code solution to the problem outlined: Piegirl is buying stickers for a project. Stickers come on sheets, and each sheet of stickers contains exactly n stickers. Each sticker has exactly one character printed on it, so a sheet of stickers can be described by a string of length n. Piegirl wa...
#include <bits/stdc++.h> using namespace std; int Up(int a, int b) { return (a + b - 1) / b; } class Type { public: char ch; int number; int k; int value; Type() {} Type(char _ch, int _number) : ch(_ch), number(_number), k(0) {} friend bool operator<(const Type& a, const Type& b) { return a.number < ...
### Prompt Your challenge is to write a Cpp solution to the following problem: Piegirl is buying stickers for a project. Stickers come on sheets, and each sheet of stickers contains exactly n stickers. Each sticker has exactly one character printed on it, so a sheet of stickers can be described by a string of length ...
#include <bits/stdc++.h> using namespace std; string s; int c[26]; bool check(int m, string t) {} bool solve() { int l = 1, r = 10000; while (l <= r) { } } bool compare(pair<char, int> a, pair<char, int> b) { return a.second > b.second; } int main() { cin >> s; int n; cin >> n; unordered_set<char> st; ...
### Prompt Please formulate a Cpp solution to the following problem: Piegirl is buying stickers for a project. Stickers come on sheets, and each sheet of stickers contains exactly n stickers. Each sticker has exactly one character printed on it, so a sheet of stickers can be described by a string of length n. Piegirl...
#include <bits/stdc++.h> using namespace std; string s; int n; int cnt[256]; bool check(int x) { if (x == 0) return false; int sum = 0; for (char c = 'a'; c <= 'z'; ++c) { int d = cnt[c] / x + !!(cnt[c] % x); sum += d; } return sum <= n; } string get(int x) { string t = ""; for (char c = 'a'; c <=...
### Prompt Generate a cpp solution to the following problem: Piegirl is buying stickers for a project. Stickers come on sheets, and each sheet of stickers contains exactly n stickers. Each sticker has exactly one character printed on it, so a sheet of stickers can be described by a string of length n. Piegirl wants t...
#include <bits/stdc++.h> using namespace std; int am[27]; int dp[27][1010]; int path[27][1010]; int call(int p, int n) { if (p == 26) return (n == 0 ? 0 : (1 << 29)); int &ret = dp[p][n]; if (ret != -1) return ret; int &ppp = path[p][n]; ret = (1 << 29); if (!am[p]) { ret = call(p + 1, n); ppp = 0; ...
### Prompt Construct a Cpp code solution to the problem outlined: Piegirl is buying stickers for a project. Stickers come on sheets, and each sheet of stickers contains exactly n stickers. Each sticker has exactly one character printed on it, so a sheet of stickers can be described by a string of length n. Piegirl wa...
#include <bits/stdc++.h> using namespace std; int a[27], c[27], d[27]; int main() { int count, i, n, max, co, t, index, k; char str[1010], ch, b[1010]; ch = getchar(); while (ch != '\n') { a[ch - 'a' + 1]++; ch = getchar(); } count = 0; for (i = 1; i <= 26; i++) if (a[i] != 0) count++; scanf...
### Prompt Please create a solution in cpp to the following problem: Piegirl is buying stickers for a project. Stickers come on sheets, and each sheet of stickers contains exactly n stickers. Each sticker has exactly one character printed on it, so a sheet of stickers can be described by a string of length n. Piegirl...
#include <bits/stdc++.h> using namespace std; template <class F, class T> T convert(F a, int p = -1) { stringstream ss; if (p >= 0) ss << fixed << setprecision(p); ss << a; T r; ss >> r; return r; } template <class T> void db(T a, int p = -1) { if (p >= 0) cout << fixed << setprecision(p); cout << a << ...
### Prompt Please provide a Cpp coded solution to the problem described below: Piegirl is buying stickers for a project. Stickers come on sheets, and each sheet of stickers contains exactly n stickers. Each sticker has exactly one character printed on it, so a sheet of stickers can be described by a string of length ...
#include <bits/stdc++.h> using namespace std; int ceil_div(int a, int b) { return (a + b - 1) / b; } int main() { cin.tie(0); cout.tie(0); ios_base::sync_with_stdio(0); string s; cin >> s; int n; cin >> n; set<char> st(s.begin(), s.end()); if (n < st.size()) { cout << -1 << endl; return 0; }...
### Prompt Generate a Cpp solution to the following problem: Piegirl is buying stickers for a project. Stickers come on sheets, and each sheet of stickers contains exactly n stickers. Each sticker has exactly one character printed on it, so a sheet of stickers can be described by a string of length n. Piegirl wants t...
#include <bits/stdc++.h> using namespace std; struct lett { char let; int nb; int at; }; int main() { int values[26], offset = static_cast<int>('a'), total; lett letts[26]; string str; cin >> str; for (int i = 0; i < 26; i++) { values[i] = 0; } for (int i = 0; i < str.length(); i++) { values...
### Prompt Create a solution in CPP for the following problem: Piegirl is buying stickers for a project. Stickers come on sheets, and each sheet of stickers contains exactly n stickers. Each sticker has exactly one character printed on it, so a sheet of stickers can be described by a string of length n. Piegirl wants...
#include <bits/stdc++.h> using namespace std; const double eps = 1e-8; int dblcmp(double d) { if (fabs(d) < eps) return 0; return d > eps ? 1 : -1; } const double PI = 3.1415926535897932384626433832795; const double pi = acos(-1.0); int dx[4] = {-1, 0, 1, 0}; int dy[4] = {0, -1, 0, 1}; long long pov(long long a, lo...
### Prompt Construct a CPP code solution to the problem outlined: Piegirl is buying stickers for a project. Stickers come on sheets, and each sheet of stickers contains exactly n stickers. Each sticker has exactly one character printed on it, so a sheet of stickers can be described by a string of length n. Piegirl wa...
#include <bits/stdc++.h> using namespace std; const int mod = 1e9 + 9; long long gcd(long long a, long long b) { if (b == 0) return b; return gcd(b, a % b) + a / b; } int main() { ios::sync_with_stdio(0); cin.tie(0); string s; cin >> s; int n; cin >> n; vector<pair<int, int>> a(26); for (int i = 0; ...
### Prompt Please create a solution in Cpp to the following problem: Piegirl is buying stickers for a project. Stickers come on sheets, and each sheet of stickers contains exactly n stickers. Each sticker has exactly one character printed on it, so a sheet of stickers can be described by a string of length n. Piegirl...
#include <bits/stdc++.h> using namespace std; int i, j, n, m, k, v[30]; string s; int main() { cin >> s >> n; for (i = 0; i < s.size(); i++) v[s[i] - 'a']++; for (k = 1; k <= s.size(); k++) { m = 0; for (i = 0; i < 26; i++) m += ceil(v[i] / (double)k); if (m <= n) { cout << k << "\n"; for ...
### Prompt Please formulate a cpp solution to the following problem: Piegirl is buying stickers for a project. Stickers come on sheets, and each sheet of stickers contains exactly n stickers. Each sticker has exactly one character printed on it, so a sheet of stickers can be described by a string of length n. Piegirl...
#include <bits/stdc++.h> using namespace std; namespace p335ABanana { void solve(int test_num) { int cnt[26] = {0}; string str; int n; cin >> str >> n; for (int i = 0; i < (int)str.size(); i++) cnt[str[i] - 'a']++; for (int res = 1; res <= 1000; res++) { int need = 0; for (int c = 0; c < 26; c++) ne...
### Prompt Please provide a Cpp coded solution to the problem described below: Piegirl is buying stickers for a project. Stickers come on sheets, and each sheet of stickers contains exactly n stickers. Each sticker has exactly one character printed on it, so a sheet of stickers can be described by a string of length ...
#include <bits/stdc++.h> using namespace std; int v[10001]; int main() { string s; int n, i, j, k, m, o, p; cin >> s >> n; o = s.length(); for (i = 0; i < o; i++) { v[s[i] - 'a']++; } for (i = 1; i <= 1000; i++) { string ans = ""; for (j = 0; j < 26; j++) { if (v[j]) { int y = (v...
### Prompt Generate a cpp solution to the following problem: Piegirl is buying stickers for a project. Stickers come on sheets, and each sheet of stickers contains exactly n stickers. Each sticker has exactly one character printed on it, so a sheet of stickers can be described by a string of length n. Piegirl wants t...
#include <bits/stdc++.h> using namespace std; string s; int coos; map<char, int> cnt; string getcoos(int nos) { string p = ""; for (auto y : cnt) { int t = (y.second + nos - 1) / nos; for (int j = 0; j < t; j++) p += (char)(y.first); } return p; } int main() { cin >> s; cin >> coos; int n = s.size...
### Prompt Generate a cpp solution to the following problem: Piegirl is buying stickers for a project. Stickers come on sheets, and each sheet of stickers contains exactly n stickers. Each sticker has exactly one character printed on it, so a sheet of stickers can be described by a string of length n. Piegirl wants t...
#include <bits/stdc++.h> using namespace std; int main() { string s; cin >> s; long long int n; cin >> n; long long int size = s.length(); vector<long long int> freq(26, 0); for (long long int i = 0; i < size; i++) { freq[s[i] - 'a']++; } long long int diff = 0; for (long long int i = 0; i < 26;...
### Prompt Construct a Cpp code solution to the problem outlined: Piegirl is buying stickers for a project. Stickers come on sheets, and each sheet of stickers contains exactly n stickers. Each sticker has exactly one character printed on it, so a sheet of stickers can be described by a string of length n. Piegirl wa...
#include <bits/stdc++.h> using namespace std; signed main() { ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); ; string s, t; long long n, i; cin >> s; cin >> n; set<pair<double, char>> m; map<char, long long> freq, c; for (i = 0; i < s.length(); ++i) { freq[s[i]]++; } for ...
### Prompt Please create a solution in CPP to the following problem: Piegirl is buying stickers for a project. Stickers come on sheets, and each sheet of stickers contains exactly n stickers. Each sticker has exactly one character printed on it, so a sheet of stickers can be described by a string of length n. Piegirl...