uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
f6d6a461-43f2-42f2-b6b3-8e5b15a072b2 | ksood2004/leetcodee | 0882-peak-index-in-a-mountain-array/0882-peak-index-in-a-mountain-array.cpp | class Solution {
public:
int peakIndexInMountainArray(vector<int>& arr) {
int n=arr.size();
int s=0;
int e=n-1;
while(s<e){
int mid=s+(e-s)/2;
if(arr[mid]>arr[mid+1]){
e=mid;
}
else{
s=mi... | ALGO | 0.999977 | 5.810225 |
7fb61cef-89f0-4086-9871-d0cf713e55e6 | rjkmkd/C- | maxElement.cpp | #include<iostream>
using namespace std;
int main(){
int arr[5]={2,6,4,9,198};
int ans = arr[0];
for(int i =0; i<5;i++){
if(arr[i]>ans){
ans=arr[i];
}
}
cout<<ans<<endl;
return 0;
} | ALGO | 0.999407 | 3.07281 |
57855801-3f2b-429f-86fd-14a0ad1a2b19 | ashrafulislampro/code_forces_pbs | shape_1.cpp | #include <iostream>
using namespace std;
int main(){
int n;
cin>>n;
for(int i = 0; i < n; i++){
for(int j = n-i; j >= 1; j--){
cout<<"*";
}
cout<<endl;
}
return 0;
} | ALGO | 0.999907 | 3.868341 |
36a359e3-b4f3-415c-8087-db230580e19f | woodart8/Learning-Algorithm-CPP | 1074-2.cpp | #include <iostream>
using namespace std;
int npow(int n, int m){
int r=1;
for(int i=0;i<m;i++){
r*=n;
}
return r;
}
int z(int n, int r, int c){
if(n==1){
return 2*r+c;
}
int l=npow(2, n-1);
if(r<l){
if(c<l){
return z(n-1, r, c);
}
el... | ALGO | 0.998467 | 3.26001 |
9a9e84dc-cbf9-46ca-b76b-d0bf964a4260 | sparrowstar/WineglassSoftware-Source-SDK-Code | Discharge-2016/src/utils/vbsp/brushbsp.cpp | #include "vbsp.h"
int c_nodes;
int c_nonvis;
int c_active_brushes;
// if a brush just barely pokes onto the other side,
// let it slide by without chopping
#define PLANESIDE_EPSILON 0.001
//0.1
void FindBrushInTree (node_t *node, int brushnum)
{
bspbrush_t *b;
if (node->planenum == PLANENUM_LEAF)
{
for (b=n... | ALGO | 0.995141 | 4.610228 |
480d7402-791f-4fb2-962c-23c7443470f9 | anshdholakiya/cpp_DSA | Lecture 22 Character ,string/Que_1_lengthOfString.cpp | #include<iostream>
using namespace std;
int getlength(char name[]){
int count = 0;
for(int i=0 ; name[i] != '\0' ; i++){
count++;
}
return count;
}
int main(){
char name[20];
cout << "enter name : ";
cin >> name;
// int length=0;
// for (int i:name){
// if(i=='\0')... | TOOL | 0.895348 | 3.368778 |
e6f4d724-9953-4723-aea1-f9e0f4fd1744 | ishandutta2007/codeforces | psyho/normal/316/A2.cpp | #include <cmath>
#include <algorithm>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <vector>
#include <iostream>
#include <sstream>
#include <set>
#include <map>
//#include <emmintrin.h>
using namespace std;
#define FORE(it,c) for(__typeof((c).begin()) it = (c).begin(); it != (c).end(); ++it)
#def... | ALGO | 0.999969 | 3.543732 |
eae36733-8ba6-49f3-8dec-f0ad3226e2fd | ThiAnhs/Phan-Tich-Va-Thiet-Ke-Thuat-Toan | Sap Xep/HeapSort.cpp | #include <stdio.h>
typedef struct {
int soNguyen;
float soThuc;
}DaySo;
void Swap(DaySo *x, DaySo *y){
DaySo temp;
temp = *x;
*x = *y;
*y = temp;
}
void PushDow(DaySo a[], int first, int last){
int r = first;
while(r <= (last - 1) / 2){
if(last == 2*r + 1){
if(a[r].soNguyen > a[last].soNguyen) Swap(&a[r... | ALGO | 0.999639 | 3.119753 |
233e478f-6923-4dd9-a421-2a696a60c157 | junhochoi-dev/algorithm | [PS]BOJ/00000_09999/05000_05999/05063/boj05063.cpp | #include <iostream>
using namespace std;
int main() {
int r, e, c, size;
cin >> size;
for (int n = 0; n < size; n++) {
cin >> r >> e >> c;
if (r < e - c)
cout << "advertise" << endl;
else if (r > e - c)
cout << "do not advertise" << endl;
else
cout << "does not matter" << endl;
}
return 0;
} | ALGO | 0.999942 | 3.768322 |
dfd3f8dc-99c4-45e6-a4c3-9f75110847a4 | tchomphoochan/cmutoi_codes | solutions/toi/toi14/plantation.cpp | /**
* toi14_plantation
*
* aquablitz11 (2019)
* closest pair of point using line sweep algorithm
*/
#include <bits/stdc++.h>
using namespace std;
#define X first
#define Y second
using pii = pair<int, int>;
const int INF = 1e9;
int main()
{
int T;
scanf("%d", &T);
while (T--) {
int n, r, d;... | ALGO | 0.999918 | 4.427426 |
e58abaad-fecc-4a8f-b0ec-95ab85960e07 | rylahs/BOJ | Code/10998.cpp | // BOJ 10998
// AXB
// https://www.acmicpc.net/problem/10998
#include <bits/stdc++.h>
using namespace std;
int main(void)
{
ios::sync_with_stdio(false);
cin.tie(nullptr);
int a, b;
cin >> a >> b;
cout << a * b;
return 0;
} | ALGO | 0.993122 | 4.380022 |
18bfb38b-fe16-4a99-9437-95cf64e741f9 | astraey/Synthetic_Image | M1/src/core/eqsolver.cpp | #include <cmath>
#include <iostream>
#include "eqsolver.h"
EqSolver::EqSolver()
{
}
// Compute the root of a linear equation of type: c1*x + c0 = 0
// (useful for solving intersections of rays with planes, i.e., polygons)
bool EqSolver::rootLinEq(double c1, double c0, rootValues &res)
{
if (c1 == 0) {
/... | ALGO | 0.999604 | 5.024689 |
c1531f17-8eea-4bc9-9f53-4a4212377f08 | agrim08/c_plus_plus | new/switch_statement.cpp | // Note: The switch expression should evaluate to either integer or character.
// It cannot evaluate any other data type.
#include <iostream>
using namespace std;
int main() {
int rating;
cin >> rating;
switch(rating) {
case 1:
cout << "rated as 1 star";
break;
case 2:
cout << "rated as 2 star";
... | TOOL | 0.906651 | 4.28292 |
9e0be7da-4743-443b-8515-87f0437cebaa | noornabi-noor/Codeforces | ABC_083_B_Some_Sums.cpp | #include <bits/stdc++.h>
using namespace std;
#define int long long
#define ld long double
#define lld long long double
#define ull unsigned long long
#define pll pair<int, int>
#define M 1000000007
#define BISMILLAH ios_base::sync_with_stdio(0);cin.tie(0);
#define ALHAMDULILLAH return 0;
#define YES cout << "YES" <<... | ALGO | 0.999605 | 3.55493 |
86f734ab-64d6-4dca-aef5-c9d992563020 | fulatin/MyAlgorithmProblemCode | daGongZhiXing/4/a.cpp | #include <bits/stdc++.h>
typedef long long ll;
using namespace std;
int main() {
int a, b, c;
cin >> a >> b >> c;
cout << 2 * max(a, max(b, c)) << endl;
return 0;
}
| ALGO | 0.999006 | 4.060763 |
0a23a4e6-14b8-43f9-8407-6a4ac90ec892 | ishandutta2007/codeforces | rush_d_cat/normal/744/A.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long LL;
const int N = 1000 + 10;
int par[N], sz[N], c[N];
int find(int x) {
return par[x]==x?x:par[x]=find(par[x]);
}
void unite(int x,int y){
if(find(x)!=find(y)){
sz[find(y)] += sz[find(x)];
par[find(x)]=find(y);
}
}
int main() {
for(int i=0;i<N;i++... | ALGO | 0.999971 | 3.759579 |
0fc41fcc-1b5b-496e-a14a-e76fb8315e72 | thebesttv/00.ACM | 50.c/20.入门经典/code/ch5/UVa12096.cpp | // UVa12096 The SetStack Computer
// Rujia Liu
#include<iostream>
#include<string>
#include<set>
#include<map>
#include<stack>
#include<vector>
#include<algorithm>
using namespace std;
#define ALL(x) x.begin(),x.end()
#define INS(x) inserter(x,x.begin())
typedef set<int> Set;
map<Set,int> IDcache; // 把集合映射成ID
vector<... | ALGO | 0.99661 | 4.481855 |
f9ae8edb-0d55-46d1-a970-16866a46dd00 | stikhead/mindgym | codeforces/A/59A.cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
string ogstr;
string newstr;
cin >> ogstr;
int long long lower=0;
int long long upper=0;
int long long length = ogstr.size();
for(int i = 0; i < length; i++){
if (islower(ogstr[i])) {
lower++;
}
... | ALGO | 0.999617 | 4.944236 |
51b04799-836f-4ce9-b2bb-267cd531e92a | AishwaryaTatiwar/Competitive_DSA | reverse.cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
int n;
cin>>n;
int arr[n];
for(int i=0;i<n;i++){
cin>>arr[i];
}
for(int i=0;i<n/2;i++){
int temp=arr[i];
arr[i]=arr[n-i-1];
arr[n-i-1]=temp;
}
for(int i=0;i<n;i++){
cout<<arr[i];
}
re... | ALGO | 0.999929 | 4.150132 |
afff5413-c782-4b59-bca2-32c54a1b222a | neelchoudhury/cp | Codeforces/651B-2.cpp | #include <bits/stdc++.h>
#define ll long long int
#define ld double
#define MOD 10000000007
#define mem(a) memset(a,0,sizeof(a))
#define pb push_back
#define ff first
#define ss second
#define sc(n) scanf("%d", &n)
#define pr(n) printf("%I64d\n", n)
#define prf(n) printf("%lf\n",n)
#define scf(n) scanf("%lf", &n)... | ALGO | 0.999875 | 3.306588 |
91297d0d-4e94-4c5a-a86a-f960c65c8672 | Izana180/atcoder | abc/abc343/abc343_c.cpp | #include <bits/stdc++.h>
using namespace std;
bool is_palindrome(string x){
int low = 0;
int high = x.length()-1;
while(low<high){
if(x[low]!=x[high]){
return false;
}
low++;
high--;
}
return true;
}
int main() {
long N;
cin >> N;
double max_double = cbrt(N);
long max = max_dou... | ALGO | 0.99996 | 4.877501 |
d946cf2b-a048-4ee3-9629-141bf8f0128d | deavid/alepherp | src/plugins/openrptplugin/openrpt/OpenRPT/renderer/codeean.cpp | /*
* This file contains the implementation of the Code EAN and similar
* formats for rendering purposes. All this code assumes a 100dpi
* rendering surface for it's calculations.
*/
#include <QString>
#include <QRect>
#include <QPainter>
#include <QPen>
#include <QBrush>
#include "parsexmlutils.h"
#include "r... | TOOL | 0.927988 | 5.209155 |
4bca23bb-bb57-44d3-8bc8-b6a0d8843f95 | IAlgorithmia/DSA_CP | Sem3/DSAwithC++/140-LCS.cpp | #include <bits/stdc++.h>
using namespace std;
/*
Explanation :
Idea for recursive solution is that if the last characters are matching, then we return 1 + lcs(m - 1, n - 1)
else we call for max of m - 1, n and m, n - 1, ie, reduce the string size by 1 for both the strings and take the max
base case is when size becom... | ALGO | 0.999985 | 5.956627 |
8f1a0281-f9eb-47c1-a836-f41d12be0397 | suzukikazuharu/-D- | 開発/Libs/BaseLib/DxLib/physics_effects/src/base_level/collision/pfx_shape.cpp | #include "stdafx.h"
#include "../../../include/physics_effects/base_level/collision/pfx_shape.h"
namespace sce {
namespace PhysicsEffects {
void pfxGetShapeAabbDummy(const PfxShape &shape,PfxVector3 &aabbMin,PfxVector3 &aabbMax)
{
(void)shape,(void)aabbMin,(void)aabbMax;
}
void pfxGetShapeAabbSphere(const PfxShape... | ALGO | 0.950855 | 7.27563 |
01681f2f-9ffb-42c3-84af-1d3f0cd98e26 | Zu-rin/AtCoder | AtCoder_Beginner_Contest/ABC246/ABC246D.cpp | #include <iostream>
#include <vector>
#include <string>
#include <list>
#include <queue>
#include <algorithm>
#define rep(i, n) for(i = 0; i < (n); i++)
#define chmax(x, y) x = max(x, y)
#define chmin(x, y) x = min(x, y)
#define MOD 1000000007
#define PI 3.14159265358979323846
#define INF 1ll << 61
using namespace std... | ALGO | 0.999864 | 4.298542 |
deb2f94d-3e59-42d7-a1f9-352ec309e37e | bbrianxiao/Leetcode | Two Pointer/1004. Max Consecutive Ones III/solution.cpp | class Solution {
public:
int longestOnes(vector<int>& nums, int k) {
int retval = 0;
int currMax = 0;
int kleft = k;
int i = 0;
for (int j = 0; j < nums.size(); j++) {
currMax++;
if (nums[j] == 0) kleft--;
while (kleft < 0) {
... | ALGO | 0.999989 | 6.319529 |
9c852d2b-24c4-43b1-95f8-853e1fdfa68c | Showrov-CoU/Codeforces-Solution | A_Regular_Bracket_Sequence.cpp | #include <bits/stdc++.h>
#define PI 2*acos(0.0)
#define ll long long int
#define ull unsigned long long int
#define MOD 1e9+7
#define endl ("\n")
#define vector vector<ll>
#define gcd(a,b) __gcd(a,b)
#define lcm(a,b) (a*(b/__gcd(a,b)))
#define fr(i,n)... | ALGO | 0.998856 | 4.194611 |
76f00cf5-5624-48fa-9cff-9c5c3d8b75d2 | nuloperrito/RKHReader | Converter.cpp | #include "Converter.h"
std::string Converter::ConvertHexToString(const std::vector<uint8_t> &Bytes, const std::string &Separator)
{
std::ostringstream s;
for (size_t i = 0; i < Bytes.size(); ++i)
{
if (i != 0)
{
s << Separator;
}
s << std::setw(2) << std::setfill... | TOOL | 0.921323 | 5.949506 |
560197b3-5743-4724-8dc0-32d4b3d73f38 | brunomendesdecarvalho/axolotl-facts | windows/runner/utils.cpp | #include "utils.h"
#include <flutter_windows.h>
#include <io.h>
#include <stdio.h>
#include <windows.h>
#include <iostream>
void CreateAndAttachConsole() {
if (::AllocConsole()) {
FILE *unused;
if (freopen_s(&unused, "CONOUT$", "w", stdout)) {
_dup2(_fileno(stdout), 1);
}
if (freopen_s(&unuse... | TOOL | 0.998693 | 6.797273 |
f350c068-dd83-41f2-9890-3910389bee46 | ScarboroughCoral/Notes | LeetCode/5. 最长回文子串.cpp | class Solution
{
private:
string addSplit(string &s, string sp)
{
string ss = "#";
for (char c : s)
{
ss += c;
ss += "#";
}
return ss;
}
public:
string longestPalindrome(string s)
{
if (s.length() < 2)
return s;
string ss = addSplit(s, "#");
int maxLen = 1, b... | ALGO | 0.999875 | 5.879361 |
85c3d0c8-9a92-4bcb-888b-cc4eebfcefd9 | ituacm/ITU-ACM-AlgoTeam | Regular-Question-Answers/pascals-triangle.cpp | // Author: Mehmet Tolga Kilinckaya
// Link: https://leetcode.com/problems/pascals-triangle/description/
class Solution {
public:
vector<vector<int>> generate(int N) {
// Initialize a vector 'dp' to represent the current row of Pascal's Triangle
vector<int> dp;
dp.push_back(1);
// I... | ALGO | 0.99999 | 7.385657 |
cd7c9d53-f7fa-4bfc-a365-a647ba014533 | Kawser-nerd/CLCDSA | Source Codes/CodeJamData/15/01/9.cpp | #include <bits/stdc++.h>
#include "header.h"
int main() {
int T, n;
char c;
cin >> T;
rep(X, 0, T) {
cin >> n;
int ans = 0, total = 0;
rep(i, 0, n + 1) {
cin >> c;
total += c - '0';
ans = max(i - total + 1, ans);
}
printf("Case #%d: %d\n", X + 1, ans);
}
}
| ALGO | 0.999253 | 3.867116 |
0f0429bd-0e61-4ac6-9499-06a7115745e3 | rtbr-opensource/rtbr-open-source | sp/src/game/server/ai_planesolver.cpp | #include "cbase.h"
#include <float.h> // for FLT_MAX
#include "ai_planesolver.h"
#include "ai_moveprobe.h"
#include "ai_motor.h"
#include "ai_basenpc.h"
#include "ai_route.h"
#include "ndebugoverlay.h"
// memdbgon must be the last include file in a .cpp file!!!
#include "tier0/memdbgon.h"
//------------------------... | ALGO | 0.994192 | 4.856802 |
b62a1a2d-0718-4d59-8222-7e43810c22c8 | Anujdominoblack/DSA-using-c- | ARRAY/arraysecondnaive.cpp | #include<iostream>
using namespace std;
int getlargest(int arr[],int n) //function to find the largest
{ int largest=0;
for(int i=0;i<n;i++)
{
if(arr[i]>arr[largest])
{
largest=i;
}
}
return largest;
}
int secondlargest(int arr[],int n) //function to find the second largest
{
in... | ALGO | 0.999514 | 3.740661 |
1752bd09-2109-4d42-b8a0-871aee5bde55 | sarvinshrivastava/Cpp.Leetcode | P-162.cpp | #include <iostream>
#include <vector>
using namespace std;
int findPeakElement(vector<int> &arr)
{
int n = arr.size();
if (n == 1)
return 0;
if (arr[0] > arr[1])
return 0;
if (arr[n - 1] > arr[n - 2])
return n - 1;
int low = 1, high = n - 2;
while (low <= high)
{
... | ALGO | 0.999969 | 5.374008 |
6e215d91-abb6-42e8-bd29-ba52534f1dc9 | ishandutta2007/codeforces | turmax/normal/1278/D.cpp | #include <bits/stdc++.h>
using namespace std;
#define int long long
bool comp(pair <int,int> a1,pair <int,int> a2)
{
return a1.second<a2.second;
}
vector <int> parent;
vector <int> lp;
unordered_map <int,int> o;
int glav(int x)
{
int y=x;
while(true)
{
if(parent[y]==(-1))
{
... | ALGO | 0.999999 | 4.12628 |
e24558a0-f98e-4195-8359-0b0a6827fb7b | bot00101101/lstu | programming/semesters/1/practice/cumtests/4/A.cpp | #include <iostream>
int main() {
int N; scanf("%d", &N);
int *a = new int[N];
for (int i = 0; i < N; i++) { a[i] = i+1; }
for (int i = 0; i < N; i++) { printf("%d ", a[i]); }
delete[] a;
return 0;
} | ALGO | 0.874036 | 3.38247 |
5a4d75cc-7766-4ca2-8199-8bdce8383b17 | CarloNicolini/paco | src/eigen/unsupported/doc/examples/BVH_Example.cpp | #include <Eigen/StdVector>
#include <unsupported/Eigen/BVH>
#include <iostream>
using namespace Eigen;
typedef AlignedBox<double, 2> Box2d;
namespace Eigen {
Box2d bounding_box(const Vector2d &v) { return Box2d(v, v); } //compute the bounding box of a single point
}
struct PointPointMinimizer //how to compute squa... | ALGO | 0.99988 | 6.502348 |
d77cdb68-d76b-43ca-80c8-98aeb0c90d7f | Yeabtsega1/dsa-practice | DSA Learning Series/0/Alternative_Square_Pattern.cpp | #include <bits/stdc++.h>
using namespace std;
void displayOdd(int start){
for(int i = start; i < start + 5;i ++){
cout<<i<<" ";
}
cout<<endl;
}
void displayEven(int start){
for(int i = start; i > start - 5;i --){
cout<<i<<" ";
}
cout<<endl;
}
int main()
{
int n;
cin >> n... | ALGO | 0.999707 | 3.371679 |
7e1d222c-c158-4662-a4ef-052bd63eea69 | coolyuyuyu/leetcode | algorithm_0000-0999/228-Summary Ranges/main.cpp | class Solution {
public:
vector<string> summaryRanges(vector<int>& nums) {
vector<string> ret;
for (size_t lft = 0, rht = 1; rht <= nums.size(); ++rht) {
if (rht == nums.size() || (nums[rht - 1] + 1) < nums[rht]) {
string range = std::to_string(nums[lft]);
... | ALGO | 0.999949 | 6.567861 |
9fedab11-747e-4946-92b6-bc81bb780844 | driannn4/Tugas-MP_1 | windows/runner/utils.cpp | #include "utils.h"
#include <flutter_windows.h>
#include <io.h>
#include <stdio.h>
#include <windows.h>
#include <iostream>
void CreateAndAttachConsole() {
if (::AllocConsole()) {
FILE *unused;
if (freopen_s(&unused, "CONOUT$", "w", stdout)) {
_dup2(_fileno(stdout), 1);
}
if (freopen_s(&unuse... | TOOL | 0.998733 | 6.76775 |
d2388123-7300-4088-8994-eba2b534ecbd | Slavik0419/8.2 | fds/fds/Source.cpp | #include <iostream>
#include <string>
using namespace std;
string Deleted(string& s)
{
int pos1 = s.find_first_of("(", 0);
int pos2 = s.find_last_of(")");
if (pos1 == -1 || pos2 == -1)
{
cout << "nema (((( ";
}
else {
s = s.erase(pos1, pos2 - pos1+1);
return s;
}
}
int main()
{
size_t pos1 = ... | ALGO | 0.995746 | 4.436313 |
eddb5748-9c1a-472e-84bf-7f85224f20df | xwt1/MN-RU | src/test/C++/test_degree_percentage_sift.cpp |
#include <iostream>
#include <fstream>
#include <vector>
#include <random>
#include <thread>
#include <atomic>
#include <mutex>
#include "hnswlib/hnswlib.h"
#include <numeric>
#include <unordered_set>
#include <algorithm>
#include <unordered_map>
#include <chrono>
#include "util.h"
int main(int argc, char* argv[]) {
... | ALGO | 0.933363 | 4.085704 |
ec3e5605-dab5-4214-8fc9-df5a3440430a | dxuanthu1/New | I_GGX64/3/3对3/1车2兵对2炮1兵.cpp | #ifndef END_my_m_MT_R_1che2pawn_B_2pao1pawn
#define END_my_m_MT_R_1che2pawn_B_2pao1pawn
#include "..\\..\\chess.h"
#include "..\\..\\preGen.h"
#include "..\\..\\endgame\mat.h"
#include "1221.cpp"
#include "..\\..\\white.h"
#else
#include "..\\..\\black.h"
#endif
void my_m_MT_R_1che2pawn_B_2pao1pawn(typePOS &POSITION... | ALGO | 0.987234 | 3.238263 |
3f5e9dd6-adb2-4408-a7b1-3d3d325fe341 | hmhlee/sgde | data/Mister.0.cpp | #include <bits/stdc++.h>
using namespace std;
char shy[1005];
int main() {
int T;
scanf("%d", &T);
for (int cn = 1; cn <= T; ++cn) {
int S, csum = 0, ans = 0;
scanf("%d%s", &S, shy);
for (int i = 0; i <= S; ++i) {
int num = shy[i] - '0';
if (num) ans = max(ans, i - csum);
csum += num;
}
printf("Ca... | ALGO | 0.998959 | 3.865253 |
ea591846-a54b-4f84-bc57-c9ca6f9591da | yogasrivarshan/Codeforces-Solutions | kthL.cpp | #include<bits/stdc++.h>
using namespace std;
#define ll long long int
#define pb push_back
#define mod 1000000007
#define mp make_pair
// for(i=0;i<n;i++)
// for(auto it = m.begin();it!=m.end();it++)
void solve(){
ll n,i,j,k,m;
cin>>n>>m;
vector<ll>a(n);
ll o=0,z=0;
for(i=0;i<n;i++){
cin>>a[i];
if(a[i]==1)
... | ALGO | 0.999862 | 3.667385 |
ed7eca01-d6e6-465d-9aee-e726cf7e499c | pawan7295/leetcode | 747-min-cost-climbing-stairs/min-cost-climbing-stairs.cpp | class Solution {
public:
int helper(vector<int>& cost,int i,vector<int> &dp)
{
if(i==0 || i==1)
return cost[i];
if(dp[i]!=-1)
return dp[i];
dp[i]=cost[i]+min(helper(cost,i-1,dp),helper(cost,i-2,dp));
return dp[i];
}
int minCostClimbingStairs(vector<int>& cost) {
int n=cost.size();
... | ALGO | 0.999982 | 6.119745 |
2a661013-0d02-49b6-bcb0-e73ade82aa6b | souravjha1111/code-daily | 680-valid-palindrome-ii/680-valid-palindrome-ii.cpp | class Solution {
public:
bool ispalindrome(string s, int i, int j){
while(i < j){
if(s.at(i) == s.at(j)){
i++;
j--;
}else return false;
}
return true;
}
bool validPalindrome(string s) {
int i = 0;
int j = s.size... | ALGO | 0.999979 | 6.197043 |
dd16b4ba-fdd3-4763-8e00-56ec83f59165 | SueHeck/EE272A_DNN_Accelerator | dnn-accelerator-unit-rtl-master/cpp/conv_gold.cpp | #include <stdio.h>
#include <cassert>
#include <string.h>
#include <cstdint>
template <int OY, int OX, int OC, int IC, int FY, int FX, int STRIDE>
void conv_gold(int16_t ifmap[(OY-1)*STRIDE+FY][(OX-1)*STRIDE+FX][IC],
int16_t weight[FY][FX][IC][OC],
int32_t ofmap[OY][OX][OC]){
// Implem... | ALGO | 0.916161 | 4.497627 |
1af2eefb-e067-4da2-acf1-6e7dd161d527 | hiranoyu0830/CompetitiveProgramming | ABC221/c.cpp | #include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for (int i = 0; i < (n); ++i)
int main(){
int n;
cin >> n;
vector<int> a;
while (n){
a.push_back(n%10);
n /= 10;
}
sort(a.begin(), a.end());
int k = a.size();
int ans = 0;
do {
for (int i = 1; i <... | ALGO | 0.999981 | 4.77449 |
ea1e35a5-de66-4912-afd2-30c7d3b1bc95 | GustavoBorgesSouza/flutter_youtube | windows/runner/utils.cpp | #include "utils.h"
#include <flutter_windows.h>
#include <io.h>
#include <stdio.h>
#include <windows.h>
#include <iostream>
void CreateAndAttachConsole() {
if (::AllocConsole()) {
FILE *unused;
if (freopen_s(&unused, "CONOUT$", "w", stdout)) {
_dup2(_fileno(stdout), 1);
}
if (freopen_s(&unuse... | TOOL | 0.9988 | 6.76073 |
a3386417-4e31-4f3d-9c40-81a0afcacb59 | alexandraback/datacollection | solutions_2645486_0/C++/kwangswei/problem1.cpp | #include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <cstdio>
#include <map>
#include <set>
#include <stack>
#include <cstdlib>
using namespace std;
#define MAX_E 6
#define MAX_R 6
#define MAX_N 11
int e;
int r;
int n;
vector<int> v;
int gain(int in_energy, int job) {
return in_... | ALGO | 0.999853 | 3.762796 |
078cf54e-5656-4bab-8b5f-f4e5138590d3 | showmanlee/HowCanISolveThisQuestion | BOJ/19000/19963.cpp | // Санта Клаус
// https://www.acmicpc.net/problem/19963
#include <iostream>
#include <algorithm>
using namespace std;
int main(void) {
cin.tie(NULL);
ios_base::sync_with_stdio(false);
int n, m, k;
cin >> n >> m >> k;
vector<bool> v(n + 1, true);
int res = n;
for (int i = 0; i < m; i++) {
... | ALGO | 0.999987 | 3.702861 |
31af89a3-6fb7-44c9-b6bd-22d6014aa5d8 | mattgarmon/UA_Projects | seam_carving/seam.cpp | #include <iostream>
#include <fstream>
#include <vector>
#include <string>
#include <algorithm>
//utility functions
int abs(int n){
return (n < 0 ? -n : n);
}
int min(int n, int m){
return (n < m ? n : m);
}
//represents a 2D grid of integers
//to be used for PGM pixel array representation and energy matrix
s... | ALGO | 0.997418 | 4.578384 |
bcccfb08-44cb-411b-ace6-239dc11c3b66 | accelerates/C-Primer-5th | 第9章/9.4.7.cpp | using namespace std;
vector<int> findNumViaFirst(const string& v)
{
vector<int> num;
for(auto beg = v.cbegin();beg != v.cend();++beg)
{
if (isdigit(*beg)) {
num.push_back(atoi(&*beg));
}
}
return num;
}
vector<char> findChar(const string& v)
{
vector<char> num;
fo... | ALGO | 0.948575 | 4.023529 |
e5338ce8-73e9-4e73-8436-674f87c07e80 | CoderOJ/contests | GCJ/21p/D/main.cpp | #include "/home/jack/code/creats/log.h"
#include "/home/jack/code/creats/range.h"
#include "/home/jack/code/creats/util.h"
// #include "/home/jack/code/creats/STree.h"
// #include "/home/jack/code/creats/Tree.h"
// #include "/home/jack/code/creats/Graph.h"
// #include "/home/jack/code/creats/Intm.h"
// #include "/home... | ALGO | 0.99853 | 3.880107 |
fad48ffd-bec5-4847-b568-d2e48eadb66e | NXIST-backup/algorithm_trans | algorithm_improve/Graph/acwing376.cpp | /*
Problem Name:机器任务
algorithm tag:图论,二分图,最小点覆盖,匈牙利算法
*/
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <map>
#include <queue>
#include <unordered_map>
#include <vector>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
const int I... | ALGO | 0.999951 | 4.058911 |
0802646d-e92d-4bc1-b7a5-51d8789f290c | jarmani/openbsd-bt | gnu/llvm/lib/Analysis/PhiValues.cpp | #include "llvm/Analysis/PhiValues.h"
#include "llvm/ADT/SmallPtrSet.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/IR/Instructions.h"
using namespace llvm;
void PhiValues::PhiValuesCallbackVH::deleted() {
PV->invalidateValue(getValPtr());
}
void PhiValues::PhiValuesCallbackVH::allUsesReplacedWith(Value *) {
... | TOOL | 0.978491 | 7.822194 |
28d71dd9-af2d-41c0-92c5-e6c434fb7722 | 113bommy/deepmind_codecontests_refine | cpp_gold_filter_file/cpp_train_11489_9.cpp | #include <bits/stdc++.h>
using namespace std;
const int M = 200010, logn = 20;
char s[M];
int wa[M], wb[M], wv[M], wc[M];
int r[M], sa[M], rak[M], height[M], dp[M][20], SIGMA = 0;
int logg[M];
int whom[M], start[M], lenth[M];
int cmp(int *r, int a, int b, int first) {
return r[a] == r[b] && r[a + first] == r[b + firs... | ALGO | 0.999953 | 3.932731 |
27f95786-7cbf-4f20-b89e-4610bcc093bf | chaitanyakrishna-r/DSA | Recursion/binarySearch.cpp | #include<iostream>
using namespace std;
bool binarySearch(int arr[], int s, int e, int key){
int mid = s +(e-s)/2;
// base case
if(s>e){
return false;
}
if(arr[mid] == key){
return true;
}
if(arr[mid]> key){
return binarySearch(arr, s, mid-1, key);
}else{
... | ALGO | 0.999977 | 5.208773 |
ac88413f-b0c0-4bff-9777-38d465af06cb | caeruleus1F/cpp_oo_soduku_solver | OO_Soduku_Solver/main.cpp | /******************************************************************************
* Author: Garrett Bates
* Last Modified: October 18, 2014
* Program: Sudoku Solver
******************************************************************************/
#include "Solver.h"
using namespace std;
int main () {
Solver solver;
so... | ALGO | 0.987503 | 5.114342 |
f35f56b9-d46b-4c6e-acce-56b5e0388d62 | promaafia/CPP-Practies | 10. One Dimensional Array/10.4.cpp | /*
10.4. Write a program that read an array and display maximum
*/
#include <iostream>
using namespace std;
int main()
{
int a[100], n;
printf("Enter the nth position of array: ");
scanf("%d", &n);
for(int i=0; i<n; i++)
{
scanf("%d", &a[i]);
//printf("%d ",a[i]);
}
int... | ALGO | 0.998772 | 4.072948 |
1cf8ac15-38a6-4e2a-9740-42103640d165 | kamala-mohan/Competitive_coding | triangle.cpp | #include<iostream>
using namespace std;
int main()
{
int s1,s2,s3;
cin>>s1>>2>>s3;
if((s1+s2>s3) && (s2+s3>s1) && (s1+s3>s2))
{
cout<<"triangle";
}
else
cout<<"not a triangle";
return 0;
} | ALGO | 0.997288 | 3.886348 |
66863702-c0e4-4d51-b821-100d72543cef | qwertier24/AC | BZOJ/BZOJ3504.cpp | #include <algorithm>
#include <stdio.h>
#include <string.h>
#include <map>
#define PROB
#define INF (1<<30)
using namespace std;
namespace nf{
#define N 100
#define M 10000
int le[N],pe[M],ecnt,data[M],ev[M];
void addEdge(int u,int v,int cap){
pe[ecnt]=le[u];
ev[ecnt]=v;
data[ecnt]=cap;
le[u]=ecnt+... | ALGO | 0.999847 | 3.462354 |
266e0e7c-8c2b-4e3b-909c-a0e0f56a463f | KSKAUSHIKRAM/DATA-STRUCTURES | week1(array)/week 1 medium2.cpp | #include <iostream>
using namespace std;
int main() {
int y, i, j;
int poss, possl;
cout << "Enter the number of elements: ";
cin >> y;
int a[y];
for (i = 0; i < y; i++) {
cin >> a[i];
}
int small = a[0];
int large = a[0];
for (j = 1; j < y; j++) {
if (small ... | ALGO | 0.999971 | 4.641702 |
6f230d05-5cb7-4edc-ad06-4ca7ba1815ab | amritansh22/Data-Structures-and-Algorithms-in-cpp | Kth Largest/maxheap.cpp | #include <iostream>
#include <vector>
#include <queue>
using namespace std;
// Function to find the K'th largest element in the
// array using max-heap
int FindKthLargest(vector<int> const &A, int k)
{
// create a max-heap using std::priority_queue
// from all elements of the vector
priority_queue<int, vector<int>>... | ALGO | 0.999933 | 4.775288 |
56bda06c-0a89-45be-b72c-f456667d3483 | vijaysaravanan1812/ComputingLab | Dynamic Programming/20) InfiniteSupplyCoins.cpp |
//Brute force
#include <iostream>
#include <climits>
using namespace std;
// Recursive function
int minElements(int arr[], int index, int target) {
if (index == 0) {
// Base case: If only one coin type is left
if (target % arr[0] == 0) return target / arr[0];
return INT_MAX;
}
//... | ALGO | 0.99999 | 5.68334 |
4d0b69c8-1945-4335-a0a5-8b944b0bc158 | fwdzh/cp_code | XCPC/Henan-Summer-2025/6/H.cpp | #include<bits/stdc++.h>
using namespace std;
using LL = long long;
constexpr int N = 100020;
int ch[N][26], v[N], tot;
void insert(string s)
{
int u = 0;
for(auto c : s){
int x = c - 'a';
if(!ch[u][x]) ch[u][x] = ++tot;
u = ch[u][x];
}
v[u] = 1;
}
void solve()
{
int n; cin >... | ALGO | 0.999982 | 4.569638 |
0e768b54-8fba-48fd-ba05-d680c4b845b0 | CandyKat/frameworks_av | services/audioflinger/AudioResampler.cpp | #define LOG_TAG "AudioResampler"
//#define LOG_NDEBUG 0
#include <stdint.h>
#include <stdlib.h>
#include <sys/types.h>
#include <cutils/log.h>
#include <cutils/properties.h>
#include "AudioResampler.h"
#include "AudioResamplerSinc.h"
#include "AudioResamplerCubic.h"
#ifdef __arm__
#include <machine/cpu-features.h>
#e... | ALGO | 0.903289 | 7.2831 |
f20e4a56-6d6e-4793-ba3b-2c04dc3b9960 | Prudvi24/Level-1 | patterns/pattern19.cpp | #include<bits/stdc++.h>
#define endl '\n'
using namespace std;
/*
**** *
* *
* *
*******
* *
* *
* ****
*/
void solve(int n){
for(int i=1;i<=n;i++){
//upper pattern
if(i==1){
for(int j=1;j<=n;j++){
if(j<=n/2+1 || j==n){
cout<<"*";
}
else{
cout<<" ";
}
}
}
... | ALGO | 0.999993 | 3.970696 |
901535c0-2b63-4866-8d63-67c947526c99 | mjmoura/tesseractdotnet | dotnetwrapper/Source/training/commontraining.cpp | #include "commontraining.h"
#include "oldlist.h"
#include "globals.h"
#include "mf.h"
#include "clusttool.h"
#include "cluster.h"
#include "mergenf.h"
#include "tessopt.h"
#include "featdefs.h"
#include "efio.h"
#include "emalloc.h"
#include "tprintf.h"
#include "freelist.h"
#include "unicity_table.h"
#include <math.... | DATA | 0.887937 | 4.876576 |
23b7b059-d012-4e37-a9a4-5b57aa2a9528 | DeveshDutt2710/Competitive_Programming | GFG/linked_list/1_detecting_loop_LL_hashing.cpp | //detecting loop in a linked list
//hashing technique
//time complexity : O(n)
//space complexity : O(n)
#include <bits/stdc++.h>
using namespace std;
struct Node{
int data;
struct Node* next;
};
void push(struct Node** head_ref, int new_data){
struct Node* new_node=new Node();
new_node->data=new_da... | ALGO | 0.999945 | 4.871952 |
36a2fff7-a817-4a38-9ada-2f5a76c3f0b0 | tjtmf1/Study-Algorithm | Study-Algorithm/Number of Ways.cpp | //http://codeforces.com/problemset/problem/466/C
#include <iostream>
#include <vector>
using namespace std;
int main(void)
{
int n;
cin >> n;
vector<int> v(n);
vector<long long> accSum(n);
long long sum = 0;
for (int i = 0; i < n; i++)
{
cin >> v[i];
sum += v[i];
accSum[i] = sum;
}
if (sum % 3 != 0)
{
... | ALGO | 0.999996 | 3.963381 |
ea5f1bfd-8612-4117-b654-e4e36bea2a42 | PSU-Robotics-Countess-Quanta/Countess-Quanta-Control | Src/ARIA_CSharpWrapper/src/md5.cpp | /*
MPL (ActivMedia) renamed to a cpp file
*/
/* RH (ActivMedia/MobileRobots) including header from ARIA which defines AREXPORT to export
functions from Windows DLLs, and added AREXPORT to functions defined below:
*/
#include "ArExport.h"
#include "md5.h"
#include <string.h>
#undef BYTE_ORDER /* 1 = big-endian,... | ALGO | 0.954496 | 6.095616 |
23d879dc-d5fb-4ade-b73d-21314e118a53 | siddhantkhandelwal/competitiveprog-submissions | codeforces/A_Petya_and_Strings.cpp | #include <bits/stdc++.h>
#define ll long long int
using namespace std;
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
string s1, s2;
cin >> s1 >> s2;
transform(s1.begin(), s1.end(), s1.begin(), ::tolower);
transform(s2.begin(), s2.end(), s2.begin(), ::tolower);
int ans;
... | ALGO | 0.999997 | 4.076643 |
ed6fa664-ee68-43b4-8867-a79d7814d67a | iwtbam/leetcode | code/lt0786.cpp | // https://leetcode-cn.com/problems/k-th-smallest-prime-fraction/
// k th smallest prime fraction
class Solution {
public:
vector<int> kthSmallestPrimeFraction(vector<int>& arr, int k) {
double l = 0.0, r = 1.0;
vector<int> ans(2, 0);
while(r - l > 1e-9){
double mid = (l + r) / ... | ALGO | 0.999806 | 4.914138 |
70d549df-1414-4eab-bb6d-1054bf16b622 | RootGaurav/Leetcode | 1072. Flip Columns For Maximum Number of Equal Rows/1072.cpp | class Solution {
public:
int maxEqualRowsAfterFlips(vector<vector<int>>& matrix) {
int n = matrix.size();
int m = matrix[0].size();
if(m==1)return n;
map<vector<int>,int>mp;
int ans=0;
for(int i=0;i<n;i++){
mp[matrix[i]]++;
}
for(int i=0;i<... | ALGO | 0.999982 | 6.233404 |
ea01d7cd-7342-4156-b58d-f70d50a5eb4a | ishandutta2007/codeforces | nikarabika/normal/1555/E.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long int LL;
typedef pair<int, int> pii;
typedef pair<LL, LL> pll;
typedef long double LD;
#define L first
#define smax(x, y) (x) = max((x), (y))
#define sz(x) ((int)(x).size())
#define R second
#define smin(x, y) (x) = min((x), (y))
#define PB push_back
#de... | ALGO | 0.99996 | 4.1845 |
04ac5e8d-40f3-4e14-a8c0-b067c298a885 | taaha-0548/Project-3-DFA-Minimizer | src/Automaton.cpp | #include "Automaton.h"
#include "Utils.h"
using namespace std;
Automaton::Automaton() : numStates(0), startState("q0"), isDFA(true) {}
// Input alphabet from user
void Automaton::inputAlphabet() {
cout << "\nStep 1: Define Alphabet\n";
cout << "Enter alphabet symbols (e.g., ab for alphabet {a,b}): ";
str... | ALGO | 0.952509 | 6.016089 |
58b3853b-7310-4c1d-8090-6c5bf94d88a2 | code233trainee/lijiminbest | 蓝桥/14届C组省赛/B.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main()
{
// ios::sync_with_stdio(false);
// cin.tie(nullptr);
int yyyy, MM, dd, hh, mm, ss;
int mouth[] = {0,31,59,90,120,151,181,212,243,273,304,334,365};
vector<int> a;
for(int i = 1; i <= 520; i++)
{
scanf("%... | ALGO | 0.99971 | 3.964483 |
809f522c-45aa-4745-a2f4-d3197f7f7db7 | ishandutta2007/codeforces | frodakcin/normal/1416/F.cpp | #include <cstdio>
#include <cstring>
#include <cassert>
#include <algorithm>
#include <vector>
const int MN = 1e5+10;
const int dx[]={-1,0,1,0};
const int dy[]={0,1,0,-1};
const char dir[] = "URDL";
const int INF = 0x3f3f3f3f;
template<typename F, int MN, int MM>
struct MaxFlow// Dinic's, because Hopcroft-Karp, maybe... | ALGO | 0.999954 | 3.836865 |
232271c8-8a74-48fb-acd5-c65e93e49ef9 | Ashish-012/Ds-Algo | Stack/prefix_evaluate.cpp | #include<bits/stdc++.h>
using namespace std;
float isOperator(char ch){
if(ch=='+'||ch=='-'||ch=='*'||ch=='/'||ch=='^')
return 1;
return -1;
}
float evaluate(string expr){
stack <float> s;
int a,b;
for(int i=expr.size()-1;i>=0;i--){
if(isOperator(expr[i]) !=-1){
a=s.top();
s.pop();
b=s.top();
s.... | ALGO | 0.999942 | 4.318299 |
90dac727-5313-4649-849a-cd1e177c0d68 | samshadnc/Samshad | libraries/AC_PID/AC_PI_2D.cpp | /// @file AC_PI_2D.cpp
/// @brief 2-axis PI controller
#include <AP_Math/AP_Math.h>
#include "AC_PI_2D.h"
const AP_Param::GroupInfo AC_PI_2D::var_info[] = {
// @Param: P
// @DisplayName: PI Proportional Gain
// @Description: P Gain which produces an output value that is proportional to the current error v... | ALGO | 0.997626 | 6.096529 |
32423dbe-ff7a-4ad4-bf03-7ae00ed4fbea | f-zyj/ACM | 按 OJ 分类/51Nod/f-51Nod-1244-莫比乌斯函数之和/f-51Nod-1244-莫比乌斯函数之和/main.cpp | #include <iostream>
#include <cstdio>
using namespace std;
typedef long long ll;
const int MAXN = 5e6 + 10;
const int MOD = 857777;
ll a, b;
int tot;
ll tmp[MOD];
ll val[MOD];
int mu[MAXN];
int prime[MAXN];
int sum[MAXN];
int nxt[MOD];
int had[MOD];
bool vis[MAXN];
void add(int x, ll y, int z)
{
val[++tot] = y... | ALGO | 0.999974 | 4.712491 |
bd313bfb-5687-45cd-9a7b-a2263b2a225a | ishandutta2007/codeforces | lycmd/normal/1687/B.cpp | #include<bits/stdc++.h>
#define int long long
using namespace std;
int const N=2333;
int n,m,x,ans;
string s;
pair<int,int>e[N];
int ask(const string&s){
return cout<<"? "<<s<<endl,cin>>x,x;
}
signed main(){
ios::sync_with_stdio(0);
cin>>n>>m,s=string(m,48);
for(int i=0;i<m;i++)
s[i]++,e[i]={ask(s),i},s[i]--;
so... | ALGO | 0.999993 | 3.305805 |
e86f336b-fd8c-4755-8de6-0a05b2b9c19b | duneesh/FOC | summing up any n numbers and finding average.foc.cpp | #include <stdio.h>
int main() {
int n, i;
float num, sum = 0, avg;
printf("Enter the number of values to be entered: ");
scanf("%d", &n);
for (i = 0; i < n; i++) {
printf("Enter value %d: ", i+1);
scanf("%f", &num);
sum += num;
}
avg = sum / n;
... | ALGO | 0.971178 | 3.39436 |
eba2def9-b24d-48eb-9f9a-cc2ebb3b48c8 | Uditgupta08/LeetCode | 1818-maximum-score-from-removing-substrings/1818-maximum-score-from-removing-substrings.cpp | class Solution {
public:
int solve(string& s, int x, string curr) {
int ans = 0;
int i = 0;
int n = s.size();
while (i < n - 1) {
if (s[i] == curr[0] && s[i + 1] == curr[1]) {
n -= 2;
ans += x;
s.erase(i, 2);
... | ALGO | 0.999957 | 5.491085 |
4f38d21b-f2d2-4943-ac9e-ea92b3217276 | h50039135/llvm_maybe | llvm/lib/CodeGen/EarlyIfConversion.cpp | #include "llvm/ADT/BitVector.h"
#include "llvm/ADT/PostOrderIterator.h"
#include "llvm/ADT/SetVector.h"
#include "llvm/ADT/SmallPtrSet.h"
#include "llvm/ADT/SparseSet.h"
#include "llvm/ADT/Statistic.h"
#include "llvm/CodeGen/MachineBranchProbabilityInfo.h"
#include "llvm/CodeGen/MachineDominators.h"
#include "llvm/Code... | ALGO | 0.99213 | 8.069721 |
d319cc68-8200-4e21-9e5e-f241d4a1136c | imteekay/algorithms | competitive-programming/uri/blobs.cpp | // https://www.urionlinejudge.com.br/judge/en/problems/view/1170
#include <iostream>
using namespace std;
int main() {
int n;
double x;
cin >> n;
while (n--) {
cin >> x;
int counter = 0;
while (x > 1) {
x /= 2;
counter++;
}
cout << counter << " dias" << endl;
}
return... | ALGO | 0.999597 | 4.233918 |
e2d55897-e4c5-4ac8-9a3b-1cb1aa1acd6b | SrinivasuluCharupally/interviewQuestions | Trees/MinDepthOfBinaryTree.cpp | #include<iostream>
#include<vector>
using namespace std;
typedef struct node {
int data;
node *right, *left;
node(int i) : data(i), left(NULL), right(NULL) {}
} node;
int recursion(node *head) {
if(head == NULL) return 0;
else if(!head->left && head->right) return 1;
return 1+min(recursion(head->left), recu... | ALGO | 0.999943 | 5.085233 |
5b03d5b8-bc6e-45a4-a000-14509d926122 | zxyDEDIRE/ACM_CODE | CodeForces/Codeforces Round 888 (Div. 3)/C.cpp | /*
嵌套变量重复 特殊样例 0 1 2 n 数组越界 开long long
清空 建图别用vector
*/
#include<bits/stdc++.h>
using namespace std;
#define endl "\n"
#define pp(x) array<int,x>
using ull=unsigned long long;
using ll=long long;
using pii=pair<int,int>;
using pdd=pair<double,double>;
const int dx[]={0,0,1,-1,1,-1,1,-1};
const int dy[]={1,-1,0,0,1,-1... | ALGO | 0.999999 | 3.941079 |
e0874a32-5891-45d5-b38d-5b034e787f8f | Utkrisht2/Intresting-problems | problems+snippet/problem37.cpp | /*You have N balls and K boxes. You want to divide the N balls into K boxes such that:
Each box contains ≥1 balls.No two boxes contain the same number of balls.
Determine if it is possible to do so.*/
#include <iostream>
using namespace std;
int main() {
// your code goes here
int t;
cin>>t;
while(t--){
int ... | ALGO | 0.999734 | 4.949592 |
87d3e87d-cb29-4662-b341-c960e911b517 | daybreaker42/Problem-Solve | 2025_PS_STUDY/data structure/15_1918.cpp | #include <bits/stdc++.h>
#define fastio ios::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
using namespace std;
// const bool debug = false;
// 연산자 우선순위 지정
map<char, int> priority = {
{'(', 3},
{')', 3},
{'*', 2},
{'/', 2},
{'+', 1},
{'-', 1},
};
string result;
stack<string> variabl... | ALGO | 0.999925 | 4.622262 |
450d7e86-cdf6-4417-91bf-6bbb8c136398 | victor-lvsy/seq_align | src/nw.cpp | #include "nw.h"
// Sequential implementation of the needleman-wunsch algorithm on CPU
void nw(const std::string &seq1, const std::string &seq2, int match, int mismatch, int gap) {
int n = seq1.length();
int m = seq2.length();
std::vector<std::vector<int>> score(n + 1, std::vector<int>(m + 1, 0));
//... | ALGO | 0.999102 | 4.615798 |
40f579b3-9cb7-4167-b076-9fadfa4dc958 | 113bommy/deepmind_codecontests_refine | cpp_source_filter_file/cpp_train_7474_28.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int A, B, C;
cin >> A >> B >> C;
cout << C - (A + B) << endl;
}
| ALGO | 0.999875 | 4.050049 |
b5317fc9-25b4-457d-961c-305e6dcac09c | bdsullivan/INDDGO | lib_treed/src/TDTree.cpp | #include "GraphDecomposition.h"
#include "TreeDecomposition.h"
#include "Debug.h"
#include "Util.h"
#include "RndNumGen.h"
#include <math.h>
#include <algorithm>
/**
* The constructor for the TDTree class. Allocates necessary data structures
* based on the size of the provided Graph.
*/
TDTree::TDTree(Graph::VertexWei... | ALGO | 0.997392 | 4.278865 |
d7492ce3-d902-4513-b96e-60b984f83ebd | Neonlab-kr/CPP_Server | GameServer/GameServer.cpp | #include "pch.h"
#include <iostream>
#include "CorePch.h"
#include <atomic>
#include <mutex>
#include <windows.h>
#include <future>
#include "ThreadManager.h"
#include <vector>
#include <thread>
// 소수 구하기
bool IsPrime(int number)
{
if (number <= 1)
return false;
if (number == 2 || number == 3)
return true;
fo... | ALGO | 0.969597 | 4.432964 |
87b428be-6302-4828-806d-4998055fa6b2 | mh-mehdikhani2003/Basic_Programing_Cpp | Quiz/Quiz8,9/piadesazi1.cpp | #include <iostream>
using namespace std;
long long int H_max (long long int A[],int i)
{
long long int max;
if(i==0){return A[0];}
else
{
max=H_max(A,i-1);
if(max<A[i]){return A[i];}
else
{
return max;
}
}
}
int main()
{
int n;
cin>>n;
... | ALGO | 0.999854 | 4.66174 |
f4bbb322-a746-44d6-8fba-ed0d7fa090bd | pchapin/cpp | QTree/query_tree.cpp |
#include <cstddef>
#include <fstream>
#include <iostream>
#include <string>
#include <vector>
using namespace std;
bool matching_key_path( const vector<string> &path_components, const string &search_key_path )
{
string current_key_path;
for( const auto &path_component : path_components ) {
current_ke... | TOOL | 0.985251 | 6.016023 |
6446d2b0-4217-420f-8c6b-5ef20e6ab446 | MahinAshraful/CodeWatch_Data | sample-data/p00006/s245975395.cpp | #include<iostream>
#include<algorithm>
#include<string>
#include<math.h>
using namespace std;
int keta(int x){
int i=0;
while (x/pow(10,i)>=1){
i++;
}
if (x==0){
return 1;
}
else
return i;
}
int main(){
string s;
cin>>s;
int x=s.size();
string a="";
for (int i=1;i<=x;i++){
a+=s[x-i];
}
cout<<a<<endl;
} | ALGO | 0.999908 | 3.721642 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.