uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
86c99b80-9895-4cbb-9aaf-ae4e3b32956b | bazk/simulated-annealing | src/state.cpp | #include <iostream>
#include <iomanip>
#include <cstdlib>
#include <cstring>
#include "state.h"
using namespace std;
State::State()
{
this->m_state_vector = (int*) malloc(Powers::getSize() * sizeof(int));
for (int i = 0; i < Powers::getSize(); i++)
this->m_state_vector[i] = 0;
}
State::~State()
{
... | ALGO | 0.999511 | 3.941596 |
7f8ea841-00eb-41fd-9de3-92bc54410f0e | jk-jung/problem-solving | codeforces/Codeforces Round 21x/R218_div2_A.cpp | #include <algorithm>
#include <array>
#include <cassert>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <vector>
using namespace std;
typedef long long ll;
typedef pair<int, int> pi;
typedef vector<i... | ALGO | 0.999973 | 3.864257 |
96b78ee4-ebd2-44f4-bee4-17da4beed3c9 | shivachaudhary46/DSA-Journey | questions/question_no_4.cpp | #include<iostream>
using namespace std;
int main(){
int n = 5;
for(int i=1; i>=n; i--){
cout<<i<<" ";
i++;
}
//infinite loop jane bhayo
}
| ALGO | 0.997231 | 3.022615 |
33a55136-1ae5-4d57-a2e4-e0c5bb401623 | jamesguan/CMSC436-Homeworks | OpenGL/DataVisualizationHW1 - Blue Gradient/DataVisualizationHW1/Dependencies/glm/test/core/core_func_integer_find_lsb.cpp | // This has the programs for computing the number of trailing zeros
// in a word.
// Max line length is 57, to fit in hacker.book.
#include <cstdio>
#include <cstdlib> //To define "exit", req'd by XLC.
#include <ctime>
int nlz(unsigned x) {
int pop(unsigned x);
x = x | (x >> 1);
x = x | (x >> 2);
x = ... | ALGO | 0.998968 | 5.181918 |
7a87c724-8b9b-465a-a55e-a42ac65a6223 | roilatzres/Divided-Differences-for-anharmonic-oscillator | main_openmp.cpp | #include <iostream>
#include <vector>
#include <functional>
#include <cmath>
#include <complex>
#include "include/divdiffcomplex.h"
#include "include/permutation.h"
#include "include/Serializer.h"
#include <fstream>
#include "include/json-develop/single_include/nlohmann/json.hpp"
#include <string>
// #include <mpi.h>
... | ALGO | 0.995744 | 4.328197 |
c78a467a-3e37-4b3c-af20-05ad55984995 | oxygen-hunter/Flashboom | data/big-vul-100/add_attention_code/CodeLlama/top0-100/stone-game-vi-Solution.stoneGameVI/177887_DoS_Overflow.cpp | gs_heap_alloc_bytes(gs_memory_t * mem, uint size, client_name_t cname)
{
gs_malloc_memory_t *mmem = (gs_malloc_memory_t *) mem;
byte *ptr = 0;
#ifdef DEBUG
const char *msg;
static const char *const ok_msg = "OK";
# define set_msg(str) (msg = (str))
#else
# define set_msg(str) DO_NOTHING
#endif
... | TOOL | 0.988855 | 4.846882 |
301c303e-f377-4476-ae13-e302e8b197b9 | rwmutel/APPSC_redemption | scorekeeper/Middlewares/Third_Party/EdgeImpulse_OS-APPSC_MachineLearning/edgeimpulse/edge-impulse-sdk/tensorflow/lite/micro/kernels/micro_tensor_utils.cpp | #include "edge-impulse-sdk/tensorflow/lite/micro/kernels/micro_tensor_utils.h"
#include <algorithm>
#include <cmath>
#include <cstdint>
#include <cstring>
#include <limits>
#include <utility>
#include "edge-impulse-sdk/third_party/gemmlowp/fixedpoint/fixedpoint.h" // from @gemmlowp
#include "edge-impulse-sdk/tensorf... | ALGO | 0.975536 | 7.539769 |
e82d207c-5cf8-47b2-94e9-5a31daf84214 | DungNguyenCoder/SPOJ_PTIT | P163PROH.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define faster() ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define mx 1000000
#define mod 100000007
#define TEST 1
void solution()
{
float a;
cin >> a;
float res = 2.0/(1.0-(a/180.0));
int tmp = res;
if(tmp*1000 == re... | ALGO | 0.996647 | 3.948519 |
1f6e2cad-c621-435f-b37f-3d8ca7d28183 | Prateek-Pandey-96/Algorithms | BINARY SEARCH/Search in rotated sorted array.CPP | // 33. Search in Rotated Sorted Array
class Solution {
public:
int search(vector<int>& nums, int target) {
int n = nums.size();
int low = 0, high = n-1;
while(low <= high){
int mid = low + (high-low)/2;
if(nums[mid]==target)
return mid;
//... | ALGO | 0.999966 | 6.253977 |
985e8627-29c3-4254-b74c-bebaea578e26 | sidneyp/llvm-tricore | lib/CodeGen/MachineDominators.cpp | #include "llvm/CodeGen/MachineDominators.h"
#include "llvm/CodeGen/Passes.h"
#include "llvm/ADT/SmallBitVector.h"
using namespace llvm;
namespace llvm {
template class DomTreeNodeBase<MachineBasicBlock>;
template class DominatorTreeBase<MachineBasicBlock>;
}
char MachineDominatorTree::ID = 0;
INITIALIZE_PASS(Machin... | ALGO | 0.999705 | 7.477268 |
9130cdc1-fa4b-46f9-bbe4-ed79e2b78df1 | retroBro3/CP_codings | DSA && CP Topics/DSA/Semester 1/Course 3/Week 6 - BST, Heap, Priority Queue and Map/Module 21 - Binary Search Tree Implementation/Practice/insert_in_BST.cpp | #include <bits/stdc++.h>
using namespace std;
class BTnode
{
public:
int data;
BTnode *leftChild, *rightChild;
BTnode(int data)
{
this->data = data;
this->leftChild = nullptr;
this->rightChild = nullptr;
}
};
BTnode *inputTree()
{
/// the value decides whether or not t... | ALGO | 0.999972 | 4.563858 |
b1253f5d-7ef9-41f1-b591-143fb09adcf8 | A-jha/Data-Structure-Lab | 8-Queues/cicularQueue1.cpp | // |-->1---->2--->3--+
// | |
// |-----------------+
#include <iostream>
using namespace std;
struct Node
{
int data;
Node *next;
};
Node *head = NULL;
//enqueue function
void enqueue(int item)
{
//1. if head == NULL
if (head == NULL)
{
head = new Node();
head->data... | ALGO | 0.999845 | 4.438221 |
ca644fc1-a544-4bc6-9122-9b68a06c7df9 | naringcode/algorithm-training | BaekjoonOnlineJudge/implementation/15312.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
int table[]{ 3, 2, 1, 2, 3, 3, 2, 3, 3, 2, 2, 1, 2, 2, 1, 2, 2, 2, 1, 2, 1, 1, 1, 2, 2, 1 };
string strA;
string strB;
vector<int> vec;
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
cout.tie(nullptr);
cin >> st... | ALGO | 0.999993 | 5.376258 |
1dc59bf1-7c4d-4ca0-82ba-b797643034db | LalitSharma7/Interviewbit-Leetcode-Codes | Two Pointer/Max 1s after modification.cpp | int Solution::solve(vector<int> &A, int B) {
int s= 0;
int maxc = 0;
int zero = 0;
int n = A.size();
for(int e=0; e<n; e++)
{
if(A[e]==0)
{
zero++;
}
while(zero>B)
{
if(A[s]==0)
{
... | ALGO | 0.999925 | 5.381744 |
042f46f3-7263-4627-a224-67be01390fbb | yesha1423/yesha-dsa | DAY-5/indiabix17.cpp | #include <iostream>
using namespace std;
//Look at this series: 2, 6, 18, 54, ... What number should come next?
int main() {
int x = 54;
int y = 3;
int nextTerm = x * y;
cout << "The next number in the series is: " << nextTerm << endl;
return 0;
}
| ALGO | 0.999847 | 4.071801 |
7de7557b-348a-420e-9cf9-6b3c5918bf39 | bishalroy20/XPSC | week-8/Day-5/C_Joty_and_Chocolate.cpp | /*
author : BishalRoy20
*/
#include<bits/stdc++.h>
#define int long long int
#define pii pair<ll,ll>
#define yes cout << "YES" << '\n'
#define no cout << "NO" << '\n'
#define cyes cout << "Yes" << '\n'
#define cno cout << "No" << '\n'
#define minus cout << -1 << '\n'
#define fastread() (ios_base::sync_with_stdio(0)... | ALGO | 0.999823 | 3.91997 |
c4488a5a-3739-485d-82d5-87940996ec5f | codefever1912/CodeForces | practice/Flipping_Game.cpp | #include <bits/stdc++.h>
using namespace std;
void solve(){
int n,c1=0;cin >> n;
vector<int>a(n);
for(auto &e:a){cin >> e;c1+=(e==1);}
int x=0,y=0;
for(int i=0;i<n;i++){if(a[i]==0){x=i;break;}}
for(int i=n-1;i>=0;i--){if(a[i]==0){y=i;break;}}
int count=y-x+1;
for(int i=x;i<=y;i++){
... | ALGO | 0.999988 | 3.923116 |
fc301b91-b3a1-4144-9a98-a381ddc79d83 | OTOY-NZ/OctaneBlender | blender/intern/cycles/bvh/bvh2.cpp | #include "bvh/bvh2.h"
#include "scene/hair.h"
#include "scene/mesh.h"
#include "scene/object.h"
#include "scene/pointcloud.h"
#include "bvh/build.h"
#include "bvh/node.h"
#include "bvh/unaligned.h"
#include "util/foreach.h"
#include "util/progress.h"
CCL_NAMESPACE_BEGIN
BVHStackEntry::BVHStackEntry(const BVHNode *... | ALGO | 0.976504 | 7.178693 |
2d6f5344-c9cb-46b7-95ce-cddd20f40266 | AbdullahAhmed6859/CS-224-OOP-LABS | LAB_6/main.cpp | #include <iostream>
#include "Queue.h"
using namespace std;
int main() {
unsigned int size, numDequeue;
cin >> size;
Queue q;
for (int i = 0; i < size; i++) {
int data;
cin >> data;
q.enqueue(data);
}
cin >> numDequeue;
q.printQueue();
for (int i = 0; i < numD... | ALGO | 0.993923 | 4.447147 |
4bee319b-7ec7-43a5-9837-1e08b98fd3e3 | 113bommy/deepmind_codecontests_refine | cpp_source_filter_file/cpp_train_4799_4.cpp | #include <bits/stdc++.h>
using namespace std;
inline int read() {
char ch = getchar();
int u = 0, f = 1;
while (!isdigit(ch)) {
if (ch == '-') f = -1;
ch = getchar();
}
while (isdigit(ch)) {
u = (u << 1) + (u << 3) + ch - 48;
ch = getchar();
}
return u * f;
}
const int maxn = 5005;
int f[m... | ALGO | 0.999929 | 3.451314 |
9f806ece-2140-4224-bb64-08ba78e382c7 | Rawnak003/Coding | insertion.cpp | #include<bits\stdc++.h>
using namespace std;
int main()
{
int n,key;
cin >> n;
int arr[n];
for(int i=0;i<n;i++){
cin >> arr[i];
}
for(int j=1;j<n;j++){
key=arr[j];
int k=j-1;
while(k>=0 && arr[k]>key){
arr[k+1]=arr[k];
k--;
}
... | ALGO | 0.999997 | 3.805913 |
0cfb3f0b-9537-4b03-a073-d8e94f7e262b | peterclemenko/Forque3D-FPSTutorial | Engine/lib/bullet/src/BulletCollision/CollisionShapes/btConvex2dShape.cpp | #include "btConvex2dShape.h"
btConvex2dShape::btConvex2dShape( btConvexShape* convexChildShape):
btConvexShape (), m_childConvexShape(convexChildShape)
{
m_shapeType = CONVEX_2D_SHAPE_PROXYTYPE;
}
btConvex2dShape::~btConvex2dShape()
{
}
btVector3 btConvex2dShape::localGetSupportingVertexWithoutMargin(const btVecto... | ALGO | 0.871764 | 7.274159 |
859c46a3-ae2c-4bc1-9b28-acef49845d00 | rmbozhko/SikorskyLabs | complex_algo/lab6/main.cpp | #include <iostream>
#include <sstream>
#include <string>
#include <fstream>
#include <functional>
#include "Node.hpp"
#define MATRIX_SIZE 10
int** readData(const char* filename) {
std::ifstream infile(filename);
std::string line;
std::string delimiter = "\t";
size_t pos = 0;
std::string token;
int i;
in... | ALGO | 0.998834 | 4.066872 |
8e0fdfc9-78fa-4adb-baf8-32ee00a86472 | facebookarchive/clangir | polly/lib/Transform/FlattenAlgo.cpp | #include "polly/FlattenAlgo.h"
#include "polly/Support/ISLOStream.h"
#include "polly/Support/ISLTools.h"
#include "llvm/Support/Debug.h"
#define DEBUG_TYPE "polly-flatten-algo"
using namespace polly;
using namespace llvm;
namespace {
/// Whether a dimension of a set is bounded (lower and upper) by a constant,
/// i.... | TOOL | 0.856083 | 5.29362 |
2f2e0143-7429-4bbb-aea6-ebcf5d88b228 | Chunting/LeetCode_Chunting | LeetCode/wordBreak.cpp | #include<stdio.h>
#include<iostream>
#include<set>
#include<string>
#include<vector>
using namespace std;
bool wordBreak ( string s, set<string> &dict ) {
if ( s.empty() || dict.empty() )
return false;
int n = s.size();
vector <bool> flag ( n+1, false );
flag[0] = true;
for ( int i=1; i<=n; ++i ) {
if( flag[ i... | ALGO | 0.998052 | 4.257046 |
17c5201b-bd0b-44c3-89c5-a71d53800c46 | yja938882/CSE | coding_problem/baekjoon_11047.cpp | #include <iostream>
using namespace std;
int sol(int n , int k , int * arr , int c){
if( k == 0)
return c;
int ret = k/ arr[n];
if( ret == 0 ) return sol( n-1 , k, arr ,c);
return sol( n-1, k - ret*arr[n] , arr , c + ret);
}
int main( void ){
int N, K;
cin >> N >> K;
int coin[N];
for( int i=0; i<N; i++ ... | ALGO | 0.999861 | 3.664945 |
dcbf9c3f-de2f-41ca-84dd-02e9adaecf04 | goodday451999/ISIM732C-System-Simulation-and-Modelling | Assignment 2/Solution.cpp | #include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
using namespace std;
int main() {
int n;
cin >> n;
double a, b;
cin >> a >> b;
double shooterX[n+2];
double shooterY[n+2];
shooterX[0] = a;
shooterY[0] = b;
double bomberX[n+2];
... | ALGO | 0.999944 | 4.18904 |
b40d500d-3758-4063-a646-d04dba1be3af | Mwanyi/boost_searcher | dir_tool/boost_1_81_0/libs/bimap/example/population_bimap.cpp | // VC++ 8.0 warns on usage of certain Standard Library and API functions that
// can be cause buffer overruns or other possible security issues if misused.
// See https://web.archive.org/web/20071014014301/http://msdn.microsoft.com/msdnmag/issues/05/05/SafeCandC/default.aspx
// But the wording of the warning is mis... | TOOL | 0.963103 | 5.76458 |
0ca0a4e4-c68d-47ca-9225-a54ed67838a0 | coder-writes/tree-notes | 5PreOrderTraversal.cpp | #include <bits/stdc++.h>
using namespace std;
struct Node
{
/* data */
int data;
Node* left;
Node* right;
Node(int val)
{
data = val;
left = right = NULL;
}
};
void PrintPreOrderTraversal(Node* root)
{
if(root == NULL)
{
return;
}
cout<<root->data<<... | ALGO | 0.999968 | 4.657845 |
32e940c9-5c48-47af-afa8-72c98b545caf | AymanBoudaya/litewait2 | 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 |
f08c8e7a-d121-40e3-ba34-edcbfd61210f | KhronosGroup/SPIRV-Tools | source/util/parse_number.cpp | #include "source/util/parse_number.h"
#include <functional>
#include <iomanip>
#include <memory>
#include <sstream>
#include <string>
#include <tuple>
#include "source/util/hex_float.h"
#include "source/util/make_unique.h"
namespace spvtools {
namespace utils {
namespace {
// A helper class that temporarily stores ... | TOOL | 0.85611 | 7.851442 |
34510867-6c6b-4350-8839-08583de1607d | ishandutta2007/codeforces | senpai_notice_me/normal/1530/C.cpp | #define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <cstring>
#include <algorithm>
#include <cstdint>
#include <cstddef>
#include <queue>
using namespace std;
constexpr size_t MAXN = (size_t) 1e5 + 5;
int a[MAXN], b[MAXN];
int main()
{
int T; scanf("%d", &T);
while (T--) {
int asum = 0, bs... | ALGO | 0.999916 | 3.768777 |
dcbd43a5-bfc7-4236-8045-c5108f645922 | madamsetty-pavan/DSA-Problem-Solving | 0714-best-time-to-buy-and-sell-stock-with-transaction-fee/0714-best-time-to-buy-and-sell-stock-with-transaction-fee.cpp | class Solution {
public:
int maxProfit(vector<int>& prices, int &fees) {
int n = prices.size();
vector<vector<int>> dp(2, vector<int>(2,0));
dp[0][1] = -prices[0]- fees;
for(int i=1;i<n;i++) {
dp[1][0] = max(prices[i] + dp[0][1] , dp[0][0]);
... | ALGO | 0.9998 | 4.713977 |
4d6a2e76-28c1-4ff2-aa40-2f3233b909f7 | hljeong/cp | kattis/supplyroutes.cpp | #include <bits/stdc++.h>
#define A first
#define B second
#define vc vector
#define pb push_back
using namespace std;
using ll = long long; using ld = long double;
using vi = vc<int>; using vll = vc<ll>;
using si = set<int>; using sll = set<ll>;
using pii = pair<int, int>; using mii = map<int, int>;
using gr = vc<vi>; ... | ALGO | 0.999858 | 4.984735 |
9f59e8ba-c212-497e-be67-44f40bfff369 | Sudheer-18/leetcode | 1207-delete-nodes-and-return-forest/delete-nodes-and-return-forest.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.99979 | 6.18255 |
1c7cafa4-551b-448f-a52e-fe30cf86bf69 | Nirdosh2004/Top-Interview-150-Leetcode-Solutions | Rotate Array .cpp | class Solution {
public:
void rotate(vector<int>& nums, int k) {
// Ensure k is within the bounds of the array size by taking k modulo nums.size()
k %= nums.size();
// Reverse the entire array
reverse(nums.begin(), nums.end());
// Reverse the first k elements
revers... | ALGO | 0.999998 | 6.562969 |
763e3274-f565-4ff2-b8c2-a783b63152b1 | cslarsen/project-euler | e357/e357.cpp | // Project Euler problem 86
// https://oeis.org/search?q=1%2C2%2C6%2C10%2C22%2C30%2C42%2C58%2C70%2C78%2C82&language=english&go=Search
#include <stdio.h>
#include <stdint.h>
#include <math.h>
#include "prime_sieve.h"
typedef uint64_t Z;
#define LIMIT 100000000
static const prime_sieve<LIMIT> sieve;
// For every divi... | ALGO | 0.996228 | 5.795618 |
d2001fcc-c7e8-4b3f-bab8-c3957409896d | MateyApostolov/Olimpiici_D | round_trip.cpp | #include <bits/stdc++.h>
using namespace std;
const int maxn = pow(10, 5) + 1;
vector <int> graph[maxn];
vector <int> st, cyc;
int vis[maxn];
void dfs (int x) {
vis[x] = 1;
st.push_back(x);
for(auto y : graph[x]) {
if(vis[y] == 2) continue;
if(vis[y] == 0) dfs(y);
else if(cyc.empty... | ALGO | 0.999955 | 4.390068 |
9b213cb2-05e1-4d8e-9eef-6f7ebf8d71ff | raincross7/code-similarity | codes/train_code/problem490/problem490_293.cpp | #include<iostream>
#include<string>
using namespace std;
int main(){
string str;
cin >> str;
long long n;
n = str.size();
long long cnt=0;
long long bcnt=0;
for(long long i=0; i<n; i++){
if(str[i]=='W'){
cnt = cnt + bcnt;
}else{
bcnt++;
}
}... | ALGO | 0.999905 | 3.713943 |
c592fc01-fea0-4778-9b13-f3cfbf178afc | oxygen-hunter/Flashboom | data/big-vul-100/add_attention_code/Gemma/top0-100/flatten-nested-list-iterator-NestedIterator2.hasNext/177853_DoS_Overflow.cpp | setPath(JsonbIterator **it, Datum *path_elems,
bool *path_nulls, int path_len,
JsonbParseState **st, int level, Jsonb *newval, bool create)
{
JsonbValue v;
JsonbValue *res = NULL;
int r;
if (path_nulls[level])
elog(ERROR, "path element at the position %d is NULL", level + 1);
switch ... | ALGO | 0.866663 | 3.181473 |
01975d74-b1f2-4e21-8f46-7f33265625b2 | manisha1904/6Companies30DaysChallenge | Microsoft/Longest_Happy_Prefix.cpp | Problem Link - leetcode.com/problems/longest-happy-prefix/description/
class Solution {
public:
string longestPrefix(string s) {
vector<int> ans(s.size(),0);
int i=1,j=0;
while(i<s.size())
{
if(s[i]==s[j])
{
ans[i]=j+1;
i++;j++;... | ALGO | 0.999899 | 5.911255 |
91b15745-ef15-42ef-b31b-935c18201625 | DoNotEatMe/C-Edu | edu/2021/12.08.2021/hw1.1.cpp | #include <iostream>
using namespace std;
// Задача 1.1 : Пользователь вводит целое положительное число не больше 100; Нарисуйте такой прямоугольник
int main()
{
int x, arr[100];
cin >> x;
for (int i = 0; i < x; i++)
{
for (int j = 0; j < x; j++)
{
if ( /* i == 0 || i == ... | ALGO | 0.967529 | 3.119893 |
85ef93ac-a723-4e6a-bc78-aca32ce5e6f8 | 99sparsh/CodeforcesSolutions | 655/1372A.cpp | #include <bits/stdc++.h>
#define mod 1000000007
#define FOR(i, a, b) for (i = a; i < b; i++)
#define FastIO \
ios_base::sync_with_stdio(false); \
cin.tie(NULL); \
cout.tie(NULL);
using namespace std;
typedef long long ll;
typedef pair<ll, ll> pll;
typedef priority_q... | ALGO | 0.999859 | 3.243795 |
0ec68534-b8b4-4c31-b5c8-ff6d7a6896ea | PerfectPan/LeetCode | solution/1702/sol1.cpp | class Solution {
public:
string maximumBinaryString(string binary) {
int n = binary.size(), i = binary.find('0');
if (i == string::npos) {
return binary;
}
int zero = count(binary.begin(), binary.end(), '0');
string s(n, '1');
s[i + zero - 1] = '0';
... | ALGO | 0.999985 | 6.5664 |
124d1bdf-9a15-4a1a-9f9b-24b672fed3d8 | Tomcruseal/dImageProcessor | include/boost_1_77_0/libs/compute/example/k_means.cpp | #include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/imgproc/imgproc.hpp>
#include <boost/compute/system.hpp>
#include <boost/compute/container/vector.hpp>
#include <boost/compute/image/image2d.hpp>
#include <boost/compute/interop/opencv/core.hpp>
#include <boost/compute/interop/op... | ALGO | 0.998626 | 6.887066 |
2c46648e-9aa3-4ffe-add0-22436fb33453 | shengxiaoyi1993/algorithm | leetecode/permutations/main.cpp | #include<iostream>
#include<string>
#include <vector>
#include"solution.hpp"
using namespace std;
int main(){
Solution tmp;
vector<int> nums;
nums.push_back(1);
nums.push_back(2);
nums.push_back(3);
vector<vector<int> > lists=tmp.permute(nums);
cout<<"result:"<<endl;
for (size_t i = 0; i < lists.size(... | ALGO | 0.999928 | 4.492581 |
b48e6711-2515-448e-bab4-37e2ab8db3d2 | nirzha/persontrack | OpenPose-Multi-Person/opencv-3.4.0/modules/calib3d/src/levmarq.cpp | #include "precomp.hpp"
#include <stdio.h>
namespace cv
{
class LMSolverImpl : public LMSolver
{
public:
LMSolverImpl() : maxIters(100) { init(); }
LMSolverImpl(const Ptr<LMSolver::Callback>& _cb, int _maxIters) : cb(_cb), maxIters(_maxIters) { init(); }
void init()
{
epsx = epsf = FLT_EPSILON... | ALGO | 0.999337 | 6.37447 |
da582919-5cc6-4325-bf4c-7f9f6801cad2 | joshbenner851/CSE331 | Weighted Graph/main.cpp | // A C++ program to determine the shortest path of a directed graph
#include <cstdlib>
#include <iostream>
#include <fstream>
#include "graph.h"
using namespace std;
int main(int argc, char* argv[])
{
if (argc != 4)
{
cerr << "Incorrect number of command line arguments." << endl;
cerr << "Us... | ALGO | 0.997752 | 4.260286 |
e19a5772-ded1-4061-b637-dc9290f69b59 | Nafyaz/my-codes | Codeforces/1626C.cpp | #include<bits/stdc++.h>
using namespace std;
#define ll long long
ll n;
ll k[102];
ll h[102];
map<pair<ll, ll>, ll> dp;
ll call(ll i, ll health)
{
if(health < h[i])
return -1;
if(i == n)
return 0;
if(dp.find({i, health}) != dp.end())
return dp[{i, health}];
ll newHealth = k... | ALGO | 0.999905 | 3.476728 |
bad01ad2-f8b3-4de8-935b-38908e72c556 | Talustus/boost_src | libs/math/example/students_t_example1.cpp | // students_t_example1.cpp
// Example 1 of using Student's t
// http://en.wikipedia.org/wiki/Student's_t-test says:
// The t statistic was invented by William Sealy Gosset
// for cheaply monitoring the quality of beer brews.
// "Student" was his pen name.
// WS Gosset was statistician for Guinness brewery in Dublin,... | ALGO | 0.991184 | 6.036408 |
5dc6497e-b157-4756-b1f8-de43e5d36cf4 | ishandutta2007/codeforces | damians/normal/191/E.cpp |
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
#include <set>
#include <queue>
#include <map>
#include <cstdio>
#include <iomanip>
#include <sstream>
#include <iostream>
#include <cstring>
#define REP(i,x,v)for(int i=x;i<=v;i++)
#define REPD(i,x,v)for(int i=x;i>=v;i--)
#define FOR(i,v)for(in... | ALGO | 0.999985 | 3.472751 |
f3229bba-22ff-4e7f-b77f-419dd0a6896b | Li2ladybro/Learn_C | 蓝桥杯/飞机降落/2024.2.17.cpp | #define _CRT_SECURE_NO_DEPRECATE
#include<stdio.h>
int N;
int st[10] = { 0 };
typedef struct data
{
int t;
int d;
int L;
}data;
data arr[30] = { 0 };
static int DFS(int u, int time)
{
if (u == N)
return 1;
int i = 0;
for (i = 0; i < N; i++)
{
if (!st[i])
{
st[i] = 1;
if (arr[i].t + arr[i].d < time)
... | ALGO | 0.999845 | 3.635007 |
45ea0037-b6ad-4d69-af2c-84a263af68cd | rotaruciprian81/C-PlusPlus-sorting-program | C++ sorting.cpp | // C++ sorting.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <iostream>
#include <conio.h>
using namespace std;
//in order to use 3 sorting algorithms 3 different functions have been created
//declaring the functions
void selectionSort(int array[], int n);
void insertionS... | ALGO | 0.99952 | 4.457697 |
7dcc00a2-70ec-4e03-b425-74e1b79ac69c | haan823/problem-solving | swea/5648.cpp | /////////////////////////////////////////////////////////////////////////////////////////////
// 기본 제공코드는 임의 수정해도 관계 없습니다. 단, 입출력 포맷 주의
// 아래 표준 입출력 예제 필요시 참고하세요.
// 표준 입력 예제
// int a;
// float b, c;
// double d, e, f;
// char g;
// char var[256];
// long long AB;
// cin >> a; // int 변수 1개 입력... | ALGO | 0.999606 | 4.28733 |
d9af69a0-2ef2-4913-bcd2-2530baace7a5 | meldose/openCV | 3rdparty/carotene/src/magnitude.cpp | #include "common.hpp"
#include "vtransform.hpp"
#include <cmath>
namespace CAROTENE_NS {
#ifdef CAROTENE_NEON
namespace {
struct Magnitude
{
typedef s16 type;
void operator() (const int16x8_t & v_src0, const int16x8_t & v_src1,
int16x8_t & v_dst) const
{
int16x4_t v_src0_p = vget... | ALGO | 0.997935 | 6.709992 |
f1ec0c1d-0cb3-4e45-95ee-c0d7a2f2407f | ArionDas/Leetcode_Solutions | 120-triangle/triangle.cpp | class Solution {
public:
// int find_min_path_sum(int i, int j, int n, vector<vector<int>>& triangle, vector<vector<int>>& dp) {
// if(dp[i][j]!=-1)
// return dp[i][j];
// if(i==n-1) {
// return triangle[i][j];
// }
// int bottom = find_min_path_sum(i+1, j,... | ALGO | 0.999986 | 6.200329 |
1dc51438-4b6d-4221-8489-cb67714c1845 | yashmittal-git/LeetCoding | excel-sheet-column-title.cpp | // 168. Excel Sheet Column Title
// Given a positive integer, return its corresponding column title as appear in an Excel sheet.
// For example:
// 1 -> A
// 2 -> B
// 3 -> C
// ...
// 26 -> Z
// 27 -> AA
// 28 -> AB
// ...
// Example 1:
// Input: 1
// Output: "A"
// Example 2:
//... | ALGO | 0.999415 | 5.958525 |
79f24d2e-29b2-4cb5-b95d-c502cd3979ff | pulkitgaur07/Data-Structures-and-algorithm | Heap/maximum_sum_combination.cpp | // Question : You are given two integer arrays a[] and b[] of equal size. A sum combination is formed by adding one element from a[] and one from b[], using each index pair (i, j) at most once. Return the top k maximum sum combinations, sorted in non-increasing order.
// Examples:
// Input: a[] = [3, 2], b[] = [1, 4]... | ALGO | 0.999995 | 5.211892 |
b0434bc8-9adf-4d89-b25c-eafc04c02e23 | Ausp3x/competitive-programming | [6] NOI.PH Training 2025/[1] Pre-Finals Training/Unit 1 (Graphs and Trees)/[3] APIO 2024-1 - September.cpp | // 人外有人,天外有天
// author: Ausp3x
#pragma GCC optimize("O3, fast-math")
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace std;
using namespace __gnu_pbds;
#define fi first
#define se second
#define pb push_back
// #define DEBUG
typedef long long lng;
typedef __int128 lll;
template<... | ALGO | 0.999867 | 5.183549 |
dd049681-1076-4442-ac94-f8b6ae42b87b | Mosseir/MLAB18 | lab18_3.cpp | #include<iostream>
#include<cstdlib>
#include<ctime>
#include<vector>
using namespace std;
vector<int> randomVector(int);
void showVector(vector<int>);
int dotProduct(vector<int>,vector<int>);
int main(){
srand(time(0));
vector<int> x = randomVector(5);
vector<int> y = randomVector(5);
int z = dotProduct(x,y);
s... | ALGO | 0.973123 | 4.066895 |
84d77143-7f77-4ead-ba0e-78998ffbaf39 | maxime-tournier/meuh | control/solver/panda.cpp | #include "panda.h"
#include <phys/system.h>
#include <sparse/linear/transpose.h>
#include <sparse/linear/diagonal.h>
#include <sparse/linear.h>
#include <math/algo/iter.h>
#include <core/log.h>
// #include <phys/solver/si.h>
#include <math/mosek.h>
#include <phys/solver/qp.h>
namespace control {
namespace solver... | ALGO | 0.998016 | 5.688598 |
60265a34-9a9a-4f2f-bec8-fee0bce6f780 | Kawser-nerd/CLCDSA | Source Codes/AtCoder/abc054/C/4484585.cpp | #include <algorithm>
#include <iostream>
#include <numeric>
#include <vector>
bool check(const std::vector<int>& path,
const std::vector<std::vector<int>>& g) {
int cur = 1;
std::vector<bool> used(g.size(), false);
used[1] = true;
for (auto p : path) {
if (!used[p] &&
std::find(g[cur].be... | ALGO | 0.999873 | 4.775751 |
282fa078-db18-4302-ad38-422b11b024e2 | ishandutta2007/codeforces | rednextcentury/normal/547/E.cpp | #include<bits/stdc++.h>
using namespace std;
#define ll long long
const int Alpha=28;
int ret[1000000];
vector< pair<int,pair<int,int> > > Q[1000000];
vector<int> vec[1000000];
int BIT[1000000],mx=5e5;
void update(int x, int delta)
{
for(; x <= mx; x += x&-x)
BIT[x] += delta;
}
int query(int x)
{
int su... | ALGO | 0.999899 | 3.817121 |
dfbe6624-67d6-4408-a1e9-357313f2b0e7 | wpn-zju/LeetCode-Dump | dump-cn/709.to-lower-case.cpp | class Solution {
public:
string toLowerCase(string str) {
for(char& c : str)
if(c >= 'A' && c <= 'Z')
c += 'a' - 'A';
return str;
}
}; | ALGO | 0.894835 | 5.768177 |
5c95cbed-a011-4079-9d52-6c6e9e0a4e93 | cosim/foment | src/hcontain.cpp | /*
Foment
*/
#ifdef FOMENT_WINDOWS
#include <intrin.h>
#endif // FOMENT_WINDOWS
#include "foment.hpp"
// ---- Population Count ----
//
// popcount_3 from http://en.wikipedia.org/wiki/Hamming_weight#Efficient_implementation
const uint64_t m1 = 0x5555555555555555; //binary: 0101...
const uint64_t m2 = 0x3333333333... | ALGO | 0.967117 | 4.398469 |
8df68ad2-ec24-4e03-9018-48b69c64f099 | imraghavagr/DSA-cpp | 00. striverSDEsheet/day09-recursion/02.subset2.cpp | //https://leetcode.com/problems/subsets-ii/description/
#include<iostream>
using namespace std;
//without using set - optimal solution - like combination sum 2 problem as taught by striver
void solve(int index, vector<int> &nums, vector<int> &op, vector<vector<int>> &ans){
if(index > nums.size()) return;
ans.pu... | ALGO | 0.999971 | 5.645761 |
c16e197b-da54-4950-9156-31b08a147681 | RikkiS0105/C-Programming-Learning-Files | Test file 5, April 19, 2021.cpp | #include<iostream>
#include<cmath>
using namespace std;
int main(){
int p;
int i;
int t;
cout<<"Enter Principal Amount."<<endl;
cin>>p;
cout<<"Enter Interest Rate."<<endl;
cin>>i;
cout<<"Enter Term period."<<endl;
cin>>t;
int si = ((p*i*t)/100);
cout<<si;
cout<<endl<<endl<<si;
return 0;
}
| ALGO | 0.974823 | 3.492394 |
2b50cec1-322e-449a-bab0-4670d6aab325 | ImtiazAhmedAkash/Problem-Solving | codeforces/1811/A.cpp | /* In the Name of ALLAH, the most gracious, the most merciful */
// Insert Digit
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define nl '\n'
#define deb(x) cerr << #x << " = " << x << nl
const int inf = 1e9;
const ll INF = 1e18;
const int mod = 998244353;
const int N = 2e5 + 5;
void solve(... | ALGO | 0.999889 | 4.543733 |
cb12afb6-4cd2-46eb-bb73-d88b6b30e0a6 | SJMA11723/Problem-solving | ICPC/EUROPE/2023/2023-2024 ICPC East North America Regional Contest (ECNA 2023)/K.cpp | /**
* Author: Jorge Raul Tzab Lopez
* Github: https://github.com/SJMA11723
*/
#include <bits/stdc++.h>
#define all(x) x.begin(), x.end()
#define pb push_back
#define fi first
#define se second
using namespace std;
int main(){
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
int n; cin >> n;
... | ALGO | 0.999967 | 4.164908 |
0b91cf3d-aec4-4e13-adfd-d46759e77044 | gourikasoni/100-days-challenge | day 5/c2f.cpp | #include <iostream>
using namespace std;
float c2f( float temp)
{
float s;
s=temp*1.8 +32;
return s;
}
int main ()
{
float celcius [10] = {37,38.2,39.6,42.9,53.9,100.4,42.6,44.9,50.6,99.6};
float faren [10];
int i;
for(i=0;i<=9;i++)
{
faren [i] = c2f(celcius[i]);
}
cout<<endl... | TOOL | 0.997473 | 3.867835 |
a56be606-6f82-4f92-8eb2-78e72d9600b0 | JesminNipu/Some-of-UVA-source-code | 11344.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
char m[1002];
int tc, l, n, i, j, r,sum,a[100];
bool flag;
cin>>tc;
while (tc--)
{
scanf("\r");
gets(m);
l = strlen(m);
cin>>n;
for (i = 0; i < n; i++)
cin>>a[i];
... | ALGO | 0.994476 | 3.14733 |
edd2ae5b-67e5-4fbc-a097-f4d6a90aa2ad | Deanmeisong/Leetcode_Puzzle_2 | 2954-count-the-number-of-infection-sequences/2954-count-the-number-of-infection-sequences.cpp | using LL = long long;
class Solution {
public:
LL mod = 1e9+7;
LL fact[100005];
LL power[100005];
int numberOfSequence(int n, vector<int>& sick) {
fact[0] = 1;
for(int i = 1; i <= n; ++i) fact[i] = (fact[i-1]*i)%mod;
power[0] = 1;
for(int i = 1; i <= n; ++i) power[i] = (p... | ALGO | 0.999992 | 4.362309 |
a4003d00-bd2b-455b-ba7d-69458400ed60 | yashwant938/CSES | leetcode/partition_labels.cpp | class Solution {
public:
vector<int> partitionLabels(string s) {
unordered_map<char,int> last_occurance;
for(int i=0;i<s.size();i++){
last_occurance[s[i]]=i;
}
vector<int>ans;
int start=0, end=0;
for(int i=0;i... | ALGO | 0.999715 | 5.645895 |
52b532cf-8cc7-4588-afa9-ce8710454636 | omkarsp45/DSA | 13.cpp | // Function
#include<iostream>
using namespace std;
int add(int a,int b){ //formal parameters
int c = a + b;
return c;
}
int main(){
int a=12 , b=13, c;
c= add(a,b); //actual parameters
cout<<c;
return 0;
} | TOOL | 0.968442 | 4.203245 |
f8fea639-0002-4b5c-9121-55f1ff07cf69 | TheIslland/Code_learn | 7.代码练习/1.面试常见题/三数之和_双指针.cpp | /************************************************************
File Name : 三数之和_双指针.cpp
Author: TheIslland
Mail: <EMAIL>, <EMAIL>
Created Time: 2020-07-12 星期天 09:07:04
************************************************************/
vector<int> three_sum(vector<int> &nums, int length, int target) {
if (... | ALGO | 0.999802 | 4.994812 |
d9bfacad-58a4-4483-b387-5fb14e078d0c | zzctommy/public-source-code | 码库/CF17E Palisection.cpp | #include<bits/stdc++.h>
using namespace std;
#define fi first
#define se second
#define mkp make_pair
#define pb push_back
#define sz(v) (int)(v).size()
typedef long long LL;
typedef double db;
template<class T>bool ckmax(T&x,T y){return x<y?x=y,1:0;}
template<class T>bool ckmin(T&x,T y){return x>y?x=y,1:0;}
#define re... | ALGO | 0.999997 | 4.098939 |
040cec06-e9d6-4fab-b317-5b2414b7ee50 | matumoto1234/cp-crawler | AtCoder/arc117/arc117_a/21863372.cpp | // detail: https://atcoder.jp/contests/arc117/submissions/21863372
#include <bits/stdc++.h>
using namespace std;
#define range(i, l, r) for (int i = (int)(l); i < (int)(r); (i) += 1)
#define rrange(i, l, r) for (int i = (int)(r)-1; i >= (int)(l); (i) -= 1)
template <typename T1, typename T2> inline void chmax(T1 &a, T2... | ALGO | 0.999957 | 3.352906 |
2486b3f4-47c7-4331-a69f-8b6a81dc2004 | arlechann/atcoder | AtCoder/ABC279/E.cpp | #include <algorithm>
#include <cassert>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <functional>
#include <iomanip>
#include <iostream>
#include <limits>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <string>
#include ... | ALGO | 0.999956 | 3.949129 |
d93dfd41-f521-40fa-a6e6-67a2efb0887f | amsraman/Competitive_Programming | USACO/Contests/Gold/2019-2020/Contest 2/gold20jan2.cpp | #include <bits/stdc++.h>
typedef long long ll;
using namespace std;
int n, q, a, b, arr[5000];
ll counts[2000001], dp[5000][5000];
int main()
{
freopen("threesum.in","r",stdin);
freopen("threesum.out","w",stdout);
cin >> n >> q;
for(int i = 0; i<n; i++)
cin >> arr[i];
for(int i = 0; i<n; ... | ALGO | 0.999751 | 3.845855 |
b3332035-96cb-4228-ab7c-f41522338f71 | forresil/cxx_programming | caveofprogramming/basic/CreatingParticles/src/Swarm.cpp | /*
* Swarm.cpp
*
* Created on: 18.05.2019
* Author: forba
*/
#include "Swarm.h"
namespace forresil
{
Swarm::Swarm()
{
m_pParticles = new Particle[NPARTICLES];
}
Swarm::~Swarm()
{
delete[] m_pParticles;
}
} /* namespace forresil */
| TOOL | 0.988101 | 3.82322 |
a9601d87-6ef4-47f4-8551-ebdbdd9fe0d6 | raghuvanshraj/Competitive-Programming-Archive | Codeforces/0768/768B.cpp | /**
* author: vulkan
* created: 30.08.2019 06:36:53 PM
**/
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
ll get_length(ll n) {
ll msb = 0;
while (n) {
msb++;
n /= 2;
}
return 2 * (ll)pow(2, msb - 1) - 1;
}
int is_one(ll n, ll i, ll len) {
if (n < 2) {
return n;
}
ll mid =... | ALGO | 0.999648 | 3.237122 |
e1aeddd5-3606-4d46-be86-d7ea269591d2 | PowerSym/GPU_Transient | Online_Transient_GPU/source/governorModels.cpp | #include "ode_solver.cuh"
namespace transient_analysis {
real__t ODE_solver::
process_steam_machine_third_order(const vector_type& x, vector_type& dxdt, const STEAM_DATA& steam,
real__t val_src, const int idx_hp, const int idx_ip, const int idx_lp) {
/*
integrate_block(dxdt, val... | ALGO | 0.993226 | 3.431327 |
454bcd3f-9aa6-4a46-971b-b4e484ddff3b | ZXPrism/CP-Solutions | Luogu/U360487-1.cpp | #include "bits/stdc++.h"
using u64 = unsigned long long;
using i64 = long long;
void solve() {
int n = 0;
std::cin >> n;
std::vector<int> v(n);
for (int i = 0; i < n; i++) {
std::cin >> v[i];
}
if (n % 2 == 0) {
std::cout << "0\n";
return;
}
int ans = 0;
... | ALGO | 0.999997 | 5.21198 |
5bea8b77-6c62-4673-8d4d-8852952f66ea | paulnewman1979/edocteel | 069/697/main.cpp | #include <iostream>
#include <vector>
#include <algorithm>
#include <stdio.h>
#include "../../template/common/Input.hh"
#include "../../template/common/Output.hh"
#include <unordered_map>
using namespace std;
class Solution {
public:
int findShortestSubArray(vector<int>& nums) {
unordered_map<int, vector<... | ALGO | 0.999902 | 4.879617 |
b06dac66-7372-43ab-94d7-bf38acb72b6c | MinboyKim/BOJ | 23_July/18/BRONZE1_1032_KangManJoo.cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
string s,tmp;
int n;
cin>>n;
n--;
cin>>s;
while(n--){
cin>>tmp;
for(int i=0; i<s.size(); i++){
if(s[i]!=tmp[i]){
s[i]='?';
}
}
}
cout<<s;
} | ALGO | 0.99996 | 3.068741 |
ccc30bcd-6095-4a41-b6df-e8fa3fc4f6f3 | priyanshsingh/Cpp-learning | DSAlgo/Data_St/stack/practice1.cpp | #include <iostream>
using namespace std;
class Stack
{
private:
int top;
int arr[10];
public:
Stack()
{
top = -1;
for (int i = 0; i < 10; i++)
{
arr[i] = 0;
}
}
bool isEmpty()
{
if (top == -1)
return true;
else
... | ALGO | 0.985585 | 4.51336 |
9c614c76-3e42-45b8-b241-8aaf5591c834 | Giulian617/FMI-NO-STRESS-13 | Peak/src/Pick.cpp | // Matteo - Subtask 2
// Teorema lui Pick
#include <bits/stdc++.h>
using namespace std;
long long count_lattices_on(pair<int, int> A, pair<int, int> B, int a, int b) {
// Panta este a/b
// Astfel, vor exista puncte intregi din b / (a, b) in b / (a, b)
int g = __gcd(a, b);
int x1 = A.first, x2 = B.firs... | ALGO | 0.999345 | 4.844002 |
f9d13b94-66f7-403a-82ce-bef59f991682 | AshutoshKumarPatel/100DaysWithCpp | Day20/plus-one.cpp | #include <iostream>
#include <vector>
using namespace std;
class Solution {
public:
vector<int> plusOne(vector<int>& digits) {
for (int i = digits.size() - 1; i >= 0; i--) {
if (digits[i] == 9) {
digits[i] = 0;
} else {
digits[i]++;
re... | ALGO | 0.999889 | 6.921542 |
cd533e2b-ddab-4167-892c-54ce95fbd7eb | sanjaykaswan/Codeforces_codes | A-team.cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
int n,a,b,c,ans,count;
ans = 0;
cin>>n;
for (int i = 0; i < n; i++)
{
count = 0;
cin>>a>>b>>c;
if(a==1){
count += 1;
}
if(b==1){
count += 1;
}
if(c==1){
... | ALGO | 0.999806 | 3.81615 |
b48692d8-71e3-4fe1-bad9-424f5f1dfbf1 | ishandutta2007/codeforces | hyperbolic/normal/1680/D.cpp | #include <stdio.h>
long long int abs(long long int k)
{
return k>0?k:-k;
}
long long int x[3010],check[3010];
int main()
{
int a,b;
scanf("%d%d",&a,&b);
for(int i=1;i<=a;i++) scanf("%lld",&x[i]);
for(int i=1;i<=a;i++) if(x[i]==0) check[i] = 1;
for(int i=1;i<=a;i++) check[i] += check[i-1];
for(int i=1;i<=a;i++)... | ALGO | 0.999965 | 3.163715 |
8b760e3f-b025-4536-8724-6b1d3cd94dd9 | mapoferri/biobb_netprop | biobb_netprop/disc4all-data-fra/guild/src/boost/libs/stl_interfaces/example/interoperability.cpp | #include <algorithm>
#include <array>
#include <numeric>
#include <cassert>
// This is a random access iterator templated on a value type. The ValueType
// template parameter allows us easily to define const and non-const iterators
// from the same template.
template<typename ValueType>
struct random_access_iterator... | TEST | 0.966254 | 6.984657 |
15af03be-07ff-403b-a448-0de610dd31d0 | IIIIIGODIIIII/LeetCode | 3. Hard/76. Minimum Window Substring.cpp | #include <iostream>
#include <bits/stdc++.h>
using namespace std;
int main()
{
string s = "ADOBECODEBANC", t = "ABC", answer;
int length = INT_MAX, left = 0, right = 0, have = 0, need, result_length = INT_MAX;
int result[2] = {-1, -1};
char temp;
if (t.empty()){
cout<<"Empty String"<<endl... | ALGO | 0.999975 | 5.728142 |
8e2d8139-0bda-4752-be4a-31c5d4a8301a | Badhansen/UVa | 1176 - A Benevolent Josephus.CPP | // solved
#include<bits/stdc++.h>
using namespace std;
int main()
{
long long arr[33005],i,j,n;
arr[0]=0;
arr[1]=2;
j=1;
for(i=2;i<33000;i++){
if(i==j){
arr[i]=i*2;
j=1;
}
else if(j==1){
arr[i]=i+1;
j+=2;
}
else... | ALGO | 0.999816 | 3.893432 |
d38e7e42-a139-4770-afd8-e7fe207e0c1b | rohitsingh2410/prep | parenthesisMatching.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{ cout<<"Enter the parenthesis brackets here: ";
//string str="}{";
string str;
getline(cin,str);
//string str="{{}}[]";
int count=str.length();
// {{}}[]
stack<char> data; int flag=0;
for (int i = 0; i < count; ++i)
{
if(str[i]=='{'||str[i]=='['||str... | ALGO | 0.999376 | 4.388477 |
be4afd44-3a5e-4ce4-a2b4-27de397db073 | goyalyash82/GFG | Difficulty: Basic/Decision Making in Java/decision-making-in-java.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
//User function Template for C++
class Solution {
public:
string compareNM(int n, int m){
// code here
if( n<m){
return "lesser";
}
if(n>m){
return "gr... | ALGO | 0.999824 | 5.638657 |
b82f4c9b-6b13-4243-9923-f1b41ba89d91 | kks227/BOJ | 6000/6080.cpp | #include <cstdio>
#include <queue>
using namespace std;
const int MAX = 1000;
const int roff[8] = {-1, -1, -1, 0, 0, 1, 1, 1};
const int coff[8] = {-1, 0, 1, -1, 1, -1, 0, 1};
int main(){
int R, C, map[MAX][MAX];
scanf("%d %d", &R, &C);
for(int i = 0; i < R; ++i)
for(int j = 0; j < C; ++j)
scanf("%d", &map[i][... | ALGO | 0.998324 | 3.782191 |
f8b461a1-7b36-4964-b8ee-e938ce395686 | BinomialSheep/CompetitiveC-- | AtcoderContest/ARC149/C.cpp | #include <bits/stdc++.h>
// デバッグ用マクロ:https://naskya.net/post/0002/
#ifdef LOCAL
#include <debug_print.hpp>
#define debug(...) debug_print::multi_print(#__VA_ARGS__, __VA_ARGS__)
#else
#define debug(...) (static_cast<void>(0))
#endif
using namespace std;
using ll = long long;
using vi = vector<int>;
using vl = vector<lo... | ALGO | 0.999819 | 4.276252 |
d75edfa5-e5fa-48c9-9ea6-bad6156450c3 | AhmedHani/Online-Judges-Problems-SourceCode | CodeForces-/Codeforces Round #120 (Div. 2), problem: (D) Non-Secret Cypher.cpp | #include <cstdlib>
#include <stdio.h>
#include <string.h>
#include <string>
#include <iostream>
#include <vector>
#include <algorithm>
#include <queue>
#include <functional>
#include <map>
#define Max 4000000 + 5
#define INF 1000000000
//#define INT_MAX 2147483647
#define FOR(i, N) for( long long i = 0 ; i < N ; i++ )
... | ALGO | 0.999697 | 3.888998 |
80501c9f-4e6c-4d6b-9c2c-236ad7f4f061 | SonarSystems/Tic-Tac-Toe-Cocos2d-x | C++/[5] Grid/TicTacToePractise/cocos2d/cocos/base/CCNS.cpp | #include "base/CCNS.h"
#include <string>
#include <vector>
#include <string.h>
#include <stdlib.h>
#include "base/ccUtils.h"
using namespace std;
NS_CC_BEGIN
typedef std::vector<std::string> strArray;
// string toolkit
static inline void split(const std::string& src, const std::string& token, strArray& vect)
{
... | TOOL | 0.864974 | 5.404184 |
d6685952-cb12-438f-9d0f-7ff8eaa6737b | mecuai/mecuai | src/sync.cpp | #include <sync.h>
#include <logging.h>
#include <utilstrencodings.h>
#include <stdio.h>
#include <map>
#include <memory>
#include <set>
#ifdef DEBUG_LOCKCONTENTION
#if !defined(HAVE_THREAD_LOCAL)
static_assert(false, "thread_local is not supported");
#endif
void PrintLockContention(const char* pszName, const char* ... | TOOL | 0.936164 | 6.295769 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.