uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
9661b141-5b11-43e2-96e0-5194c0ff94b0 | PrinceInScripts/Leetcode-Question | 7. September 2024/Problem 4 {Delete Nodes From Linked List Present in Array}/Question.cpp |
/*
# 3217. Delete Nodes From Linked List Present in Array
*/
/*
You are given an array of integers nums and the head of a linked list. Return the head of the modified linked list after removing all nodes from the linked list that have a value that exists in nums.
Example 1:
Input: nums = [1,2,3], head = [1,2,3,4,5]... | ALGO | 0.999987 | 5.983636 |
4fca09aa-f61a-4149-8fb9-5492fe85bb06 | ishandutta2007/codeforces | wo_/normal/343/A.cpp | #include<cstdio>
#include<iostream>
using namespace std;
long long get(long long num,long long den)
{
if(num==0) return 0;
if(den==1) return num;
if(num>den) return get(num%den,den)+(num/den);
long long nden=den%num;
if(nden==0) nden+=num;
return get(num,nden)+((den-nden)/num);
}
int main()
{
long long num,de... | ALGO | 0.999952 | 4.181986 |
7c1feb28-58a3-4cd3-967b-884a82edad1c | ishandutta2007/codeforces | 2222/normal/82/C.cpp | #define _CRT_SECURE_NO_DEPRECATE
#include <algorithm>
#include <string>
#include <vector>
#include <queue>
#include <iostream>
#include <cmath>
#include <sstream>
#include <map>
#include <set>
#include <stack>
#include <cstring>
#include <ctime>
#include <cstdio>
#include <memory>
using namespace std;
#define pb push_b... | ALGO | 0.999995 | 3.777054 |
1d1f7459-00fc-4589-ada8-b58f8fc0e562 | qwedsazxc1/CSES | Advanced Techniques/Houses and Schools.cpp | #include <bits/stdc++.h>
#define INF 0x7f3f3f3f3f3f3f3f
using namespace std;
typedef long long ll;
const int maxn = 3e3 + 5;
ll cost[maxn][maxn], dp[maxn][maxn], pos[maxn][maxn];
void build(vector<ll> &arr){
int n = arr.size();
vector<ll> pre(n + 1);
pre[0] = 0;
for (int i = 1; i <= n; i++)
pre[i] = pre[i - 1]... | ALGO | 0.99991 | 3.833085 |
9dfa8821-1b1b-4295-87bf-2155365adba7 | jk1ash/LeetCode | 299.猜数字游戏.cpp | /*
* @Author: jklash
* @Description:
* @Date: 2021-11-08 11:18:14
* @LastEditTime: 2021-11-08 11:50:43
*/
/*
* @lc app=leetcode.cn id=299 lang=cpp
*
* [299] 猜数字游戏
*/
#include <iostream>
#include <vector>
#include <math.h>
using namespace std;
// @lc code=start
class Solution {
public:
string getHint(strin... | ALGO | 0.999957 | 6.508495 |
9965ce14-5a0f-4d30-902a-1eb9689b7a2e | Gautham/Competitive-Coding | Project Euler/3.cpp | #include <iostream>
#include <math.h>
using namespace std;
int main() {
long E = 600851475143L;
int n = sqrt(E) + 1;
int f = -1;
int i = 3;
while (i < n) {
while (i < n && E % i) i += 2;
if (i < n) {
E /= i;
f = i;
}
}
cout<<f;
return 0;
} | ALGO | 0.999963 | 3.981311 |
ed8dd76e-6589-4ae0-b200-d7656bb80812 | thomasfrosio/quinoa | src/quinoa/ProjectionMatching.cpp | #include <noa/Array.hpp>
#include <noa/Signal.hpp>
#include <noa/Geometry.hpp>
#include <noa/FFT.hpp>
#include "quinoa/Metadata.hpp"
#include "quinoa/CommonArea.hpp"
#include "quinoa/Types.hpp"
namespace {
using namespace qn;
struct SIRTWeight {
using value_type = f32;
f32 fake_iter;
... | ALGO | 0.999851 | 6.046207 |
c011253b-fea6-4c73-b5ce-24c385590170 | SadmanHafizShuvo21/codeforces | A_Array_Divisibility.cpp | //08 July 2024
#include<bits/stdc++.h>
using ll = long long;
void solve(){
int n;
std::cin>>n;
for(int i=1;i<=n;i++){
std::cout<<i<<" \n"[i==n];
}
}
int main(){
std::ios::sync_with_stdio(false);
std::cin.tie(nullptr);
int tesecase;
std::cin>>tesecase;
while(tesecase--)
so... | ALGO | 0.9994 | 5.584228 |
3fc4b49c-dcdc-4cc2-ba82-2164b45a1ab5 | cropped33/code_forces | A_Puzzles.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
int n, m;
cin >> n >> m;
int a[m];
for (int i = 0; i < m; i++)
cin >> a[i];
sort(a, a + m);
int res = m - n + 1;
int i = 0;
int dif = a[n - 1] - a[0];
while (res > 0)
// for (int i = 0; i < n; i++)
{
i... | ALGO | 0.999951 | 3.207458 |
1925efae-ccd8-4d38-b1cb-13a900777bd4 | Raajokiaa-Ritu/The_Ultimate_List_By_Shahjalal_Shohag | basics/learn a language/70_The Brothers.cpp | //link:https://vjudge.net/problem/Gym-287306K/origin
#include<bits/stdc++.h>
using namespace std;
#define pb push_back
int i,j,n,m,e,s;
vector<int>v;
int main()
{
#ifndef ONLINE_JUDGE
freopen("input.txt","r",stdin);
freopen("output.txt","w",stdout);
#endif
string a,b,c,d;
cin>>a>>b;
cin>>c>>d;
if(b == d)cout<<... | ALGO | 0.999405 | 3.464383 |
9b510548-9b93-4d10-90fb-0b3a3b1fcf4b | orangecalculator/algo | sorting/heapsort.cpp | #include <cstdio>
#include <time.h>
int swap(int *swap1,int *swap2){
int temp=*swap2;
*swap2=*swap1;
*swap1=temp;
return 1;
}
int downheap(int *sor, int i, int j, int p){
int u=p,left,right;p++;
while(p!=u){
p=u;
left=2*p-i+1;
right=l... | ALGO | 0.999884 | 3.760755 |
cc0919e8-a39b-4a0f-a03e-9a0f8137d818 | emilymryan/LAMMPS-SPH-Source-Code | src/USER-OMP/dihedral_harmonic_omp.cpp | /* ----------------------------------------------------------------------
Contributing author: Axel Kohlmeyer (Temple U)
------------------------------------------------------------------------- */
#include "omp_compat.h"
#include <cmath>
#include "dihedral_harmonic_omp.h"
#include "atom.h"
#include "comm.h"
#inclu... | ALGO | 0.999642 | 6.921301 |
bdce5c76-520e-4873-8290-2ec0a8ee0e2f | AbdulGhani9/myflutterui-s | 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.998756 | 6.772262 |
0863fcd8-8179-4518-bb2f-551e063bed0a | Abhayrajgithub1234/ChessPP | src/pawn.cpp | #include "pawn.h"
#include "colors.h"
Pawn::Pawn() : Piece(0, 0, Color::NONE) {
}
Pawn::Pawn(int xPos, int yPos, Color color) : Piece(xPos, yPos, color) {
}
Pawn::~Pawn() {
}
void Pawn::draw(SDL_Renderer* m_renderer) {
SDL_Rect rect;
rect.x = xPos;
rect.y = yPos;
rect.h = 75;
rect.w = 75;
S... | ALGO | 0.92511 | 4.986681 |
d307d2ec-a638-49ee-856d-0621e6298549 | SadManFahIm/Uri-Judge | 2091.cpp | #include <bits/stdc++.h>
typedef long long ll;
using namespace std;
int main(){
ios_base::sync_with_stdio(false);
cin.tie(NULL);
ll n;
while(1){
cin >> n;
if(!n)
break;
vector<long long> A(n);
for(int i = 0; i < n; ++i){
cin >> A[i];
... | ALGO | 0.999881 | 3.776525 |
0780b58d-4bbf-4224-92db-c9b5b0d69859 | rahul02shah/All-C-PRogram | prime number.cpp | #include <stdio.h>
int main()
{
for(int i=1;i<=100;i++){
int count=0;
for(int j=1;j<i;j++){
if(i%j == 0){
count++;
}
}
if(count <= 1) printf("%d\n", i);
}
return 0;
}
| ALGO | 0.99918 | 4.397644 |
e3739efc-b86e-44c6-96bf-b7881d243413 | Shobhit-singhal/DSA | before binary search/binartToDec.cpp | #include<iostream>
using namespace std;
int main(){
printf("hello world\n");
int decimal=0,binary;
cout<<"input binary: ";
cin>>binary;
int mul=1;
while (binary>0){
decimal=(binary%10)*mul+decimal;
mul*=2;
binary=binary/10;
}
cout<<"the decimal is: "<<decimal;
} | ALGO | 0.997024 | 3.711467 |
9c83a077-b15d-4c31-b399-e1b1a7397cd9 | Dhavalc2012/Opticial-Character-Recognisation | libraries/tess-two/jni/com_googlecode_tesseract_android/src/training/text2image.cpp | #include <stdlib.h>
#include <string.h>
#include <algorithm>
#include <iostream>
#include <map>
#include <string>
#include <utility>
#include <vector>
#include "allheaders.h" // from leptonica
#include "boxchar.h"
#include "commandlineflags.h"
#include "degradeimage.h"
#include "errcode.h"
#include "fileio.h"
#includ... | TOOL | 0.867644 | 6.131308 |
4187876b-47c1-48d8-8d63-3ffbb4d725d6 | SharifiZarchi/Algorithms_Design | Covid Challenge/Round-1/judge/submissions/96105983/phase0.cpp | #include <iostream>
#include <vector>
using namespace std;
#define INF 9999999
#define V 6
int n;
int graph[V][V] = {};
vector<int> shpath[V][V];
int shortest_path_cost[V][V] = {};
vector<pair<int, int>> operation1[40];
vector<pair<int, int>> operation2[40];
int loc_of_family[V] = {};
int day = 1;
int minDistance(in... | ALGO | 0.999924 | 3.841772 |
c8fb0d5e-360e-4db0-bcb4-378c4d13694c | sudharsan12/problem_solving | substring_with_concatination_all_words.cpp | #include<bits/stdc++.h>
using namespace std;
//approch 1
/*
int fun(vector<string>words,int nxt,string s,int pos,int len,int n)
{
if(nxt==len)
return 1;
for(int i=nxt;i<len;i++)
{
if(s[pos]==words[i][0] && s.compare(pos,n,words[i])==0)
{
swap(words[i],words[nxt]);
return fun(wo... | ALGO | 0.999794 | 5.079796 |
8644c178-37bd-41a7-9093-f46bb38c4929 | metehkaya/Algo-Archive | Problems/LeetCode/Solutions/2493.Divide_Nodes_Into_the_Maximum_Number_of_Groups.cpp | class Solution {
public:
void dfs(int u, vector<bool>& mark, vector<int>& comp, vector<vector<int>>& adj) {
mark[u] = true;
comp.push_back(u);
for(auto v : adj[u])
if(!mark[v])
dfs(v,mark,comp,adj);
}
int bfs(int u , vector<vector<int>>& adj) {
int... | ALGO | 0.999778 | 5.307574 |
1fcff725-e96c-43f5-93b2-129d75ec9c86 | surplusus/Database_ProblemSol | Coding_Problem/Coding_Problem_In_C/(ongoing)FloodFill_BFS_DFS.cpp | // Flood Fill
// https://trello-attachments.s3.amazonaws.com/5d3670afb1d231324efa90cc/5e78e425b923f41887dd0b4a/e60681e1ee09a9d31ca516743e27883c/Recursive_Flood_Fill.gif
// ־ ǥ ֺ ŽϿ
// ǿ ٲ
// BFS Ǵ DFS
#include <iostream>
#include <cstring>
#include <vector>
#include <cstring>
#include <string>
#include <tuple>
#... | ALGO | 0.999688 | 4.950758 |
a15e6aa2-9b2a-4188-9a60-acd5e950174e | RiceUmai/OpenGL_Game | OpenGL_Game/Opengl_Game_we_Are/include/glm/test/perf/perf_matrix_div.cpp | #define GLM_FORCE_INLINE
#include <glm/ext/matrix_float4x4.hpp>
#include <glm/ext/matrix_double4x4.hpp>
#include <glm/ext/matrix_transform.hpp>
#include <glm/ext/matrix_relational.hpp>
#include <glm/ext/vector_float4.hpp>
#if GLM_CONFIG_SIMD == GLM_ENABLE
#include <glm/gtc/type_aligned.hpp>
#include <vector>
#include <... | TEST | 0.876312 | 6.633595 |
ecd19a74-abeb-4794-943b-fbefbf3f0a63 | ivaROS/ivaOmplCore | src/ompl/geometric/planners/stride/src/STRIDE.cpp | /* Author: Bryant Gipson, Mark Moll, Ioan Sucan */
#include "ompl/geometric/planners/stride/STRIDE.h"
// enable sampling from the GNAT data structure
#define GNAT_SAMPLER
#include "ompl/datastructures/NearestNeighborsGNAT.h"
#include "ompl/base/goals/GoalSampleableRegion.h"
#include "ompl/tools/config/SelfConfig.h"
#i... | ALGO | 0.999398 | 7.322763 |
9002dc00-3a25-47b2-b9e8-208ad1c228bb | alexandraback/datacollection | solutions_5731331665297408_0/C++/pwypeanut/c.cpp | #include <cstdio>
#include <iostream>
#include <stack>
#include <vector>
using namespace std;
int N, T, E;
string S1[10];
int adjm[10][10];
bool used[10][10];
stack<int> S;
vector<int> V;
string ans;
int main() {
freopen("C-small-attempt0.in", "r", stdin);
freopen("C-small-attempt0.out", "w", stdout);
sca... | ALGO | 0.999993 | 4.922385 |
3ce5376f-b893-4591-8e25-0295e050bd7b | hyunsikwon/algorithm-study | Baekjoon/동적 프로그래밍/파도반 수열_#9461/파도반 수열_#9461/main.cpp | #include <iostream>
using namespace std;
long long a[102] = {0,};
long long padovan(int N) {
if (a[N] != 0) return a[N];
if (N == 1 || N == 2 || N == 3) a[N] = 1;
else if (N == 4 || N == 5) a[N] = 2;
else a[N] = padovan(N-1) + padovan(N-5);
return a[N];
}
int main(int argc, const char * arg... | ALGO | 0.999988 | 5.08285 |
49f70ab0-b14e-4ce0-873a-c853f5de0c5a | ashwini0529/lastdayofhacktoberfest | DP/mincost.cpp | #include <iostream>
#include <vector>
#include <climits>
using namespace std;
int mincost(int** input,int i,int j,int m,int n)
{
if(i==m-1&&j==n-1)
return input[m-1][n-1];
if(i>=m||j>=n)
return INT_MAX;
int a=mincost(input,i+1,j,m,n);
int b=mincost(input,i,j+1,m,n);
int c=mincost(input,i+1,j+1,... | ALGO | 0.999963 | 4.402797 |
62d8cd1c-c244-4c71-ab11-a483eae0ba23 | amitkrjha-geek/leetcode | 114-flatten-binary-tree-to-linked-list/114-flatten-binary-tree-to-linked-list.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.999934 | 5.965624 |
e0d49f7f-ea32-47e8-8a11-463d4b7b503f | MrinmoiHossain/LeetCode | 881.Boats_to_Save_People/BoatsToSavePeople.cpp | class Solution {
public:
int numRescueBoats(vector<int>& people, int limit) {
sort(begin(people), end(people));
int i = 0, j = people.size() - 1;
int ans = 0;
while(i <= j){
ans++;
if(people[i] + people[j] <= limit)
i++;
... | ALGO | 0.999996 | 5.975685 |
aa23bd87-7bc9-488a-94f2-d470b1bf2aea | alexandraback/datacollection | solutions_5708921029263360_0/C++/diametralis/main.cpp | #include <iostream>
#include <fstream>
#include <sstream>
#include <iomanip>
#include <string>
#include <set>
#include <map>
#include <unordered_map>
#include <queue>
#include <deque>
#include <stack>
#include <list>
#include <bitset>
#include <utility>
#include <functional>
#include <string>
#include <algorithm>
#inc... | ALGO | 0.99785 | 3.204367 |
1ae70dde-b3ca-4901-8b78-75c23f0ae6a1 | Cameron-Calpin/Code | src - C++/Data Structures - Linked Lists/TicTacToe.cpp | /* Author: Cameron Calpin
*
* Simple 2-player TicTacToe game. Looks sloppy and
* uses unnecessary resources here and there, but I
* will update and revise the code to be more space
* efficient.
*
* Date: 8/28/17
* version: 1
*/
#include <iostream>
#include <stdio.h>
#include <cstdlib>
#include <string>
#inc... | ALGO | 0.981274 | 4.85244 |
7314c47b-9637-4555-a224-d82177871ed2 | janalisawaugh/home_project | 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 |
e89bbdb5-38d9-4d71-b329-9c5446308b06 | Kawser-nerd/CLCDSA | Source Codes/CodeJamData/17/03/8.cpp | #include <map>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <algorithm>
typedef long long ll;
#define rep(i, a, b) for (int i = a; i <= b; ++ i)
const int N = 1000005;
using namespace std;
int top, T; ll p[N], n, m;
map <ll, ll> h;
void push(ll x) {
p[top ++] = x, push_heap(p... | ALGO | 0.999903 | 4.11447 |
4afe79ba-619b-4f0f-87b7-328265b29f2f | tokotoko9981/AtCoder | ABC/ABC352/A.cpp | #include <bits/stdc++.h>
using namespace std;
using vi = vector<int>;
using vii = vector<vector<int>>;
using vl = vector<long long>;
using vll = vector<vector<long long>>;
using vc = vector<char>;
using vcc = vector<vector<char>>;
using vs = vector<string>;
using vss = vector<vector<string>>;
using ll = long long;
#de... | ALGO | 0.999768 | 3.495163 |
205caf16-2e16-425e-984a-2e12de8bc495 | gh18l/DeepSort-yolov3 | src/matching/tracker.cpp | #include "tracker.h"
#include "nn_matching.h"
#include "../feature/model.h"
#include "linear_assignment.h"
using namespace std;
//#define MY_inner_DEBUG
#ifdef MY_inner_DEBUG
#include <string>
#include <iostream>
#endif
tracker::tracker(/*NearNeighborDisMetric *metric,*/
float max_cosine_distance, int nn_budget,
... | ALGO | 0.998533 | 6.116223 |
50c6ac7e-a07e-4ddd-b4a7-797ffce64ef8 | zhangwj0101/codestudy | algorithm/HDU-ACM/HDU_ACM_C++/Lucifer/2060.cpp | ////////////////////System Comment////////////////////
////Welcome to Hangzhou Dianzi University Online Judge
////http://acm.hdu.edu.cn
//////////////////////////////////////////////////////
////Username: devil_momo
////Nickname: Lucifer
////Run ID:
////Submit time: 2008-07-12 21:27:07
////Compiler: Visual C++
///////... | ALGO | 0.99764 | 3.539296 |
061d2346-6980-4203-af02-7783705f8a29 | Kannupriyasingh/coding-ninjas-competitive-programming-using-cplusplus | Segment Tree/2 vs 3.cpp | /*
The fight for the best number in the globe is going to finally come to an end.The top two contenders for the best number are number 2 and number 3.It's the final the entire world was waiting for. Expectorates from all across the globe came to witness the breath taking finals.
The finals began in an astonishing way.A... | ALGO | 0.999972 | 4.815326 |
e7fa195d-76dd-41c6-a30a-062d637e57cd | Shraddhap26/Leetcode | 1056-capacity-to-ship-packages-within-d-days/1056-capacity-to-ship-packages-within-d-days.cpp | class Solution {
public:
int shipWithinDays(vector<int>& weights, int days) {
int sum=0;
for(int i=0;i<weights.size();i++){
sum+=weights[i];
}
int start=0,end=sum;
int mid=(start+end)/2;
int ans=-1;
while(start<=end){
if(ispossible(weights,weights.size(),days ... | ALGO | 0.999997 | 5.789604 |
392da438-3dfb-4efb-b343-3edfbbf18d5a | IshwariAmbre/C- | 179.cpp | //accept string from number and count small charaxters of string
//A-Z
#include<iostream>
using namespace std;
int CountSmall(char st[])
{
int iCnt=0;
while(*str!='\0')
{
if((*str>=97)&&(*str<=122))
{
iCnt++;
}
str++;
}
return iCnt;
}
int main()
{
c... | ALGO | 0.995876 | 3.550252 |
31cb888c-cfbf-40a8-8528-91931440bd87 | bstew794/CS-3460 | Assignment4/sortutils.cpp | #include <algorithm>
#include <chrono>
#include <execution>
#include <iomanip>
#include <iostream>
//local imports
#include "sortutils.hpp"
void initializeRawArrayFromStdArray(const SourceArray& source, int dest[])
{
for (size_t i = 0; i < source.size(); i++)
{
dest[i] = source.at(i);
}
}
void fi... | TOOL | 0.97529 | 6.308072 |
8d58c270-c597-48fe-90cc-bfd51cc9d482 | jamesfang87/Silver | Custom Comparators and Coordinate Compression/Restaurant Customers/main.cpp | #include <iostream>
#include <vector>
#include <algorithm>
struct Time {
int time;
bool leaving;
};
bool cmp(const Time &x, const Time &y) { return x.time < y.time; }
int main() {
int n; std::cin >> n;
std::vector<Time> times (n * 2);
for (int i = 0; i < n * 2; i += 2) {
int enter, leav... | ALGO | 0.99985 | 4.787641 |
99306f8e-9cc7-4c5f-82da-1047645abfd8 | joshianshul2/N-Aray-Tree | LevelWiseinput.cpp | #include<iostream>
#include<vector>
#include"genricTreesIntro.cpp"
#include<queue>
using namespace std;
TreeNode<int>* LevelWiseInput()
{
queue<TreeNode<int>*> pendingnodes;
int rootdata;
cout<<"Enter The root data "<<endl;
cin>>rootdata;
TreeNode<int>* root=new TreeNode<int>(rootdata);
pending... | ALGO | 0.999138 | 4.471899 |
9518215b-cee0-40b6-89b8-98f72aa1d7f9 | avinashw50w/ds_algo | Leetcode/Medium/337. House Robber III.cpp | /*The thief has found himself a new place for his thievery again. There is only one entrance to this area, called root.
Besides the root, each house has one and only one parent house. After a tour, the smart thief realized
that all houses in this place form a binary tree. It will automatically contact the police if t... | ALGO | 0.99993 | 6.142462 |
46760c44-8f11-4869-8d17-5d0e99aaf5df | Darelife/CompetitiveProgramming | cses/Tree_Matching.cpp | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
#define int long long
#define debug(x) cout << #x << " = " << x << "\n";
#define vdebug(a) \
cout << #a ... | ALGO | 0.998453 | 4.032079 |
7e5798dd-d24e-4af2-97d8-c554f53e71a0 | annemiekie/Plucker | libraries/eigen-3.4.0/bench/dense_solvers.cpp | #include <iostream>
#include "BenchTimer.h"
#include <Eigen/Dense>
#include <map>
#include <vector>
#include <string>
#include <sstream>
using namespace Eigen;
std::map<std::string,Array<float,1,8,DontAlign|RowMajor> > results;
std::vector<std::string> labels;
std::vector<Array2i> sizes;
template<typename Solver,type... | TOOL | 0.998575 | 6.326138 |
fcc75b33-8b0a-4999-ab21-2b90153ce6b1 | shobhaduseja/OOP-LAB | LAB 5/task7.cpp | #include <iostream>
#include <cstring>
using namespace std;
class Product {
int id;
char name[50];
int quantity;
public:
Product() {}
Product(int i, char* n, int q) : id(i), quantity(q) {
strncpy(name, n, 49);
name[49] = '\0';
}
int getID() {
return id;
}
... | TOOL | 0.985925 | 5.530583 |
52d93d52-bb1a-44d1-9a14-d6bf5411b574 | slarmick/ASD_LABS | lab4/lab4.cpp | #include <iostream>
#include <vector>
using namespace std;
// Функция сортировки методом прочесывания (Comb Sort)
void combSort(vector<int>& arr) {
int n = arr.size(); // Размер массива
int gap = n; // Начальный шаг прочесывания
bool swapped = true; // Флаг для отслеживания перестановок
// Цикл продо... | ALGO | 0.999987 | 5.893594 |
f6e3e2c4-e5ae-49da-a1a5-6388511ca67d | yxhuangCH/AndroidSourceCode | 6.1.0/frameworks/av/media/libstagefright/codecs/m4v_h263/dec/src/find_min_max.cpp | /*
------------------------------------------------------------------------------
INPUT AND OUTPUT DEFINITIONS
Inputs:
input_ptr = pointer to the buffer containing values of type UChar
in a 2D block of data.
min_ptr = pointer to the minimum value of type Int to be found in a
square bloc... | ALGO | 0.999963 | 6.63482 |
e19be8ba-8d99-4de9-a8e0-b56d243e22bc | gavinband/bgen | 3rd_party/boost_1_55_0/libs/numeric/ublas/doc/samples/mapped_vector.cpp | #include <boost/numeric/ublas/vector_sparse.hpp>
#include <boost/numeric/ublas/io.hpp>
int main () {
using namespace boost::numeric::ublas;
mapped_vector<double> v (3, 3);
for (unsigned i = 0; i < v.size (); ++ i)
v (i) = i;
std::cout << v << std::endl;
}
| TOOL | 0.887191 | 3.095502 |
064dfeca-2b16-44a7-b42a-016cb6489e5a | KaduFallone/lp1 | 1lista_de_exercicios/exercicio25.cpp | #include<iostream>
#include<cmath>
using namespace std;
int main (){
double x1, x2, x3, result;
cout <<"Insira x1, x2, e x3, para descobrir o valor de x: \n";
cin >> x1;
cin >> x2;
cin >> x3;
result = x1 + (x2/(x3+x1)) + (2*(x1-x2)) + (log(64)/log(2));
cout << "O resultado de x eh: " << ... | ALGO | 0.994701 | 3.508341 |
ea80dd43-3641-4c1a-9cc7-9f284a9cc1f6 | ishandutta2007/codeforces | shimarin/normal/1440/E.cpp | #include<bits/stdc++.h>
#define For(i,x,y) for (register int i=(x);i<=(y);i++)
#define FOR(i,x,y) for (register int i=(x);i<(y);i++)
#define Dow(i,x,y) for (register int i=(x);i>=(y);i--)
#define Debug(v) for (auto i:v) printf("%lld ",i);puts("")
#define mp make_pair
#define fi first
#define se second
#define pb push_b... | ALGO | 0.999964 | 3.918314 |
5c0a000b-6ae1-4727-80fd-231184fa1c60 | C-2024-1-3/240310wangtingzhong | 实验三,四/实验三1(1).cpp | #include <iostream>
int gcd(int a, int b) {
while (b != 0) {
int temp = b;
b = a % b;
a = temp;
}
return a;
}
int main() {
int m, n;
std::cout << "Ȼ m n";
std::cin >> m >> n;
int gcdValue = gcd(m, n);
std::cout << "m n ԼΪ" << gcdValue << std::endl;
retu... | ALGO | 0.99972 | 4.574638 |
95d2b17d-f3b1-4f26-95ed-a50953328886 | yifeihe007/FDTD | clang/lib/Sema/SemaModule.cpp | #include "clang/AST/ASTConsumer.h"
#include "clang/AST/ASTMutationListener.h"
#include "clang/Lex/HeaderSearch.h"
#include "clang/Lex/Preprocessor.h"
#include "clang/Sema/SemaInternal.h"
#include "llvm/ADT/StringExtras.h"
#include <optional>
using namespace clang;
using namespace sema;
static void checkModuleImportCo... | TOOL | 0.899983 | 7.498465 |
9a11f3ac-a8f4-45b8-9706-f9388fd79845 | mathieu-clement/lesdarons | TAP3/Projet/src/Awele.cpp | #include "Awele.hpp"
#include <iostream>
#include <stdlib.h>
#include <stdio.h>
#include <cstring>
using namespace std;
/**
* Create a new game of Awele.
*/
Awele::Awele() : Game()
{
board = new int[12];
// Fill the 12 holes with 4 seeds
fill_n(board, 12, 4);
}
/**
* Destroy a game of Awele.
*/
Aw... | ALGO | 0.984343 | 3.716906 |
597f1e73-4a5e-455d-aee2-b50c593a5f5d | NekoSekaiMoe/zig-bootstrap-ollvm | zig/stage1/cpp/bigint.cpp | #include "bigfloat.hpp"
#include "bigint.hpp"
#include "buffer.hpp"
#include "list.hpp"
#include "os.hpp"
#include "softfloat.hpp"
#include <limits>
#include <algorithm>
static uint64_t bigint_as_unsigned(const BigInt *bigint);
static void bigint_normalize(BigInt *dest) {
const uint64_t *digits = bigint_ptr(dest... | TOOL | 0.901105 | 7.285269 |
52c7ef11-00ed-4e3f-9367-5729d2682d77 | cxwcfea/uva-code | 141.cpp | #include <cstdio>
#include <cstring>
#include <cstdlib>
#define MAXN 52
#define MAXHASH 1003
typedef int State[MAXN][MAXN];
State st[8*MAXN];
int head[MAXHASH];
int next[8*MAXN];
char input[MAXN];
int n;
int hash(State &s) {
int v = 0;
for (int i = 1; i <= n; ++i) {
for (int j = 1; j <= n; ++j) {
if (s[i][j... | ALGO | 0.999736 | 3.638189 |
6a3fedad-7b4c-4590-bd11-2a3705d408e8 | idlechara/Research | MetricHashing/main.cpp | #include <iostream>
#include <stdio.h>
#include "lib/etc/Macros.h"
#include "lib/visualization/Screen.h"
#include "lib/element/VectorElement.h"
#include "lib/permutation/Permutation.h"
#include "lib/indices/StandardPermutationIndex.h"
#include "lib/canned_food/Experiment.h"
int do_experiment();
int main() {
std::... | ALGO | 0.969782 | 4.24611 |
de19f4fe-8a45-49f6-b6bb-6001518db89b | ParijaAnnuprit/Parija_Annuprit_leetcode | 994-rotting-oranges/994-rotting-oranges.cpp | class Solution {
public:
vector<vector<int>>check{{0,1},{0,-1},{1,0},{-1,0}};
int orangesRotting(vector<vector<int>>& grid) {
int m = grid.size();
int n = grid[0].size();
vector<vector<int>>vis(m,vector<int>(n,0));
queue<pair<int,int>>q;
int minutes = 0;
for(int i... | ALGO | 0.999959 | 6.158606 |
7ff9c7b3-7b9e-409f-ad8e-748a0bd5c240 | Minusie357/Algorithm | BackjoonAlgorithm/1953. 팀배분.cpp | //#include <iostream>
//#include <queue>
//using namespace std;
//
//#ifdef _DEBUG
//#include "Utility.h"
//#endif // _DEBUG
//
//
//constexpr int max_size = 100;
//int main()
//{
// ios::sync_with_stdio(false);
// cin.tie(NULL);
//
// int n;
// cin >> n;
//
// vector<int> graph[max_size + 1];
// for (int i = 1; i <= n... | ALGO | 0.999898 | 4.120621 |
e2ee70dc-ef8a-44f8-89e2-4827022b2742 | Nexisato/LeetCodeDiary | LeetCode/0084-Largest-Rectangle-in-Histogram/84-Largest-Rectangle-in-Histogram.cpp | /*
LeetCode 84: Largest Rectangle in Histogram
@Description:
Given n non-negative integers representing the histogram's bar height where the width of
each bar is 1, find the area of largest rectangle in the histogram.
Constraints:
1 <= heights.length <= 10^5
0 <= heights[i] <= 10^4
*/
#include <bits/stdc++.h>
using na... | ALGO | 0.999973 | 7.046513 |
6d9ba67d-a5d0-4298-9764-20e3fec32bad | ninjatun3/cpp | examples/drweb.cpp | #include <iostream>
#include <random>
#include <string>
#include <cstring>
using namespace std;
void TrimRight(char*);
void TrimRightString(string&);
template <typename T>
void _testTrimRight(void(*)(T), const size_t&);
// вариант реализации
void TrimRight(char* s) {
// проверяем чтобы строка была непустой
if (!*... | TEST | 0.962625 | 4.904235 |
e3e6eef4-c74c-443b-afa4-ca1dcb60b05d | xiaoxiaodx/qt-source-code-learning | qtSource/src/widgets/graphicsview/qgraphicssceneindex.cpp | /*!
\class QGraphicsSceneIndex
\brief The QGraphicsSceneIndex class provides a base class to implement
a custom indexing algorithm for discovering items in QGraphicsScene.
\since 4.6
\ingroup graphicsview-api
\internal
The QGraphicsSceneIndex class provides a base class to implement
a ... | TOOL | 0.955987 | 3.377652 |
47ac4f9b-9af4-4a1e-8a0c-d9b34ae5452a | Jaehyun-Jeong/coding_problems | baekjoon/2480.cpp | #include <iostream>
using namespace std;
int main(){
int A, B, C;
cin >> A >> B >> C;
if (A == B && B == C) cout << 10000+A*1000;
else if (A == B && A > C) cout << 1000+A*100;
else if (B == C && B > A) cout << 1000+B*100;
else if (A == C && C > B) cout << 1000+C*100;
else if (A > B && A > C... | ALGO | 0.998776 | 3.862337 |
ea565b86-0112-4f67-ad82-87a5a84fb919 | ChinmayBhintade30/C_language_bootcamp | Section_10_exercises/efficient calculation basic way.cpp | #include<stdio.h>
#include<stdlib.h>
#include<math.h>
int main()
{
int x;
int x2,x4,x6,x8;
printf("Enter value of x: ");
scanf("%d",&x);
x2=x*x;
x4=x*x*x*x;
x6=x*x*x*x*x*x;
x8=x*x*x*x*x*x*x*x;
printf("X^2=%d \nX^4=%d \nX^6=%d \nX^8=%d \n",x2,x4,x6,x8);
return 0;
}
| ALGO | 0.997714 | 3.092276 |
e1bc6f6d-786b-48fc-a644-c826229ff0b5 | AbhishekSaini1322/ARRAYS-QUESTION-CODE | SORT1AND0.cpp | #include<iostream>
using namespace std;
int sort(int arr[],int size){
int ones = 0;
int zeros = 0;
for(int i=0; i<size; i++){
if(arr[i]==0)
zeros++;
if(arr[i]==1)
ones++;
}
int index = 0;
while(zeros--){
arr[index] = 0;
index++;
}
w... | ALGO | 0.999966 | 4.130018 |
755c9ca0-5214-4ad1-9237-7b9b88fc71d6 | mostafanasrat4/World-Time-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.9988 | 6.76073 |
bca0c7ea-49d7-4433-ab23-32136be41b0a | PonnePonne/Programmering-1 | Bonus/Bonus14/BOnus14.cpp | #include <iostream>
using namespace std;
int main() {
char ord[100];
char mat[3];
cout << "Skriv in ett ord" << endl;
cin >> ord;
for(int i = 0; i < 99; i++){
if(ord[i] == 'A'or ord[i] == 'a' or ord[i] == 'T' or ord[i] == 't'){
break;
} else if(ord[i] == 'M' or ord[i] == 'm'){
mat[0] = 'M';
}
}
for... | ALGO | 0.999388 | 3.269207 |
c04542b3-3001-4b10-a987-b2558be557a2 | LazyPlanet/MX-Architecture | ThirdParty/boost_1_63_0/libs/geometry/doc/src/examples/strategies/buffer_join_miter.cpp | // Boost.Geometry (aka GGL, Generic Geometry Library)
// QuickBook Example
//[buffer_join_miter
//` Shows how the join_miter strategy can be used as a JoinStrategy to create sharp corners
#include <boost/geometry.hpp>
#include <boost/geometry/geometries/point_xy.hpp>
#include <boost/geometry/geometries/geometries.hpp... | TOOL | 0.986192 | 6.659193 |
bf41b375-1806-4184-b601-5a98ddd7c720 | gursewak8642/Portfolio | programs/reverse pattern using for loop.cpp | //pattern to print
//55555
//4444
//333
//22
//1
//
//
#include<stdio.h>
#include<conio.h>
int main(){
int r,c,row;
printf("Enter the value :-");
scanf("%d",&row );
for(r=5;r<=row;r--)
{
for(c=5;c<=r;c--)
{
printf("%d",c);
}
printf("\n");
}
}
| ALGO | 0.99799 | 3.097483 |
729c46a8-6c56-44cb-9430-29c4c2bb0a6f | NSergeevich87/C-All-Projects | GB_C++/2_Arrays_and_Pointers/1_17_05_24/task_2.cpp | /** Сортировка
Что нужно сделать:
Пользователь вводит в консоль 15 дробных чисел. Необходимо прочитать их и вывести в консоль в порядке от
большего к меньшему. По возможности используйте минимум дополнительной памяти и проходов по массиву.
Пример:
Ввод: 1.2 2.3 1.11 3.4 5.5 5.4 5.3 5.1 1.5 1.25 5.41 5.31 5.11 1.51 ... | ALGO | 0.999234 | 4.770692 |
73893960-da0f-4f3c-b0fc-b3cfa6b473a3 | glexey/code | p611/d2.cpp | #include<bits/stdc++.h>
using namespace std;
const int N=5005;
char s[N];
int dp[N][N]; // dp[k,len]: number of cuts of string 0..k-1
// such that last number is of length len
int fs[N][N];
int n;
bool smaller(int l1, int l2, int len) {
int fd = fs[l1][l2];
if (fd >= len) return false;
return ... | ALGO | 0.999984 | 4.136043 |
2364175d-f91f-4c14-bf88-cef0c621e9d9 | SIGMOD-25-Programming-Contest/base | src/statement.cpp | #include <cassert>
#include <common.h>
#include <inner_column.h>
#include <plan.h>
#include <statement.h>
std::vector<uint8_t> bitmap_not(std::vector<uint8_t> bitmap) {
auto task = [&bitmap](size_t begin, size_t end) {
for (size_t i = begin; i < end; ++i) {
bitmap[i] = ~bitmap[i];
}
... | TOOL | 0.89963 | 6.99083 |
3ded5604-07ed-4fd0-ae3b-c36426ccecdd | Gaurav-20/LeetCode-Solutions | 2788-split-strings-by-separator/2788-split-strings-by-separator.cpp | class Solution {
public:
void append(string word, char separator, vector<string>& result) {
string temp = "";
for (char c: word) {
if (c == separator) {
if (temp != "") {
result.push_back(temp);
temp = "";
}
... | ALGO | 0.999792 | 6.26814 |
e97e287b-b91e-46f9-8e0b-83cfa0b71238 | satyamtiwari736182/CP | pepcoding/Level 2/Stacks_&_Queue/29_Design Circular Deque.cpp | // Design your implementation of the circular double-ended queue (deque).
// Your implementation should support following operations:
// 1. MyCircularDeque(): Initializes the deque object.
// 2. insertFront(): Adds an item at the front of Deque.
// 3. insertLast(): Adds an item at the rear of Deque.
// 4. deleteFront... | ALGO | 0.990947 | 3.799653 |
fcc5be47-e03d-4462-b077-5b9636f00778 | CSPercival/CP-Problemset | CodeForces/Normal_Rounds/2110D.cpp | #include<bits/stdc++.h>
#define st first
#define nd second
#define all(x) x.begin(), x.end()
#define BOOST cin.tie(NULL); ios_base::sync_with_stdio(false);
#define int ll
typedef long long ll;
using namespace std;
template <typename T> struct tag:reference_wrapper <T>{ using reference_wrapper <T>::reference_wrapper;... | ALGO | 0.999864 | 3.956739 |
5b014f24-180d-4c97-a603-23111da9759d | use-atharv/c-practicals1 | linear.cpp | #include <iostream>
using namespace std;
int linearSearch(int arr[], int n, int x) {
// Iterate through the array
for (int i = 0; i < n; i++) {
if (arr[i] == x) {
return i; // Return the index if found
}
}
return -1; // Return -1 if not found
}
int main() {
int arr[... | ALGO | 0.999861 | 5.691256 |
4fbc6c54-840f-4eab-842c-11be1b2cfdc7 | ViralTaco/code | C++/CodinGame/CodinGame/Temperature/Temperature.cpp | #include <algorithm>
#include <iostream>
#include <vector>
static bool is_lower(int a, int b) {
return a < b;
}
static int closest(std::vector<int> v, int value_to_compare_to) {
std::sort(v.begin(), v.end(), is_lower);
auto iter = std::lower_bound(v.begin(), v.end(), value_to_compare_to);
/* std::lower_bound... | ALGO | 0.999948 | 5.185854 |
312e464e-e6b8-40a8-a33c-dcec08418682 | debabrota1604/onlineJudgeProgs | leetCode/p53_kedenes_algorithm.cpp | #include<bits/stdc++.h>
using namespace std;
class Solution {
public:
int maxSubArray(vector<int>& nums) {
int max_so_far, max_ending_here;
max_so_far = INT_MIN;
max_ending_here =0;
for(auto num:nums){
max_ending_here += num;
if(max_ending_here > max_so_far) ... | ALGO | 0.999879 | 5.590058 |
64e12a13-16a4-4968-96fc-d4ca9ab1c383 | YuanhsiangShen/TiCopter440 | libraries/SITL/SIM_Sailboat.cpp | /*
Sailboat simulator class
see explanation of lift and drag explained here: https://en.wikipedia.org/wiki/Forces_on_sails
To-Do: add heel handling by calculating lateral force from wind vs gravity force from heel to arrive at roll rate or acceleration
*/
#include "SIM_Sailboat.h"
#include <AP_Math/AP_Ma... | TOOL | 0.987212 | 5.464522 |
35cd462a-d761-4b83-9395-3338e2d0390e | ishandutta2007/codeforces | bicsi/normal/406/D.cpp | #include<bits/stdc++.h>
using namespace std;
int64_t X[200000], Y[200000];
int ST[200000], ste;
int Parent[20][200000], D[200000];
int64_t det(int a, int b, int c) {
return (X[b] - X[a]) * (Y[c] - Y[b]) - (X[c] - X[b]) * (Y[b] - Y[a]);
}
int pl(int node, int lev) {
for(int i=0; (1<<i)<=lev; i++)
if(... | ALGO | 0.999996 | 4.396269 |
5d12e83c-846e-4038-bd1a-4f7eab33efe4 | flyforall/rep1 | src/lib/flight_tasks/tasks/Orbit/FlightTaskOrbit.cpp | /**
* @file FlightTaskOrbit.cpp
*/
#include "FlightTaskOrbit.hpp"
#include <mathlib/mathlib.h>
#include <lib/ecl/geo/geo.h>
using namespace matrix;
FlightTaskOrbit::FlightTaskOrbit() : _circle_approach_line(_position)
{
_sticks_data_required = false;
}
bool FlightTaskOrbit::applyCommandParameters(const vehicle_... | TOOL | 0.896523 | 6.745487 |
63480e01-e595-46e9-9955-8372945d435e | fixxtion1/cp-sail | CSES/1621.cpp | #include <bits/stdc++.h>
using namespace std;
#define all(x) (x).begin(), (x).end()
#define ll long long
void solve(){
int n;
cin >> n;
set<int> a;
for(int i=0; i<n; i++){
int x;
cin >> x;
a.insert(x);
}
cout << a.size();
}
int main(){
ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
int tc=... | ALGO | 0.999467 | 4.938298 |
102bf05d-cff1-4be6-becf-5e7c1015eba0 | Chinmay9460/Coding-Challenges-by-Chinmay | March 2025 Leetcode Problems/Lexcographical Numbers.cpp | #include <bits/stdc++.h>
using namespace std;
#define INL __attribute__((always_inline))
#define ll long long
#define vll vector<ll>
#define pb push_back
#define f first
#define s second
const int MAX = 1000007;
const int MOD = 1000000007;
class Solution {
public:
vector<int> lexicalOrder(int n) {
vecto... | ALGO | 0.999795 | 4.703805 |
b0744e1c-3b1c-4db7-95cb-b0f7c836de95 | Sloan0/Google-code-jam-2016 | Counting_Sheep.cpp |
#include <iostream>
#include <fstream>
#include <cmath>
using namespace std;
bool allDigits(bool digits[10], int kevin);
int main(){
ofstream outputStream ("Counting_Sheep_output.txt");
ifstream inputStream ("A-large-practice.in");
int startNum;
int k;
int result;
bool done;
int cases;
inputStream >>... | ALGO | 0.999572 | 4.885313 |
480c4642-c8f2-4f99-ae63-22781ef1e2e9 | UlisesToledoH/C-CPP-OOP | Projects C++/03_Triangulos_Area_Heron/AreaTriangulo_Heron_POO.cpp | // Programa: AreaTriangulo_Heron_POO.cpp
// Calcula el área de un triángulo con el teorema de Herón usando POO en C++.
// Verifica que los lados formen un triángulo válido, solicita datos al usuario y muestra el resultado.
#include <iostream>
#include <cmath>
#include <cstdlib>
using namespace std;
class Coordenadas ... | ALGO | 0.994324 | 6.324948 |
f42c3e63-bfc2-4882-8938-039b43b69e02 | WGree/solutions | Codeforces/Div3/636/B.cpp | //B.cpp
#include <bits/stdc++.h>
using namespace std;
int main() {
int t;
cin >> t;
while (t--) {
int n;
cin >> n;
if (n >> 1 & 1) {
cout << "NO" << endl;
continue;
}
cout << "YES" << endl;
for (int i = 1; i <= n / 2; ++i) {
... | ALGO | 0.999829 | 4.687809 |
e8673733-23e7-4873-b71d-6e9d274eedbc | carol-sf/TractianMobileChallenge | 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.998799 | 6.776823 |
291d8a7a-60fb-4c50-a666-a882bb2c063f | NandiniMehta0603/450 | Arrays/26. Chocolate Distribution.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 the array
sort(a.begin(),a.end());
if(n==m){
return (a[n-1]-a[0]);
... | ALGO | 0.999902 | 5.935042 |
cb44a63e-d6a0-410f-8dee-480a91f2626e | DevSonseol/Algorithm | 프로그래머스/올바른괄호.cpp | #include <string>
#include <iostream>
#include <stack>
using namespace std;
bool solution(string s)
{
stack<char> st;
bool answer = true;
for (int i = 0; i < s.size(); i++)
{
if (st.empty() && s[i] == '(')
{
st.push(s[i]);
}
else if (st.empty() && s[i] ==... | ALGO | 0.998332 | 5.433679 |
ef7437e4-4cd5-450d-a8a6-b90238bb0a39 | Lee-Jungyu/algorithm | programmers/77484.cpp | #include <string>
#include <vector>
using namespace std;
vector<int> solution(vector<int> lottos, vector<int> win_nums) {
bool my_nums[46] = {false, };
int zero_cnt = 0;
for(int i = 0; i < lottos.size(); i++) {
if(lottos[i] == 0) zero_cnt++;
my_nums[lottos[i]] = true;
}
... | ALGO | 0.999319 | 5.358041 |
8b847231-b62f-4532-84ac-881fbda7abfa | denis-gubar/Leetcode | Tree/0894. All Possible Full Binary Trees.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.999733 | 6.275747 |
644ed538-fe99-4d51-8e24-5d57cc57faff | sidjha57/Coding | C++/Codeforces/C1_Potions_Easy_Version_.cpp | //template
#include <iostream>
#include <string>
#include <set>
#include <list>
#include <map>
#include <unordered_map>
#include <stack>
#include <queue>
#include <deque>
#include <vector>
#include <utility>
#include <iomanip>
#include <sstream>
#include <bitset>
#include <cstdlib>
#include <iterator>
#include <algorit... | ALGO | 0.999977 | 4.021007 |
0042c44e-65a3-4096-b9b0-c20331bc6c53 | SaifHaiderMalik/OOP | Labs/Saif/Lab10/task2.cpp | #include<iostream>
#include<string>
using namespace std;
class Binary{
int bit;
public:
Binary(){
bit = 0;
}
Binary(int _bit){
if(_bit == 0 || _bit == 1){
bit = _bit;
}
}
void setBinary(int _bit){
if(_bit == 0 || _bit == 1){
... | ALGO | 0.999551 | 4.807227 |
2b6dc97b-1075-4731-a34c-9785ac0ed7a9 | jjiangweilan/WeilanEngine-GL | Extern/Box2D/Box2D/Dynamics/Joints/b2GearJoint.cpp | #include "Box2D/Dynamics/Joints/b2GearJoint.h"
#include "Box2D/Dynamics/Joints/b2RevoluteJoint.h"
#include "Box2D/Dynamics/Joints/b2PrismaticJoint.h"
#include "Box2D/Dynamics/b2Body.h"
#include "Box2D/Dynamics/b2TimeStep.h"
// Gear Joint:
// C0 = (coordinate1 + ratio * coordinate2)_initial
// C = (coordinate1 + ratio ... | ALGO | 0.967671 | 7.015675 |
1e09d47d-c3bd-41b4-be29-16d40b15437e | huangallen2008/cppcode | code/CSES/Increasing Array/Increasing Array.cpp | #include<bits/stdc++.h>
using namespace std;
#define ll long long
#define int ll
#define FOR(i,a,b) for(int i=a;i<b;i++)
#define REP(i,n) FOR(i,0,n)
#define REP1(i,n) FOR(i,1,n+1)
#define RREP(i,n) for(int i=n-1;i>=0;i--)
#define f first
#define s second
#define pb push_back
#define ALL(x) x.begin(),x.end()
#define SZ(... | ALGO | 0.999947 | 3.521528 |
9f58d4ec-2aac-44f4-84af-355cb76ff997 | OgnjenRistovski/snake-game | ZmijiceBES/bes.cpp | //Ognjen Ristovski RT-1/21
#include <iostream>
#include <fstream>
#include <conio.h> //Ova biblioteka se koristi za korisnicki unos tj. komande za pomeranje same zmije tipa kbhit()
#include <windows.h> //Ova biblioteka se koristi zbog SetConsoleCursorPosition()
#include <chrono> //Upotreba ove i <thread> datoteke z... | TOOL | 0.932139 | 3.402617 |
297d6f8b-0d07-4db6-9c3c-02dab8560f2e | Rohit-8/Leetcode | 947-most-stones-removed-with-same-row-or-column/947-most-stones-removed-with-same-row-or-column.cpp | class Solution {
public:
int par[10001], ran[10001];
void setParRank(int n){
for(int i = 0; i <= n; i++){
par[i] = i; ran[i] = 0;
}
}
int findpar(int node){
if(node == par[node]) return node;
return par[node] = findpar(par[node]);
}
void unionp(int u, ... | ALGO | 0.999932 | 5.07427 |
dbcab206-46ef-4285-9ee2-880efbebe3ff | TulipManiaCoin/TulipManiaCoin | src/hash.cpp | #include "hash.h"
inline uint32_t ROTL32 ( uint32_t x, int8_t r )
{
return (x << r) | (x >> (32 - r));
}
unsigned int MurmurHash3(unsigned int nHashSeed, const std::vector<unsigned char>& vDataToHash)
{
// The following is MurmurHash3 (x86_32), see http://code.google.com/p/smhasher/source/browse/trunk/MurmurH... | ALGO | 0.992391 | 6.288588 |
15520f19-3643-4f79-b024-b6099bd4a0b3 | aanchal2320/LeetCode | 458-poor-pigs/458-poor-pigs.cpp | class Solution {
public:
int poorPigs(int buckets, int minutesToDie , int minutesToTest) {
if(buckets==1)return 0;
int ans = 1;
int t = minutesToTest/minutesToDie + 1;
while(pow(t,ans)<buckets)
ans++;
return ans;
}
}; | ALGO | 0.997892 | 5.930748 |
b5c363c4-d7ef-492e-8ac0-8e1e4fcdc49c | heroineworshiper/countreps | parse/connect_parts.cpp | #include "connect_parts.hpp"
#include <queue>
namespace trt_pose {
namespace parse {
std::size_t connect_parts_out_workspace(const int C, const int M) {
return sizeof(int) * C * M;
}
void connect_parts_out(int *object_counts, // 1
int *objects, // PxC
con... | ALGO | 0.966717 | 5.86964 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.