uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
d59a9920-2e06-4f19-909a-c431962fce8f | BongYunnong/TIL | Baekjoon/동적계획법/12015_가장긴증가하는부분수열2.cpp | // https://www.acmicpc.net/problem/12015
// 쓸데없는거를 지워버리는 것까지는 맞았는데, 아예 처음부터 데이터를 따로 만들어버릴 생각은 못 했고
// 결정적으로 값을 바꿔치기 하는 방법을 생각하지 못했다.
// lower_bound를 쓰는 방법을 기억해둬야겠다. 이것을 쓰면 아주 간단하게 어려운 문제가 풀리는 듯 하다.
#include<iostream>
#include<vector>
using namespace std;
int N;
vector<int> DP;
int main(){
cin>>N;
for(int i=0... | ALGO | 0.999997 | 4.629338 |
4dbe6928-8854-4b66-97b1-8758832ba539 | ishandutta2007/codeforces | itst/normal/777/A.cpp | #include<bits/stdc++.h>
using namespace std;
int biao[6][3] = {0,1,2,1,0,2,1,2,0,2,1,0,2,0,1,0,2,1};
int main(){
int n , k;
cin >> n >> k;
cout << biao[n % 6][k];
return 0;
} | ALGO | 0.999976 | 3.011984 |
82666674-5749-483b-85ac-e2b47bfb988c | oxygen-hunter/Flashboom | data/big-vul-100/add_attention_code/MixtralExpert/top0-100/cheapest-flights-within-k-stops-Solution.findCheapestPrice/177812_Bypass.cpp | void sum_update(const char *p, int32 len)
{
switch (cursum_type) {
case CSUM_MD5:
md5_update(&md, (uchar *)p, len);
break;
case CSUM_MD4:
case CSUM_MD4_OLD:
case CSUM_MD4_BUSTED:
if (len + sumresidue < CSUM_CHUNK) {
memcpy(md.buffer + sumresi... | ALGO | 0.998929 | 4.610229 |
72b92e5a-bd5e-4b3a-8368-923fcabfbccd | ishandutta2007/codeforces | jacynkaa/normal/1510/J.cpp | #include <bits/stdc++.h>
#include <chrono>
#include <ext/pb_ds/assoc_container.hpp>
#include <math.h>
using namespace __gnu_pbds;
using namespace std;
#define endl "\n"
#define mp make_pair
#define st first
#define nd second
#define pii pair<int, int>
#define pb push_back
#define _upgrade ios_base::sync_with_stdio(0), ... | ALGO | 0.999956 | 3.408729 |
026ef93e-10aa-45ea-b351-6a518977ae5f | isolis237/mazeMaker | dsets.cpp | /* Your code here! */
#include <iostream>
#include "dsets.h"
void DisjointSets::addelements(int num) {
for (int i = 0; i < num; i++) {
set.push_back(-1);
}
}
int DisjointSets::find(int elem) {
if (set[elem] < 0)
return elem;
set[elem] = find(set[elem]);
return set[elem];
}
void Di... | ALGO | 0.996582 | 4.644731 |
7cf328f5-1367-41ec-a0d2-3fac58d2bed2 | thanakrit555/lab22 | lab22_2.cpp | #include<iostream>
#include<list>
#include<algorithm>
using namespace std;
void printList(list<string> s){
list<string>::iterator i;
for( i = s.begin(); i != s.end(); i++){
cout << *i << " ";
}
cout << "\n";
}
int main(){
list<string> line_up;
list<string>::iterator loc;
line_up.push_back("Alice");
... | ALGO | 0.996021 | 4.118673 |
d711e51a-7bbe-4b4b-acab-9ea2e586b73b | nxvtej/operating-system | demo.cpp | #include <iostream>
#include <thread>
#include <unistd.h>
using namespace std;
void taskA()
{
for (int i = 0; i < 10; i++)
{
sleep(1);
printf("TaskA: %d\n", i);
fflush(stdout);
}
}
void taskB()
{
for (int i = 0; i < 10; i++)
{
sleep(1);
printf("TaskB: %d\n"... | TEST | 0.914834 | 3.87639 |
16d2fdc2-1a55-43a9-95fb-9cdfbfbe3934 | prateek27/oreilly-cpp-basics | priority_queue.cpp | #include <iostream>
#include <queue>
using namespace std;
int main() {
// Min Heap
priority_queue<int,vector<int>, greater<int> > myPriorityQueue;
// Insert elements into the priority_queue
myPriorityQueue.push(30);
myPriorityQueue.push(10);
myPriorityQueue.push(20);
// Display the top (... | ALGO | 0.992656 | 5.622845 |
8c4fa121-4d83-4b61-8846-75cc0932ca39 | shubham452/algo | dp/matrix chain multiplication/03_palindrome partitioning.cpp | #include<bits/stdc++.h>
using namespace std;
bool ispalindrome(string str, int i, int j)
{
while(i<j)
{
if(str[i]!=str[j])
{
return false;
}
else
{
i++;
j--;
}
}
return true;
}
int mcm(string str, int i, int j)
{
int... | ALGO | 0.999926 | 4.924381 |
24b07232-dae3-4cb0-a6e0-7a8ae98d8c54 | chenhan1218/UVa-Online-Judge | 10868.cpp | #include <iostream>
using namespace std ;
int main()
{
double k , l , s , w , from_l_to_s , spring_energy , potential_energy ;
while( cin >> k >> l >> s >> w )
{
if( k == 0 && l == 0 && s == 0 && w == 0 )
{
break ;
}
if( s < l )
{
if( 19.62 * s > 100.0 )
/* If he collides at a speed of more tha... | ALGO | 0.998769 | 3.823769 |
36c0b8c9-7dac-4601-9ddc-9ba7c345905a | kaushalrajjj/DSA_OCD | DAY_29.cpp | 📅 *Schedule for day27:*
❓ Q1: https://bit.ly/3w6hUaa
❓ Q2: https://bit.ly/3QlEoMx
q1) Reverse DLL
Code:
DLLNode* reverseDLL(DLLNode* head) {
if(head==nullptr)return nullptr;
if(head->next==nullptr) return head;
DLLNode* temp=head->next;
DLLNode* back=head;
... | ALGO | 0.999747 | 5.673457 |
1d869443-6d4c-444a-ae78-e670019dea6a | Shubhamm1211/LeetCode | 783-search-in-a-binary-search-tree/search-in-a-binary-search-tree.cpp | /**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode() : val(0), left(nullptr), right(nullptr) {}
* TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}
* TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), l... | ALGO | 0.99999 | 5.86411 |
86a60cbe-72da-49ad-ba0a-8126907df319 | 113bommy/deepmind_codecontests_refine | cpp_source_filter_file/cpp_train_3795_21.cpp | #include <bits/stdc++.h>
using namespace std;
char matrix[110][110];
int main() {
for (int i = 1; i <= 100; i++)
for (int j = 1; j <= 100; j++) matrix[i][j] = '*';
int n;
scanf("%d", &n);
int ds = 1;
int m = n / 2, b, e;
b = e = m + 1;
for (int i = 1; i <= n; i++) {
for (int j = b; j <= e; j++) {
... | ALGO | 0.999809 | 3.22705 |
6b02349b-6b82-4aad-86b1-e49e639569db | Shahriar-Saikat21/Problem_Solve_LeetCode | LeetCode/Divide_&_Conquer/50_Pow(x,n).cpp | #include<bits/stdc++.h>
using namespace std;
/*
Implement pow(x, n), which calculates x raised to the power n (i.e., xn).
Example 1:
Input: x = 2.00000, n = 10
Output: 1024.00000
Example 2:
Input: x = 2.10000, n = 3
Output: 9.26100
Example 3:
Input: x = 2.00000, n = -2
Output: 0.25000
Explanation: 2-2 = 1/22 = 1... | ALGO | 0.999896 | 6.124874 |
290d40df-44ac-406e-8995-19f6dd678695 | memade/llvm-project | libc/benchmarks/automemcpy/lib/RandomFunctionGenerator.cpp | #include "automemcpy/RandomFunctionGenerator.h"
#include <llvm/ADT/StringRef.h>
#include <llvm/Support/raw_ostream.h>
#include <optional>
#include <set>
namespace llvm {
namespace automemcpy {
// Exploration parameters
// ----------------------
// Here we define a set of values that will contraint the exploration a... | ALGO | 0.921059 | 7.32292 |
d544489b-a4a8-4a29-84f2-8205bdefe7d4 | AbuJubair7/CP | Contests/Archive/Codforces/Codeforces Round #801 (Div. 2)/OptimalPath.cpp | /*
Author: Jubair_7
Date: 20 June 2022
*/
#include <bits/stdc++.h>
using namespace std;
#define BOOST ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define FOR(i,n) for(ll i = 0 ; i<n ; i++)
#define endl "\n"
#define pb push_back
typedef long long ll;
ll mod = 1e9+7;
ll gcd(ll a, ll b){
if(b == 0... | ALGO | 0.999958 | 5.119681 |
05019181-9dc7-42d7-81a8-e781b9402878 | MZayed47/Online_Judge_UVa | UVa10079.cpp | /* Pizza Cutting */
#include<iostream>
using namespace std;
int main()
{
long long n;
while(cin>>n){
if(n<0){
break;
}
cout<<((n*(n+1))/2)+1<<endl;
}
return 0;
}
| ALGO | 0.999745 | 3.555385 |
7f5f916c-7f8c-4921-85b2-806e48d6122b | zephyr-fun/LeetCodeSolution | dp/1595_Minimum_Cost_to_Connect_Two_Groups_of_Points.cpp | // 2022.04.27
const int MAX_S1 = 12 + 1;
const int MAX_ALLS2 = 1 << 12;
int dp[MAX_S1][MAX_ALLS2];
class Solution {
int INF = 0x3f3f3f3f;
public:
int connectTwoGroups(vector<vector<int>>& cost) {
memset(dp, 0x3f, sizeof(dp));
int s1 = cost.size();
int s2 = cost[0].size();
int ALL... | ALGO | 0.999952 | 4.989471 |
85cfa1e7-8ac4-48db-a7b4-1635def6d5af | yangtengleo/DeepSPIN | lammps_DeepSPIN/lib/gpu/lal_eam.cpp | /***************************************************************************
eam.cpp
-------------------
Trung Dac Nguyen, W. Michael Brown (ORNL)
Class for acceleration of the eam pair style.
_______________________________________... | ALGO | 0.971718 | 5.734339 |
01231abe-b587-4ff4-91a4-16f7635569c0 | Neo-Stark/Practicas-SCD | scd-p3-fuentes/filosofos-plantilla.cpp | // -----------------------------------------------------------------------------
//
// Sistemas concurrentes y Distribuidos.
// Práctica 3. Implementación de algoritmos distribuidos con MPI
//
// Archivo: filosofos-plantilla.cpp
// Implementación del problema de los filósofos (sin camarero).
// Plantilla para completar... | ALGO | 0.999451 | 5.232343 |
7d2b28bf-f96b-4678-846b-2e2e396d514c | ishandutta2007/codeforces | ssamt/normal/1551/B2.cpp | #include <stdio.h>
#include <vector>
int main() {
int h, i, j;
int t, n, k;
scanf("%d", &t);
for(h=0; h<t; h++) {
scanf("%d %d", &n, &k);
int cur = 1;
int a[n];
std::vector<int> count[n+1];
std::vector<int> add;
int answer[n];
for(i=0; i<n; i++) {
answer[i] = 0;
}
for(i=0; i<n; i++) {
scanf... | ALGO | 0.999952 | 3.05344 |
7b5f36a5-00a3-441a-a2c5-a07a44a30619 | cosmosapjw-quantum/Omoknuni_test | src/games/chess/chess_rules.cpp | // src/games/chess/chess_rules.cpp
#include "games/chess/chess_rules.h"
#include "games/chess/chess_state.h"
#include <algorithm>
#include <array>
namespace alphazero {
namespace chess {
// Helper constant arrays for knight and king moves
const std::vector<std::pair<int, int>> KNIGHT_MOVES = {
{-2, -1}, {-2, 1}, ... | ALGO | 0.996154 | 7.656278 |
1e45114d-b357-4400-99fb-1b6745d14477 | dinhcanh303/Cpp_Basic | C++_Basic/CT3B10.cpp | #include <bits/stdc++.h>
using namespace std;
bool check(int n ){
for(int i=2; i<=sqrt(n);i++)
{
if(n%i==0) return 0;
}
return n>1;
}
int main(){
long long n ; cin >> n;
for(int i=2; i<=sqrt(n);i++){
if( check(i) && 1ll*i*i <=n){
cout << 1ll*i*i<<" ";
}
}
return 0;
}
| ALGO | 0.999828 | 4.050107 |
8348d63d-200e-4959-93df-ca46677f1015 | tofuwen/icpc-Rujia-Liu | Beginning_Algorithm_Contests_Second_Edition/aoapc-bac2nd-master/ch12/UVa1673.cpp | // UVa1673 str2int
// Rujia Liu
//
// This is Problem 12-3 of <<Beginning Algorithm Contests>> 2nd edition
//
// Note that we're using the "big string method", as explained in the book.
// It's slightly less efficient than the official "multiple string DAWG" because we need to explicitly store '$' edges.
// However, it... | ALGO | 0.999882 | 4.510192 |
d7f1fa1d-68a7-4a1e-bfb8-ef49dcd84eb1 | sun-alf/rctank | src/ParsingUtils.cpp | #include <stdio.h>
#include <string.h>
#include <ctype.h>
#include <stdlib.h>
#include "Asserts.h"
#include "ParsingUtils.h"
namespace ParsingUtils
{
#define _HEX_PREFIX_LENGTH 2 // "0x" -- is our prefix
static bool _HasHexPrefix(char* str)
{
if ( str[0] == '0' && (str[1] == 'x' || str[1] == 'X') )
... | TOOL | 0.876805 | 4.734478 |
c90ccab5-f24c-4df8-b101-0e9b93fbdcdd | chirantan-basu01/LeetCode-I | interleaving-string/interleaving-string.cpp | class Solution {
public:
int t[101][101];
bool lcs(string s1,string s2,string s3,int n1,int n2,int n3){
if(t[n1+1][n2+1]!=-1){
return t[n1+1][n2+1];
}
if(n1<0 and n2<0){
return t[n1+1][n2+1]=true;
}
if(n1<0){
if(s2[n2]==s3[n3]){
... | ALGO | 0.999916 | 5.939008 |
8406a920-dfbd-4b1d-bfe9-dbe9eb905ca9 | adarsh4j/100-DAYS-OF-CODING | Day35/Sum.cpp | #include<iostream>
#include<string.h>
using namespace std;
int main()
{
char str[100];
int i,sum = 0;
cout<<"Enter a string: ";
cin>>str;
for (i= 0; str[i] != '\0'; i++)
{
if ((str[i] >= '0') && (str[i] <= '9'))
{
sum += (str[i] - '0');
}
}
cout<<"Sum is: "<<sum;
return 0;
}
| ALGO | 0.998843 | 3.526966 |
3449d6eb-6b4c-4dfb-b6e0-ec270a0cdf8b | ashay1001/DSA-450 | 6. Binary Trees/1. Binary Tree Implementation and travaersal.cpp | #include<bits/stdc++.h>
using namespace std;
struct Node
{
int data;
struct Node *left;
struct Node *right;
Node(int val)
{
data = val;
left = NULL;
right = NULL;
}
};
Node* createNode(int val)
{
Node *newNode = new Node(val);
if(newNode == NULL)
{
... | ALGO | 0.999928 | 4.569523 |
b2116195-f0b4-411c-9b9e-26e639554735 | Hamza-ouabiba/Competitive-Programming | Codeforces/Div4/A/vlad_shapes.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int t;
int n;
cin>>t;
while(t--)
{
cin>>n;
string a[n];
for(int i=0;i<n;i++)
{
cin>>a[i];
}
int col=-1;
int row=-1;
for(int i=0;i<n;i++)
{
for... | ALGO | 0.999391 | 3.913564 |
b53c6bd5-2e7f-466f-95e0-7fff688f7fb2 | hack-parthsharma/LeetCode | 1995-count-special-quadruplets/1995-count-special-quadruplets.cpp | class Solution {
public:
int countQuadruplets(vector<int>& nums) {
int ans = 0, n = nums.size();
for (int a = 0; a < n - 3; ++a)
for (int b = a + 1; b < n - 2; ++b)
for (int c = b + 1; c < n - 1; ++c)
for (int d = c + 1; d < n; ++d)
... | ALGO | 0.999327 | 6.135998 |
cad05284-18f5-42fc-bc3f-a130d29e50a2 | easyhooon/BOJ_CODES | 1495.cpp | #include<iostream>
using namespace std;
int v[101];
bool d[101][1001];
int main() {
int n, s, m;
cin >> n >> s >> m;
for (int i = 1; i <= n; i++) {
cin >> v[i];
}
d[0][s] = true;
for (int i = 0; i < n; i++) {
for (int j = 0; j <= m; j++) {
if (d[i][j] == false) {
continue;
}
if (j - v[i + 1]... | ALGO | 0.999989 | 3.703549 |
8e16d46f-554b-4c28-910f-f51cb095ed86 | Kawchar-Ahammed/who-i-am | 3 Basic Data Structure/Module 12/Palindrome.cpp | #include<bits/stdc++.h>
using namespace std ;
class Node
{
public:
int val ;
Node * next ;
Node( int val )
{
this->val = val ;
this->next = NULL ;
}
} ;
void insert_tail(Node *& head, Node *& tail, int value )
{
Node * newNode = new Node(value) ;
if( head == NULL... | ALGO | 0.999986 | 4.018249 |
066708a1-4a2f-4a66-9fde-25013c792b54 | WhiteDOU/POJ | 狄杰斯特拉.cpp | #include <cstdio>
#include <iostream>
using namespace std;
struct E
{
int next;
int c;
};
vector<E> edge[101];
bool mark[101];
int dis[101];
int main()
{
int n, m;
while (cin >> n >> m)
{
if (n == 0 && m == 0)
break;
for (int i = 1; i <= n; ++i)
{
edge[i].clear();
}
while (m--)
{
int a, b, ... | ALGO | 0.999928 | 4.14041 |
2a2b886b-2547-47ac-bcd0-db2c8734858a | developertanvir2019/algorithm_with_cpp | week4_recap/assignment/Maze.cpp | #include <bits/stdc++.h>
using namespace std;
bool vis[1005][1005];
int dis[1005][1005];
pair<int, int> parent[1005][1005];
int n, m;
char a[1005][1005];
vector<pair<int, int>> d = {{0, 1}, {0, -1}, {-1, 0}, {1, 0}};
bool valid(int i, int j) {
return (i >= 0 && i<n && j>=0 && j<m && a[i][j] != '#' && !vis[i][j]);... | ALGO | 0.999771 | 4.647202 |
f27ddc8e-78b6-4b69-a25d-24971a7cbbf3 | cmlibs/zinc | src/general/matrix_vector.cpp | /*******************************************************************************
FILE : matrix_vector.c
LAST MODIFIED : 16 November 2004
DESCRIPTION:
Code for performing vector calculations - normalize, dot product etc. -, and
matrix calculations - multiplication, LU decomposition etc. - on small matrices.
Data form... | ALGO | 0.999183 | 4.799179 |
c572aa71-1428-4c62-be47-c02942767777 | EricTtTtT/Functionally-Reduced-And-Inverter-Graph | src/sat/test/satTest.cpp | #include <iostream>
#include <vector>
#include "sat.h"
using namespace std;
class Gate
{
public:
Gate(unsigned i = 0): _gid(i) {}
~Gate() {}
Var getVar() const { return _var; }
void setVar(const Var& v) { _var = v; }
private:
unsigned _gid; // for debugging purpose...
Var _var;
};
//
/... | ALGO | 0.999478 | 6.751188 |
d48bac99-7091-4b58-9acb-f1efac11a46d | NurMuhammadCSE/basic-data-structure-and-problem-solving-2 | 10-bst-heap-and-priority/36-binary-search-tree/1-intro-to-binary-tree.cpp | #include<bits/stdc++.h>
using namespace std;
class treeNode
{
public:
int data;
treeNode* leftChild;
treeNode* rightChild;
treeNode(int value)
{
data = value;
leftChild = NULL;
rightChild = NULL;
}
};
void printTree(treeNode* root, int level);
void spacePrint(int level... | ALGO | 0.99999 | 5.40939 |
b4c3acdd-2974-4235-af40-94965d2df967 | thanhlnbka/deepstream-sample-apps | deepstream-6.1.1/sources/libs/nvdsinfer_customparser/nvdsinfer_customclassifierparser.cpp | #include <cstring>
#include <iostream>
#include "nvdsinfer_custom_impl.h"
/* This is a sample classifier output parsing function from softmax layers for
* the vehicle type classifier model provided with the SDK. */
/* C-linkage to prevent name-mangling */
extern "C"
bool NvDsInferClassiferParseCustomSoftmax (std::ve... | DATA | 0.876006 | 6.437058 |
a5ed9a34-ba77-4cdf-89b7-65ba1a6e8c70 | Rkrohit371/DynamicProgrammic | Buy_Sell_k_transactions.cpp | #include<bits/stdc++.h>
using namespace std;
int func(vector<int>&arr, int n, int k){
int dp[k+1][n];
for(int i=0;i<=k;i++){
for(int j=0;j<n;j++){
if(i==0 || j==0){
dp[i][j] = 0;
} else {
int maxv = 0;
for(int p=0;p<j;p++){
... | ALGO | 0.999962 | 3.971045 |
d331effc-d53a-4ff9-9ae5-6e5456c9b646 | algo-study-embedded-21/algorithm-study | sohee/32_dice_and_yut.cpp | #include <iostream>
#include <vector>
using namespace std;
int cmd[10];
int arr[10];
int maxvalue;
int map[4][21] = {
{0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40},
{10, 13, 16, 19, 25, 30, 35, 40},
{0, 20, 22, 24, 25, 30, 35, 40},
{30, 28, 27, 26, 25, 30, 35, 40}
};
int n[4] = { ... | ALGO | 0.999964 | 3.978832 |
576ffdcd-f68d-4431-9117-0474ce453021 | ck89119/Algorithm | UVa/590.cpp | #include <bits/stdc++.h>
using namespace std;
#define dump(x) cerr << __LINE__ << " : "<< #x << " = " << (x) << endl
#define clr(a, x) memset(a, x, sizeof(a)) //0:0, -1:-1, INF:0x3f, -INF:0xc0
#define mp(a, b) make_pair(a, b)
#define pb(a) push_back(a)
#define lson l, m, rt << 1
#define rson m + 1, r, rt << 1 | 1
#... | ALGO | 0.999785 | 3.679577 |
efe89b0b-6df6-4e17-a3e7-09d781e19f28 | ashish-jha-73/CodeCrucible | Sum_of_Arrays.cpp | #include<bits/stdc++.h>
using namespace std;
typedef long double ld;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<char> vc;
typedef pair<int, int> pii;
typedef pair<int, char> pic;
#define fl(i, j) for(int i{0}; i<j; i++)
#define fb(i, j, k) for (int i{j}; i>=k; i--)
#define fn(i... | ALGO | 0.999816 | 3.760759 |
6e53818e-d63d-4393-adee-e98fdab2b44c | divyanshuvats10/K22SN_12218673_Week1 | Lecture3_1.cpp | #include <iostream>
using namespace std;
int main() {
//Declare 2 variables and then assign them values of 3,5 and then add them.
int a=3;
int b=5;
// a=3;
// b=5;
// int c;
// c=a+b;
cout<<a+b<<endl<<"a+b";
cout<<a+b;
cout<<endl;
cout<<"a+b";
return 0;
}
| ALGO | 0.982357 | 3.312502 |
27d21495-d84d-4696-a7a4-6782c0dc2a67 | 113bommy/deepmind_codecontests_refine | cpp_source_filter_file/cpp_train_11807_5.cpp | #include <bits/stdc++.h>
using namespace std;
int memo[105][105];
vector<int> de, at;
int C[105];
int N, M, pw;
string tp;
int dp(int X, int Y) {
if (X < 0 || Y < 0) return 0;
if (memo[X][Y] != -1) return memo[X][Y];
int res = dp(X, Y - 1);
if (C[X] > at[Y]) res = max(res, dp(X - 1, Y - 1) + C[X] - at[Y]);
re... | ALGO | 0.999897 | 3.93377 |
7a01ac3e-fcdf-4d31-b292-10078e48b638 | laquythi/laquythi.github.io | C++/29-HocWhile/main.cpp | #include <iostream>
using namespace std;
/* run this program using the console pauser or add your own getch, system("pause") or input loop */
int main(int argc, char** argv) {
int n;
int sum=0;
int i=1;
cout<<"moi ban nhap 1 so:";
cin>>n;
while(i<=n){
sum+=i; //sum=sum+i;
i=i+1; //i++;
}
cout<<"sum="<<sum;... | ALGO | 0.999678 | 3.570053 |
7cc3d840-9843-418e-b4aa-51f6c6b417b3 | abh253/codeforces | contests/#856/C_Scoring_Subsequences.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;
template<class T>
using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update> ;
template<typename T>
using ordered_multiset = tree<T... | ALGO | 0.99998 | 4.067639 |
8caec3c3-ea12-4481-82de-359ba0f68277 | Deng-yl/work_D | opencv-4.11.0/samples/cpp/tutorial_code/ImgTrans/generalizedHoughTransform.cpp | /**
@file generalizedHoughTransform.cpp
@author Markus Heck
@brief Detects an object, given by a template, in an image using GeneralizedHoughBallard and GeneralizedHoughGuil.
*/
#include "opencv2/highgui.hpp"
#include "opencv2/imgproc.hpp"
using namespace cv;
using namespace std;
int main() {
//! [generali... | ALGO | 0.963709 | 5.409581 |
3e0e3b43-ae69-441b-8710-5b0fc3cfe626 | Akshat005Chaudhary/OS-LAB | Dont forget your Fork/prg3.cpp | /*
Creating Multiple Child Processes
You can use fork() multiple times to create more than one child process.
This program demonstrates how to create two child processes.
*/
/*
#include <stdio.h>
#include <unistd.h>
#include <sys/wait.h>
int main() {
pid_t pid1 = fork();
if (pid1 < 0) {
printf("F... | ALGO | 0.993663 | 4.88457 |
4d3d4326-60c0-465e-a20d-d959fad6627c | sommerlukas/llvm-offload-jetson | libcxx/benchmarks/algorithms.partition_point.bench.cpp | #include <array>
#include <algorithm>
#include <cassert>
#include <cstdint>
#include <tuple>
#include <vector>
#include "benchmark/benchmark.h"
#include "CartesianBenchmarks.h"
#include "GenerateInput.h"
namespace {
template <typename I, typename N>
std::array<I, 10> every_10th_percentile_N(I first, N n) {
N step... | TEST | 0.868182 | 7.10622 |
0aaf5be0-2b9b-48aa-adb3-9e0c2c30374f | KarlaSalamun/ML_basics | test_functions/RosenbrockFunction.cpp | //
// Created by karla on 24. 10. 2019..
//
#include <cmath>
#include "RosenbrockFunction.h"
double RosenbrockFunction::get_value( std::vector<double> args )
{
double sum = 0;
for (auto i=0; i<args.size()-1; i++) {
sum += ( 100 * pow( ( args[i+1] - pow( args[i], 2 )), 2 ) + pow( (1-args[i]), 2 ));
... | ALGO | 0.92055 | 5.363557 |
93881e34-2f20-4213-947b-9a6aea99602a | mattloulou/Leetcode-Question-Solutions | 2130. Maximum Twin Sum of a Linked List.cpp | #include <vector>
using namespace std;
// Definition for singly-linked list.
struct ListNode {
int val;
ListNode *next;
ListNode() : val(0), next(nullptr) {}
ListNode(int x) : val(x), next(nullptr) {}
ListNode(int x, ListNode *next) : val(x), next(next) {}
};
class Solution {
public:
int pairSu... | ALGO | 0.999875 | 5.412106 |
4dba78bc-876c-4ccb-b811-109a2b0a31d0 | epeshk/TextIOBenchmarks | PlainTextIOBenchmarks/sources/echo_d/cin_untie.cpp | #include <iostream>
#include <ios>
using namespace std;
int main()
{
cin.tie(NULL);
int t;
cin >> t;
for (int i = 0; i < t; ++i) {
double a, b, c, d;
cin >> a >> b >> c >> d;
cout << a << ' ' << b << ' ' << c << ' ' << d << '\n';
}
} | ALGO | 0.851515 | 3.308416 |
26bb0128-f7dc-4ca8-a81a-e93027bc0318 | ZhongZeng/Leetcode | lc653twSumBST.cpp |
/*
653. Two Sum IV - Input is a BST
Related Topics: Tree
Similiar Questions: Two Sum, Two Sum II - Input array is sorted, Two Sum III - Data structure design
Test Cases:
[5,3,6,2,4,null,7]
9
[1,0,4,-2,null,3]
7
[1]
1
Runtime: 20 ms, faster than 98.17% of C++ online submissions for Two Sum IV - Input is a BST.
*/
... | ALGO | 0.999999 | 6.730441 |
101f9660-a045-4e56-b345-a04f33403bf5 | arsgsg1/ProblemSolving | BOJ/11055/main.cpp | #include <iostream>
#include <algorithm>
using namespace std;
#define MAX_SIZE 1001
int N;
int arr[MAX_SIZE];
int dp[MAX_SIZE];
int main()
{
cin >> N;
int answer = 0;
for (int i = 1; i <= N; i++)
scanf("%d", &arr[i]);
for (int i = 1; i <= N; i++) {
dp[i] = arr[i];
for (int j = 1; j < i; j++) {
if (arr[j] <... | ALGO | 0.999908 | 3.75203 |
19ee8d6a-9609-4ce9-a39b-d2fd6d81747a | zenki209/DSA-Framework-and-LeetCode | LeetCode Solving/Logic/maxProfit.cpp | class Solution {
public:
int maxProfit(vector<int>& prices) {
int maxProf = 0;
int minPrice = prices[0];
for(int i = 1; i < prices.size(); i++){
maxProf = max(maxProf, prices[i] - minPrice);
minPrice = min(minPrice, prices[i]);
}
return maxProf;
}
}; | ALGO | 0.999726 | 6.213139 |
767c24a1-0748-4014-9929-121fed72fd62 | JonathonMacleod/Distributed-Game-Architecture | libs/BOOST1.82.0/libs/msm/doc/PDF/examples/Orthogonal-deferred2.cpp | #include <iostream>
// back-end
#include <boost/msm/back/state_machine.hpp>
//front-end
#include <boost/msm/front/state_machine_def.hpp>
#include <boost/msm/front/functor_row.hpp>
namespace msm = boost::msm;
namespace mpl = boost::mpl;
using namespace boost::msm::front;
namespace
{
// events
struct play {};
... | TOOL | 0.898791 | 7.327089 |
55d24265-75c3-4f8d-b81c-0a12128ef831 | mrsu-ru/2021-203 | chernovaaa.cpp | #include "chernovaaa.h"
/**
* Введение в дисциплину
*/
void chernovaaa::lab1()
{
cout << "Hello World!";
}
/**
* Метод Гаусса с выбором главного элемента
*/
void chernovaaa::lab2()
{
for(int i = 0; i < N; i++)
{
int m = i;
for (int j = i+1; j < N; j++)
{
if (abs(A[j... | ALGO | 0.999851 | 3.102894 |
63461a4f-5de2-43d4-a86f-7026b43707ea | mlverse/cuda.ml | src/tsne.cpp | #include "tsne.h"
// [[Rcpp::export(".tsne_fit")]]
Rcpp::NumericMatrix tsne_fit(
Rcpp::NumericMatrix const& x, int const dim, int const n_neighbors,
float const theta, float const epssq, float const perplexity,
int const perplexity_max_iter, float const perplexity_tol,
float const early_exaggeration, float con... | ALGO | 0.999261 | 6.267755 |
3ecb3ed0-bfb9-4168-a92e-a54ced15effa | Vydami/Arduino | libraries/MAX30100lib/src/MAX30100_BeatDetector.cpp | #include <Arduino.h>
#include "MAX30100_BeatDetector.h"
#ifndef min
#define min(a,b) \
({ __typeof__ (a) _a = (a); \
__typeof__ (b) _b = (b); \
_a < _b ? _a : _b; })
#endif
BeatDetector::BeatDetector() :
state(BEATDETECTOR_STATE_INIT),
threshold(BEATDETECTOR_MIN_THRESHOLD),
beatPeriod(0),
... | TOOL | 0.935307 | 6.760785 |
f1b2e43d-a52c-46d0-97a1-9de1124013bc | seotosps/ps | PS_Study/182.cpp | /*
Prob No.182 : Ʈ [CH02.2.Algorithm(Design)]
Time Limit(Test case) : 1000(ms)
Total Submit : 640 Accepted : 203
Background
n Է¹Ƽ n Ǵ ٸ Ʈ ϴ α ۼϽÿ.
3 2 Ʈ ̴.
Input
n Էµȴ. ( n 20̸ ̴.)
Output
n ִ ٸ 2 Ʈ Ѵ.
IO Example
Է
3
5
*/
#include<cstdio>
int d[21]={1,1},n,c,j,i,sum;
int main(){
scanf("%d",... | ALGO | 0.999993 | 4.040904 |
4b0cb307-31fa-4bc3-9bbb-adb93fe60984 | leokang123/Algorithm | 2.7.해시/회있사.cpp | #include <bits/stdc++.h>
using namespace std;
int main (void) {
cin.tie(nullptr)->sync_with_stdio(false);
vector<string> s;
int n; cin >> n;
for (int i = 0 ; i < n ; i++) {
string a, b; cin >> a >> b;
s.push_back(a);
}
sort(s.rbegin(), s.rend());
for(int i = 0 ; i < n ; i++) {
if (i + 1 < n &... | ALGO | 0.999969 | 4.196633 |
686b7a74-54a2-4117-b417-11737963333a | Chaaany/SSafy_15_BESTTEAM | 20240823/백준/오석호_S1_14426_접두사_찾기.cpp | #include <iostream>
#include <string>
#include <unordered_map>
using namespace std;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
// 14426 접두사 찾기
// 브루트포스
int n, m;
string s;
unordered_map<string, bool> chk; // 체크용 map
cin >> n >> m;
for (int i = 0; i < n; ++i) {
cin >> s;
... | ALGO | 0.999851 | 4.512734 |
9a81de60-981c-4775-aae0-33c1782d4cc3 | priyanshpsalian/SEM-4 | AOA/PRACTICALS/2.cpp | #include <iostream>
using namespace std;
int main()
{
int a,k;
cout << "Enter the no of elements you want to sort:-";
cin >> a;
const int n = a;
int arr[n];
cout << "Enter the elements you want to sort:-";
for (int i = 0; i < n; i++)
{
cin >> arr[i];
}
for (int i = 1; ... | ALGO | 0.999855 | 4.112808 |
77b39b01-c50f-4139-b07b-e9fd510e414c | Fang0105/APCSpractice | tcircjudge/d101.cpp | #include<bits/stdc++.h>
#define int long long
#define endl '\n'
#define ull unsigned long long
#define IL(X) ((X)*2+1)
#define IR(X) ((X)*2+2)
using namespace std;
int MAX = LONG_MAX;
int MIN = LONG_MIN;
int n,k;
signed main(){
ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
cin>>n>>k;
int arr[n];
fill(arr,arr+n,-... | ALGO | 0.999873 | 3.889412 |
bd8d455f-1356-403b-83b3-496c1e3f57f1 | santhoshkumr96/youtube | search/binarysearchtree.cpp | /*
Tech videos in Tamil @ Santhosh Subramaniam youtube channel
Channel link : https://www.youtube.com/channel/UCdpGuJetVhKzinbgM80B1ow
*/
#include <bits/stdc++.h>
using namespace std;
int binarySearch(int a[], int low, int high, int value){
while(low <= high){
int mid = (low+high) / 2;
if(a[mid... | ALGO | 0.99961 | 5.731751 |
7510d9bb-43a8-429e-9efd-7bfc009ff8eb | Ravi-Khatri/code | codeforce/practice/MASH_2.00/C.cpp | #include<bits/stdc++.h>
#define ll long long
#define vi vector<int>
#define vll vector<ll>
#define F first
#define S second
#define pb push_back
#define f(i,s,n) for(int i=(int)s;i<=(int)n;++i)
#define Fast ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0);
using namespace std;
void solve()
{ int n;cin>>n;
string a,... | ALGO | 0.999954 | 3.398557 |
171f1f4e-06a6-43fa-a84b-2845ef0f3da3 | wsscottca/routing_map_project | src/route_planner.cpp | #include "route_planner.h"
#include <algorithm>
#include <iostream>
RoutePlanner::RoutePlanner(RouteModel &model, float start_x, float start_y, float end_x, float end_y): m_Model(model) {
// Convert inputs to percentage:
start_x *= 0.01;
start_y *= 0.01;
end_x *= 0.01;
end_y *= 0.01;
// TO... | ALGO | 0.991717 | 4.849683 |
ffc6e43f-7586-498b-9768-51a3eca43c26 | AlessandroBarbiero/ROS-Robotics-first-project | src/BaselineCalculator.cpp | #include "ros/ros.h"
#include "project_1/Speed.h"
#include "nav_msgs/Odometry.h"
#include "std_msgs/Float64.h"
#include <message_filters/subscriber.h>
#include <message_filters/sync_policies/approximate_time.h>
class BaselineCalculator
{
private:
ros::NodeHandle n;
double gearRatioSum;
int count;
messa... | TOOL | 0.915464 | 4.964982 |
ed506990-e190-4e5a-a3b7-330481f16214 | juno7803/Algorithm | Math/quick sort.cpp | #include <iostream>
using namespace std;
void quickSort(int* data, int start, int end);
int main()
{
return 0;
}
void quickSort(int* data, int start, int end)
{
if (start >= end)
{
return;
}
}
| ALGO | 0.99938 | 4.799776 |
33acd4fd-a716-42aa-93d7-e08ffc2faf17 | hades/aoc2015 | third_party/boost/libs/graph/test/weighted_matching_test.cpp | #include <boost/graph/max_cardinality_matching.hpp>
#include <boost/graph/maximum_weighted_matching.hpp>
#include <iostream>
#include <fstream>
#include <sstream>
#include <boost/graph/adjacency_list.hpp>
#include <boost/graph/adjacency_matrix.hpp>
#include <boost/core/lightweight_test.hpp>
using namespace boost;
ty... | TEST | 0.998081 | 6.009471 |
a5a3e970-a4b5-4ef4-9337-3fd18a22f925 | Entye12/CSES | Cpp/Dynamic Programming/Coin_Combinations1.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int n,x,c; const ll MOD=1e9+7;
vector<ll> dp {1}; set<ll> coins;
int main(){
scanf("%d %d",&n,&x);
for (int i=1;i<=n;i++){
scanf("%d",&c);
coins.insert(c);
}
for (int i=1;i<=x;i++){
ll a = 0;
for (const... | ALGO | 0.999984 | 4.066103 |
3ea1bfe0-0e53-4834-8f8f-77cedc855f3a | masoudbehzadinasab/Trilinos_12_11 | packages/fei/test_utils/HexBeamCR.cpp | /*--------------------------------------------------------------------*/
/* Under the terms of Contract DE-AC04-94AL85000, there is a */
/* of the U.S. Government. Export of this program may require */
/*--------------------------------------------------------------------*/
#include <fei_macros.hpp... | TOOL | 0.882875 | 5.441043 |
8a305806-de48-4aca-b21c-d668891c6673 | FZU-GummyBear/Dream | Team_Training/54、2011 ICPC 成都/code/j.cpp | #include<bits/stdc++.h>
using namespace std;
#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define rep(i, a, b) for(int i = (a); i < (b); ++i)
#define per(i, a, b) for(int i = (b) - 1; i >= (a); --i)
#define de(x) cout << #x << " = " << x << endl
#define dd(x) cout << #x << " = " << x << ... | ALGO | 0.999883 | 3.555268 |
4c932680-d1c2-4b0e-8ea5-7e127eac1097 | deepak04112002/DSA | Array/RearrangeArrayElementsbySign.cpp | //Leetcode//time-O(n)//space-O(n);
class Solution {
public:
vector<int> rearrangeArray(vector<int>& nums) {
vector<int>ans(nums.size(),0);
int pos=0;
int neg=1;
for(int i=0;i<nums.size();i++){
if(nums[i]>0){
ans[pos]=nums[i];
pos+=2;
}
el... | ALGO | 0.999886 | 5.793664 |
cc5cf39a-d225-4036-af81-2563e7c98b01 | ZHENZHI76/CPP_OJ_exercise | C++算法编程课C2a/5.高精度算法减除/高精度除法_高精除低精.cpp | #include <iostream>
#include <cstring>
using namespace std;
char s1[1005];
int a[1005], len_a;
int b;
int ans[1005], len_ans;
int main() {
cin >> s1 >> b;
len_a = strlen(s1);
for(int i = 0; i < len_a; i++) {
a[len_a - i - 1] = s1[i] - '0';
}
if(b == 0) {
cout << "除数不能为0" << endl;
... | ALGO | 0.999952 | 3.727775 |
8fce568d-7fac-4fbc-ac28-54bcd3d95e05 | embededdrive/Algorithm | C++/Mincoding/starter_training_08.cpp | #include <iostream>
using namespace std;
int main()
{
char a, b, c, *pa, *pb, *pc;
cin >> a >> b >> c;
pa = &a;
pb = &b;
pc = &c;
if (*pa > *pb && *pa > *pc)
{
cout << *pa;
}
else if (*pb > *pa && *pb > *pc)
{
cout << *pb;
}
else {
cout << *pc;
}
return 0;
} | ALGO | 0.999662 | 3.614528 |
fc357013-c2ad-4eb3-84cb-4cfd60dcbb0b | zhonyu555/PrusaSlicer | src/libigl/igl/edge_collapse_is_valid.cpp | IGL_INLINE bool igl::edge_collapse_is_valid(
const int e,
const Eigen::MatrixXi & F,
const Eigen::MatrixXi & E,
const Eigen::VectorXi & EMAP,
const Eigen::MatrixXi & EF,
const Eigen::MatrixXi & EI)
{
using namespace Eigen;
using namespace std;
// For consistency with collapse_edge.cpp, let's determine... | ALGO | 0.99604 | 6.341059 |
18ef8dbb-9142-478f-840b-ad3b90a4f61e | guilhermesvm/data-structures-cpp | data-structures-I/7-ex-sort/ordenacao.cpp | #include <utility>
template <typename T>
void selectionsort(T vet[], int n) {
while (n > 1) {
T maior = vet[0];
int pos = 0;
for (int i = 1; i < n; i++) {
if (vet[i] > maior) {
maior = vet[i];
pos = i;
}
}
std::swap(vet[n - 1], vet[pos]); // trocar vet[n-1] com vet[p... | ALGO | 0.999412 | 5.391321 |
848095ed-be3d-479d-95e0-ef720b307b03 | webaverse-studios/moemate-avatar-wasm | physx/source/geomutils/src/sweep/GuSweepSphereCapsule.cpp | #include "GuSweepSphereCapsule.h"
#include "GuSphere.h"
#include "GuCapsule.h"
#include "GuDistancePointSegment.h"
#include "GuSweepSphereSphere.h"
#include "GuIntersectionRayCapsule.h"
using namespace physx;
using namespace Gu;
bool Gu::sweepSphereCapsule(const Sphere& sphere, const Capsule& lss, const PxVec3& dir, ... | ALGO | 0.986095 | 6.991693 |
09b9b779-43a6-4605-8e30-bfc3eeda5580 | princeofcrows/--cp | contest/cf/_v-1045-d2/A_Painting_With_Two_Colors.cpp | #include <bits/stdc++.h>
using namespace std;
// Data type
#define int long long
#define ll long long
#define pii pair<int, int>
#define piii pair<int, pii>
#define vi vector<int>
#define vll vector<long long>
#define vpi vector<pii>
#define mii map<int, int>
#define msi map<string, int>
#define si set<int>
#define s... | ALGO | 0.999131 | 3.999379 |
502f76fe-d2ea-4de8-a528-ffbb200555f3 | NaviHX/LeetNote | hard/1335/solution.cpp | #define INF (0x7fffffff-1001)
class Solution {
public:
int minDifficulty(vector<int>& jobDifficulty, int d) {
int n=jobDifficulty.size();
if(n<d) return -1;
vector<vector<int>> dp(d,vector<int>(n,INF));
int m=0;
for(int i=0;i<n;i++)
{
m=max(m,jobDifficulty... | ALGO | 0.999945 | 6.159397 |
80ef620b-adb7-4ad7-8d7e-24cc0e82246d | Digit24-dev/algorithm | Quiz/BJ/삼성SW/14503 로봇 청소기.cpp | #include <iostream>
#include <vector>
#include <stack>
using namespace std;
#define MAX 51
int n, m;
int r, c;
int d;
int answer = 1;
int map[MAX][MAX];
int visited[MAX][MAX];
//
int dc[] = {0, 1, 0, -1};
int dr[] = {-1, 0, 1, 0};
// +1 : ð, -1: ݽð
void dfs(int r, int c, int d, int ans) {
visited[r][c] = true... | ALGO | 0.999803 | 4.524976 |
b93ed1ae-bada-4b72-8122-0b89a0cb8294 | marqueswill/beecrowd | iniciante/BEE 2987.cpp | #include <iostream>
#include <string>
using namespace std;
int main() {
string letra;
cin >> letra;
int num = (int)letra[0] - 64;
cout << num << endl;
return 0;
} | ALGO | 0.992447 | 3.42463 |
0db7cf7d-c83b-432b-9a5e-b6966d8c7dad | yingziyu-llt/program_in_univ | intro_of_comp/11.15/15.cpp | #include<stdio.h>
#include<algorithm>
#include<string.h>
#include<math.h>
using namespace std;
int reverse(int n)
{
int res = 0;
while(n != 0)
res = res * 10 + n % 10,n /= 10;
return res;
}
int main()
{
#ifdef llt
freopen("15.in","r",stdin);
freopen("15.out","w",stdout);
#endif
int n;
scanf("%d",&n);
for(in... | ALGO | 0.99982 | 3.064562 |
d04f170e-ff00-4f0c-9b6a-e0bb0467698d | RISHABH-GUPTA-RG/50daysDSAChallenge | Day026-030/Day27_LeetCode_53.cpp | class Solution {
public:
int maxSubArray(vector<int>& nums) {
int curMax = 0, maxTillNow = INT_MIN;
for(auto c : nums)
curMax = max(c, curMax + c),
maxTillNow = max(maxTillNow, curMax);
return maxTillNow;
}
}; | ALGO | 0.999901 | 6.354255 |
d9bfbd36-b019-4932-8844-2e80989fcaa2 | pritam1293/CP | Codeforces/2106D.cpp | #include<bits/stdc++.h>
using namespace std;
void solve();
int main() {
ios_base::sync_with_stdio(0); cin.tie(0);
#ifndef ONLINE_JUDGE
freopen("../input.txt", "r", stdin);
freopen("../output.txt", "w", stdout);
#endif
int t=1;
cin>>t;
while(t--) solve();
cerr << "time: " << (float)clock() /... | ALGO | 0.999992 | 3.829079 |
48e1d060-d998-4fde-96f0-217a54c6b26f | 113bommy/deepmind_codecontests_refine | cpp_source_filter_file/cpp_train_3491_18.cpp | #include <bits/stdc++.h>
#pragma GCC target("sse4.2")
using namespace std;
bool home = 1;
signed realMain();
signed main() {
home = 0;
if (home) {
freopen("tony_stark", "r", stdin);
} else {
ios::sync_with_stdio(0);
cin.tie(0);
}
realMain();
}
const int M = (int)1e9 + 7;
int add(int a, int b) {
... | ALGO | 0.999864 | 4.791984 |
06f26c40-2ac9-4958-a1b2-e0f3effaa76d | C5Hwang/Online-Judge-Solutions | POJ/POJ3270.cpp | #include <stdio.h>
#include <stdlib.h>
#include <algorithm>
#define DEBUG printf("Passing [%s] in Line %d\n" , __FUNCTION__ , __LINE__) ;
const int MAX_N = 1e4 + 10 , INF = 0x3f3f3f3f ;
struct data {int num , bh ;}t[MAX_N] ;
bool ap[MAX_N] ;
int n , ans , len , mn , MN , eg[MAX_N] ;
void dfs(int x) {
if (ap[x]) r... | ALGO | 0.999977 | 3.358141 |
1294e812-ef91-4eee-a907-0fbbd69212da | vinodrajwaniya/Assignment---23 | 6.cpp | #include<iostream>
using namespace std;
int main()
{
int x,y,z;
float avg;
cout<<"Enter three number ";
cin>>x>>y>>z;
avg=(x+y+z)/3;
cout<<"Average of 3 numbers is "<<avg;
return 0;
} | TOOL | 0.8582 | 3.507463 |
3fb15a94-4c7f-4338-ad6f-f9a5da40dcc8 | dragon-tc-tmp/llvm-project | clang-tools-extra/clang-include-fixer/find-all-symbols/tool/FindAllSymbolsMain.cpp | #include "FindAllSymbolsAction.h"
#include "STLPostfixHeaderMap.h"
#include "SymbolInfo.h"
#include "SymbolReporter.h"
#include "clang/ASTMatchers/ASTMatchFinder.h"
#include "clang/ASTMatchers/ASTMatchers.h"
#include "clang/Frontend/CompilerInstance.h"
#include "clang/Frontend/FrontendActions.h"
#include "clang/Lex/Pre... | TOOL | 0.967213 | 7.603081 |
0bf41a0f-540b-4875-9a0f-e231fb6dbab5 | achrafoo2018/Competitive_Programming_Contests | codeforces/ahspcpc21/h.cpp | #include "bits/stdc++.h"
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<bool> vb;
typedef vector<char> vchr;
typedef vector<string> vstr;
typedef vector<vi> vvi;
typedef vector<vchr> vvchr;
typedef vector<ll> vll;
typedef vector<pi... | ALGO | 0.999847 | 3.852031 |
c771f495-aefa-40df-982b-0526191b80fc | jycoast/algorithm-wiki | source-code/cpp/101.symmetric-tree.cpp | #include "node.h"
using namespace std;
/*
* @lc app=leetcode.cn id=101 lang=cpp
*
* [101] Symmetric Tree
*/
// @lc code=start
/**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode() : val(0), left(nullptr), right(nullptr) {}
... | ALGO | 0.999747 | 6.701823 |
e213398c-8153-4295-a1b1-90d9f90722ec | hanriiver/algorithm | step solved/9012.cpp | #include <iostream>
#include <vector>
#include <queue>
#include <algorithm>
#include <stdio.h>
#include <stack>
using namespace std;
int main() {
ios_base::sync_with_stdio(false), cin.tie(NULL);
int T;
cin >> T;
while (T--) {
stack<char> st;
string s;
cin >> s;
for (int i = 0; i < s.size(); i++) {
if (s... | ALGO | 0.999833 | 5.033194 |
c84cf77c-a0d6-4e6e-a29b-6b916a00dc94 | AshvinBa/CPP_Programs-2 | recursion/check_sortde_or_not.cpp | #include <iostream>
using namespace std;
bool func(int *arr, int n)
{
if (n == 0 || n == 1)
return true;
if (arr[0] > arr[1])
{
return false;
}
else
{
bool remain = func(arr + 1, n - 1);
}
}
int main()
{
int arr[] = {2, 4, 51, 16, 27, 8, 9};
int n = sizeof(ar... | ALGO | 0.999969 | 4.55495 |
a17254c9-1ece-4b61-88a1-c52bd6c2e9f5 | CFOP2357/verano-2020-progra-competitiva | IV Icesi training camp 2020/dia 1/A.cpp | #include <bits/stdc++.h>
using namespace std;
int v[105];
int main(){
int n;
cin>>n;
for(int i=0; i<n; i++)
cin>>v[i];
int fO=v[0], sO;
for(int i=0; i<n; i++){
if(v[i]<fO)
fO=v[i];
}
sO=fO;
for(int i=0; i<n; i++){
if(sO==fO)
sO=v[i];
... | ALGO | 0.999991 | 3.793573 |
2d8a140b-a026-495d-bbf6-4cf928705452 | SCUT-CCNL/3DSIFT | 3DSIFT/3party/Eigen/bench/benchmarkXcwise.cpp | // g++ -O3 -DNDEBUG benchmarkX.cpp -o benchmarkX && time ./benchmarkX
#include <iostream>
#include <Eigen/Core>
using namespace std;
using namespace Eigen;
#ifndef VECTYPE
#define VECTYPE VectorXLd
#endif
#ifndef VECSIZE
#define VECSIZE 1000000
#endif
#ifndef REPEAT
#define REPEAT 1000
#endif
int main(int argc, c... | ALGO | 0.949877 | 3.907753 |
0ca7ab6e-1ac8-4200-81a1-b3031478b161 | lmaddira/MultiResolutionAstar | src/planner.cpp | #include "planner.h"
#include "visualisation.h"
#include "continousPlanner.h"
#include <GL/glut.h>
int main(int argc, char** argv)
{
Env_res env;
visualise vis;
vis.initialise();
// std::cout<< env.get_grid_x()<<" "<< env.get_grid_y()<<"\n";
env.grid_update();
point start(0,0,0);
point goal... | ALGO | 0.954626 | 3.584952 |
be51f4da-8688-478b-9f6c-1b116729f9c5 | PreethiHarshini21/CPP-Practice-Questions | P67ARRAYSsorting.cpp | // Bubble Sort
// if arr[i] > arr[i+1] swap them.To place the element in their respective position, we have to do the following operation N-1 times.
#include<iostream>
using namespace std;
int main(){
int n;
cout<<"enter size of data";
cin>>n;
int arr[n];
for (int i = 0; i < n; i++)
{
... | ALGO | 0.999721 | 4.920368 |
7157be9d-2667-4c8f-942c-87f0f1ed7e50 | anupam8nith/Leetcode | 0039-combination-sum/0039-combination-sum.cpp | class Solution {
public:
void findall(vector<vector<int>>&ans, vector<int> &candidates, vector<int> currVec, int idx, int sum, int target)
{
if (sum == target)
{
ans.push_back(currVec);
return;
}
if (idx > candidates.size() || sum > target) return;
f... | ALGO | 0.999964 | 6.184744 |
d23be8a6-5ba3-49c4-9eaf-9bf63e25553e | saumyasrivastava08/Important_Coding_Problems | Data Structures/T8-Recurssion/1.4 Is Palindrome.cpp | #include <iostream>
using namespace std;
bool isPalindrome(string str, int start, int end)
{
if(start >= end)
return true;
return ((str[start]==str[end]) &&
isPalindrome(str, start + 1, end - 1));
}
int main() {
string s;
cin>>s;
printf("%s", isPalindrome(s, 0, s.length() -1) ? "true" : "false");... | ALGO | 0.999929 | 4.950062 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.