uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
c04b8032-bddd-4265-adad-e2ab7bb1c079 | Rkp420/LeetCodeDaily | Nov-LeetCodeDaily/Day20.cpp | #include <iostream>
#include <string>
using namespace std;
class Solution
{
public:
int takeCharacters(string s, int k)
{
int n = s.length();
if (n == 0)
return -1;
vector<int> freq(3, 0);
// Step 1 : Storing the frequency of the characters
for (char ch : s)... | ALGO | 0.999978 | 5.355953 |
1cc46c58-b460-4d49-a634-083c616253e4 | newer-zhu/Aubo_Obstacle_Avoidance | src/aubo_robot-melodic/aubo_kinematics/src/kinematics.cpp | #include "aubo_kinematics/kinematics.h"
#include <stdarg.h>
#include <sys/time.h>
#define ARM_DOF 6
const double ZERO_THRESH = 1e-4;
const double PI = M_PI;
#ifdef AUBO_I3_PARAMS
const double a2 = 0.266;
const double a3 = 0.2565;
const double d1 = 0.157;
const double d2 = 0.119;
const double d5 = 0.1025;
const double... | ALGO | 0.999163 | 3.862783 |
3889159b-6948-4d15-ad84-404439928cab | kkmw0/Baekjoon-Online-Judge | DP/2491.cpp | #include <iostream>
#include <algorithm>
using namespace std;
int n, result = 1;
int arr[100001];
int d_inc[100001];
int d_dec[100001];
int main(void){
ios::sync_with_stdio(0); cin.tie(0);
cin >> n;
for(int i = 1; i <= n; i++){
cin >> arr[i];
d_inc[i] = 1;
d_dec[i] = 1;
}
... | ALGO | 0.999984 | 4.434511 |
681138d7-a9b5-4040-9a08-ce5bf79f8789 | salimmia/Problem-Solving | Code_Template/Notes and files/code-library-shahjalal shohag/Graph Theory/Online Articulation Bridges.cpp | #include<bits/stdc++.h>
using namespace std;
const int N = 1e5 + 9;
// Given number of nodes n and q queries
// add edge (u,v)
// output the bridges in current graph
int n, bridges, par[N], bl[N], comp[N], sz[N];
void init() {
for (int i = 0; i < n; ++i) {
bl[i] = comp[i] = i;
sz[i] = 1;
par[i] = -1;
}... | ALGO | 0.99941 | 4.866199 |
fde52eff-5fb1-4c64-92f7-ae09a445ffd9 | ehdnd/SCCC | BOJ/math/소수의_곱.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
const ll MAX = 1LL << 31;
int K, N, cnt = 0;
vector<ll> P;
priority_queue<ll> pq;
void Solve() {
cin >> K >> N;
while (K--) {
ll x;
cin >> x;
pq.push(-x);
P.push_back(x);
}
ll p = -1;
while (1) {
ll x = pq.top();
... | ALGO | 0.99998 | 4.257583 |
7cdfd111-066b-438b-84d3-26cf29092452 | iamitshaw/dsa-series | LRNDSA01/TEST/main.cpp | #include <bits/stdc++.h>
int32_t main(int32_t rgc,char* argv[]) {
/* fast input-output */
std::ios_base::sync_with_stdio(false);
std::cin.tie(nullptr);
std::cout.tie(nullptr);
/* get number */
int32_t number;
/* process number until 42 is entered */
while (std::cin >> number && number... | ALGO | 0.985119 | 3.860392 |
b39145e3-1556-44d5-8626-531fa38e4ad1 | 18pa1a0520/Pantheon_Assignment | third_party/proto-quic/src/third_party/icu/source/tools/toolutil/filetools.cpp | #include "unicode/platform.h"
#if U_PLATFORM == U_PF_MINGW
// *cough* - for struct stat
#ifdef __STRICT_ANSI__
#undef __STRICT_ANSI__
#endif
#endif
#include "filetools.h"
#include "filestrm.h"
#include "charstr.h"
#include "cstring.h"
#include "unicode/putil.h"
#include "putilimp.h"
#include <stdio.h>
#include <stdli... | TOOL | 0.881237 | 4.922137 |
382094bb-71e4-454a-84ce-4b3e4c9fcfe0 | selinger/katahex | cpp/tests/testnnevalcanary.cpp | #include "../tests/tests.h"
#include "../neuralnet/nneval.h"
#include "../dataio/sgf.h"
//------------------------
#include "../core/using.h"
//------------------------
void Tests::runCanaryTests(NNEvaluator* nnEval, int symmetry, bool print) {
{
string sgfStr = "(;GM[1]FF[4]CA[UTF-8]AP[CGoban:3]ST[2]RU[Chines... | TEST | 0.966022 | 7.296135 |
745a1c57-02c6-4295-8595-50be2e9fcb5e | dustingarner/LeetcodeProblems | Leetcode25.cpp | /**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode() : val(0), next(nullptr) {}
* ListNode(int x) : val(x), next(nullptr) {}
* ListNode(int x, ListNode *next) : val(x), next(next) {}
* };
*/
class Solution {
public:
ListNode* reverseKGro... | ALGO | 0.999992 | 5.91003 |
6d1883ee-e43a-445f-a0e4-b5b8a13afa83 | jayeshpatel8/Coding-Practise-using-Leetcode-Coding-Platform | problems/substring_xor_queries/solution.cpp | class Solution {
public:
vector<vector<int>> substringXorQueries(string s, vector<vector<int>>& queries) {
unordered_map<int, vector<int>> m;
for (int i = 0; i<s.size(); i++){
long long val = 0;
for (int j=i; j<min<int>(s.size(), i+30); j++){
val =( val << 1) +... | ALGO | 0.999727 | 5.761663 |
ccbf8d39-ab62-4614-b269-c5166232f254 | navanizard/CS135_Projects | Arrays_and_Vectors/sort_with_pointers.cpp | /*
Author: Nava Karine Nizard
Course: CSCI-135
Instructor: Professor Tong Yi
Date: March 19, 2025
Assignment: Homework E7.1
This program defines a function sort2 that receives two pointers and sorts
the values to which they point, such that x <= y.
*/
#include <iostream>
using namespace std;
void sort2(double* p, d... | ALGO | 0.999974 | 5.666204 |
b95b7bad-ea08-43bc-8530-da9881705c85 | 565353780/filter-socket | ie/src/extension/ext_roifeatureextractor_onnx.cpp | #include "ext_list.hpp"
#include "ext_base.hpp"
#include <cassert>
#include <cmath>
#include <vector>
#include <string>
#include <algorithm>
#include "ie_parallel.hpp"
namespace InferenceEngine {
namespace Extensions {
namespace Cpu {
// implementation taken from Caffe2
template <typename T>
struct PreCalc {
int po... | DATA | 0.900033 | 6.964178 |
e093bb14-3e68-47af-a7b0-3bd5a8dce938 | BioDataAnalysis/blaze | blazemark/src/boost/SMatDVecMult.cpp | //=================================================================================================
//=================================================================================================
//*************************************************************************************************
// Includes
//****... | ALGO | 0.999679 | 5.451661 |
ca5be530-850e-40d0-83d5-cffff95f236a | 20MH1A0590/Leetcode | Arrays/Easy/leetcode561.cpp | class Solution {
public:
int arrayPairSum(vector<int>& nums) {
sort(nums.begin(),nums.end());
int max_sum = 0;
int k = nums.size();
for(int i = 1; i <= k; i += 2)
{
max_sum += min(nums[i],nums[i-1]);
}
return max_sum;
}
};
| ALGO | 0.99968 | 5.866116 |
b53d5fb8-dc15-48d6-a8e2-3c19a8c3e4d5 | ashikurrahmanbhuiyan/codeforces | codeton4/A.cpp | #include <bits/stdc++.h>
using namespace std;
#define el "\n"
#define in(a) int a=1; cin >> a;
#define int long long int
#define vi vector<int>
#define gcd(a,b) __gcd(a,b)
#define lcm(a,b) (a*b)/__gcd(a,b)
#define lb(arr,n,t) lower_bound(... | ALGO | 0.999804 | 4.213238 |
15955a53-2180-434c-83b3-5ed16d493651 | ridhambabariya/Assignment | FINALS/SE MODULE 4/Constructor and OOP/1.cpp | /*Write a program to find the multiplication values and the cubic values using inline function*/
#include <iostream>
using namespace std;
inline int multiply(int a,int b)
{
return a*b;
}
inline int cubic(int x)
{
return x*x*x;
}
int main()
{
int num1,num2,num;
cout<<"Enter any 2 number = ";
cin>>num... | ALGO | 0.991839 | 4.385306 |
33d2910e-0ab8-4b4e-aaf4-d4c0b3f3b755 | Luislc1/SharedPreferences-e-Provider | 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 |
e1719a1b-2fdc-4be2-b478-3ab68a54c378 | casafurix/LeetCode | Problems/Easy/88_MergeSortedArray.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
void merge(vector<int> &nums1, int m, vector<int> &nums2, int n)
{
int first = m - 1, second = n - 1;
for (int i = m + n - 1; i >= 0; i--)
{
if (second < 0)
break;
if (nums1[first] > nums2[second])
{
... | ALGO | 0.999859 | 3.103935 |
e39c5729-7438-4812-8c68-2501b1ff1c4b | Ta0Huu/ddisStructure | lab20_2.cpp | #include<iostream>
using namespace std;
struct Rect{
double x,y,w,h;
};
double overlap(Rect *r1,Rect *r2){
double x1 = max(r1->x,r2->x)-min(r1->x+r1->w,r2->x+r2->w);
double y1 = max(r1->y-r1->h,r2->y-r2->h)-min(r1->y,r2->y);
if(x1*y1 <= 0)return 0;
return x1*y1;
} | ALGO | 0.98916 | 3.402637 |
2971946f-fd15-4d12-a6b5-6b8aa1bf00fc | adityanjr/code-DS-ALGO | CodeForces/Complete/1-99/39J-SpellingCheck.cpp | #include <iostream>
#include <vector>
int main(){
std::ios_base::sync_with_stdio(false);
std::string s, t; std::cin >> s >> t;
long ind(0), pos(s.size() - 1); bool inc(false), possible(true);
for(long p = 0; p < t.size(); p++){
if(t[p] == s[ind]){++ind;}
else if(!inc && t[p] == s[ind ... | ALGO | 0.999988 | 3.913841 |
c7f819a0-cede-407b-ae38-15beee94d19c | Next-Gen-UI/Code-Dynamics | Leetcode/0438. Find All Anagrams in a String/0438.cpp | class Solution {
public:
vector<int> findAnagrams(string s, string p) {
vector<int> ans;
vector<int> count(128);
int required = p.length();
for (const char c : p)
++count[c];
for (int l = 0, r = 0; r < s.length(); ++r) {
if (--count[s[r]] >= 0)
--required;
while (requi... | ALGO | 0.999967 | 6.767301 |
e1a066b6-22a4-4002-b829-12ddda5459ee | DuaMohyyudin/Object_Oriented_Programming | Lab06/Q4_21L-5797.cpp | #include<iostream>
using namespace std;
class polynomial
{
private:
int totalterm;
int *coeff;
int *exp;
public:
polynomial() : totalterm(0), coeff(0), exp(0) {}
polynomial(int n,int *a,int *b){
totalterm=n;
coeff=a;
exp=b;
}
friend ostream & operator<<( ostream & out, const polynomial & t);
fri... | ALGO | 0.990238 | 3.671899 |
84542202-f687-46b7-9936-c4fed9331436 | Kawser-nerd/CLCDSA | Source Codes/CodeJamData/13/53/19.cpp | #include <cstdio>
#include <cstring>
#include <algorithm>
#include <queue>
#define FOR(i,s,e) for (int i=(s); i<(e); i++)
#define FOE(i,s,e) for (int i=(s); i<=(e); i++)
#define FOD(i,s,e) for (int i=(s)-1; i>=(e); i--)
#define CLR(a,x) memset(a, x, sizeof(a))
#define EXP(i,l) for (int i=(l); i; i=qn[i])
#define LLD lo... | ALGO | 0.999798 | 3.396405 |
7ce3186e-e095-48bf-a938-38351b3ce6b2 | QinHongZhe/hongzhe-leetcode | solution/0500-0599/0551.Student Attendance Record I/Solution.cpp | class Solution {
public:
bool checkRecord(string s) {
return count(s.begin(), s.end(), 'A') < 2 &&
s.find("LLL") == string::npos;
}
};
| ALGO | 0.999453 | 5.574326 |
c675234b-38d2-4a89-8480-0d3d00c79e59 | kirillserious/2018-1-contest | up10/task_01.cpp | #include <iostream>
#include <vector>
using namespace std;
vector<char> v;
void
f (int k, int flag)
{
if (!k) {
for (auto i = v.rbegin(); i != v.rend(); ++i) {
cout << *i;
}
cout << endl;
return;
}
v[k - 1] = '1';
f(k - 1, 1);
v[k - 1] = '2';
... | ALGO | 0.999925 | 3.906705 |
427428c8-8f5d-48f5-b555-6bf1b9632010 | BeeCoder-Git/Medi_Minder_App | 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 |
358aa9d7-b7a8-4a59-b866-7df846a7ff5b | mostafaabuBakr9/Movie_App | 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 |
b6ee0334-d797-4e98-82f5-ef895e1e71a7 | Anggaysm/algo-perkuliahan | coding challange/akarakar.cpp | #include <iostream>
#include <math.h>
using namespace std;
int main (){
double a,b,c,d,x1,x2;
cout << "Input a : ";
cin >> a;
cout << "Input b : ";
cin >> b;
cout << "Input c : ";
cin >> c;
d = b*b-4*a*c;
if (d >= 0)
{
x1 = (-b + sqrt(d)) /(2 * a);
x2 = (-b - sqr... | ALGO | 0.999679 | 3.626343 |
39f89a1e-e99c-4e62-a938-594a1dcea8ed | TACC/GraviT | third-party/glm/test/core/core_func_integer_find_msb.cpp | // This has the programs for computing the number of leading zeros
// in a word.
// Max line length is 57, to fit in hacker.book.
// Compile with g++, not gcc.
#include <cstdio>
#include <cstdlib> // To define "exit", req'd by XLC.
#include <ctime>
#define LE 1 // 1 for little-endian, 0 for big-endian.
... | ALGO | 0.998727 | 3.230461 |
7c4aa727-4cfa-4a0b-afaa-48ffb5800f86 | nayoungjin39/test | 프로그래머스/1/12943. 콜라츠 추측/콜라츠 추측.cpp | #include <string>
#include <vector>
using namespace std;
int solution(int num) {
long long n = num;
int answer = 0;
while(n != 1){
if
(answer >= 500) return-1;
if
(n % 2 == 0)
n /= 2;
else
n = n * 3 + 1 ;
answer... | ALGO | 0.999945 | 5.24127 |
d1dd8898-5804-47bb-8f20-f5f6846f0cbb | ishandutta2007/codeforces | krijgertje/normal/628/C.cpp | #include <algorithm>
#include <iostream>
#include <sstream>
#include <string>
#include <cstring>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <cstdio>
#include <cstdlib>
#include <cctype>
#include <cmath>
#include <list>
#include <cassert>
#include <ctime>
#include... | ALGO | 0.999969 | 3.413629 |
09e00312-1715-406f-853c-71f0d3af8ae2 | priyanshkulshrestha/Hacktoberfest-22 | dsa/array/chocolateDistribution.cpp | // { Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution{
public:
long long findMinDiff(vector<long long> a, long long n, long long m){
//code
sort(a.begin(),a.end());
long long mini = INT_MAX;
for(int i =0;i<=n-m;i++){
int x = a[i+m-1]... | ALGO | 0.999866 | 5.838897 |
5aa417f8-8321-47da-aaf0-f55d79d9cccb | ravinderdevesh/codechef | chefluck.cpp | #include <iostream>
#include <stdio.h>
using namespace std ;
int main () {
int T ;
long long N ;
scanf("%d" , &T) ;
while(T--) {
scanf("%lld" , &N) ;
long long x ;
bool found = false ;
for(long long y = 0 ; N - 4 * y >= 0 ; y++) {
x = (N - 4 * y) ;
if(x % 7 == 0) {
found = true ;
printf("%lld... | ALGO | 0.999758 | 3.758652 |
7e16a120-9591-46b0-8f66-ba81d88698db | trgtanhh04/Programming-Techniques | Struct_C++/Bai2_Tong2phanso/2.cpp | #include<iostream>
using namespace std;
struct phanso {
long long tu, mau;
};
int gcd(int a, int b) {
if (b == 0) return a;
return gcd(b, a % b);
}
void nhap(phanso& x) {
cout << "Nhap phan so " << endl;
cin >> x.tu >> x.mau;
}
void tong(phanso& p, phanso& q) {
int t, m;
t = p.tu * q.mau + p.mau * q.tu;
m = p.... | ALGO | 0.999572 | 5.005988 |
fa25ffff-7dd5-48b5-9e8b-a1bfd6908e56 | hp1430/My-DSA-codes-in-C- | Binary Search/InfiiniteSortedArray.cpp | // Given an infinite sorted array, we have to search a specific element in the array.
#include <iostream>
using namespace std;
int main()
{
int n=8;
int a[] = {1,2,4,7,10,12,15,18};
int target=10;
int lo=0, hi=1;
while(a[hi]<target)
{
lo=hi;
hi *= 2;
}
int mid=0;
cou... | ALGO | 0.99966 | 5.065785 |
162d8706-47f9-4bf6-b290-17d672845e5c | ishandutta2007/codeforces | gs12117/normal/590/C.cpp | #include<stdio.h>
int n,m;
char map[1010][1010];
int q[1100000][2];
int dist[3][1010][1010];
int chk[1010][1010];
int qs,qe;
int s[3];
int ans;
void qpush(int x,int y,int p,int d){
if(x<0||x>=n||y<0||y>=m||chk[x][y]==1||map[x][y]=='#')return;
chk[x][y]=1;
dist[p][x][y]=d;
q[qe][0]=x;
q[qe][1]=y;
qe++;
}
int main(... | ALGO | 0.999926 | 3.244566 |
d0d51ff7-e005-42f0-94cd-659194a65f65 | kwikius/ultrasonic_wind_sensor | libraries/UltrasonicWindSensor/wind_sensor_impl.cpp |
/**
* @brief quan.h is required for arduino framework to
* pick up the quan library in the ../../libraries folder
*/
#include <quan.h>
#include <quan/time.hpp>
#include <quan/frequency.hpp>
#include <builtin_led.h>
#include "flight_sequence.h"
// for showing output at human visible speed
//#define UWS_SLOW_M... | TOOL | 0.897976 | 5.230079 |
34b14069-28e8-41ca-950d-83bc60b68be0 | lluisalemanypuig/physics-simulator | examples/interfaces/spring-meshes/sim_03.cpp | // C includes
#include <string.h>
// C++ includes
#include <iostream>
using namespace std;
// glm includes
#include <glm/vec3.hpp>
// render includes
#include <render/triangle_mesh/rendered_triangle_mesh.hpp>
#include <render/geometry/robject.hpp>
#include <render/shader/shader_helper.hpp>
#include <render/include_g... | ALGO | 0.932646 | 4.519742 |
ef5a02d5-3692-44d1-a285-994d00b52e00 | Metrological/cobalt | src/third_party/icu/source/tools/toolutil/ucm.cpp | #include "unicode/utypes.h"
#include "unicode/ustring.h"
#include "cstring.h"
#include "cmemory.h"
#include "filestrm.h"
#include "uarrsort.h"
#include "ucnvmbcs.h"
#include "ucnv_bld.h"
#include "ucnv_ext.h"
#include "uparse.h"
#include "ucm.h"
#include <stdio.h>
#if !UCONFIG_NO_CONVERSION
/* -----------------------... | TOOL | 0.937659 | 6.925716 |
45cf83be-81bb-458e-b03d-dd34624f5263 | weakson/code | codeforces/r913/pa.cpp | #include<bits/stdc++.h>
#define ll long long
#define F first
#define S second
#define weakson ios::sync_with_stdio(0), cin.tie(0);
#define pll pair<ll, ll>
#define dbg(x) cout << #x << " = " << x << endl;
using namespace std;
string row = "abcdefgh";
string col = "12345678";
int main(){
weakson;
int t;
cin >> t;
... | ALGO | 0.999414 | 3.959798 |
b8d73656-1c48-4330-a313-8179f4031550 | Stachq1/safe_nav_dynamic_env | eigen3/doc/examples/Tutorial_ReductionsVisitorsBroadcasting_reductions_bool.cpp | #include <Eigen/Dense>
#include <iostream>
using namespace std;
using namespace Eigen;
int main()
{
ArrayXXf a(2,2);
a << 1,2,
3,4;
cout << "(a > 0).all() = " << (a > 0).all() << endl;
cout << "(a > 0).any() = " << (a > 0).any() << endl;
cout << "(a > 0).count() = " << (a > 0).count() << endl... | ALGO | 0.972578 | 3.835741 |
fb08f6a9-4e0c-4fd3-a721-5cc39cbd67d5 | zadigus/cfsSIA3D | Numerics/Algorithms/PrimalAlgorithms/DiffusionAlgorithms/SemiImplicitDiffusionAlgorithm.cpp | #include "SemiImplicitDiffusionAlgorithm.hpp"
// Glacier
#include "Glacier/Glacier.hpp"
#include "Numerics/Mesh/Grid.hpp"
#include "Glacier/GlacierComponents/Rheology/Rheology.hpp"
#include "Glacier/GlacierComponents/SlidingLaw/SlidingLaw.hpp"
// Linear system
#include "Numerics/LinSyst/LinSyst.hpp"
#include "Teuchos... | ALGO | 0.99944 | 5.794361 |
512fc069-5b65-4867-864e-26286a591430 | 10000Je/algorithm-training | BaekJoon/Silver/1389/C++/1389.cpp | // no.1389: 케빈 베이컨의 6단계 법칙 (S1)
#include <cstdio>
#include <queue>
#include <vector>
#include <set>
#include <map>
using namespace std;
int bfs(vector<vector<int>>&, map<int, int>&, int);
int main() {
int n, m;
scanf("%d %d", &n, &m);
vector<vector<int>> graph(n+1, vector<int>(n+1, -1));
for(int i=1;... | ALGO | 0.999865 | 4.152837 |
02508b13-9d4d-4886-9327-875e1a2e61a9 | raincross7/code-similarity | codes/train_code/problem279/problem279_366.cpp | #include <bits/stdc++.h>
using namespace std;
#define _GLIBCXX_DEBUG
#define rep(i,n) for(long long i = 0; i < (n); ++i)
#define ll long long
#define P pair<ll,ll>
#define all(v) (v).begin(),(v).end()
const ll mod = 1e9+7;
const ll INF = 1e18;
const double pi = acos(-1.0);
int main(void)
{
string s;
cin>>s;
... | ALGO | 0.999876 | 3.826217 |
bbc7d741-a0b6-41b4-b863-ee8d4f059f3c | priyajit27/Leetcode | 0501-find-mode-in-binary-search-tree/0501-find-mode-in-binary-search-tree.cpp | /**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode() : val(0), left(nullptr), right(nullptr) {}
* TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}
* TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), l... | ALGO | 0.999993 | 6.152793 |
e02e5190-3597-4c5a-bd8c-4212544e72bf | Tanukumar01/DSA-series | Array/max_sum_subarray.cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
int ar[7]={3,-4,5,4,-1,7,8};
int maxSum= INT_MIN;
for(int st=0;st<7;st++){
int cur_sum =0;
for(int end=st;end<7;end++){
cur_sum=cur_sum+ar[end];
maxSum= max(cur_sum,maxSum);
}
} cout<<""<<maxSum... | ALGO | 0.999947 | 3.801835 |
6de59c3f-0dc1-4f55-a29c-aa4bedad3b33 | isage/vita-boost | libs/move/example/doc_move_iterator.cpp | //[move_iterator_example
#include <boost/container/vector.hpp>
#include "movable.hpp"
#include <cassert>
int main()
{
using namespace ::boost::container;
//Create a vector with 10 default constructed objects
vector<movable> v(10);
assert(!v[0].moved());
//Move construct all elements in v into v2
ve... | TEST | 0.881149 | 4.427506 |
98d03cd3-632e-433e-a937-08f4ee3b3684 | raincross7/code-similarity | codes/train_code/problem016/problem016_315.cpp | #include<iostream>
#include<vector>
const static int MOD = 1e9 + 7;
int main(void){
int n;
std::cin >> n;
std::vector<long long> a(n);
for(int i = 0; i < n; i++){
std::cin >> a[i];
}
long long x;
long long ans = 0;
long long tmp;
for(long long i = 0; i < 60; i++){
x = 0;
for(int... | ALGO | 0.999984 | 4.233003 |
f0b50e08-0af9-4d20-9d8c-1c355ee54ec9 | Istimam/phitron_code | 2.C++ For Data Structure/Week02 Class & String/Module06 More about Class & String/reverse_word_print.cpp | #include<bits/stdc++.h>
using namespace std;
void print(stringstream&/*Referrence*/ ss)
{
string word;
/*Base case*/
if(ss>>word)
{
/*Recursion*/
print(ss);
cout<<word<<endl;
}
}
int main()
{
string s;
getline(cin,s);
/*Word printing using stringstream*/
... | ALGO | 0.978605 | 3.839089 |
d8032eba-1558-4dfa-bf0f-c89d01144966 | dustincys/msphy-SCNAClonal | dependencies/eigen/build_dir/doc/snippets/compile_tut_arithmetic_redux_minmax.cpp | static bool eigen_did_assert = false;
#define eigen_assert(X) if(!eigen_did_assert && !(X)){ std::cout << "### Assertion raised in " << __FILE__ << ":" << __LINE__ << ":\n" #X << "\n### The following would happen without assertions:\n"; eigen_did_assert = true;}
#include <iostream>
#include <Eigen/Eigen>
#ifndef M_PI... | ALGO | 0.997853 | 3.39652 |
5791479c-fd6b-451a-8122-570a807303e1 | zhangsj96/athena_radRThybrid | src/radiation/frequencygrid.cpp | #include <sstream> // msg
#include <stdio.h> // fopen and fwrite
// Athena++ headers
#include "./radiation.hpp"
#include "../utils/utils.hpp"
//--------------------------------------------------------------------------------------
// \!fn void FrequencyGrid()
// \brief function to create the frequency grid
// spec... | ALGO | 0.996421 | 5.865842 |
c976fe96-a71f-4f49-a706-e240dc89bce9 | samikshamodi/CompetitiveProgramming | UVA12148-Electricity.cpp | /* samikshamodi - Samiksha Modi */
#include <bits/stdc++.h>
using namespace std;
int M[]={31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
bool oneday(int ad,int am, int ay, int bd, int bm, int by)
{
if(--bd==0)
{
if(--bm==0)
{
--by;
bm=12;
}
bd=M[bm-1];
bool isleap=(by%4 && (by%100!=0 || by%400==0... | ALGO | 0.999707 | 3.296733 |
dd66dd7f-bdcb-4140-9131-9b5bf0e4dea6 | shuklaravi/Online-Judges | codes-sahni/minmax1.cpp | // find the index/location of the min and max elements of a sequence
#include <iostream>
#include <algorithm>
using namespace std;
template<class T>
bool minmax(T a[], int n, int& indexOfMin, int& indexOfMax)
{// Locate min and max elements in a[0:n-1].
// Return false if less than one element.
if (n < 1) return... | ALGO | 0.999574 | 5.07596 |
31cdf4b5-76b7-40b9-9631-aa2534c1b85d | 3211SHANKAR/Leetcode-Solutions | 2265-partition-array-according-to-given-pivot/2265-partition-array-according-to-given-pivot.cpp | class Solution {
public:
vector<int> pivotArray(vector<int>& nums, int pivot) {
vector<int>v;
int count=0;
for(int i=0;i<nums.size();i++){
if(nums[i]<pivot)v.push_back(nums[i]);
else if(nums[i]==pivot)count++;
}
while(count--){
v.push_back(... | ALGO | 0.999985 | 6.173719 |
20bc523c-ec28-4237-a82c-19c7a65c447c | Ahmed-Zaher/CompetitiveProgramming | CodeChef/CODECHEF GNUM.cpp | /*
* This is a matching problem, we want to match pairs (i, j) with pairs (p, q)
* Consider the bipartite graph where L is set of all valid pairs (i, j) (as described in the problem)
* and R is the set of all valid (p, q). We then connect each node in L with a node in R if the gcd
* of the 2 nodes is > 1, and after... | ALGO | 0.999952 | 4.81536 |
d3e066b3-0ef9-4cee-ad93-ad29fe03089c | borman/checkers-game | src/main_bot/main_bot.cpp | #include "mask64.h"
#include "field.h"
#include "state.h"
#include "ai_ab.h"
#include "ai_chaotic.h"
#include "debug_io.h"
using namespace std;
const int maxDepth = 4;
int main()
{
State st;
try
{
st = State::read("matrix.txt");
}
catch (const string &err)
{
cout << "Error: " << err << endl;
... | ALGO | 0.984546 | 5.075965 |
bd9cd822-6b0b-40a7-9575-eb643b0034f5 | ishandutta2007/codeforces | bigbag/normal/1637/B.cpp | /**
* created: 12/02/2022, 16:38:25
**/
#include <bits/stdc++.h>
using namespace std;
const int max_n = 111, inf = 1000111222;
int t, n, a[max_n];
int main() {
//freopen("input.txt", "r", stdin);
//freopen("output.txt", "w", stdout);
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
cin >> ... | ALGO | 0.9998 | 5.447134 |
5df5e392-37ba-409b-9bb7-a8becafb8e50 | JunnyXiao1208/datasturct-cpp | 绪论/reverseArray.cpp | #include <algorithm>
//κεݹֹһݹʱβݹ顣
void reverseArray(int *A, int lo, int hi)
{
if (lo < hi)
{
std::swap(lo, hi);
reverseArray(A, lo + 1, hi - 1);
}
}
void reverseArray1(int *A, int lo, int hi)
{
next:
if (lo < hi)
{
std::swap(lo, hi);
lo++;hi--;
goto next;
... | ALGO | 0.999453 | 4.594772 |
ec90d6c9-7914-404f-a259-38612c004d77 | Alien147899/c-lessons | ch07/7_14_topfive.cpp | // topfive.cpp -- handling an array of string objects
#include <iostream>
#include <string>
using namespace std;
const int SIZE = 5;
void display(const string sa[], int n);
int main()
{
string list[SIZE]; // an array holding 5 string object
cout << "Enter your " << SIZE << " favorite astronomical sights:\n... | TOOL | 0.956422 | 4.468527 |
f9d8e0c9-f86c-4442-8f33-8d2b9a228d0a | DonghoOh-pipity03/Coding-Test | week2 - 그래프이론 DFS BFS/R1068.cpp | // 1068 - 절단점 -> BFS X
// DFS, Vector
#include<bits/stdc++.h>
using namespace std;
int n, d, t, answer, root;
vector<int> v[51]; // 입력은 최대 50개가 들어므로, 부모는 최대 50개 최소 1개가 될수 있다.
int dfs(int _parrent){
int ret = 0, c = 0;
for (auto i : v[_parrent]) {
if (i == d) continue;
c++;
ret += dfs(i);
}
if (c == 0) re... | ALGO | 0.999955 | 4.845839 |
0ccfc20c-1ace-4c3a-8d31-c2540e0ae66a | Fabho/UVA-Judge-Solutions | 11172 - Relational Operator/main.cpp | /*
Fabho
Fabian Calsina Chuquimia
2021
*/
#include <iostream>
using namespace std;
int main() {
int cases, numberOne, numberTwo;
char answer;
cin>>cases;
while(cases--) {
cin>>numberOne>>numberTwo;
if(numberOne > numberTwo)
answer = '>';
else if(numberOne == numbe... | ALGO | 0.999916 | 4.57103 |
6582f57a-6bd0-4a3f-9ae7-e38b2b5b5101 | yuntianyi-chen/Artifacts-of-ADS-Bug-Fix-Pattern-Study | data/bug-fix file-change dataset/autowarefoundation_autoware.universe/1398/after/planner_interface.cpp | #include "obstacle_cruise_planner/planner_interface.hpp"
namespace
{
StopSpeedExceeded createStopSpeedExceededMsg(
const rclcpp::Time & current_time, const bool stop_flag)
{
StopSpeedExceeded msg{};
msg.stamp = current_time;
msg.stop_speed_exceeded = stop_flag;
return msg;
}
tier4_planning_msgs::msg::StopRe... | ALGO | 0.89664 | 5.956314 |
b73d9faf-a7fd-4d44-ae07-e107f5c1f3b2 | FangYang970206/Leetcode | Difficulty/Medium/[18] 4Sum/solution.cpp | class Solution {
public:
vector<vector<int>> fourSum(vector<int>& nums, int target) {
vector<vector<int>> res;
int nums_size = nums.size();
if (nums_size < 4) return res;
sort(nums.begin(), nums.end());
int hi = nums[nums_size - 1];
map<int, int> num2id;
int m... | ALGO | 0.999988 | 6.064451 |
2435510c-c6a4-4a71-9ba2-ef0d50a96e96 | rohitshakya/CodeBucket | 2. Coding_Problems/Type1/factorial of a no.cpp | #include<iostream>
using namespace std;
void fact(int p);
int main()
{
int z,n;
cout<<"enter no"<<endl;
cin>>n;
fact(n);
}
void fact(int p)
{
long double fact=1,i=1;
for(i=1;i<=p;i++)
{
fact=fact*i;
}
cout<<"factorial of no is:"<<fact;
}
| ALGO | 0.999741 | 3.417045 |
5a586ce9-84ed-4a6c-9686-8cfd6b10c856 | RamazanFIT/algorithms | part1/lab5/quick_sort.cpp | #include <bits/stdc++.h>
#define ENDL "\n"
#define ff first
#define ss second
#define all(x) (x).begin(), (x).end()
#define endd return 0;
#define goodluck ios_base::sync_with_stdio(0);cin.tie(NULL);cout.tie(NULL);
using ll = long long;
using namespace std;
int get_random_number(int left, int right) {
return le... | ALGO | 0.999701 | 4.076956 |
1594d532-afea-47cb-9dab-9d402ac525b0 | drkvogel/retrasst | jonathanpr/BioBankPACStatusCGI/xmz.cpp | /*===========================================================================*/
/* TREATMENT MINIMIZATION UTILITIES */
/*===========================================================================*/
#include <time.h>
#include "xbasic.h"
#include "xdb.h"
#include "xsql.h"
#include "xquery.h"
#include "xmz.h"
/*======... | ALGO | 0.941777 | 4.739248 |
e03d470a-d3cb-47c8-a7e1-e8170741898b | Defense-Hub/Algorithm-Study | 24.10.10/Park_1991.cpp | #include <iostream>
#include <vector>
#include <unordered_map>
using namespace std;
unordered_map<char, pair<char,char>> tree;
void preorder(char cur){
if(cur == '.') return;
cout << cur;
preorder(tree[cur].first);
preorder(tree[cur].second);
}
void inorder(char cur){
if(cur == '.') return;
i... | ALGO | 0.999924 | 4.657621 |
d71f6b9c-1387-48bc-a52c-00f0dd881cf8 | yorutsuki123/Game2048 | Game2048/Game2048.cpp | // Game2048.cpp : 定義應用程式的進入點。
//
#include "framework.h"
#include "Game2048.h"
#include "Gaming.h"
#define MAX_LOADSTRING 100
HINSTANCE hInst; // 目前執行個體
WCHAR szTitle[MAX_LOADSTRING]; // 標題列文字
WCHAR szWindowClass[MAX_LOADSTRING]; // 主視窗類別名稱
HWND mainWnd;
RECT... | TOOL | 0.948203 | 4.610496 |
be3e4f30-3351-440d-8045-c8ddb59f359b | apu52/GFG-Daily-Solutions | Min distance between two given nodes of a Binary Tree.cpp | class Solution{
public:
/* Should return minimum distance between a and b
in a tree with given root*/
int ans=0;
int solve(Node *root, int a, int b){
if(!root)
return 0;
int left=solve(root->left,a,b);
int right=solve(root->right,a,b);
... | ALGO | 0.999969 | 5.63472 |
21a0323c-0d38-45db-8397-f7a2eef2b25d | wayandway/algorithms-cpp | BOJ/Bruteforcing/9094.cpp | #include <iostream>
#include <cmath>
#include <cctype>
using namespace std;
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
int test;
cin>>test;
for(int i=0; i<test; i++){
double n,m,a;
cin>>n>>m;
int cnt=0;
for(int i=0; i<n; i++){
... | ALGO | 0.999625 | 3.501212 |
4407393d-9586-4b53-b6f3-80009fcf2911 | minji9924/codetree-TILs | 240818/최소 정수 출력/min-integer-output.cpp | #include <iostream>
#include <queue>
#include <algorithm>
#include <vector>
using namespace std;
int N, X;
priority_queue<int, vector<int>, greater<int>> pq;
int main() {
cin >> N;
for (int i = 0; i < N; i++) {
cin >> X;
if (X == 0) {
if (pq.size() == 0) cout << "0\n";
... | ALGO | 0.999985 | 4.675679 |
80a0f777-c926-4569-ba3d-fad5fec47b55 | sarvex/leetcode-ruby | solution/1800-1899/1826.Faulty Sensor/Solution.cpp | class Solution {
public:
int badSensor(vector<int>& sensor1, vector<int>& sensor2) {
int i = 0;
int n = sensor1.size();
for (; i < n - 1 && sensor1[i] == sensor2[i]; ++i) {}
for (; i < n - 1; ++i) {
if (sensor1[i + 1] != sensor2[i]) return 1;
if (sensor1[i] !=... | ALGO | 0.99992 | 5.22147 |
18baab9b-1280-4152-aa1d-f1952c1c0c02 | WushanCloud/nowcoders | 计算糖果.cpp |
A,B,C三个人是好朋友,每个人手里都有一些糖果,我们不知道他们每个人手上具体有多少个糖果,但是我们知道以下的信息:
A - B, B - C, A + B, B + C. 这四个数值.每个字母代表每个人所拥有的糖果数.
现在需要通过这四个数值计算出每个人手里有多少个糖果,即A,B,C。这里保证最多只有一组整数A,B,C满足所有题设条件。
输入描述:
输入为一行,一共4个整数,分别为A - B,B - C,A + B,B + C,用空格隔开。 范围均在-30到30之间(闭区间)。
输出描述:
输出为一行,如果存在满足的整数A,B,C则按顺序输出A,B,C,用空格隔开,行末无空格。 如果不存在这样的整数A,B,C,则输出No
... | ALGO | 0.999975 | 3.329133 |
c136658b-f1bf-4dd3-9916-db091305f70a | ishandutta2007/codeforces | andr1y/normal/1139/C.cpp | #include <bits/stdc++.h>
#define ld long double
#define ll long long
#define ull unsigned ll
#define pll pair<ll, ll>
#define itr(a) begin(a), end(a)
#define mp make_pair
#define pb push_back
#define x first
#define y second
#define pp(a, b) pb(mp(a, b))
#define get_bit(n, k) n&(1<<k)
#define endl '\n'
#define vl vecto... | ALGO | 0.999979 | 3.997516 |
fbebcc6e-fcd8-48df-87d2-d17ab103e950 | kamrul17/DSA_Stuff | String/tempCodeRunnerFile.cpp | bool checkPalindrome(char name[], int len)
{
int s = 0;
int e = len - 1;
while (s <= e)
{
if (name[s] != name[e])
{
return 0;
}
else
{
s++;
e--;
}
}
return 1;
} | ALGO | 0.977977 | 3.653198 |
0a0fa01e-f902-4225-b6bd-6ebabb417ee0 | Subham988/GFG_PotD | May/7th_May/String_Mirror.cpp | class Solution{
public:
string stringMirror(string str)
{
string temp;
temp += str[0];
for (int i = 1; i < str.length(); i++)
{
if (str[0] == str[1])
break;
if (str[i] <= str[i-1])
temp += str[i];
else
... | ALGO | 0.999965 | 5.897039 |
9a103e4e-0ac5-4b31-a30a-564c6976a2bb | NQBH/advanced_STEM_beyond | OLP_ICPC/C++/DPAK_meet_in_the_middle.cpp | #include <bits/stdc++.h>
#define int long long
using namespace std;
const int MOD = 1e9 + 7;
int n, x;
int res = 0;
int mid;
vector<int> a;
vector<int> ma;
void backTracking(int i, int total) {
if (total > x) {
return;
}
if (i > mid) {
ma.push_back(total);
return;
}
backTracking(i + 1, total);
backTra... | ALGO | 0.999963 | 4.81086 |
7764ca14-de10-45de-b9a7-5a2ffb31cf35 | Andres1717/tarea-programacion-1 | soda,jugos pre parcial.cpp | //programa hecho por Andres Isai Vasquez Vasquez
#include <math.h>
#include <stdio.h>
#include <iostream>
#include <cstdlib>
#include <windows.h>
void c();
int main()
{
int n;
int opcion;
do{
printf( "\n PROGRAMA QUE CALCULA LA PRODUCCION DIARIA Y ");
printf( "\n LOS INSUMO... | TOOL | 0.879962 | 3.328094 |
81bed435-5247-4cef-ab10-f150c481a71c | ngthanhtrung23/CompetitiveProgramming | codeforces/599/C.cpp |
#include <bits/stdc++.h>
#define FOR(i,a,b) for(int i=(a),_b=(b); i<=_b; ++i)
#define FORD(i,a,b) for(int i=(a),_b=(b); i>=_b; --i)
#define REP(i,a) for(int i=0,_a=(a); i < _a; ++i)
#define DEBUG(X) { cout << #X << " = " << X << endl; }
#define PR(A,n) { cout << #A << " = "; FOR(_,1,n) cout << A[_] << ' '; cout << e... | ALGO | 0.999734 | 4.172478 |
c7a9b635-bf25-43cf-bbaf-c391c32a334e | dhanielo/frender | src/qt/qtbase/src/tools/qlalr/compress.cpp | #include "compress.h"
#include <QtCore/qdebug.h>
#include <QtCore/qlist.h>
#include <algorithm>
#include <iterator>
#include <iostream>
#define QLALR_NO_CHECK_SORTED_TABLE
struct _Fit: public std::binary_function<int, int, bool>
{
inline bool operator () (int a, int b) const
{
return a == 0 || b == 0 || a =... | ALGO | 0.99776 | 5.55851 |
c7567984-ca73-4c2d-9a2e-fe5043db5064 | domob1812/huntercore | src/versionbits.cpp | #include <versionbits.h>
#include <consensus/params.h>
const struct VBDeploymentInfo VersionBitsDeploymentInfo[Consensus::MAX_VERSION_BITS_DEPLOYMENTS] = {
{
/*.name =*/ "testdummy",
/*.gbt_force =*/ true,
}
};
ThresholdState AbstractThresholdConditionChecker::GetStateFor(const CBlockIndex* pi... | ALGO | 0.994854 | 7.69993 |
52ed8402-d821-4707-a242-a6361d70046a | mhgill/First-Year-Programming-Assignments | 2nd.cpp | #include <iostream>
#include <string>
#include <cmath>
using namespace std;
int main ()
{
int passboth = 0;
int p10 = 0;
int x1 =0;
int y1 = 0;
int passy = 0;
int passx = 0;
int p = 0;
int q = 0;
int r = 0;
string x;
string y;
int a = 0;
int b = 0;
int c = 0;
... | ALGO | 0.999206 | 3.613387 |
f0072d59-8cbe-4c47-a76b-eefdece911bf | far120/data-structure----algorithms | stl structure/doubly linked list.cpp | #include <iostream>
using namespace std;
#include <string>
using namespace std;
// this code is written by the author of the project Mostafa ElFar 29/9/2024
struct nodeType
{
int info;
nodeType *next;
nodeType *prev;
};
class doublylinkedList
{
private:
nodeType *first, *last;
int count = 0;
publi... | ALGO | 0.999764 | 5.460284 |
f3dddc5e-af55-4f1a-ba09-151318b237b7 | paresh00003/assignment__4__opps | assignment_4/q16.cpp | /*Write a program to find the max number from given two numbers
usingfriend function*/
#include <iostream>
using namespace std;
class Test
{
private:
int x, y;
public:
void input()
{
cout << "Enter two numbers:";
cin >> x >> y;
}
friend void find(Test t);
};
void find(Test t)
{
... | ALGO | 0.99886 | 4.756386 |
6deae539-0f9a-4aff-a05e-365a468a6dc4 | A7mad9/RouterLessProject | synthatic/mesh/src/arbiters/matrix_arb.cpp | // $Id$
// ----------------------------------------------------------------------
//
// Matrix: Matrix Arbiter
//
// ----------------------------------------------------------------------
#include "matrix_arb.hpp"
#include <iostream>
using namespace std ;
MatrixArbiter::MatrixArbiter( Module *parent, const string &... | ALGO | 0.998484 | 5.073612 |
81726b2f-0f3f-4014-a94d-0d0ac1f0f0f0 | zuoqing1988/ZQlib | SampleScatteredInterpolation/SampleScatteredInterpolation.cpp | #include "ZQ_ScatteredInterpolationRBF.h"
#include "opencv\cv.h"
#include "opencv\highgui.h"
#include <time.h>
using namespace ZQ;
template<class T>
void test2d()
{
const char* file = "input.jpg";
IplImage* img = cvLoadImage(file,1);
if(img == 0)
{
printf("load img %s fail\n",file);
return ;
}
int width ... | ALGO | 0.895091 | 4.013865 |
02c83a15-3124-458b-bb0c-f50f6a4bf688 | myunbin/PS | BOJ/2388.cpp | #include <bits/stdc++.h>
using namespace std;
#pragma GCC optimize("Ofast")
#pragma GCC target("fma,sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2,tune=native")
#pragma GCC optimize("unroll-loops")
#define fileio() freopen("input.txt","r",stdin); freopen("output.txt","w",stdout)
#define fio() ios_base::sync_with_std... | ALGO | 0.999986 | 3.50485 |
83da2a47-63b2-4114-9bae-d83dd2d6dd59 | SLIIT-FacultyOfComputing/tutorial-02b-IT21816390 | tute02.cpp | /*Exercise 2 - Selection
Convert the C program given below which calculates an employee's salary to a C++ program.
Input Type, Salary, otHours
Type = 1
OtRate = 1000
Type = 2
OtRate = 1500
Type = 3
OtRate = 1700
Please Note that the input command in C++ is std::cin. This is a representation of the Keyboard.*/
#incl... | ALGO | 0.864993 | 3.336671 |
b1cd4d2b-2a9d-4566-95b7-242e102372bb | Abishekkarthik1625/C_Programming | Lab_2/Type of triangle.cpp | #include<stdio.h>
int main(){
int a,b,c;
scanf("%d %d %d",&a,&b,&c);
if(a==b && b==c && c==a)
{
printf("Equilateral");
}
else if(a==b || b==c || c==a){
printf("Isosceles");
}
else{
printf("Scalene");
}
return 0;
}
| ALGO | 0.999894 | 3.928432 |
d95d971d-dce1-4adb-911e-9748885b14c0 | Nani1333/DSA | week7.cpp | #include <bits/stdc++.h>
using namespace std;
bool isValidDecimal(const string& ip) {
vector<int> parts;
stringstream ss(ip);
string part;
while (getline(ss, part, '.')) {
if (part.empty() || part.size() > 3 || !all_of(part.begin(), part.end(), ::isdigit)) {
return false;
}... | ALGO | 0.988664 | 6.907543 |
473b299b-fb61-4a41-aea2-3b71c65145d5 | Hasanul-Bari/codeforces | codeforces/69/A.cpp | #include<iostream>
using namespace std;
int main()
{
int n;
cin>>n;
int a,b,c,sa=0,sb=0,sc=0;
for(int i=0; i<n; i++)
{
cin>>a>>b>>c;
sa=sa+a;
sb=sb+b;
sc=sc+c;
}
if(sa==0 && sb==0 && sc==0)
cout<<"YES"<<endl;
else
cout<<"NO"<<endl;
... | ALGO | 0.99974 | 3.715394 |
720d11a7-4de2-4cb6-ba94-2bc59d568fb8 | raushanprabhakar1/mahindraMPC | control_mahindra/src/Eigen-3.3/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.999808 | 6.502348 |
742d7c09-1992-49cf-ba29-e6e35b6aff04 | Eldinosaur/FrontOptica | 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 |
bb8fcb67-4da0-4ed0-afef-51d282882b86 | udhayan4/Leetcode-challenge- | 137-single-number-ii/single-number-ii.cpp | class Solution {
public:
int singleNumber(vector<int>& nums) {
int result = 0;
for (int k = 0; k < 32; k++) {
int temp = 1 << k;
int countOnes = 0;
for (int num : nums) {
if ((num & temp) != 0) {
countOnes++;
}
... | ALGO | 0.999899 | 5.674794 |
960db24f-7866-4771-b953-0735f71997c2 | heavenMOJANG/ICPC | programmes_C_Cpp/HDU/2024HDU多校/HDU多校10/1011.cpp | #pragma GCC optimize(1)
#pragma GCC optimize(2)
#pragma GCC optimize(3,"Ofast","inline")
#include<bits/stdc++.h>
#define int long long
using namespace std;
constexpr int INF = 0x7fffffff;
void solve() {
int n, m, k; cin >> n >> m >> k;
vector<int> a(n), b(n);
int cnt = 0;
for (auto && x : a) {
c... | ALGO | 0.999951 | 4.044173 |
b40a0a42-1c74-4c39-9466-f05fb9d4ffdc | GuessEver/ACMICPCSolutions | CodeForces/492/A/A.cpp | #include <cstdio>
int n;
int main()
{
scanf("%d", &n);
int total = 0;
int now = 0;
int i = 0;
while(1)
{
now += i+1;
total += now;
if(total <= n) i++;
else break;
}
printf("%d\n", i);
return 0;
}
| ALGO | 0.999718 | 3.201029 |
43b91221-7f15-41e4-8f5d-f62f393f1ee6 | ThomasPak/cell-competition | vertex/src/CellCompetition.cpp | // This cell competition is adapted from Osborne 2017
// The paper tutorial for this paper can be found here:
// https://chaste.cs.ox.ac.uk/trac/wiki/PaperTutorials/CellBasedComparison2017
// I/O
#include <iostream>
#include <sstream>
#include <stdexcept>
#include "CellLabel.hpp"
#include "SmartPointers.hpp"
#include... | ALGO | 0.968754 | 6.690948 |
09833ae2-8ce0-458b-9d84-4433fab084f4 | rhemesh/CPP-Programs | Example_programs.cpp/biggest_num_in_3.cpp | #include<iostream>
using namespace std;
int biggest(int a,int b,int c)
{
return a>b?(a>c?a:c):(b>c?b:c);
}
int main()
{
int a,b,c;
cout<<"Enter a,b, and c values to find biggest in them:"<<endl;
cin>>a>>b>>c;
int res = biggest(a,b,c);
cout<<"value "<<res<<" is biggest in all among"<<endl;
} | ALGO | 0.997096 | 4.248328 |
e20dafcd-642d-4b53-8fcc-e027f3524293 | AlanFreySpace/algorithm_contest | DreamJudge1/Source/chapter7/section7_3/1319.cpp | #include <stdio.h>
using namespace std;
int n,m,ans;
int s[1005];
int Get(int x){
int r=s[x];
while(r!=s[r]) r=s[r];//ҵ
int i=x,j;
while(i!=r){//·ѹ
j=s[i];
s[i]=r;
i=j;
}
return r;
}
void Merge(int x,int y){
int r1=Get(x),r2=Get(y);
if(r1!=r2){//ÿһκϲ,·1
... | ALGO | 0.999932 | 3.863509 |
422a4d26-ecba-415c-9ff1-9ec841db7fb9 | adong001/C-DS-CPP | C++_Test0616/C++_Test0616/main3.cpp | #define _CRT_SECURE_NO_WARNINGS 1
#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
class myClass
{
public:
void foo();
void func();
};
void myClass::foo()
{
delete this;
}
void myClass::func()
{
myClass *a = new myClass();
a->foo();
}
//class A
//{
//public: void f()
//{
// printf... | ALGO | 0.954533 | 3.762736 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.