uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
32ada9e7-a884-401c-bf91-8acdd60fe300 | VanillaNexusSource/android_frameworks_av | media/libstagefright/codecs/amrwb/src/median5.cpp | /*
------------------------------------------------------------------------------
Filename: median5.cpp
Date: 05/08/2007
------------------------------------------------------------------------------
REVISION HISTORY
Description:
-----------------------------------------------------------------------------... | ALGO | 0.999993 | 6.086952 |
d5ac16a8-2bfb-44e8-8363-2ab1cd83d2d0 | OpenTenBase/TXSQL | boost/boost_1_77_0/libs/program_options/src/split.cpp | #define BOOST_PROGRAM_OPTIONS_SOURCE
#include <boost/program_options/parsers.hpp>
#include <boost/tokenizer.hpp>
#include <string>
#include <vector>
namespace boost { namespace program_options { namespace detail {
template< class charT >
std::vector<std::basic_string<charT> >
split_unix(
const st... | TOOL | 0.888057 | 6.747805 |
5f7db538-37ad-4714-8c25-8fc3fa28d1cb | vkcode7/cpp | code/lambdas.cpp | #include <iostream>
// using Comparator = bool(*)(int, int);
template <typename T, int size, typename Comparator>
void Sort(T (&arr)[size], Comparator comp)
{
for (int i = 0; i < size - 1; ++i)
{
for (int j = 0; j < size - 1; ++j)
{
if (comp(arr[j], arr[j + 1]))
{
... | ALGO | 0.993077 | 5.045683 |
7d17b43c-0baf-47e8-a265-5c2418a242c9 | qualificationalitated/Start_git | Algorithm/2000~2999/2056/2056.cpp | #include <cstdio>
#include <iostream>
#include <vector>
#include <queue>
#define WORK 10002
using namespace std;
int workTime[WORK], prevWorkCnt[WORK];
int dp[WORK];
vector<int> workPriority[WORK];
queue<int> workList;
void setMaxTimeINdpArray()
{
while (!workList.empty())
{
int nowWork = workList.front... | ALGO | 0.999941 | 3.711456 |
ba02c4da-b3ff-4471-8792-80228b2c7cab | los-kenzo/android_frameworks_base | tools/split-select/Main.cpp | #include <algorithm>
#include <cstdio>
#include "aapt/AaptUtil.h"
#include "Grouper.h"
#include "Rule.h"
#include "RuleGenerator.h"
#include "SplitDescription.h"
#include "SplitSelector.h"
#include <androidfw/AssetManager.h>
#include <androidfw/ResourceTypes.h>
#include <utils/KeyedVector.h>
#include <utils/Vector.h... | TOOL | 0.978914 | 6.459566 |
b53ff0aa-c50b-4364-965d-b9578fcfd844 | YannCat/calculatrice_hp | src/main.cpp | #include "fonctions.hpp"
#include "affichage.hpp"
/* author : Maxime BELAVAL
* ON NE MODIFIE PAS MON CODE SANS ME PREVENIR ET SANS MON AUTORISATION.
* ON N'UTILISE PAS DE NAMESPACE STD.
*/
int main()
{
// std::string result, input;
std::cout << "Tests method : std::string resultByStack(std::string userInput... | TEST | 0.859268 | 3.689441 |
ebefa5e9-03e6-428b-8aa0-c90dbcfe5a6f | Manahil-ai/Nike_app | windows/runner/utils.cpp | #include "utils.h"
#include <flutter_windows.h>
#include <io.h>
#include <stdio.h>
#include <windows.h>
#include <iostream>
void CreateAndAttachConsole() {
if (::AllocConsole()) {
FILE *unused;
if (freopen_s(&unused, "CONOUT$", "w", stdout)) {
_dup2(_fileno(stdout), 1);
}
if (freopen_s(&unuse... | TOOL | 0.998733 | 6.76775 |
2adc06d5-37cc-4a1c-813b-9cf3b041a864 | lantimilan/topcoder | hacker_rank/worldcup/bishop-war.cpp | // bishop-war.cpp
#include <iostream>
#include <string>
#include <vector>
using namespace std;
int N, M;
vector<string> board;
int dp[12][1<<20];
// mask:
// 0 no attack
// 1 attack left
// 2 attack right
// 3 attack both
inline void set_bit(int &mask, int pos, int val) {
mask |= val << 2*pos;
}
inline void clea... | ALGO | 0.999925 | 3.921027 |
ee074faa-4580-4f71-8dbd-979e07b371ec | algorithm004-01/algorithm004-01 | Week 05/id_536/leetcode_120_536.cpp | #include <iostream>
#include <string.h>
#include <vector>
using namespace std;
class Solution {
public:
/******
ⷨ1DP
ʱ临ӶO(n*n)
*******/
int dp(vector<vector<int>>& triangle)
{
int n = triangle.size();//
if(n == 0)
return 0;
if(n == 1)
re... | ALGO | 0.999965 | 4.741144 |
957aa971-8ccd-44f0-9307-c33fbfe113b1 | tat-tvam-asii/Leetcode | 2646-kth-largest-sum-in-a-binary-tree/kth-largest-sum-in-a-binary-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.999976 | 5.839899 |
7bc50b9d-71f3-4c07-b8be-458a7ebcd6c0 | linuxemb/cpp_interview | linklist/kthnodefromback.cpp | #include <iostream>
using namespace std;
struct ListNode {
int val;
ListNode* next;
ListNode(int x):val(x), next(nullptr) {}
};
ListNode* findKthFromEnd(ListNode * head, int k) {
ListNode * fast = head;
ListNode * slow = head;
// move fast pointer to k steps ahead
for (int i =0; i < k; i++) {
if (!fas... | ALGO | 0.999699 | 5.15831 |
b52b4d7f-2a8d-4268-a20d-d6e2768b2e16 | Muhammad-Ibrar727/OOP | chapter 8 operator overloading/less than or equal to operator overloading.cpp | #include<iostream>
using namespace std;
class Distance {
private:
int feet;
int inches;
public:
Distance(int f = 0, int i = 0) {
feet = f;
inches = i;
}
bool operator<=(const Distance& d) {
if(feet < d.feet) {
return tr... | ALGO | 0.981607 | 3.380755 |
8403bc2c-937c-404b-a67b-9de0505dbf03 | danny-wang/leetcode | 242. Valid Anagram.cpp | /**
242. Valid Anagram
Given two strings s and t, write a function to determine if t is an anagram of s.
For example,
s = "anagram", t = "nagaram", return true.
s = "rat", t = "car", return false.
Note:
You may assume the string contains only lowercase alphabets.
Follow up:
What if the inputs contain unicode characters... | ALGO | 0.999769 | 6.340667 |
04a0064a-9d4f-4738-af5f-e2b340aa57a3 | err235wqw/RIP_BOT | University/C++/Course_1/Practise/Second_term/vector_list_1_15_b.cpp | #include <iostream>
#include <vector>
#include <list>
using namespace std;
int main() {
list<int> a = { 12, 34, 56, 78, 90 };
auto lastTwo = prev(a.end(), 2);
auto minElement = min_element(lastTwo, a.end());
a.erase(minElement);
for (int num : a) {
cout << num << " ";
}
return 0... | ALGO | 0.999236 | 4.291637 |
47064a7d-c7d8-4e00-8158-3258751a5db3 | Sourav61/DSA-Practice | GFG/Hard/PointsInStraightLine.cpp | // https://practice.geeksforgeeks.org/problems/points-in-straight-line/1
//{ Driver Code Starts
//Initial Template for C++
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
//Back-end complete function Template for C++
class Solution {
public:
int maxPoints(int X[], int Y[], int N) {
u... | ALGO | 0.999958 | 5.251652 |
93e57c88-b001-4e48-9753-75e1567b8d57 | jasdeep-batra/Leetcode-GFG-Problem-Solving | Shortest Uncommon Subsequence - GFG/shortest-uncommon-subsequence.cpp | // { Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution {
public:
int shortestUnSub(string S, string T) {
// code here
vector<vector<int>> dp(S.size()+1,vector<int>(T.size()+1,1000));
//f//or(int i=1;i<S.size()+1;i++)dp[i][0] = 1;
... | ALGO | 0.999956 | 5.955146 |
c5e95a0d-a0d2-43de-864a-277dfc41f3b5 | AnimezKishan/Data-Structures-and-Algorithm-Preparation | LeetCode/Graph/[C++] 2092. Find All People With Secret.cpp | // Dijkstra's Algorithm
class Solution {
public:
vector<int> findAllPeople(int n, vector<vector<int>>& meetings, int firstPerson) {
unordered_map<int, vector<pair<int, int>>> adj;
for(vector<int> &meeting: meetings){
int u = meeting[0];
int v = meeting[1];
int t... | ALGO | 0.999998 | 5.639928 |
131a4f4b-a34e-41f7-85f4-46e9609bda57 | wassimalharaki/Codeforces | 2000/TimetoRun.cpp | #include <bits/stdc++.h>
using namespace std;
#define int long long
#define nl '\n'
#define v vector
void solve() {
int n, m, k; cin >> n >> m >> k;
if (k > 4 * n * m - 2 * (n + m)) {
cout << "NO" << nl;
return;
}
v<pair<int, string>> ans;
if (m - 1)
ans.push_back({m - 1, ... | ALGO | 0.999949 | 4.663029 |
2af11377-a785-46b5-825f-4b5e7bbb5361 | vlsi-test-lab/OpenEDA | packages/eigen-eigen-323c052e1731/bench/benchVecAdd.cpp |
#include <iostream>
#include <Eigen/Core>
#include <bench/BenchTimer.h>
using namespace Eigen;
#ifndef SIZE
#define SIZE 50
#endif
#ifndef REPEAT
#define REPEAT 10000
#endif
typedef float Scalar;
__attribute__ ((noinline)) void benchVec(Scalar* a, Scalar* b, Scalar* c, int size);
__attribute__ ((noinline)) void be... | TOOL | 0.903524 | 5.142219 |
a69d1937-7274-46c8-bd43-94eb6c7f5139 | cpp-port/libmysql | extra/icu/icu-release-69-1/source/common/bytestriebuilder.cpp | #include "unicode/utypes.h"
#include "unicode/bytestrie.h"
#include "unicode/bytestriebuilder.h"
#include "unicode/stringpiece.h"
#include "charstr.h"
#include "cmemory.h"
#include "uhash.h"
#include "uarrsort.h"
#include "uassert.h"
#include "ustr_imp.h"
U_NAMESPACE_BEGIN
/*
* Note: This builder implementation stor... | TOOL | 0.957086 | 7.573488 |
53ef6ffb-63df-4f66-8e7e-e4ab931ff744 | dhawalmahajan/CPP-DSA-Practice | leet_code_problems/missing_number.cpp | /**
* Given an array containing n distinct numbers taken from 0, 1, 2, ..., n, find
* the one that is missing from the array.
*
* For example,
* Given nums = [0, 1, 3] return 2.
*/
#include <iostream>
#include <vector>
int missingNumber(std::vector<int>& nums) {
int missing_sum = 0;
for (auto n : nums) {
... | ALGO | 0.99898 | 6.515398 |
b51d5405-ecfc-4d3b-b8ec-4f4966fe803a | ishita41/cpp-codes | countbits.cpp | #include <iostream>
using namespace std;
int main() {
int n;
cin>>n;
int count=0;
while(n!=0){
if(n&1)
{
count++;
}
n=n>>1;
}
cout<<count;
} | ALGO | 0.999897 | 4.626542 |
cee1e33b-a0d9-472b-8db2-1b993b500634 | toughrogrammer/algo-train | dovelet/stair21/black-and-white.cpp | #include <iostream>
#include <stdio.h>
#include <vector>
#include <algorithm>
#define MAX_POINTS 101
#define INFINITE 99999
using namespace std;
class Pair {
public:
int start, end, height;
Pair(int start, int end) {
this->start = start;
this->end = end;
}
bool operator<(const ... | ALGO | 0.999923 | 3.312474 |
50873f28-81d4-4146-b43b-b5d930684aaf | BurningBeans/1091_Programming | S1093508_HW3/s1093508_hw3.cpp | #include<iostream>
#include<algorithm>
#include<vector>
using namespace std;
int main()
{
vector<int> nums;
int cases = 0;
int input = 0;
bool output = false;
cin >> cases;
for(int i = 0; i < cases; i++)
{
cin >> input;
nums.push_back(input);
}
sort(nums.begin(),nu... | ALGO | 0.99997 | 4.43062 |
9a195bc1-b5c9-4ae9-b9d2-c060889f405a | DenisLeonte/info-bac | 18/S3-3.cpp | #include <iostream>
using namespace std;
int count(float a[], int n)
{
float s = 0;
int k = 0;
for (int i = 0; i < n; i++)
s += a[i];
s /= n;
for (int i = 0; i < n; i++)
if (a[i] >= s)
k++;
return k;
}
int main()
{
return 0;
} | ALGO | 0.995107 | 3.196517 |
26953eda-97e1-4926-83cd-9aee570040c3 | Sacdeneu/Raven | VS2015/Common/fuzzy/FuzzySet_Singleton.cpp | #include "FuzzySet_Singleton.h"
double FuzzySet_Singleton::CalculateDOM(double val)const
{
if ( (val >= m_dMidPoint-m_dLeftOffset) &&
(val <= m_dMidPoint+m_dRightOffset) )
{
return 1.0;
}
//out of range of this FLV, return zero
else
{
return 0.0;
}
} | TOOL | 0.958974 | 4.314299 |
d33923d4-640e-4ec8-9d8f-a7d0746798b4 | 113bommy/deepmind_codecontests_refine | cpp_source_filter_file/cpp_train_9963_41.cpp | #include <bits/stdc++.h>
using namespace std;
const int N = 5e5 + 10;
int d[] = {0, 4, 10, 20, 35, 56, 83, 116, 155, 198, 244, 292, 341};
int main() {
ios::sync_with_stdio(false);
long long n;
cin >> n;
if (n <= 11) {
cout << d[n] << endl;
} else {
long long ans = 341;
cout << ans + (long long)(n ... | ALGO | 0.999871 | 4.092964 |
bc363c7e-c39d-4a94-907b-6f22896f3704 | SalahHassan202/dr_mostafa_saad_sheet_solved_by_cpp | A. Magnets.cpp | // A. Magnets
#include<iostream>
#include<string>
#include<algorithm>
using namespace std;
int main()
{
int num , counter = 1 ; cin >> num ;
int arr[100000]; // given in problem =====> n (1≤n≤100000)
for(int i =0 ; i < num ; i++)
{
cin>> arr[i] ;
}
for(int i =0 ; i< num-1 ; i++)
{
if(... | ALGO | 0.999892 | 3.959887 |
62b7a5ce-65ec-4739-bc65-ef436538d516 | vilve-aman/DataStructuresAndAlgorithms | Dynamic Programing/coinChange-1.cpp | // coinChange -1 maximum no of ways to form a number from given coins ------------ classic variation of unbounded knapsack
#include <bits/stdc++.h>
using namespace std;
void printvector(vector<int> &v){
for (int i = 0; i < v.size() ; i++)
cout<<v[i]<<" ";
}
void coinChange(int n, int limit, int... | ALGO | 0.999992 | 4.635678 |
84eb0046-bdb0-4905-9e08-b713aa658b86 | Pioooooo/Python-Interpreter | third_party/runtime/src/atn/ATNSimulator.cpp | #include "atn/ATNType.h"
#include "atn/ATNConfigSet.h"
#include "dfa/DFAState.h"
#include "atn/ATNDeserializer.h"
#include "atn/EmptyPredictionContext.h"
#include "atn/ATNSimulator.h"
using namespace antlr4;
using namespace antlr4::dfa;
using namespace antlr4::atn;
const Ref<DFAState> ATNSimulator::ERROR = std::make... | ALGO | 0.890059 | 7.819151 |
b1f0e04b-7766-433f-af02-f2c88eb97970 | leonardogc/AEDA1718 | AEDA_Proj2/utils.cpp | #include "utils.hpp"
bool is_number(const std::string& s)
{
std::string::const_iterator it = s.begin();
while (it != s.end() && std::isdigit(*it)) ++it;
return !s.empty() && it == s.end();
}
int read_number_Input() {
string input;
int option;
getline(cin, input);
if (!is_number(input) || 0 == (option = atoi(i... | TOOL | 0.880818 | 4.384256 |
e63b3fca-fdd0-4329-9d85-3b89a666d521 | kisuk010203/PS | C++/Math/Number_theory/2793.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> p;
p arr[4] = {{6, 12},
{420, 840},
{8 * 9 * 5 * 7 * 11 * 13, 16 * 9 * 5 * 7 * 11 * 13},
{(ll)(16 * 27 * 25 * 7 * 11 * 13 * 17) * 19 * 23 * 29 * 31,
(ll)(16 * 27 * 25 * 7 * 11 * 13 *... | ALGO | 0.999677 | 4.405893 |
ee98ea67-305a-4225-a128-1fb895901dc2 | aralab-unr/CoSM-ICP | external_libraries/pcl_1_9/surface/src/3rdparty/opennurbs/opennurbs_matrix.cpp | /* $NoKeywords: $ */
#include "pcl/surface/3rdparty/opennurbs/opennurbs.h"
// 8 July 2003 Dale Lear
// changed ON_Matrix to use multiple allocations
// for coefficient memory in large matrices.
// ON_Matrix.m_cmem points to a struct DBLBLK
struct DBLBLK
{
int count;
double* a;
struct DBLBLK *next;
};
do... | TOOL | 0.994365 | 5.379927 |
b9763d43-effb-4351-af95-68fef850a897 | Mr-Second/mordern-ftpsvr | src/server/utils/string_helper.cpp | #include "string_helper.h"
#include <random>
#include <iostream>
NAMESPACE_BEGIN
namespace StringHelper
{
std::string encode(std::string_view svInput)
{
std::string strResult;
size_t nLength = svInput.size();
for (size_t nIndex = 0; nIndex + 2 < nLength; nIndex += 3)
{
uint32_t dwTriple = (static_cast<uint8_t... | TOOL | 0.875717 | 6.134204 |
7d58ce64-d552-48eb-95dd-fa1723343721 | PranshuArora07/MyDs | main/array/2d_array.cpp/1.cpp | #include<iostream>
using namespace std;
bool search_2d_array(int arr[][3], int row, int col, int target ){
for(int i = 0; i< row ; i++ ){
for(int j = 0; i< col ; j++){
if(arr[i][j] == target){
return 1;
}
}
}
return 0;
}
int main(){
int arr[3][3] = {1,3,4,2,5,6,7,8,9};
int target;
cout<< "enter the v... | ALGO | 0.999615 | 4.626777 |
d28fd555-7f61-4558-9f94-6052b44210bc | amangupta2486/6Companies30DaysChallenge | Walmart/Q6_Power Of Numbers.cpp | class Solution{
public:
long long power(int x,int n)
{
if(n==0)
{
return 1;
}
long long r = power(x,n/2);
if(n%2==0)
{
return ((r%mod)*(r%mod))%mod;
}
else
{
... | ALGO | 0.999975 | 5.322622 |
4275fe46-8030-40cf-bd28-161e111f2b99 | kunal7447/codeforces | Settlement_of_Guinea_Pigs.cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
int t;
cin>>t;
while(t--){
int n;
cin>>n;
int arr[n];
int k = n-1;
for(int i=0;i<n;i++){
cin>>arr[i];
}
int h = 0;
int ned = 0;
int u = 0;
int c = 0;
for(int i=0;i<n;i++){
if(arr[i]==1){
c++;
ned++;
if(h-u>=1){
u++;
... | ALGO | 0.999898 | 4.01302 |
3d5c31eb-469f-48f1-b7c8-a10dc0849a79 | a0x8o/torch | third_party/eigen/doc/snippets/JacobiSVD_basic.cpp | MatrixXf m = MatrixXf::Random(3,2);
cout << "Here is the matrix m:" << endl << m << endl;
JacobiSVD<MatrixXf> svd(m, ComputeThinU | ComputeThinV);
cout << "Its singular values are:" << endl << svd.singularValues() << endl;
cout << "Its left singular vectors are the columns of the thin U matrix:" << endl << svd.matrixU(... | ALGO | 0.999764 | 3.463409 |
75c88612-940e-40c6-af09-04378c989db2 | menerucha/Leetcode_DSA_Questions | Miniumum_time_to_Repair_Cars.cpp | class Solution
{
public:
bool isPossible(vector<int> &ranks, long long mid, int cars)
{
long long count = 0;
for (int i = 0; i < ranks.size(); i++)
{
long long temp;
temp = mid / ranks[i];
count += sqrt(temp);
}
if (count >= cars)
... | ALGO | 0.999952 | 5.522927 |
c710fd74-8eaf-4378-b3a2-e0490468fd86 | manid2/dsa | cpp/graphs/bellman-ford.cpp | /**
* Bellman-Ford - Single source shortest path to all nodes
* =======================================================
*
* Refer:
*
* https://www.w3schools.com/dsa/dsa_algo_graphs_bellmanford.php
* https://www.geeksforgeeks.org/bellman-ford-algorithm-dp-23/
*/
#include "tests.h"
#include "graphs.h"
using nam... | ALGO | 0.999733 | 6.4201 |
fb038163-f5c0-4934-acaa-b31b294c6aa3 | SrayanBhattacharyya/CP_SolvedProblems | codeforces/1542/C.cpp | //Srayan Bhattachrayya JU EE
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define lld long double
#define rep(i,n) for(ll i=0;i<n;i++)
#define rev(i,n) for(ll i=n;i>=0;i--)
#define rev_a(i,a,n) for(ll i=n;i>=a;i--)
#define rep_a(i,a,n) for(ll i=a;i<n;i++)
typedef pair <ll, ll> pll;
typedef vector <... | ALGO | 0.999919 | 5.002106 |
2908dded-ff14-4d0a-bede-5f73720db223 | mikkolaj/wdi | zestaw2/19.cpp | #include <iostream>
#include <cmath>
using namespace std;
int main()
{
for(int i=1; i<=100; i++)
{
for(int j=i; j<=100; j++)
{
if(sqrt(i*i+j*j)-int(sqrt(i*i+j*j))==0)
cout << i << " x " << j << " x " << sqrt(i*i+j*j) << endl;
}
}
}
| ALGO | 0.999117 | 3.141511 |
4316d230-dddd-430d-a4e3-bdc19a39d70b | leehayeong/Algorithm | programmers/level1/12943.cpp | #include <string>
#include <vector>
#include <iostream>
using namespace std;
/*
콜라츠 추측
1. num 짝수면 2로 나눔 / 홀수면 3을 곱하고 1을 더함
2. 1이 될 때까지 반복
*/
int solution(int num) {
int answer = 0;
while(answer <= 500){
if(num == 1) break;
if(num % 2 == 0) num = num / 2;
else if(num % 2 == 1) nu... | ALGO | 0.999973 | 5.545297 |
35af02ce-8398-47be-b8f4-0b97ca19420c | PriyanshK09/LPU-CSE205-DSA | CircularQueue.cpp | #include <iostream>
using namespace std;
#define MAX 5
class CircularQueue {
private:
int front;
int rear;
int arr[MAX];
public:
CircularQueue() {
front = -1;
rear = -1;
for (int i = 0; i < MAX; i++) {
arr[i] = 0;
}
}
bool isEmpty() {
retur... | ALGO | 0.997921 | 5.339603 |
071b840e-cb81-46e8-b21a-ec9099229757 | MahbubHossainFaisal/Problem-Solving | Graphs/Probelms/Graph coloring problem.cpp | #include<bits/stdc++.h>
using namespace std;
void colorGraph(vector<vector<int>> graph, int v){
int result[v];
bool colored[v];
result[0]=0;
for(int i=1;i<v;i++) result[i] =-1;
for(int i=0;i<v;i++) colored[i] = false;
int chromaticNum=0;
for(int i=1;i<v;i++){
for(auto x: graph[i]... | ALGO | 0.999981 | 4.686834 |
b1ad1fec-8eab-492a-9ab2-71fed6da2fd1 | daecheolsong/algorithm-study-group | Choi-Jinseo/정수 삼갹형/정수 삼각형.cpp | #include <string>
#include <vector>
using namespace std;
int solution(vector<vector<int>> triangle) {
vector<vector<int>> dp = triangle;
dp[0][0] = triangle[0][0];
int n = triangle.size();
for (int i = 1; i < n; i++) {
for (int j = 0; j < i + 1; j++) {
if (j == 0) {
... | ALGO | 0.999961 | 5.519261 |
940e1151-9c53-4165-95e8-031609773565 | Alek-Plocharski/algortihms-and-data-structures-projects | prj/prj.cpp | #include <iostream>
#include <queue>
#include <list>
#include <vector>
constexpr int MAXN = 1e5 + 50;
using namespace std;
vector<list<int>> graph(MAXN);
vector<int> in_degree(MAXN);
vector<long long> number_of_employees(MAXN);
struct My_cmp {
bool operator()(int a, int b) {
return number_of_employees[a... | ALGO | 0.999992 | 4.229751 |
cc356a63-91fa-4ea4-a70f-945abaec091b | DeepeshnotCool/LeetCode-Submissions | my-folder/problems/jump_game_ii/solution.cpp | class Solution {
public:
// int helper(vector<int> &nums, int start, int n, vector<int> &memo){
// if(start == n){
// return 0;
// }
// if(memo[start] != -1)
// return memo[start];
// int mini = INT_MAX-1;
// for(int i = 1; i <= nums[start]; i++){
... | ALGO | 0.999975 | 5.409 |
861f077f-34fd-4ae9-81f2-b2e5824312ac | phamcaotri/homework | C++/DSA/P2/baibonus.cpp | #include <iostream>
#include <vector>
#include <time.h>
using namespace std;
int getInteger(string welcome) {
cout << welcome << '\n';
int n;
do {
cin >> n;
if (n < 1 or n > 100000000) {
cout << "Invalid input, please try again: ";
}
else return n;
} while (t... | ALGO | 0.999708 | 4.549282 |
3982ea05-0ff7-4e96-88f1-80e2576cbd2e | juniorandrade1/Competitive-Programming | Codeforces/443-2/B/B.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;
typedef pair< ll, ll > ii;
typedef vector< ll > vi;
typedef vector< ii > vii;
#define INF 0x3F3F3F3F
#define LINF 0x3F3F3F3F3F3F3F3FLL
#define pb push_back
#define mp make_pair
#define pq priori... | ALGO | 0.999997 | 3.539696 |
8210d03c-b91e-4701-85a6-d2363fb71d1f | raincross7/code-similarity | codes/train_code/problem383/problem383_219.cpp | #include <iostream>
#include <algorithm>
#include <vector>
#include <string>
using namespace std;
int main()
{
int a,b;
cin >> a;
vector <string> red(a);
for(int i=0;i<a;i++) cin >> red[i];
cin >> b;
vector <string> blue(b);
for(int i=0;i<b;i++) cin >> blue[i];
int sum = 0;
string wa;
for(int i=0;... | ALGO | 0.993121 | 3.870344 |
21d98f02-a87a-43d0-8f3e-05027cab6362 | sadraiiali/ShootYekZarb | player/Lib/rcsc/geom/voronoi_diagram_original.cpp | // -*-c++-*-
/*!
\file voronoi_diagram_original.cpp
\brief 2D voronoi Source File.
*/
#ifdef HAVE_CONFIG
#include <config.h>
#endif
#include "voronoi_diagram_original.h"
#include "delaunay_triangulation.h"
#include "triangle_2d.h"
namespace rcsc {
/*------------------------------------------------------------... | ALGO | 0.999601 | 6.538466 |
c4d32f2f-7f94-4180-a0af-0ded4a9bdd91 | g-denisenko/stroustrup-ppp-practice | ch3/exercises/exercise6.cpp | #include <iostream>
using namespace std;
double ask_number() {
double num;
if(cin>>num) return num;
std::cin.ignore(1000, '\n');
cin.clear();
}
char ask_operation_symbol() {
char symbol;
cin >> symbol;
if(symbol=='+' || symbol=='-' || symbol=='*' || symbol=='/') return symbol;
std::cin... | TOOL | 0.975401 | 3.542675 |
ef1d82c4-cc16-470d-b076-0dfbe871ce92 | netrunner-debian-kde-extras/konversation | src/irc/inputfilter.cpp | #include "inputfilter.h"
#include "server.h"
#include "replycodes.h"
#include "application.h"
#include "version.h"
#include "query.h"
#include "channel.h"
#include "statuspanel.h"
#include "common.h"
#include "notificationhandler.h"
#include <config-konversation.h>
#include <QStringList>
#include <QDateTime>
#include ... | WEB | 0.897677 | 5.859872 |
332fc74b-dc4f-41b8-9db8-f1b0832454c5 | da0p/AoC_2021 | day6/laternFish2.cpp | #include <iostream>
#include <fstream>
#include <string>
#include <vector>
#include <sstream>
#include <numeric>
std::vector<uint64_t> parseInput(std::string inputFileName, uint64_t tankSize)
{
std::ifstream inputFile(inputFileName, std::ios::in);
if (!inputFile) {
std::cerr << "File could not be opened" << std:... | ALGO | 0.999122 | 5.885604 |
83256140-7310-46e1-a4fc-3086416c8358 | Yoyuuhi/cpp-atcoder | _result/_AtCoderBeginnerContest336/A-Long_Loong/main.cpp | #include <bits/stdc++.h>
#include <atcoder/all>
#define out(X) cout << (X) << endl;
#define outs(XS) \
for (auto X : XS) cout << X << " ";
#define outl cout << endl;
#ifdef __LOCAL
#define DBG(X) cout << #X << " = " << (X) << endl;
#else
#define DBG(X)
#endif
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#def... | ALGO | 0.998942 | 3.320904 |
ef03885f-3d3a-4ef1-908e-322ba25a054e | kedixa/LeetCode | C++/39.cpp | class Solution {
using vii = vector<int>::iterator;
void dfs(vector<vector<int>> &result, vector<int> &tmp, vii it1, vii it2, int target)
{
/*
递归结束条件
*/
if(it1 == it2) return;
if(target < 0) return;
if(target == 0)
{
result.push_back(tmp);
... | ALGO | 0.999996 | 6.304439 |
57bac0cc-8153-4c8a-8b95-f9c1e4382a59 | fsjhhh/acm_title | cpp/模板/筛质数.cpp | #include <iostream>
#include <cstring>
#include <algorithm>
#define IOS ios::sync_with_stdio(0); \
cin.tie(0); \
cout.tie(0);
using namespace std;
typedef long long LL;
typedef pair<int, int> PII;
typedef pair<LL, LL> PLL;
const int N = 1e6 + 10;
int primes[N], cnt = 0, n;
bool st[N];
void get_pri... | ALGO | 0.999243 | 4.598024 |
01de14dd-299f-4507-8399-5bdabcd66933 | ishandutta2007/codeforces | monogon/normal/1422/A.cpp |
#include <bits/stdc++.h>
#define ll long long
#define sz(x) ((int) (x).size())
#define all(x) (x).begin(), (x).end()
#define vi vector<int>
#define pii pair<int, int>
#define rep(i, a, b) for(int i = (a); i < (b); i++)
using namespace std;
template<typename T>
using minpq = priority_queue<T, vector<T>, greater<T>>;
... | ALGO | 0.999815 | 4.163775 |
8ebbb3fb-2a7d-4ac1-9137-07e0dec42754 | StoyanYanev/Data-Structures-and-Algorithms | Homeworks/Homework4/Pairs.cpp | #include <iostream>
#include <vector>
#include <algorithm>
const int MAX_NUMBER = 1234;
struct Pair
{
int first;
int second;
};
struct Node
{
int data;
Node* next;
};
class LinkedList
{
public:
LinkedList()
{
m_head = NULL;
m_tail = NULL;
};
void Add(int data)
{
Node* temp = new Node;
temp->data = ... | ALGO | 0.999843 | 4.211164 |
4dfd8d1d-2c59-4397-8ab7-94a73f325f50 | achapi/CppLibrary | 重みなしグラフの最短経路復元.cpp | vector<int> shortestPath(vector<vector<int>> &G, int s, int g) {
int N = G.size();
vector<int> dist(N, -1), parent(N, -1);
queue<int> q;
dist[s] = 0;
q.push(s);
while (!q.empty()) {
int v = q.front();
q.pop();
for (int u : G[v]) {
if (dist[u] != -1) continue;
dist[u] = dist[v] + 1;
parent[u] = v;
... | ALGO | 0.999993 | 5.446381 |
7358b252-93d4-4adf-88c8-93891ec04d2e | ishandutta2007/codeforces | tzc_wk/normal/1090/B.cpp | #include <bits/stdc++.h>
using namespace std;
bool bib_start=false;
map<string,vector<string> > bib_part;
vector<string> cite;
int cnt=0;
bool cor=true;
string word_in_brk(string s){
int lbrk=s.find_first_of('{'),rbrk=s.find_first_of('}');
return s.substr(lbrk+1,rbrk-lbrk-1);
}
string after_rb(string s){
return s.su... | TOOL | 0.93418 | 3.502632 |
f47d9efa-9ff5-4a3d-bfcc-7a3d363b7c65 | gogiung/algorithm | 8980 택배/소스.cpp | #include<iostream>
#include<algorithm>
using namespace std;
const int MAX = 100001;
int n, c, m;
int capacity[2001];
pair<pair<int, int>, int> arr[MAX];
bool cmp(pair<pair<int, int>, int> a, pair<pair<int, int>, int> b) {
if (a.first.second < b.first.second) {
return true;
}
else if(a.first.second== b.first.se... | ALGO | 0.999922 | 4.181564 |
849f5f6d-f7a2-4aa4-bf8c-f030c012589d | zslwyuan/AMF-Placer | src/lib/3rdParty/blend2d/src/blend2d/compression/checksum.cpp | #include "../api-build_p.h"
#include "../compression/checksum_p.h"
namespace BLCompression {
// Compression - CheckSum - Crc32
// ==============================
const uint32_t crc32_table[] = {
0x00000000, 0x77073096, 0xEE0E612C, 0x990951BA,
0x076DC419, 0x706AF48F, 0xE963A535, 0x9E6495A3,
0x0EDB8832, 0x79DCB8A... | ALGO | 0.948126 | 7.089299 |
32488f5a-ced0-41f9-a9e9-fcaf3f3fded8 | bogdy234/Kattis | Kattis/Sum Squared Digits Function Kattis.cpp | // Sum Squared Digits Function Kattis.cpp : This file contains the 'main' function. Program execution begins and ends there.
//
#include <iostream>
using namespace std;
int transfB(int x,unsigned int b,unsigned int rest[]){
int i = 0;
while (x!=0)
{
rest[i] = x % b;
i++;
x = x / b;
}
return i;
}
int main... | ALGO | 0.999637 | 3.686591 |
353c59c2-21b4-4b12-ad6f-aa752bbf0fa2 | shawn233/OnlineJudge | Sjtu-OJ/1022/main.cpp | #include <iostream>
#include <cstdio>
#define MOD 2010
using namespace std;
int fib[2][2] = {{1,1},{1,0}};
int res[2][2] = {{1,0},{0,1}};
void multiply(int mat1[2][2], int mat2[2][2]) {
// mat1 *= mat2
int mat00, mat01, mat10, mat11;
mat00 = (mat1[0][0]*mat2[0][0])%MOD+(mat1[0][1]*mat2[1][0])%MOD;
ma... | ALGO | 0.999953 | 3.859071 |
5bfa26be-c2c4-40be-a88a-62977fd5b5c9 | AlexDominguez18/Curso-Programacion-TSU-UDG | Unidad 3 - Programacion modular/3 - Parametros por valor/C++/main.cpp | #include <iostream>
using namespace std;
int sumar(int a, int b);
int main()
{
int num1 = 5;
int num2 = 3;
int resultado = sumar(num1, num2);
cout << "El resultado de la suma es: " << resultado << endl;
cout << "num1: " << num1 << endl;
cout << "num2: " << num2 << endl;
return 0;
}
int... | ALGO | 0.994583 | 5.037916 |
6204cded-8363-4eea-8bab-4fe37f448032 | yfuka86/pc | codeforces/16xx/1688/f/f.cpp | #pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
#define rep(i,n) for(ll i=0;i<(ll)(n);i++)
#define rep_r(i,n) for(ll i=(ll)(n)-1;i>=0;i--)
#define rep2(i,sta,n) for(ll i=sta;i<(ll)(n);i++)
#define rep2_r(i,sta,n) for(ll i=(ll)(n)-1;i>=sta;i--)
#define all(v) (v).begin(),(v).end()
#define vlin(name,sz,offset) vl ... | ALGO | 0.999983 | 4.277106 |
e337f8bd-c439-494c-bf48-c2fcce094dce | abdulalimswe/CP | reserve_Code/segment tree/marge sort tree/l to r k greater value.cpp | #include<bits/stdc++.h>
#define REP(i,n) for (int i = 1; i <= n; i++)
#define mod 1000000007
#define pb push_back
#define ff first
#define ss second
#define ii pair<int,int>
#define vi vector<int>
#define vii vector<ii>
#define lli long long int
#define endl '\n'
using namespace std;
int val[30001];
vi st[4*30001];
vo... | ALGO | 0.99999 | 4.866349 |
ca746951-9b43-46a7-a981-bbae691f4b4a | Bishwajit-2810/DSA | Sorting and Searching Algorithms/RadixSort.cpp | #include <bits/stdc++.h>
using namespace std;
int getMax(int arr[], int n)
{
int mx = arr[0];
for (int i = 1; i < n; i++)
if (arr[i] > mx)
mx = arr[i];
return mx;
}
void countSort(int arr[], int n, int exp)
{
int output[n];
int i, count[10] = {0};
for (i = 0; i < n; i++)
... | ALGO | 0.99964 | 5.254575 |
c6d603eb-2608-4012-860a-4edbbd5f09f5 | amankumar6/CPP | CODEFORCES/misc/1st Month (9.6.20-8.7.20)/SoldierandBananas.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
long long int k,n,w,price(0);
cin>>k>>n>>w;
for (long long int i = 1; i <=w; i++)
{
price+=i*k;
}
if (price>n)
{
cout<<price-n<<endl;
}
... | ALGO | 0.999898 | 3.504335 |
fa84de03-e9e4-4ab5-aed0-bc369058ffbc | AryamEzra/2024-internship-mobile-tasks | mobile/aryam_ezra/task_9/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.995546 | 6.76775 |
8a08c08e-91a8-4fe6-9ad7-becfb5defba2 | sinankalkan/CENG501-Spring2021 | project_EsmeVardar/lib/csrc/cpu/roi_align.cpp | #include <torch/extension.h>
// implementation taken from Caffe2
template <typename T>
struct PreCalc {
int pos1;
int pos2;
int pos3;
int pos4;
T w1;
T w2;
T w3;
T w4;
};
template <typename T>
void pre_calc_for_bilinear_interpolate(
const int height,
const int width,
const int pooled_heigh... | DATA | 0.90266 | 6.468528 |
5fae7747-6993-41e2-a2d4-32c3284b51b0 | MObinXIV/a-Repo-to-get-back-My-level-of-the-devil | DataStructure/Hash/numberSmallerThanCurrent.cpp | // https://leetcode.com/problems/how-many-numbers-are-smaller-than-the-current-number/description/
#include<bits/stdc++.h>
using namespace std;
vector<int> smallerNumbersThanCurrent(vector<int>& nums) {
vector<int>v = nums;
sort (v.begin(),v.end());
unordered_map<int,int>mp;
for(int i =0... | ALGO | 0.999909 | 5.871506 |
f1609f6e-e3f3-4b2b-a26e-029a985ba5b2 | NikitaNikson/xray_stalker_sdk_04_fixed | xr_3da/xrGame/ai/ai_monsters_misc.cpp | ////////////////////////////////////////////////////////////////////////////
// Module : ai_monsters_misc.cpp
// Created : 23.07.2002
// Modified : 23.07.2002
// Author : Dmitriy Iassenev
// Description : Miscellanious routines for monsters
/////////////////////////////////////////////////////////////////////////... | ALGO | 0.87603 | 4.648684 |
8f596c2b-039b-4554-b636-4ce9649ed100 | enzo-garofalo/estrutura-de-dados | Recursividade/primos.cpp | /*
Fazer um programa com função recursiva que
retorna se um inteiro é ou não primo.
*/
#include <iostream>
#include <math.h>
using namespace std;
bool primo(int num, int divisor){
if(divisor == 1) return false;
if(num%divisor == 0) return true;
return primo(num, (divisor-1));
}
int main(){
int num;
... | ALGO | 0.999751 | 4.164269 |
f9bcc4d1-b097-4d37-92be-a13e155491ed | khushbu123-hub/final-project | opencv-master/modules/ml/src/inner_functions.cpp | #include "precomp.hpp"
namespace cv { namespace ml {
ParamGrid::ParamGrid() { minVal = maxVal = 0.; logStep = 1; }
ParamGrid::ParamGrid(double _minVal, double _maxVal, double _logStep)
{
CV_TRACE_FUNCTION();
minVal = std::min(_minVal, _maxVal);
maxVal = std::max(_minVal, _maxVal);
logStep = std::max(_... | ALGO | 0.998283 | 6.849699 |
18485b18-0844-4598-90a9-e7cfd8e2e1b3 | MichaelxhJiang/LeetCode | BasicCalculator2.cpp | class Solution {
public:
int calculate(string s) {
int ans = 0;
stack<int> stack;
int curNum = 0;
char prevOp = '+';
for (int i = 0; i < s.size(); i++) {
if (isdigit(s[i])) {
curNum = curNum*10 + (s[i]-'0');
}
... | ALGO | 0.999967 | 5.288336 |
0d774347-aa13-417c-88a4-9b50b1df845e | karan-saj/Data_Structure_Practise | bin_tree_insertion.cpp | #include<iostream>
using namespace std;
struct node
{
int d;
node *l;
node *r;
};
node *head=NULL;
void insert(int d)
{
node *t,*c,*temp=create(d);
int f=0;
if(head==NULL)
{
head=temp;
}
else
{
t=head;
int fa=insert_t(temp,t);
}
}
int insert_t(node *temp,node *t)
{
if(t->l==NULL)
{
t->l=temp;
}... | ALGO | 0.999712 | 3.836024 |
79c6dbab-d5d1-4129-b71e-6565e4cc0e5e | Ayush1Garg/Ayush-Practice | Difficulty: Medium/Sorting Elements of an Array by Frequency/sorting-elements-of-an-array-by-frequency.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
bool compare(pair<int,int>&p1,pair<int,int>&p2){
if(p1.first==p2.first) return p1.second<p2.second;
return p1.first>p2.first;
}
class Solution {
public:
// Complete this function
// Function to sort the array ... | ALGO | 0.999971 | 6.111709 |
be2dcbf2-0530-40df-b8b9-c5cecfb8f34f | yamen-s/demo-sample | windows/runner/utils.cpp | #include "utils.h"
#include <flutter_windows.h>
#include <io.h>
#include <stdio.h>
#include <windows.h>
#include <iostream>
void CreateAndAttachConsole() {
if (::AllocConsole()) {
FILE *unused;
if (freopen_s(&unused, "CONOUT$", "w", stdout)) {
_dup2(_fileno(stdout), 1);
}
if (freopen_s(&unuse... | TOOL | 0.9988 | 6.76073 |
291a1e7b-2f87-43ea-9950-35ec12405e23 | gunh0/algorithms | BOJ/13974_파일 합치기 2.cpp | #include <iostream>
using namespace std;
#define MEM 5005
#define sanic ios_base::sync_with_stdio(0)
#define MOD 1000000
typedef long long lld;
const int INF = 1e9 + 7;
int t;
int n;
int ls[MEM], dp[MEM][MEM], k[MEM][MEM];
int main() {
sanic;
cin >> t;
while (t--) {
cin >> n;
for (int i = 1; i <= n; i++) {
... | ALGO | 0.999749 | 3.317218 |
d9e84956-0fc2-4588-9986-357c970f2f1b | SWEG-2014-EC-Batch/Code_Tamers | FoP-I/Class-Activities/c++/check.cpp | #include <iostream>
using namespace std;
int main()
{
char letter;
cout<<"enter a letter";
cin>>letter;
if (letter>='A' && letter<='Z')
{
cout<<"it is capital letter";
}
else if( letter>='a' && letter<='z')
{
cout<<"it is a small letter";
}
else if(letter>='0' &&... | ALGO | 0.969492 | 3.070735 |
075551f8-01b4-4c25-adb0-c48c11af822d | ValentinCamus/pbrt-v3 | src/accelerators/bvh.cpp | // accelerators/bvh.cpp*
#include "accelerators/bvh.h"
#include "interaction.h"
#include "paramset.h"
#include "stats.h"
#include "parallel.h"
#include <algorithm>
namespace pbrt {
STAT_MEMORY_COUNTER("Memory/BVH tree", treeBytes);
STAT_RATIO("BVH/Primitives per leaf node", totalPrimitives, totalLeafNodes);
STAT_COUN... | ALGO | 0.999922 | 7.371261 |
44c706cd-91f0-4eaf-89f5-e77bd2db9474 | heshuting555/RefMask3D | third_party/pointnet2/_ext_src/src/sampling.cpp | #include "sampling.h"
#include "utils.h"
void gather_points_kernel_wrapper(int b, int c, int n, int npoints,
const float *points, const int *idx,
float *out);
void gather_points_grad_kernel_wrapper(int b, int c, int n, int npoints,
... | ALGO | 0.960216 | 6.576861 |
68e8c52f-b080-4fd9-9d06-2d52b4b76703 | Roshann07/CSA0417 | os20.cpp | #include <stdio.h>
void implimentWorstFit(int blockSize[], int blocks, int processSize[], int processes)
{
int allocation[processes];
for(int i = 0; i < processes; i++){
allocation[i] = -1;
}
for (int i=0; i<processes; i++)
{
int indexPlaced = -1;
for (int j=0; j<blocks; j++)... | ALGO | 0.999763 | 3.114295 |
f12c18f2-9b6f-459e-9a81-40cb084f5ebf | ldcWV/CP | USACO/Contests/2016-2017/January/Platinum/subrev.cpp | #include <iostream>
#include <fstream>
#include <string>
#include <cmath>
#include <vector>
#include <iomanip>
#include <algorithm>
#include <functional>
#include <queue>
#include <set>
#include <stack>
#include <map>
#define F first
#define S second
#define PB push_back
#define MP make_pair
#define SQ(a) (a)*(a)
#def... | ALGO | 0.999916 | 4.169015 |
3639b526-5655-4ed4-8c26-786b36768b29 | kyledh1127/codetree-TILs | 240823/사는 지역/where-live.cpp | #include <iostream>
#include <algorithm>
using namespace std;
class per{
public:
string name,phn,city;
int a;
per(string name,string phn,string city){
this->name=name;
this->phn=phn;
this->city=city;
this->a=a;
}
};
int main() {
string name,phn,city;
int a;
... | ALGO | 0.997517 | 4.280365 |
36be40ae-5f8b-449c-8854-1d16898a40e0 | HPC-Fortran2CPP/Fortran2Cpp | data/readable_format/cpp/file1132.cpp | #include <iostream>
#include <vector>
class MoColumn {
public:
void compute_column(int nz, std::vector<float>& t, std::vector<float>& q) {
std::vector<float> y(nz);
float c = 5.345f;
do {
c = c * c;
} while(false); // Mimics the goto behavior by breaking after one itera... | ALGO | 0.999467 | 4.519137 |
7c7755d2-52cd-4853-a6ba-1cee72b16e89 | akinanop/mvl-solver | tests/RandomSAT/z3-master/src/nlsat/tactic/qfnra_nlsat_tactic.cpp | #include"tactical.h"
#include"tseitin_cnf_tactic.h"
#include"degree_shift_tactic.h"
#include"purify_arith_tactic.h"
#include"nlsat_tactic.h"
#include"factor_tactic.h"
#include"simplify_tactic.h"
#include"elim_uncnstr_tactic.h"
#include"propagate_values_tactic.h"
#include"solve_eqs_tactic.h"
#include"elim_term_ite_tact... | ALGO | 0.99812 | 5.775909 |
957da1d5-4a74-4d20-97dd-a18da18d6414 | rajat-12-jadon/GFG-Questions | Index_extra_element.cpp | class Solution {
public:
int findExtra(int n, int arr1[], int arr2[]) {
// add code here.
int start = 0, end = n - 2;
int mid;
while(start <= end)
{
mid = start + (end - start)/2;
if (arr1[mid] != arr2[mid])
{
end = mid -... | ALGO | 0.999896 | 5.049158 |
762cfce7-baf2-471b-955a-efd6adbb0319 | SAURABH200301/MyCppCodes | Madoka and Childish Pranks(codeforces0.cpp | #include<bits/stdc++.h>
using namespace std;
#define ll long long
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
ll t, n, m, i, j, steps;
cin>>t;
for(;t--;){
cin>>n>>m;
steps=0;
vector<pair<pair<ll, ll>, pair<ll, ll>>> ans;
... | ALGO | 0.999354 | 3.236425 |
70027eca-fbd0-4a78-8e70-dae7898ccd59 | DarkJyn/SPOJ_PTIT | BCPENNY_PennyGame.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define MOD 1000000007;
int main(){
cin.tie(nullptr) -> sync_with_stdio(false);
int t;cin >>t;
while(t--){
int test;cin >>test;
string s;
cin >> s;
int cnt[8];
... | ALGO | 0.997318 | 3.57418 |
07a23902-78fc-4374-9a24-4744b0c9419f | wuhao5/boost | libs/intrusive/example/doc_sg_set.cpp | using namespace boost::intrusive;
class MyClass : public bs_set_base_hook<>
{
int int_;
public:
//This is a member hook
bs_set_member_hook<> member_hook_;
MyClass(int i)
: int_(i)
{}
friend bool operator< (const MyClass &a, const MyClass &b)
{ return a.int_ < b.int_; }
frien... | TOOL | 0.971948 | 5.954644 |
31c512ee-bcb6-4dfd-a31f-d71b5854de1c | HanetakaChou/PDF | Engine/Source/Editor/UnrealEd/Private/NormalMapIdentification.cpp | #include "NormalMapIdentification.h"
#include "Engine/Texture2D.h"
#include "Factories/TextureFactory.h"
#include "Framework/Notifications/NotificationManager.h"
#include "Widgets/Notifications/SNotificationList.h"
#define NORMALMAP_IDENTIFICATION_TIMING (0)
#define LOCTEXT_NAMESPACE "NormalMapIdentification"
//////... | TOOL | 0.971076 | 4.415156 |
dbe2a80f-b1c0-4158-9251-edf08555332d | iamkoushik1999/Competitive-Coding-and-Interview-Problems | Leet Code/findDuplicate.cpp | /*
Find the Duplicate Number
Medium
Given an array of integers nums containing n + 1 integers where each integer is
in the range [1, n] inclusive.
There is only one repeated number in nums, return this repeated number.
You must solve the problem without modifying the array nums and uses only
constant extra space.
E... | ALGO | 0.999726 | 6.43848 |
5b27a6f3-eef6-4529-b20f-c6ee5d0a5436 | SouvikChan/-Leetcode_Souvik | 1626-best-team-with-no-conflicts/1626-best-team-with-no-conflicts.cpp | class Solution {
public:
int bestTeamScore(vector<int>& scores, vector<int>& ages) {
vector<tuple<int,int>> items;
for (int i = 0; i < size(scores); ++i) items.push_back({scores[i], ages[i]});
sort(begin(items), end(items));
map<int,int> res; res[0] = 0;
for(auto [sc, ag] : i... | ALGO | 0.999904 | 6.136894 |
aa1ccfb7-1a72-4dc7-9bc6-fa0e32bae5c7 | melROLL/Bee_Slic3r | src/libigl/igl/ray_mesh_intersect.cpp | extern "C"
{
#include "raytri.c"
}
template <
typename Derivedsource,
typename Deriveddir,
typename DerivedV,
typename DerivedF>
IGL_INLINE bool igl::ray_mesh_intersect(
const Eigen::MatrixBase<Derivedsource> & s,
const Eigen::MatrixBase<Deriveddir> & dir,
const Eigen::MatrixBase<DerivedV> & V,
const... | ALGO | 0.972893 | 6.824683 |
8cebb00d-6897-418f-bd67-315ffdcd762f | mailtoharutyunyan/LeetCode-Solutions | solutions/2912. Number of Ways to Reach Destination in the Grid/2912-2.cpp | class Solution {
public:
int numberOfWays(int n, int m, int k, vector<int>& source,
vector<int>& dest) {
constexpr int kMod = 1'000'000'007;
// of ways of source -> dest using steps so far
int ans = source[0] == dest[0] && source[1] == dest[1];
// of ways of source -> dest's row us... | ALGO | 0.999949 | 6.361616 |
017fbd65-d681-4713-86b4-85ecef78a228 | ruds18/DSA-Practice | 0221-maximal-square/0221-maximal-square.cpp | class Solution {
public:
int solve(vector<vector<char>>&matrix , int row , int col , int &ans , vector<vector<int>>&dp){
//base case
if(row >= matrix.size() || col>= matrix[0].size()) return 0;
if(dp[row][col] != -1) return dp[row][col];
int right = solve(matrix ,... | ALGO | 0.99995 | 6.190121 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.