uuid stringlengths 36 36 | repo_name stringlengths 5 123 | relative_path stringlengths 5 4k | content stringlengths 33 2.85M | category stringclasses 6
values | algo_rel_score float64 0.85 1 | quality_score float64 3 8.76 |
|---|---|---|---|---|---|---|
8427e48e-9926-4e65-a302-d59dde3a98a8 | pjurgielewicz/ROOT_LITE | interpreter/llvm/src/lib/Transforms/Utils/LoopUnrollRuntime.cpp | #include "llvm/ADT/Statistic.h"
#include "llvm/ADT/SmallSet.h"
#include "llvm/Analysis/AliasAnalysis.h"
#include "llvm/Analysis/LoopIterator.h"
#include "llvm/Analysis/LoopPass.h"
#include "llvm/Analysis/ScalarEvolution.h"
#include "llvm/Analysis/ScalarEvolutionExpander.h"
#include "llvm/IR/BasicBlock.h"
#include "llvm... | ALGO | 0.971378 | 7.761698 |
63162f78-c010-4e67-bc96-b4ddb0aa99b5 | jaARke/LeetCode | 1379.cpp | using namespace std;
struct TreeNode {
int val;
TreeNode *left;
TreeNode *right;
TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}
};
class Solution {
public:
TreeNode* getTargetCopy(TreeNode* original, TreeNode* cloned, TreeNode* target) {
if (original == target) {
re... | ALGO | 0.99988 | 5.700555 |
7d3d0614-b07c-4869-90c0-988502b255e2 | MatrixSmythe/Aurora-old | ThirdParty/ode-0.11/ode/src/collision_trimesh_trimesh_new.cpp | // OPCODE TriMesh/TriMesh collision code
// Written at 2006-10-28 by Francisco Len (http://gimpact.sourceforge.net)
#ifdef _MSC_VER
#pragma warning(disable:4244 4305) // for VC++, no precision loss complaints
#endif
#include <ode/collision.h>
#include <ode/matrix.h>
#include <ode/rotation.h>
#include <ode/odemath.h>... | ALGO | 0.999251 | 5.90814 |
93197af0-1001-4d45-8cf0-c0763e2b3cfd | gxyau/leetcode | challenge/may2020/day15.cpp | #include<iostream>
#include<limits>
#include<vector>
using std::vector;
using std::max;
class SolutionDay15 {
public:
int maxSubarraySumCircular(vector<int>& A) {
int total = 0; // Sum of arrays
int psum = 0; // positive sum
int nsum = 0; // negative sum
int current_max = ... | ALGO | 0.999663 | 5.610148 |
4268dc13-0084-4f8c-8bd2-52715638a116 | BbillahrariBBr/cpp_practise_phitron | Module2.5/1C.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
int a,b;
char c;
cin >>a>>c>>b;
int res;
if(c== '+')
res = a+b;
if(c=='-')
res = a-b;
cout<< res;
return 0;
}
| ALGO | 0.999918 | 3.706638 |
ece7fbeb-2f57-4fba-b12c-92cca4493b35 | AnshulChaturvedi/Anshul-Codes | 0279-perfect-squares/0279-perfect-squares.cpp | class Solution {
public:
int numSquares(int n) {
//creating [1,4,9,16,25,....]
int size = sqrt(n);
vector<int> arr;
int i = 1;
while(i<=size){
arr.push_back(i*i);
i++;
}
vector<int> dp(n+1,INT_MAX);
//dp[i] represents the mini... | ALGO | 0.999912 | 5.616719 |
774ffde5-5754-4c54-9f89-d487f62fbdf1 | codeninja404/LeetCode_CPP | 131. Palindrome Partitioning.cpp | class Solution {
public:
vector<vector<string>> partition(string s) {
vector<vector<string>>res;
vector<string>v;
dfs(s, 0, v, res);
return res;
}
void dfs(string s, int pos, vector<string>& v, vector<vector<string>>& res){
if(pos >= s.size()){
res.pu... | ALGO | 0.999701 | 6.307838 |
380d2db5-bc12-427e-acf6-0a0a258f5f36 | Autoratch/submissions | Evaluator/oct20_array.cpp | #include <bits/stdc++.h>
using namespace std;
const int N = 1 << 18;
struct node
{
int a,b,c,d;
};
int m,q;
vector<node> inp;
long long tree[N << 1],lazy[N << 1];
set<int> s;
vector<long long> a;
void pushlz(int l,int r,int idx)
{
if(lazy[idx]==0) return;
tree[idx] = lazy[idx]*(a[r+1]-a[l]);
if(l!=r... | ALGO | 0.999283 | 4.222818 |
b6b9fbf8-d9de-441c-a621-757622ffaca6 | crystax/android-vendor-boost-1-62-0 | libs/graph/example/read_write_dimacs-eg.cpp | #include <boost/config.hpp>
#include <iostream>
#include <string>
#include <boost/graph/adjacency_list.hpp>
#include <boost/graph/read_dimacs.hpp>
#include <boost/graph/write_dimacs.hpp>
/*************************************
*
* example which reads in a max-flow problem from std::cin, augments all paths from
* sourc... | ALGO | 0.997221 | 6.844003 |
069a4353-43ad-4811-836f-1da08453103d | ahmad-hl/GCC_NADA_ALVR | eigen-3.4.0/doc/examples/Tutorial_ReductionsVisitorsBroadcasting_broadcast_1nn.cpp | #include <iostream>
#include <Eigen/Dense>
using namespace std;
using namespace Eigen;
int main()
{
Eigen::MatrixXf m(2,4);
Eigen::VectorXf v(2);
m << 1, 23, 6, 9,
3, 11, 7, 2;
v << 2,
3;
MatrixXf::Index index;
// find nearest neighbour
(m.colwise() - v).colwise().squaredNorm()... | ALGO | 0.999945 | 4.138078 |
d642ee4e-9140-453b-9b1a-267a10a6f164 | m-sumaim/gfg | Easy/Divisible Numbers/divisible-numbers.cpp | //{ Driver Code Starts
#include<bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution{
public:
long long int find(long long int A,long long int B){
//code here
if(A<B)
return B;
long long int x = A % B;
long long int y = B -x ;
... | ALGO | 0.999862 | 5.40453 |
4f6a6c76-9688-4fab-85c4-0040595a5037 | PrathamAsrani/GFG_POTD_CODES | Basic/Find minimum and maximum element in an array/find-minimum-and-maximum-element-in-an-array.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution {
public:
pair<long long, long long> getMinMax(long long a[], int n) {
pair<long long, long long> itr = {1e18, -1e18};
for(int i = 0; i < n; itr.first = min(itr.first, (long long)a[i]), itr.sec... | ALGO | 0.999705 | 5.624362 |
4a4eec1f-24d2-43b5-aaf1-ae8ec4f0158e | kSagiri998/BSOJ-answers | 1564.cpp | #include<cstdio>
int main(){
int n,i,j,s=0,s1=0,s2=0;
char x,a;
scanf("%d %c\n",&n,&a);
bool t;
for(i=0;i<n;i++){
t=1;
for(j=0;;j++){
x=getchar();
if(x=='\n'){
break;
}
s1++;
if(j==0){
if(x!='c'){
t=0;
}
}
if(j==1){
if(x!='o'){
t=0;
}
}
if(j==2){
if(... | ALGO | 0.997747 | 3.220751 |
06ea1f61-f143-4850-8efb-4c347b5bb91f | Unkn0wnCreature/StudentAlgorithms-5130203 | task1/global.cpp | #include <iostream>
#include "product.h"
#include "product.cpp"
#include "warehouse.h"
#include "warehouse.cpp"
#include <cmath>
using namespace std;
double calculate_dist(Warehouse w, double longitude, double lattitude){
return abs(w.logitude - longitude) + abs(w.lattitude - lattitude);
}
void insert_new_produc... | TOOL | 0.855853 | 3.35871 |
4c4a791a-9be5-470e-90e0-c3b77d60a9df | krishna-raj007/BodhiTree-Annotation | CS101_Autumn2020-21/Fibonacci/338_fibonacci.cpp | #include<simplecpp>
main_program{
//Write your code here
int n,k;
cin>>n>>k;
int fn2 = 0;
int fn1 = 1;
if(n==1)
{
cout<<fn2;
return 0;
}
cout<<fn2<<"\n"<<fn1<<"\n";
for(int i=2;i<n;i++)
{
int temp = (fn1+fn2)%k;
cout<<temp<<"\n";
fn2 = fn1%k;
fn1 = temp%k;
}
}
| ALGO | 0.999966 | 3.41903 |
5e526ae9-c2f4-4cc3-b15e-7b702b44e34f | AHSANJAWED/practice | ch8 q1.cpp | #include<stdio.h>
int facto(int);
int main()
{
int n;
printf("Enter the no\n");
scanf("%d",&n);
int ans=facto(n);
printf("factorial=%d",ans);
return 0;
}
int facto(int p)
{
int fact=1;
for(int i=1; i<=p; i++)
{
fact=fact*i;
}
return fact;
}
| ALGO | 0.999882 | 3.384985 |
b9060727-bebf-4097-a18f-55d894b54815 | VarunDTU/Leetcode-solutions-via-LeetSync | 222-count-complete-tree-nodes/count-complete-tree-nodes.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.99991 | 6.624171 |
97c06398-563f-41de-97af-b84713fb53d0 | YuanpingSong/first-year-portfolio | LA_Code_Sprint/LA Code Sprint/Personal Round/Problem_4.cpp | #include <iostream>
#include <vector>
#include <cstdio>
#include <algorithm>
#include <set>
#include <map>
#include <queue>
#include <cassert>
#include <cmath>
#include <climits>
using namespace std;
// found this online....
int maxSubArray(vector<int>& nums) {
int n = nums.size();
if(n == 0)
return 0... | ALGO | 0.995496 | 4.025898 |
b755163a-e41a-47e1-b96f-d7c875f3d5f4 | HarryAndrus/CSA1B | main.cpp | #include <iostream>
#include <iomanip>
using namespace std;
int main() {
int numTellers = 0;
int sickDays = 0;
int totalSickdays = 0;
cout << "How many tellers worked at Nation's Bank during each of the last three years ?" << endl;
cin >> numTellers;
for (int teller = 1; teller <= numTellers... | ALGO | 0.991479 | 4.167037 |
4b04c496-637e-4308-a6d0-346daa94db28 | Sped32DJ/LearningProgramming | CPP/10B/week1/Labs/exactChangeFunction.cpp | #include <iostream>
#include <vector>
using namespace std;
/* Declare your function here */
void exactChange( int inVal, vector<int>& vChange);
int main() {
int inputVal;
vector<int> changeAmount(4);
cin >> inputVal;
exactChange(inputVal, changeAmount);
// exactChange.at(0) = pennies
// 1 nickles
... | ALGO | 0.998018 | 4.322353 |
76ea38fa-6571-43d9-95e2-015559c2d631 | ishandutta2007/codeforces | gustav/normal/477/C.cpp | #include <cmath>
#include <ctime>
#include <cctype>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <set>
#include <unordered_set>
#include <map>
#include <unordered_map>
#include <stack>
#include <queue>
#include <vector>
#include <bitset>
#include <string>
#include <algorithm>
#include <function... | ALGO | 0.99999 | 3.426304 |
692a2578-0e0b-4094-baa0-ca2a58a754c7 | hmwang2002/Algorithm-Learning | leetcode/leetcode-2787.cpp | #include <bits/stdc++.h>
using namespace std;
class Solution
{
public:
int numberOfWays(int n, int x)
{
int MOD = 1e9 + 7;
long p[n + 1];
for (int i = 1; i <= n; i++)
{
p[i] = i;
for (int j = 2; j <= x; j++)
{
p[i] *= i;
... | ALGO | 0.999983 | 5.385625 |
6b01c9c4-006d-4076-a3e3-4d5d5ab6a4bf | sh-sho1kat/CODEFORCES | Codeforces Round 932 (Div. 2)/A_Entertainment_in_MAC.cpp | ///********************** بِسْمِ ٱللَّهِ ٱلرَّحْمَـٰنِ ٱلرَّحِيمِ **********************///
/**
* author: Shefat Hossen Shoikat
* date : 2024-03-05 23:13:16
**/
#include <bits/stdc++.h>
using namespace std;
#define fastio ios_base::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL)
#define mod 1000000... | ALGO | 0.99997 | 5.785609 |
126eedda-ab44-4fe4-8395-5c04ea648509 | pandeyankit123/CP-Solutions-by-Laidback | Card_Swipe.cpp | /* Waadon se apne mukarta nahin, */
/* Question se main kabhi darta nahin. */
/* Laidback O Laidback! */
/* Laidback O Laidback! */
/* Laidback O Laidback! */
/* Laidback... */
#include<bits/stdc++.h>
using namespace std... | ALGO | 0.998393 | 4.029081 |
d0f3372c-1dec-4508-bf84-6d8e8a805214 | louisfghbvc/ITSA | ITSA程式能力線上自我評量/202005/Problem 6. 能力分配.cpp | // Set again nothing special.
#include <bits/stdc++.h>
#define louisfghbvc int t; cin >> t; while(t--)
using namespace std;
void solve(){
int n;
cin >> n;
set<string> MP, Survey, G, Farmer;
string name;
int a, b;
for(int i = 0; i < n; ++i){
cin >> name >> a >> b;
bool good = ... | ALGO | 0.999093 | 3.709316 |
24d0735d-1325-4a84-bac4-33af3f4f94a5 | ishandutta2007/codeforces | lucina/normal/1695/B.cpp | #include<bits/stdc++.h>
using namespace std;
int n;
int a[100];
void solve() {
int n;
cin >> n;
for (int i = 1 ; i <= n ; ++ i) {
cin >> a[i];
}
if (n % 2) {
cout << "Mike" << '\n';
return;
}
int mn = *min_element(a + 1, a + 1 + n);
for (int i = 1 ; i <= n ; ++ i... | ALGO | 0.999971 | 4.556955 |
c0d27c16-6e7d-4255-a796-03f26ab076d8 | DecSP/cses-downloader | Dynamic Programming/Projects.cpp | #include <bits/stdc++.h>
#define ll long long
#define fastio ios::sync_with_stdio(false); cin.tie(NULL)
using namespace std;
const ll MOD = 1000000007;
const int maxn = 200001;
int n;
int main(){
fastio;
cin>>n;
vector<tuple<int, int ,ll>> arr(n);
for (int i=0; i<n; ++i) {
cin>>get<1>(arr[i])>>get<0>(arr[i])>>ge... | ALGO | 0.999406 | 4.005701 |
6dce7d9b-1d17-4ab7-91db-49d233c4f72c | jangreen/rat | src/basic/Model.cpp | #include "Model.h"
namespace {
[[nodiscard]] inline std::string annotationToString(
const CanonicalAnnotation<SatExprValue> annotation) {
std::string output;
if (annotation->getValue()) {
if (std::holds_alternative<SatSetValue>(annotation->getValue().value())) {
const auto set = std::get<SatSetValue... | ALGO | 0.99457 | 7.616191 |
a42cb65f-4789-4b1d-abe1-d538a5ca74ad | porterlin/CP-Practice | leetcode/binary-tree/508.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.999962 | 6.221266 |
657c4865-28ef-42fa-b099-60c44b28f129 | guilhermeandrd/Ed_Estrutura_De_Dados | cont_char.cpp | #include <iostream>
#include <string>
using namespace std;
// Retorna o números de ocorrências do caractere 'c' na string 'str' (com 'n' caracteres).
// Algoritmo deve ser recursivo e sem comandos de repetição.
int contaCaracteres(string str, int n, char c, int quantidade, int indice){
// fazer
//quando tem s... | ALGO | 0.999552 | 4.25185 |
5915ff54-3c9f-4053-88ee-c1479ab7c7eb | Kvnmb/cpsc2600 | HW3.cpp | // Kevin Bui
// HW3.cpp
// 11/11/22
// Purpose: recursively sort an array of integers using mergesort
// Input: a number n for array size and n integers
// Processing: recursion
// Output: a sorted array of integers
#include <iostream>
using namespace std;
void mergeSort(int [], int, int); // mergesort function
... | ALGO | 0.999879 | 5.832756 |
b152072e-403b-46e6-8a9d-6d9d4937f584 | walkccc/LeetCode | solutions/370. Range Addition/370.cpp | class Solution {
public:
vector<int> getModifiedArray(int length, vector<vector<int>>& updates) {
vector<int> ans;
vector<int> line(length);
int prefix = 0;
for (const vector<int>& update : updates) {
const int start = update[0];
const int end = update[1];
const int inc = update[2]... | ALGO | 0.999859 | 7.062878 |
381a817b-d6be-4270-937d-5f7be40d93b0 | MericLuc/CodinGame | Easy/buzzle.cpp | #include <bits/stdc++.h>
int sum_of_digits(int n, int base = 10) {
int ret{ 0 };
while ( 0 != n ) { ret += n % base; n /= base; }
return ret;
}
bool buzzle(int num, int base, const std::vector<int>& tests ) {
for ( const auto& i : tests )
if ( (0 == num % i) || (i == num % base) ) return tru... | ALGO | 0.999534 | 4.488384 |
a09649fc-9248-413a-8f3a-d09bb14c9ab4 | 113bommy/deepmind_codecontests_refine | cpp_gold_filter_file/cpp_train_6812_22.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int n, m, k;
cin >> n >> m >> k;
vector<string> v(n);
for (int i = 0; i < n; i++) cin >> v[i];
vector<vector<vector<int>>> dp(n,
vector<vector<int>>(m, vector<int>(k + 1, 0)));
vector<vector<vector<bool>>> f(
n... | ALGO | 0.999993 | 3.501754 |
bebbe70c-3a93-41af-b155-9d73a67030b2 | lclpsoz/competitive-programming | CF/1036/A.cpp | #include "bits/stdc++.h"
using namespace std;
////////////// Prewritten code follows. Look down for solution. ////////////////
#define x first
#define y second
#define len(x) ((int)(x).size())
using pii = pair<int, int>;
using ll = long long;
using llu = long long unsigned;
using ld = long double;
const ld EPS = 1e-9... | ALGO | 0.99988 | 3.702301 |
d4daec21-e6f9-4a1d-a63d-f16725d47075 | carrybanana/Cpp_study | C++PrimerPlus/CodingExample/7.11/travel.cpp | #include <iostream>
struct travel_time
{
int hour;
int mins;
};
travel_time sum(travel_time t1, travel_time t2);
void show_time(travel_time t);
const int Mins_per_hr = 60;
int main()
{
using namespace std;
travel_time day1 = {5, 45};
travel_time day2 = {4, 55};
travel_time trip = sum(day1, d... | ALGO | 0.997654 | 5.317649 |
7e8026ad-f9fe-416f-85a0-35ba9672e559 | fearlessghoul/Competitive-Programming | Problems/today.cpp | #include<bits/stdc++.h>
using namespace std;
class Solution {
public:
vector<int> queryResults(int limit, vector<vector<int>> queries) {
ios::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
int* ballMap=new int[limit+1]{};
unordered_map<int,int> color;
int count=0,i=0;
... | ALGO | 0.999161 | 5.483178 |
5d71d338-1924-4a50-918c-21b8de65621a | AntimaTiwari07/LeetCode | 2695-find-score-of-an-array-after-marking-all-elements/2695-find-score-of-an-array-after-marking-all-elements.cpp | //class Solution {
//public:
/*
long long findScore(vector<int>& nums) {
unordered_map<int,bool>valid;
int maxnum = INT_MIN;
for(int i = 0;i<nums.size();i++){
valid[i] = false;
}
long long score = 0;
int smallest = INT_MAX;
int count = 0;
... | ALGO | 0.999994 | 6.063182 |
88dd390a-7a40-4267-8c6c-93691a395bad | ishandutta2007/codeforces | mahdi_jfri/normal/83/E.cpp | #include<bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
const int maxn = 2e5 + 20;
const int maxb = 21;
int ans[maxb][1 << maxb] , dp[maxn];
int a[maxn] , total , m;
string s[maxn];
int get(int a , int b)
{
ll x = 0 , y = 0 , mx = 0;
for(int i = 1; i <= m; i++)
{
x += (1 << (i -... | ALGO | 0.999909 | 3.980433 |
e3cc5ce3-99b1-48e2-9fb8-f24e47571bdc | qinlizhong1/leetcode | twoBigNumSum.cpp | //
// Created by 覃立中 on 2021/2/18.
//
/*
*以字符串的形式读入两个数字,编写一个函数计算它们的和,以字符串形式返回。
(字符串长度不大于100000,保证字符串仅由'0'~'9'这10种字符组成)
输入:"1","99"
输出:"100"
*/
class Solution {
public:
/**
* 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可
* 计算两个数之和
* @param s string字符串 表示第一个整数
* @param t string字符串 表示第二个整数
* @retur... | ALGO | 0.99875 | 6.207549 |
40492ed4-0d05-4d69-9054-917fc693d9f0 | crusior96/ALGORITHM_CODINGS | Dynamic_Programming/점프_백준(1890).cpp | #include<iostream>
using namespace std;
//N*N칸의 모눈종이칸이 있다. 왼쪽 위에서 오른쪽 아래로 가는 경로의 모든 수를 구하여라.
//점프를 할땐 오른쪽이나 아래로만 가능하며, 점프도중 방향을 바꿀 수는 없다.
//점프 해야 하는 칸의 수는 본인이 서 있는 모눈종이칸의 수이다.
int main()
{
int N, map_point;
int maps[101][101] = {};//모눈종이칸의 숫자모음
unsigned long long int ways[101][101] = {};//각 모눈종이칸까지 도달할 수 있는 가짓수 모음
... | ALGO | 0.999946 | 3.896673 |
62035c4c-e505-4bc4-a7c6-5494fa13dde2 | protarie125/BOJ_2511 | src/main.cpp | #include <iostream>
#include <vector>
using namespace std;
using vi = vector<int>;
int main() {
ios::sync_with_stdio(false);
std::cin.tie(nullptr);
auto a = vi(10);
for (int i = 0; i < 10; ++i) {
cin >> a[i];
}
auto b = vi(10);
for (int i = 0; i < 10; ++i) {
cin >> b[i];
}
auto pa = int{ 0 };
auto p... | ALGO | 0.999903 | 4.187604 |
ad50fc5e-4c41-4733-9d0d-1c905251c909 | AjayJoshi99/Competitive_Pragramming | 2416-sum-of-prefix-scores-of-strings/2416-sum-of-prefix-scores-of-strings.cpp | struct Trie {
int score;
Trie *children[26];
Trie () {
score = 0;
memset(children, 0, sizeof(children));
}
void add(string &s, int i) {
if (i) score++;
if (i == s.size()) return;
if (!children[s[i]-'a']) children[s[i]-'a'] = new Trie();
children[s[i]-'... | ALGO | 0.999993 | 6.179778 |
bdc6bd71-a4a7-4f3f-aaf4-f89fdacb373b | MYXHcode/Sword-Finger-Offer-Learning-Code | 剑指Offer:名企面试官精讲典型编程题 编程练习/CodingInterviewChinese2-master/47_MaxValueOfGifts/MaxValueOfGifts.cpp | //==================================================================
// ָOfferԹپͱ⡷
// ߣκ
//==================================================================
// 47ֵ
// Ŀһmn̵ÿһһÿﶼһļֵ
// ֵ0Դ̵Ͻǿʼøÿ
// ƶһ̵ֱ½ǡһ̼
// õټֵ
#include <algorithm>
#include <iostream>
int getMaxValue_solution1(const int* values, int rows, i... | ALGO | 0.99948 | 5.688772 |
5c7f56c2-be3d-4c8d-b1d2-f9168c705275 | bixcoin-project/goodnewscoin | src/test/fuzz/system.cpp | #include <common/args.h>
#include <test/fuzz/FuzzedDataProvider.h>
#include <test/fuzz/fuzz.h>
#include <test/fuzz/util.h>
#include <test/util/setup_common.h>
#include <cstdint>
#include <string>
#include <vector>
namespace {
void initialize_system()
{
static const auto testing_setup = MakeNoLogFileContext<>();
}... | TEST | 0.931235 | 6.079219 |
1ebc974a-287c-4776-bf2f-50a6eedf2af2 | SgtApone117/leetcode_daily | 1755-defuse-the-bomb/defuse-the-bomb.cpp | class Solution {
public:
vector<int> decrypt(vector<int>& code, int k) {
int n = code.size();
vector<int> res(n, 0);
vector<int> sum_arr(n);
if(k == 0)
{
return res;
}
else if(k > 0)
{
int count = 0;
for(int i = 1; i... | ALGO | 0.999948 | 4.834694 |
f7e96bb4-ac05-42b7-aea2-ca6c63056ed4 | ROBOT-RIAD/XPSC_MISSION | Week 2/C_Sum_of_gcd_of_Tuples_Easy.cpp | #include<bits/stdc++.h>
#define fo(i,s,n) for(i=s;i<n;i++)
#define ffo(i,s,n) for(i=s;i<=n;i++)
#define ll long long int
using namespace std;
int gcd(int a,int b)
{
if(a%b==0)return b;
return gcd(b,a%b);
}
int main() {
int n;cin>>n;
int a,b,c;
int sum=0;
ffo(a,1,n)
{
ffo(b,1,n)
... | ALGO | 0.999982 | 4.469964 |
1c43f4c1-ebfa-4ede-912e-90a47ae23621 | kundan816/DSA1 | LeftRotateArrayBy1place.cpp |
#include<bits/stdc++.h>
using namespace std;
void solve(int arr[], int n) {
int temp = arr[0]; // storing the first element of array in a variable
// shifting
for (int i = 1; i < n; i++)
{
arr[i-1] = arr[i];
}
arr[n - 1] = temp; // assigned the value of variable at the last index
for (int i = ... | ALGO | 0.999961 | 3.943469 |
2a589801-d58c-4f80-9341-dcfeb84fef4a | LZP206/proj_cpp | 0_learning/标准模板库STL/14_STL容器/1_vector存放内置数据类型.cpp | #include <iostream>
using namespace std;
#include <vector>
#include <algorithm>
void MyPrint(int val)
{
cout << val << endl;
}
void test01() {
//创建vector容器对象,并且通过模板参数指定容器中存放的数据的类型
vector<int> v;
//向容器中放数据
v.push_back(10);
v.push_back(20);
v.push_back(30);
v.push_back(40);
//每一个容器都有自己的迭代器,迭代器是用来遍历容器中的元素
/... | ALGO | 0.884916 | 3.734322 |
e6e620c9-4919-4c2a-9ec0-ae2deb7c586b | JuncoDH/CompetitiveProgramming | online_judges/UVA/941 - Permutations.cpp | #include <bits/stdc++.h>
//#pragma GCC diagnostic ignored "-Wsign-compare"
using namespace std;
#define mp make_pair
#define pb push_back
#define all(x) (x).begin(), (x).end()
#define sz(x) (int)(x).size()
#define fi first
#define se second
#define LSB(x) ((x) & (-(x)))
typedef long long ll;
typedef long double... | ALGO | 0.999938 | 3.957764 |
5db2a920-0fc9-4e11-ab87-ac8891fbb0bf | HamZil/C-and-C-projects | C Programming Code Examples/difference between constant pointer and pointer to constant.cpp | #include <stdio.h>
void constPtr(int * const ptr);
void ptrToConst(const int * ptr);
void test(int *a);
int main(void){
int count = 5;
constPtr(&count);
ptrToConst(&count);
return 0;
}
void constPtr(int * const ptr){
int j= 10;
//ptr = &j; // will generate an error because we cannot assign new address to c... | TOOL | 0.938681 | 3.304756 |
95266774-f50f-4e7c-a9d7-7ce4805c0607 | AinsteinAI/ainstein_radar | ainstein_radar_filters/src/radar_target_array_speed_filter.cpp | #include "ainstein_radar_filters/radar_target_array_speed_filter.h"
namespace ainstein_radar_filters
{
RadarTargetArraySpeedFilter::RadarTargetArraySpeedFilter( ros::NodeHandle node_handle,
ros::NodeHandle node_handle_private ) :
nh_( node_handle ),
nh_private_( node_handle_private ),
listen_tf_( b... | TOOL | 0.923854 | 6.546251 |
8f38865b-e318-4abc-af77-c421a2417c68 | Pintukumar0307/CPP-DSA | Phase-1/09_2D_Array/01_Creation.cpp | #include<iostream>
using namespace std;
int main()
{
// creation
// int arr[10][10];
// initialise first element with 0 and 1
// int arr[10][10] = {1};
// initialise 2d array like 1d array
// int arr[3][3] = {1,2,3,4,5,6,7,8,9};
// initialise 2d array row/col wise
// int arr[4][2] = {... | TOOL | 0.975966 | 3.166509 |
64663dbb-f82d-4d63-8b1b-86706e9b4198 | NMLT-NTTMK-K18/5-258-struct | 2. Bai036/Source.cpp | #include <iostream>
#include <iomanip>
using namespace std;
struct diemkhonggian
{
float x;
float y;
float z;
};
typedef struct diemkhonggian DIEMKHONGGIAN;
void Nhap(diemkhonggian &);
float KhoangCachY(DIEMKHONGGIAN, DIEMKHONGGIAN);
int main()
{
diemkhonggian P;
cout << "Nhap toa do diemkhonggian P: " << endl... | TOOL | 0.870561 | 3.78669 |
75163dd9-4be6-45fb-a71b-bf4b1b9c6076 | dlvguo/NoobOJCollection | LeetCode/Normal/900-999/914.cpp | #include <iostream>
#include <vector>
#include <algorithm>
#include <set>
using namespace std;
class Solution
{
public:
int gcd(int x, int y)
{
if (x % y)
{
return gcd(y, x % y);
}
return y;
}
bool hasGroupsSizeX(vector<int> &deck)
{
if (deck.siz... | ALGO | 0.999759 | 5.45153 |
a7e686bb-f7e1-4c2c-b2ae-3e45df5f5b1d | nameisntimportant/transport_catalog | src/sphere.cpp | #include "sphere.h"
#include "utils.h"
#include <cmath>
#include <string>
using namespace std;
namespace
{
constexpr double DegreesToRadiansKoeff = M_PI / 180.0;
constexpr double EarthRadius = 6'371'000;
} // namespace
namespace Sphere
{
Point Point::fromDegrees(double latitude, double longitude)
{
ASSERT_WITH_... | TOOL | 0.920339 | 6.905519 |
181b4324-a227-470d-a392-393a43bfb27e | AnkitVarshney01/My-Coding-Playground | Codeforces/C_Schedule_Management.cpp | #include <iostream>
#include <string>
#include <algorithm>
#include <climits>
#include <vector>
#include <stdlib.h>
#include <map>
#include <queue>
#include <stack>
#include <set>
#include <functional>
#include <random>
#include <numeric>
#include <iomanip>
#include <chrono>
#include <cmath>
#include <cassert>
#include... | ALGO | 0.999986 | 4.134155 |
f3f85a2f-baa1-43a8-a6b1-a9709cc57d50 | z1137557736/elementary | pipioj/1122/oj_1302.cpp | #include <iostream>
/**
* 题意:找兄弟
*/
using namespace std;
typedef struct BNode{
int data;
BNode *lchild, *rchild;
} *BTree;
int flag = 0; // 0标识其他关系,1标识兄弟
int i = -1, j = -1; // x的层次和y的层次,若i和j相同,则标识为表亲
void buildTree(BTree &T) {
int d;
cin >> d;
if (d != -1) {
T = new BNode;
... | ALGO | 0.999969 | 3.65344 |
c11cf7ea-a936-452e-8e7b-bfb38a748d8a | rs-siemens/node | deps/icu-small/source/i18n/numparse_impl.cpp | #include "unicode/utypes.h"
#if !UCONFIG_NO_FORMATTING
// Allow implicit conversion from char16_t* to UnicodeString for this file:
// Helpful in toString methods and elsewhere.
#define UNISTR_FROM_STRING_EXPLICIT
#include <typeinfo>
#include <array>
#include "number_types.h"
#include "number_patternstring.h"
#includ... | TOOL | 0.885093 | 7.743069 |
22b6eeaf-868d-4b2f-aa41-978654c4d644 | by-student-2017/lammps-stable_29Sep2021 | src/compute_omega_chunk.cpp | // clang-format off
#include "compute_omega_chunk.h"
#include <cstring>
#include "atom.h"
#include "update.h"
#include "modify.h"
#include "compute_chunk_atom.h"
#include "domain.h"
#include "math_extra.h"
#include "math_eigen.h"
#include "memory.h"
#include "error.h"
using namespace LAMMPS_NS;
#define EPSILON 1.0e... | ALGO | 0.988781 | 6.56975 |
de192895-fa64-493a-8210-fa9d8232d101 | uniking/study-linux-Demo | hadoop/ml/kernel-density/kde.cpp | // Kernel density estimation by Tim Nugent (c) 2014
// Based on Philipp K. Janert's Perl module:
// http://search.cpan.org/~janert/Statistics-KernelEstimation-0.05
// Multivariate stuff from here:
// http://sfb649.wiwi.hu-berlin.de/fedc_homepage/xplore/ebooks/html/spm/spmhtmlnode18.html
#include <stdlib.h>
#include <... | ALGO | 0.999784 | 3.624921 |
1d61bacd-d03d-44b5-a9c8-63003a8ade39 | HARSHITHASALADI1/Hactoberfest-2023 | DSA/SegmentTree/rangeUpdatePointquery_LazyPropagation.cpp | #include<bits/stdc++.h>
using namespace std;
#define ll long long int
#define nline "\n"
#define v32 vector<int>
#define pb emplace_back
#define all(x) (x).begin(), (x).end()
#define forf(i, s, e) for(int i = s; i < e; i++)
#define forb(i, e, s) for(int i = e; i >= s; i--)
class segmentTree{
public:
vector<int> ... | ALGO | 0.999785 | 4.906178 |
9cb1c6b2-15fd-40d2-a9c5-160886ca3a4a | gisbi-kim/cpp17-execution-policy-practice-with-oneTBB | _main_sort.cpp | #include <algorithm>
#include <chrono>
#include <cstdint>
#include <iostream>
#include <random>
#include <ranges>
#include <string>
#include <vector>
#ifdef PARALLEL
// clang-format off
#include <execution>
// clang-format on
namespace execution = std::execution;
#else
enum class execution { seq, unseq, par_unseq, par... | TOOL | 0.987511 | 6.265897 |
4e94e7e6-09f4-4601-ac2b-1716dd00dac7 | hathu2004/Leetcode | 0268-missing-number/0268-missing-number.cpp | class Solution {
public:
int missingNumber(vector<int>& nums)
{
sort(nums.begin(),nums.end());
for(int i=0;i<nums.size();i++)
{
if(nums[i]!=i){return i;}
}
return nums.size();
}
}; | ALGO | 0.999796 | 5.429956 |
3e439292-7be1-45c8-9a62-57e181d8a45f | moondemon68/cp | Codeforces/PastContests/1185/1185C.cpp | #include <bits/stdc++.h>
#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define MOD 1000000007
#define INF 1234567890
#define pii pair<int,int>
#define LL long long
using namespace std;
int main () {
//clock_t start = clock();
ios_base::sync_with_stdio(false);
cin.tie(NULL);
... | ALGO | 0.999989 | 3.294597 |
9daf6715-0cb8-4353-a07c-2d0a8fb74739 | xdai02/C_Plus_Plus | code/Chapter3/practice/reciprocal2.cpp | #include <iostream>
#include <iomanip>
using namespace std;
int main()
{
int n;
cout << "Enter n: ";
cin >> n;
double sum = 0;
for (int i = 1; i <= n; i++)
{
if(i % 2 == 1)
{
sum += 1.0 / i;
}
else
{
sum -= 1.0 / i;
}
... | ALGO | 0.999546 | 4.316252 |
dffc65a2-5ef9-41ce-8021-d94dc30797ee | Dizlet/BOJ | 14502_연구소.cpp | #include<stdio.h>
#include<vector>
#include<algorithm>
#include<string.h>
#include<queue>
using namespace std;
int a[10][10], input[10][10];
int dy[4] = { 0,1,0,-1 }, dx[4] = { 1,0,-1,0 };
bool check[70], visit[10][10];
int n, m, answer;
vector <pair<int, int>>zero;
vector <pair<int, int>>bfs_start;
queue<int>q;
void b... | ALGO | 0.999624 | 3.665985 |
74ae60c4-9cf9-4e5d-a0d4-04390179fd30 | DucL0c/DSA_PTIT | src/DSA03011noiday2.cpp | #include <bits/stdc++.h>
using namespace std;
long long m = 1e9+7;
int main(){
int t;
cin>>t;
while(t--){
int n;
cin>>n;
int a[n];
priority_queue<int,vector<int>,greater<int> > pq;
for(int i=0;i<n;i++){
cin>>a[i];
pq.push(a[i]);
}
... | ALGO | 0.999798 | 4.614017 |
290000b3-78a0-429f-a0c6-55e220fba4e0 | semkilljaeden/LeetCodePractice | LeetCodePractice/LeetCodePractice/Q493_ReversePairs.cpp | #include "LCHeader.h"
//2:48 3:56 very funny merge sort
class Solution {
public:
int reversePairs(vector<int>& nums) {
int count = 0;
mergeSort(nums, 0, nums.size() - 1, count);
return count;
}
void mergeSort(vector<int>& nums, int start, int end, int& count) {
if (start >=... | ALGO | 0.999945 | 5.640385 |
f24bf69e-cb56-456b-9503-f9489f0344dc | sampritipanda/IOI_Repository | Kattis/chess.cpp | // Chess
#include <iostream>
#include <algorithm>
#include <cmath>
using namespace std;
bool valid(int X_1, int X_2){
return X_1 >= 'A' && X_1 <= 'H' && X_2 >= 1 && X_2 <= 8;
}
bool same_line(int X_1, int X_2, int Y_1, int Y_2){
return (abs(Y_1 - X_1) == abs(Y_2 - X_2));
}
int main() {
int N; cin >> N;
wh... | ALGO | 0.999265 | 4.26162 |
e92b7abd-3b32-4a45-af51-b7588e3f9600 | ishandutta2007/codeforces | njwrz/normal/1247/B2.cpp | #include <bits/stdc++.h>
using namespace std;
int f[1000005],a[200005];
void solve(){
int n,d,k,s=0;
scanf("%d%d%d",&n,&k,&d);
for(int i=1;i<=n;i++)scanf("%d",&a[i]);
for(int i=1;i<=d;i++){
f[a[i]]++;
if(f[a[i]]==1)s++;
}
int ans=s;
for(int i=d+1;i<=n;i++){
if(a[i-d]==a[i])continue;
f[a[i-d]]--;
if(f[a... | ALGO | 0.99985 | 3.821629 |
35a8a6cd-a1de-4b0f-a6b9-4d9b57f58bff | DuDuongVanPtit/DSA_PTIT | 19-DAT_TEN_1.cpp | #include <bits/stdc++.h>
using namespace std;
int n, k;
int x[100];
int nreal;
void Try(int i, string areal[]){
for(int j = x[i - 1] + 1; j <= nreal - k + i; j++){
x[i] = j;
if(i == k){
for(int pos = 1; pos <= k; pos++){
cout << are... | ALGO | 0.999927 | 3.783758 |
7e926728-694c-4a77-9677-88721cfa385b | hemanggs/Comptetitive-Programming | BLACK BOX/Anand Oza ( best for black box)/algo-lib-master/graphs/dinic.cpp | template<typename F> struct dinic {
static const F inf = numeric_limits<F>::max();
int V;
vvi adj;
vi dest;
vector<F> cap;
dinic (int V = 0) : V(V) {
adj.resize(V);
}
void __arc(int u, int v, F c) {
adj[u].push_back(dest.size());
dest.push_back(v);
cap.... | ALGO | 0.998417 | 4.762886 |
0b0cecd9-a86d-4806-9fd0-0f4bdebdb46b | kapoorz/cpptopics | dynamic/buy and sell stock 1 cool.cpp | #include <bits/stdc++.h>
using namespace std;
struct triplet
{
int f, s, t;
};
int maxp(vector<int> price)
{
int n = price.size();
vector<triplet> dp(n);
dp[0] = {-price[0], 0, 0};
for (int i = 1; i < n; i++)
{
triplet prev = dp[i - 1];
dp[i] = {max(prev.f, prev.t - price[i]),... | ALGO | 0.999885 | 4.28941 |
8040d84f-b2e4-4546-865f-f67864d86840 | JuanMBriones/DataStructures | parcial2/CodigosProfe/DummyList.cpp | #include <iostream>
using namespace std;
template <typename T>
class Node {
public:
T valor;
Node<T>* sig = nullptr;
};
template <typename T>
class DummyList {
public:
DummyList() {
}
~DummyList(){
auto actual = head;
while(actual) {
auto temp = actual;
ac... | TOOL | 0.958225 | 4.133007 |
0456e380-0058-48ed-a93b-846691b72dc9 | ajayjangid-51/dsa | dsasolve/solve/cfcc/dsa/findMotherVertex.cpp | #include <bits/stdc++.h>
using namespace std;
#define lb lower_bound
#define ub upper_bound
#define sz(x) x.size()
#define ll long long
#define pint unsigned int
#define pb push_back
#define vb vector<bool>
#define vi vector<int>
#define vs vector<string>
#define vvi vector<vi>
#define vvb vector<vb>
#define pii pair... | ALGO | 0.999863 | 4.332728 |
e8dd13d6-a570-4bf3-8ab1-613a857c03e4 | saadamin654/Data_structure | graphs_DFS.cpp | #include<iostream>
using namespace std;
int adj[5][5];
int vis[5];
void dfs(int n){
vis[n] = 1;
cout<<n<<" ";
for(int i =0;i<5;i++){
if(adj[n][i] == 1){
if(vis[i] != 1){
dfs(i);
}
}
}
}
int main(){
int e,x,y;
cout<<"Enter the Edges : ";
cin>>e;
for(int i =0;i<5;i++){
for(int j =0;j<5;j++)... | ALGO | 0.999519 | 3.845849 |
178d49ee-0cfc-404c-8273-47e48fabd41f | AhJo53589/leetcode-cn | problems/remove-nth-node-from-end-of-list/SOLUTION.cpp |
//////////////////////////////////////////////////////////////////////////
ListNode* removeNthFromEnd(ListNode* head, int n)
{
if (head == nullptr || n == 0) return nullptr;
if (head->next == nullptr) return nullptr;
ListNode *pTemp = head;
ListNode *pDeletePrev = head;
ListNode *pDelete = nullptr;
while (n > ... | ALGO | 0.999944 | 6.177899 |
927547c1-3330-46b3-b267-df999b861c3e | 113bommy/deepmind_codecontests_refine | cpp_source_filter_file/cpp_train_9503_5.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
long long int n, i, a = 1;
cin >> n;
for (i = 1; i <= n; i++) {
a *= i;
}
a = a / (n * n);
a *= 2;
cout << a << endl;
return 0;
}
| ALGO | 0.999937 | 3.761071 |
2c636201-d663-4fb3-985b-866c5ef71a3a | akasimina/LearnDS | Exercises/StackAndQueueApplication/TrainStation.cpp | //
// TrainStation.cpp
// DS
//
// Created by 周子朋 on 2023/4/17.
//
#include "TrainStation.hpp"
Station::Station(){
cin >> this->total;
cin >> enOrder >> deOrder;
}
bool Station::trainInOrOut(){
int j = 0;
for( int i = 0; i < this->total; i++ ){
this->station.push(enOrder[i]);... | ALGO | 0.999572 | 5.163027 |
09d16543-d8e2-41de-92da-aaf8610a1f68 | langningchen/Etiger | 0464.cpp | #include <bits/stdc++.h>
using namespace std;
const char N = 6;
int dx[4] = {0, 1, 0, -1};
int dy[4] = {1, 0, -1, 0};
char ch, d[N][N];
int a, b, n = 5;
void dfs(int x, int y)
{
d[x][y] = 'G';
for (int k = 0; k < 4; k++)
{
int nx = x + dx[k], ny = y + dy[k];
if (nx >= 1 && nx <= n && ny >= 1... | ALGO | 0.989421 | 3.385061 |
8e54fd7d-14ca-4209-8320-19b1c853b292 | shentok/qtcreator | src/tools/clangrefactoringbackend/source/symbollocationfinderaction.cpp | #include "symbollocationfinderaction.h"
#include "sourcelocationsutils.h"
#include "findlocationsofusrs.h"
#include <filepathcachingfwd.h>
#include <clang/AST/ASTConsumer.h>
#include <clang/AST/ASTContext.h>
#include <memory>
namespace ClangBackEnd {
class FindingSymbolsASTConsumer : public clang::ASTConsumer
{
p... | TOOL | 0.931825 | 7.540058 |
5ea37d8d-ad99-472d-8326-d9e3cb0dff80 | hridoyPRGMR/Number-Theory | primeNumber.cpp | #include<bits/stdc++.h>
using namespace std;
bool prime(int n){
if(n==2)return true;
if(n<2 || n%2==0 )return false;
for(int i=3; i<sqrt(n);i+=2){
if(n%i==0)return false;
}
return true;
}
int main(){
int t;cin>>t;
while(t--){
int n;cin>>n;
cout<<prime(n)<<endl;
... | ALGO | 0.999316 | 4.757514 |
1e69faa4-0f29-4d44-b162-2077dc8fb7a3 | GopherTeen/OJ_Code | Problems/Codeforces/1901-2000/1968/A_Maximize.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
static constexpr int MOD = 1'000'000'007;
void solve() {
int x;
cin >> x;
cout << x - 1 << "\n";
}
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
int T;
cin >> T;
while (T--) {
solve();
}
... | ALGO | 0.999379 | 5.054079 |
35458c5e-e716-49b4-b51f-1e76ec472fd5 | yizhiweimengxiangfendoudefeifei/Autoware.ai.annotation1 | src/autoware/common/amathutils_lib/src/kalman_filter.cpp | #include "amathutils_lib/kalman_filter.hpp"
KalmanFilter::KalmanFilter() {}
KalmanFilter::KalmanFilter(const Eigen::MatrixXd &x, const Eigen::MatrixXd &A,
const Eigen::MatrixXd &B, const Eigen::MatrixXd &C,
const Eigen::MatrixXd &Q, const Eigen::MatrixXd &R,
... | ALGO | 0.99112 | 6.519943 |
81951c76-86ac-4006-b2fb-f76b9be9b387 | madhavm0706/DataStructure | array/arrayrotation.cpp | #include<iostream>
using namespace std;
void leftrotatearraybyone(int arr[],int n){
int temp = arr[0],i;
for(int i=0;i<n-1;i++){
arr[i]= arr[i+1];
}
arr[n-1]= temp;
}
void leftrotatearray(int arr[],int n, int d){
for(int i=0;i<d;i++){
leftrotatearraybyone(arr,n);
}
}
... | ALGO | 0.999898 | 4.290742 |
db673aaf-a959-48d6-a2f1-8e63f15cccb2 | yashsiwach/DSA-Notes | Patterns_Continued_3rd February 2023/Pattern-6_Fancy_Pattern2.cpp | #include<iostream>
using namespace std;
int main(){
int n = 4; // general pattern
// Upper half
for(int i = 0;i<n;i++){ // for number of rows
for(int j = 0;j<i+1;j++){
cout<<i+1; // for ith row we are printing i + 1 number
if(j!=i){
cout<<"*"; // ... | ALGO | 0.999959 | 4.02082 |
8744cf5e-43ee-4c14-9d6e-78d6f36e1455 | Shashank-tomar20/college | discrete structure and LA/data structure/practical.cpp | #include <iostream>
using namespace std;
class node
{
public:
int data;
node*next;
node()
{
node*
}
node(int data)
{
this->data=data;
next=NULL;
}
};
class linkedlist
{
public:
int n;
node*head = NULL;
void Insert (int x)
... | ALGO | 0.999158 | 3.50848 |
e201788c-0ece-4e01-ae5d-1d6486afff28 | ddubl/archiver | lib/opencv/3rdparty/carotene/src/count_nonzero.cpp | #include "common.hpp"
#include <limits>
namespace CAROTENE_NS {
s32 countNonZero(const Size2D &_size,
const u8 * srcBase, ptrdiff_t srcStride)
{
internal::assertSupportedConfiguration();
#ifdef CAROTENE_NEON
Size2D size(_size);
if (srcStride == (ptrdiff_t)(size.width))
{
size... | ALGO | 0.966874 | 6.519955 |
fd40e1c1-604d-486b-b896-6abb03872fa0 | sglre6355/atcoder | abc/297/b.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
string S;
cin >> S;
char c;
int m = -1;
bool condition = true;
bool r_appeared = false;
bool k_appeared = false;
for (int i = 0; i < 8; ++i) {
c = S.at(i);
if ((c == 'B') && (m == 0 || m == 1)) {
... | ALGO | 0.999898 | 3.963263 |
9f14caa9-4040-4caa-b332-98224912a933 | nithin1402/recipto_ui | 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 |
e657801a-b068-4ab0-9d64-6f4bc9cd0b4a | BanMan-28/ACC45DAYSOFCODEx2023 | CANDYDIST day16 1.cpp | #include <iostream>
using namespace std;
int main() {
// your code goes here
int t;
cin>>t;
while(t--)
{
int n,m;
cin>>n>>m;
if(n%m==0)
{
int divide=n/m;
if(divide%2==0)
{
cout<<"Yes"<<endl;
}
else{
cout<<"No"<<endl;
... | ALGO | 0.99989 | 4.563672 |
63e000ad-c7bd-4839-86fe-78721bcf08e9 | jmanday/Master | TFM/library/opencv-3.2.0/samples/cpp/tvl1_optical_flow.cpp | #include <iostream>
#include <fstream>
#include <opencv2/core/utility.hpp>
#include "opencv2/video.hpp"
#include "opencv2/imgcodecs.hpp"
#include "opencv2/highgui.hpp"
using namespace cv;
using namespace std;
inline bool isFlowCorrect(Point2f u)
{
return !cvIsNaN(u.x) && !cvIsNaN(u.y) && fabs(u.x) < 1e9 && fabs(... | ALGO | 0.893141 | 6.030397 |
dd20694c-96e8-4cf4-b345-d66301da35cc | Legacy-LuaSTG-Engine/LuaSTG-Sub | engine/file-system/core/FileSystemManager.cpp | // ReSharper disable CppUseStructuredBinding
#include "core/FileSystem.hpp"
#include "core/SmartReference.hpp"
#include "core/implement/ReferenceCounted.hpp"
#include <cassert>
#include <vector>
#include <mutex>
#include <ranges>
#include <filesystem>
#include <fstream>
using std::string_view_literals::operator ""sv;... | TOOL | 0.973177 | 4.618384 |
d2a9bf72-1073-479c-9b73-c6c89af303a8 | rzmv/opencv_test | modules/objdetect/src/barcode_detector/bardetect.cpp | #include "../precomp.hpp"
#include "bardetect.hpp"
namespace cv {
namespace barcode {
static constexpr float PI = static_cast<float>(CV_PI);
static constexpr float HALF_PI = static_cast<float>(CV_PI / 2);
#define CALCULATE_SUM(ptr, result) \
top_left = static_cast<float>(*((ptr) + left_col + integral_cols * top_r... | ALGO | 0.999618 | 5.184728 |
d8ad14ab-0c8d-48d6-b92b-f1f404aa4c64 | dev-sabbir/SolvedProblems | accepted/10774.cpp | #include<iostream>
#include<sstream>
#include<string>
#include<cstdlib>
#include<vector>
#include<map>
#include<queue>
#include<stack>
#include<cmath>
#include<cctype>
#include<set>
#include<bitset>
#include<algorithm>
#include<list>
#include<stdio.h>
#include<string.h>
#include<stdlib.h>
#include<math.h>
#include<cty... | ALGO | 0.999574 | 3.466281 |
ceea52da-122c-49ce-b6b2-56fb92ccfa8a | 2019211753/Coding | C/2-LinearList/List/OutMin.cpp | #include "ListBasic.cpp"
#define MAX 10000000
/**
* һͷѭֵΪһ㷨ҳнֵСĽ㲢
* ȻýڵɾֱΪֹɾͷ㡣
* @param l
*/
void output_delete(List *&l)
{
while (l->next != l)
{
List *pre = l;
List *p = l;
int min = MAX;
while (p->next != l)
{
if (p->next->val < min)
{
... | ALGO | 0.999933 | 3.478517 |
d963db95-3cff-488b-8527-f19baecff6b0 | vanshika-37/LeetCode | 1312-minimum-insertion-steps-to-make-a-string-palindrome/1312-minimum-insertion-steps-to-make-a-string-palindrome.cpp | class Solution {
public:
int minInsertions(string s) {
string r = s;
reverse(r.begin(), r.end());
int n = s.length();
vector<vector<int>>dp(n+1, vector<int>(n+1,0));
for (int i = 1; i <= n; i++){
for (int j = 1; j <= n; j++){
if (s[i-1] == r[j-1]){... | ALGO | 0.999992 | 6.060659 |
a2109330-c094-4243-b222-5bd734d480aa | raincross7/code-similarity | codes/train_code/problem305/problem305_123.cpp | #include <bits/stdc++.h>
using namespace std;
#define all(a)a.begin(),a.end()
using ll=long long;
const int INF = 1<<30;
const ll INFll =1LL<<62;
const int mod =(1e9)+7;
using P = pair<ll,ll>;
int main(){
ll n;cin>>n;
vector<ll>a(n);
vector<ll>b(n);
for (int i = 0; i <n; ++i) {
cin>>a[i]>>b[i];
... | ALGO | 0.999985 | 3.75524 |
5b7cc101-6432-423a-bcc0-41f110cc4f68 | IULOVE/openedr | edrav2/eprj/boost/libs/python/example/numpy/gaussian.cpp | #include <boost/python/numpy.hpp>
#include <cmath>
#include <memory>
#ifndef M_PI
#include <boost/math/constants/constants.hpp>
const double M_PI = boost::math::constants::pi<double>();
#endif
namespace bp = boost::python;
namespace bn = boost::python::numpy;
/**
* A 2x2 matrix class, purely for demonstration pur... | TOOL | 0.901206 | 7.68991 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.