uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
c02b4d3e-4f6b-40b2-9546-946dcf2e899f | 3lmesias/UE4Course | Engine/Source/Runtime/Core/Private/Containers/Algo/FindSortedStringCaseInsensitive.cpp | #include "Algo/FindSortedStringCaseInsensitive.h"
#include "Misc/CString.h"
namespace Algo
{
/**
* Finds a string in an array of sorted strings, by case-insensitive search, by using binary subdivision of the array.
*
* @param Str The string to look for.
* @param SortedArray The array of strings to... | ALGO | 0.999787 | 6.787518 |
b2dcaa1b-c2b8-4de6-9195-12ca1e3296e1 | rabelhmd/UVA-Solutions | UVA_10405_Longest Common Subsequence.cpp | #include <bits/stdc++.h>
using namespace std;
long int M, N, C[2000][2000];
string str1, str2;
void LCS(int M, int N)
{
for(int i = 1; i<=M; i++)
{
for(int j = 1; j<=N; j++)
{
if(str1[i-1] == str2[j-1])
{
C[i][j] = C[i-1][j-1] + 1... | ALGO | 0.999885 | 4.672365 |
e9b28be4-3bb0-45b3-b741-b71306553598 | 15831944/RSSPCryptool | BaseCrypto/cryptopp/gf2_32.cpp | // gf2_32.cpp - written and placed in the public domain by Wei Dai
#include "pch.h"
#include "misc.h"
#include "gf2_32.h"
NAMESPACE_BEGIN(CryptoPP)
GF2_32::Element GF2_32::Multiply(Element a, Element b) const
{
word32 table[4];
table[0] = 0;
table[1] = m_modulus;
if (a & 0x80000000)
{
table[2] = m_modulus ^ (... | ALGO | 0.999656 | 5.52353 |
0579f374-44f0-494b-993c-b35c3c3aab51 | eyou-note/ps | 프로그래머스/lv0/120866. 안전지대/안전지대.cpp | #include <string>
#include <vector>
using namespace std;
int dx[8]={1,1,0,-1,-1,-1,0,1},
dy[8]={0,1,1,1,0,-1,-1,-1};
int solution(vector<vector<int>> board) {
int ans = 0, limit = board.size();
for(int i=0;i<limit;i++){
for(int j=0;j<limit;j++){
// 내가 폭탄이 아니고, 내 주변이 폭탄이 아니면 카운트
... | ALGO | 0.999501 | 5.403322 |
a2783636-d19e-43f6-b57e-6e3d83025220 | enochii/leetcode-solution | 713.cpp | // 713. Subarray Product Less Than K
//有点魔怔,还以为是dp...
//Two Pointer
class Solution {
public:
int numSubarrayProductLessThanK(vector<int>& nums, int k) {
if(k <= 1 || nums.empty())return 0;
const int n = nums.size();
vector<int> dp(n, -1);
long long pro = 1;
i... | ALGO | 0.999967 | 5.356243 |
9df487ed-b2ba-4c62-b315-e82b1679e614 | abhiram138b/LEETCODE | 54-spiral-matrix/54-spiral-matrix.cpp | class Solution {
public:
vector<int> spiralOrder(vector<vector<int>>& matrix) {
vector<int> v;
int i = 0;
int j = 0;
int k = matrix.size();
int l = matrix[0].size();
int size = k * l;
while(i < k && j < l){
for(int x=j;x<l;x++){
... | ALGO | 0.999999 | 6.170767 |
97df9ba6-b6d1-4f10-a77c-81921e567f9b | firewood/topcoder | atcoder/abc_275/c.cpp | #include <algorithm>
#include <cctype>
#include <cmath>
#include <cstring>
#include <iostream>
#include <sstream>
#include <numeric>
#include <map>
#include <set>
#include <queue>
#include <vector>
using namespace std;
int calc(int a, int b) {
int ax = a % 9, ay = a / 9, bx = b % 9, by = b / 9;
return (bx - ax) * (... | ALGO | 0.999649 | 4.834999 |
b5477bfc-14be-4369-9a13-48422662eaac | Srishti-Somya/Problems | 1002-maximum-width-ramp/1002-maximum-width-ramp.cpp | class Solution {
public:
int maxWidthRamp(vector<int>& nums) {
int n = nums.size();
vector<int>maximum_r(n);
maximum_r[n-1] = nums[n-1];
for(int i = n-2 ; i >= 0; i--)
{
maximum_r[i] = max(maximum_r[i+1],nums[i]);
}
int ramp = 0;
int i = 0;... | ALGO | 0.999973 | 5.755705 |
d6d8f072-ab0b-4c34-8809-10637c890c5f | Fengdalu/acm-icpc | algorithmic-library/dreadnought-code-library/src/最远点对.cpp | point conv[100000];
int totco, n;
//凸包
void convex( point p[], int n ){
sort( p, p+n, cmp );
conv[0]=p[0]; conv[1]=p[1]; totco=2;
for ( int i=2; i<n; i++ ){
while ( totco>1 && (conv[totco-1]-conv[totco-2])/(p[i]-conv[totco-2])<=0 ) totco--;
conv[totco++]=p[i];
}
int limit=totco;
for ( int i=n-1; i>=0; i-- ){
... | ALGO | 0.999923 | 4.210754 |
ce1ae6e5-ed8f-4751-b1a0-6534a6a74f99 | codefever1912/CodeForces | practice/Restoring_Three_Numbers.cpp | #include <bits/stdc++.h>
using namespace std;
int main(){
int a[4];
for(int i=0;i<4;i++){cin >> a[i];}
sort(a,a+4);
int x,y,z;
z = (a[2]-a[0]+a[1])/2;
y = a[1]-z;
x = a[3]-y-z;
cout << x << " " << y << " " << z << endl;
} | ALGO | 0.999827 | 3.58812 |
c824a2ee-4c3e-4867-ab0f-ddbf4939be7b | ryanzhang15/RJ_HKOI | T141.cpp | #include <bits/stdc++.h>
#define ef else if
using namespace std;
typedef long long _;
typedef const long long constant;
constant maxn = 1E5+8;
_ n, m, p[maxn], dp[maxn], f[maxn];
deque<_> q;
bool cmp(_ x, _ y, _ z);
_ vl(_ pt, _ sp);
int main() {
scanf("%lld%lld", &n, &m);
for(_ i = 1; i <= n; ++i) {
scanf("... | ALGO | 0.999973 | 3.288236 |
5f3fd65b-3523-449d-ba77-79a4cb9939e6 | jonatas57/maratona | cf/gym/101972/a/a.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef vector<bool> vb;
typedef map<int, int> mii;
typedef pair<int, int> ii;
#define INF 0x3f3f3f3f
#define INFLL 0x3f3f3f3f3f3f3f3... | ALGO | 0.999043 | 4.407597 |
497a60b3-70ed-4b49-a857-b75ecf0c1a44 | Mortadelo24/leet-code-solutions | 8/cpp-solution.cpp | class Solution {
public:
int myAtoi(string s) {
}
}; | ALGO | 0.951917 | 4.684804 |
b4fc7087-1d50-44ef-b172-77f218634e15 | immaksudalam/Data-Structure-Algorithm-Problem-solve | LeetCode/Greedy/376. Wiggle Subsequence.cpp | class Solution {
public:
int wiggleMaxLength(vector<int>& nums) {
int n = nums.size();
if(n==1) return n;
int ans = 1;
int ok = 0;
for(int i=1; i<n; i++){
if(nums[i] - nums[i-1]>0 && ok != 1){
ans++;
ok = 1;
}
... | ALGO | 0.999964 | 5.500824 |
29dc846c-55a7-4ff5-9563-5e0693b45d67 | rudeUltra/DSA | 0778-swim-in-rising-water/0778-swim-in-rising-water.cpp | class Solution {
public:
using int2=array<int, 2>;
int n;
int to1D(int i, int j){
return i*n+j;
}
int swimInWater(vector<vector<int>>& grid) {
n=grid.size();
if (n==1) return 0;// edge case
vector<int> dist(n*n, INT_MAX);
dist[0]=0;
vector<bool> visite... | ALGO | 0.999961 | 5.934632 |
d14a2bf3-76f5-4b91-915e-ff316cbd2acb | caiombribeiro/teste_clone | prog/engine/phys/physBullet/bulletRayCar.cpp | #include "bulletRayCar.h"
#include <phys/dag_physics.h>
#include <scene/dag_physMat.h>
#include <workCycle/dag_workCycle.h>
#include <debug/dag_debug.h>
#include <debug/dag_log.h>
#include <workCycle/dag_workCyclePerf.h>
#define U_EPSILON 1e-6
const btVector3 gravity(0, -9.8, 0);
inline float dot(const btVector3 &a, ... | ALGO | 0.959881 | 5.665067 |
21a1ebed-245d-4af6-8e35-6d87842eeb21 | sidjha57/Coding-Data-Transfer | Competitive/C++/Codeforces/A_Contest.cpp | //template
#include<bits/stdc++.h>
//#include<ext/pb_ds/assoc_container.hpp>
//#include<ext/pb_ds/tree_policy.hpp>
//#include <ext/pb_ds/trie_policy.hpp>
//using namespace __gnu_pbds;
using namespace std;
//typedef tree<ll, null_type, less<ll>, rb_tree_tag, tree_order_statistics_node_update> pbds;
//typedef trie<strin... | ALGO | 0.999688 | 4.17277 |
31bcefee-9f20-4a64-b3ca-f42fab1a2eca | landuncoin/LDB | src/wallet_ismine.cpp | #include "wallet_ismine.h"
#include "key.h"
#include "keystore.h"
#include "script/script.h"
#include "script/standard.h"
#include "util.h"
#include <boost/foreach.hpp>
using namespace std;
typedef vector<unsigned char> valtype;
unsigned int HaveKeys(const vector<valtype>& pubkeys, const CKeyStore& keystore)
{
... | ALGO | 0.980691 | 5.437103 |
c41dbfd9-f4de-411a-88b8-e17b0cf574b7 | K2000ran/tcs_past-prepartion-code | bin_to_dec.cpp | /*
#include<iostream>
#include<math.h>
using namespace std;
int main(){
int n;
cout<<"enter the size of arr: ";
cin>>n;
int arr[n];
for(int i=0;i<n;i++){
cin>>arr[i];
}
int m=n-1;//store the size of arr;
int dec=0;
for(int i=0;i<n;i++){
dec= dec+arr[i]*pow(2,m);
... | ALGO | 0.999098 | 4.455271 |
42579063-31be-467e-97fd-f31474d5b25b | Blobixx/Style-Based-Inverse-Kinematics | body.cpp | #ifdef WIN32
#include <windows.h>
#endif
#include <GL/gl.h>
#include <GL/glu.h>
#include "body.hpp"
#include "main.hpp"
#include "operateur.hpp"
// Create the body using the BVH constructor
body::body() {
counter = 1;
matrix16f ident;
ident.LoadIdentity();
orient.push(ident);
}
void body::setBVHFile(string bv... | ALGO | 0.971512 | 4.134228 |
5367b936-a5da-4194-b2d5-64b49826328f | Pavan-B-N/DSA-with-C_plus_plus | StriverAtoZ/Heaps/KthSmallestElement.cpp | // https://www.geeksforgeeks.org/problems/kth-smallest-element5635/1
#include <queue>
#include <vector>
using namespace std;
// Time Complexity: O(nlogn)
// Space Complexity: O(n)
class Solution
{
public:
// arr : given array
// k : find kth smallest element
int kthSmallest(vector<int> &arr, int k)
{
... | ALGO | 0.999988 | 5.809198 |
d08bbacc-4f6b-4ad5-89cc-5d5e6ce6c937 | cocomodo/my_beakjoon_repo | 프로그래머스/2/42747. H-Index/H-Index.cpp | #include <bits/stdc++.h>
using namespace std;
int solution(vector<int> citations) {
sort(citations.begin(), citations.end(), greater<int>());
for (int i = 0; i < citations.size(); ++i) {
if (citations[i] <= i) {
return i;
}
}
return citations.size();
} | ALGO | 0.999819 | 5.928458 |
4e5ddd46-e9ea-472f-8385-d0de79ea91cf | shubhamkanade/cpp-program | polymorphism/function_overloading_refrence.cpp | #include<stdio.h>
#include<iostream>
class demo
{
public:
void fun(int no)
{
}
void fun(int &ref)
{
}
}obj;
int main()
{
int no=11;
///demo obj;
obj.fun(21);
obj.fun((int&)no);
return 0;
}
| ALGO | 0.967844 | 3.690512 |
6c394e07-d59b-4260-8953-15bc21c66e5d | student-Imran/Codes | cf_Shrinking-Array.cpp | #include<bits/stdc++.h>
using namespace std;
void solve()
{
int n;cin>>n;
int a[n];
for (int i = 0; i < n; ++i)
{
cin>>a[i];
}
for (int i = 0; i < n-1; ++i)
{
if (abs(a[i]-a[i+1])<=1)
{
cout<<0<<'\n';
return;
}
}
for (int i = 0; i < n-2; ++i)
{
int maxi=max(a[i+1],a[... | ALGO | 0.999774 | 4.174987 |
0ee52ce7-7103-4f4e-96b7-45e6342fd805 | minseonkkim/Algorithm_BOJ | DFS, BFS + Bitmasking/1194.cpp | #include<iostream>
#include<queue>
#include<string>
#include<vector>
#include<cmath>
#define endl "\n"
#define MAX 50
using namespace std;
int n, m, sx, sy;
char map[MAX][MAX];
bool visited[MAX][MAX][1 << 6];
int dx[] = { 0, 0, 1, -1 };
int dy[] = { 1, -1, 0, 0 };
int bfs(){
queue<pair<pair<int, int>, pair<int, in... | ALGO | 0.999621 | 4.129594 |
497cf109-28f1-4208-ac07-125d945fd204 | 4794-sourse/captand | Leetcode/算法/162. 寻找峰值.cpp | class Solution {
public:
int findPeakElement(vector<int>& nums) {
int l = 0, r = nums.size() - 1;
while (l < r) {
int mid = (l + r) >> 1;
if (nums[mid] < nums[mid + 1]) {
l = mid + 1;
} else {
r = mid;
}
}
... | ALGO | 0.999853 | 5.750512 |
95be506d-c1da-4cab-848b-bff3ec81070a | ishandutta2007/codeforces | omer223/normal/1333/B.cpp | #define MOD 1000000007
#define fast ios::sync_with_stdio(false); cin.tie(0); cout.tie(0)
#define FOR(i, n) for (int i = 0; i < n; i++)
#define pb push_back
#define mp make_pair
#define has(set, x) set.find(x) != set.end()
#define nohas(set, x) set.find(x) == set.end()
#define inc(mpp, x) {if(has(mpp, x)) mpp[x]++; else... | ALGO | 0.999926 | 3.396924 |
99dfbb74-9a1e-4395-93d9-15f5001d6f06 | eeeeetototo/2023flutter | ch4/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.998899 | 6.76073 |
f71410d1-0a03-49b6-8d29-1019f39f16ef | EntropyIncreaser/ioi2020-homework | part2/agc031_d.cpp | #include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <ctime>
#include <cctype>
#include <algorithm>
#include <random>
#include <bitset>
#include <queue>
#include <functional>
#include <set>
#include <map>
#include <vector>
#include <chrono>
#include <iostream>
#include <limits>
#include <n... | ALGO | 0.999994 | 3.083946 |
fe98b704-2654-4803-b8d0-208e14c66c08 | Vinyas-13/Leetcode | 0229-majority-element-ii/0229-majority-element-ii.cpp | class Solution {
public:
//Moore's Voting Algorithm
vector<int> majorityElement(vector<int>& nums) {
int cnt1=0;
int cnt2=0;
int el1=0;
int el2=0;
int n=nums.size();
vector<int>majElements;
for(int i=0;i<n;i++)
{
if(cnt1==0 && ... | ALGO | 0.999939 | 5.771508 |
a99f36f9-0ac3-4e85-b361-ca8ff18b258c | nhannhan2201/DSA_dp | Bai1.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int MOD = 1e9 + 7;
int main(){
string s, t;
cin >> s >> t;
int n=s.size(), m=t.size();
vector<vector<int>> f(n + 1, vector<int>(m + 1, 0));
for (int i=1; i<=n; i++){
for (int j=1; j<=m; j++){
if (s[i-1]==t[j-1]... | ALGO | 0.999959 | 4.846252 |
73f2b8de-4ce1-4f47-baf8-886be4f83705 | roshan22418/DsaPRoblem | allQuestion/catlnNUmber.cpp | #include<iostream>
using namespace std;
int CatlanNumber(int n){
if(n<=1){
return 1;
}
int res = 0;
for (int i = 0; i < n; i++)
{
res+= CatlanNumber(i)*CatlanNumber(n-i-1);
}
return res;
}
int main(){
int n = 10;
for (int i = 0; i < n ; i++)
{
cout<<... | ALGO | 0.999991 | 4.44822 |
d2e00c3f-28ab-4554-b8f2-4789e2129157 | Squeegy/test-game | godot-cpp-4.4/src/variant/vector4.cpp | /**************************************************************************/
/* vector4.cpp */
/**************************************************************************/
/* This file is part of: */
/* ... | TOOL | 0.894566 | 6.215286 |
eb4edbb3-f0a5-424d-a655-1b6b7a621bf2 | project-starch/capstone-gem5 | src/systemc/tests/systemc/misc/sim_tests/srlatch/nor.cpp | /*****************************************************************************
nor.cpp --
Original Author: Martin Janssen, Synopsys, Inc., 2002-02-15
*****************************************************************************/
/*****************************************************************************
... | ALGO | 0.990628 | 6.382857 |
e853d13e-ae64-48f5-a086-e15ffb4f0401 | hendrikvg/Programming-2-Assignments | Assignment 3/tree/functions.cpp | #include <ctime> // for random seed (srand()), and thus fillTreeRandomly()
#include <vector> // for fillTreeRandomly() and binarySearch()
#include <numeric> // for iota()
#include <string> // for getLine()
#include <sstream> // for getLine()
#include "Tree.h"
using namespace std;
/*
getInteger() makes sure the in... | ALGO | 0.99696 | 4.63495 |
6b747376-cf1a-4529-a426-6fb18a432ea4 | ricosjp/monolish-debian-package | src/blas/matrix/copy/crs_copy.cpp | #include "../../../../include/monolish_blas.hpp"
#include "../../../internal/monolish_internal.hpp"
namespace monolish {
namespace {
template <typename F>
void copy_core(const matrix::CRS<F> &A, matrix::CRS<F> &C) {
Logger &logger = Logger::get_instance();
logger.util_in(monolish_func);
// err
assert(util::i... | ALGO | 0.903222 | 4.977518 |
515e4c44-122b-4aa7-9010-e336faa94df2 | codingtyro/codeforces | c_964_div4/a.cpp | #include<bits/stdc++.h>
using namespace std;
using ll = long long;
int tt;
int main(){
cin >> tt;
while(tt--){
//input
string s;
cin >> s;
//slove
int sum = s[0] - '0' + s[1] - '0';
//output
cout << sum << endl;
}
return 0;
} | ALGO | 0.999718 | 4.672336 |
ce935f6f-ceab-4acd-96b2-039bd62815ef | raincross7/code-similarity | codes/train_code/problem087/problem087_118.cpp | #include<iostream>
#include<cstdlib>
#include<stdio.h>
using namespace std;
int main()
{
long long int a[25]={1};
a[0]=0;
a[1]=1;
for (int i=2;i<25;i++)
{
a[i]=a[i-1]*i;
}
int n;
while (cin >> n)
{
cout << a[n] << "\n";
}
return 0;
} | ALGO | 0.999885 | 3.393036 |
67d6e187-d424-4b4d-938c-dc0a9216e445 | Robin329/android12_rock_hwc | hardware/libhardware/modules/sensors/dynamic_sensor/HidUtils/HidParser.cpp | #include "HidDefs.h"
#include "HidParser.h"
#include "HidLog.h"
#include <iostream>
#include <iomanip>
namespace HidUtil {
void HidParser::reset() {
mGlobalStack = HidGlobalStack();
mLocal = HidLocal();
mTree = std::make_shared<HidTreeNode>();
mCurrent = mTree;
}
bool HidParser::parse(const std::vect... | TOOL | 0.892365 | 5.808973 |
5f8580d1-d4e1-4b77-8a79-4cb7c4f89a95 | pranphy/AOSP-keyboard | native/jni/src/suggest/core/dicnode/dic_node_utils.cpp | #include "suggest/core/dicnode/dic_node_utils.h"
#include "dictionary/interface/dictionary_structure_with_buffer_policy.h"
#include "suggest/core/dicnode/dic_node.h"
#include "suggest/core/dicnode/dic_node_vector.h"
namespace latinime {
///////////////////////////////
// Node initialization utils //
////////////////... | ALGO | 0.961592 | 7.312206 |
ab7090b5-6d31-4381-a424-716fb85fe6a7 | Ujjval-dargar/Leetcode_Logs | 0062-unique-paths/0062-unique-paths.cpp | class Solution {
public:
int uniquePaths(int m, int n) {
vector<vector<int>> dp(m, vector<int>(n, 0));
for (int i = 0; i < n; ++i) {
dp[0][i] = 1;
}
for (int i = 0; i < m; ++i) {
dp[i][0] = 1;
}
for (int i = 1; i < m; ++i) {
for (... | ALGO | 0.99984 | 6.698778 |
e4b8282f-2ee4-4688-bfef-36f9569514f7 | tsmakalagy/myproject | myproject/package_bgs/tb/PixelUtils.cpp | #include "PixelUtils.h"
PixelUtils::PixelUtils(void){}
PixelUtils::~PixelUtils(void){}
void PixelUtils::ColorConversion(IplImage* RGBImage, IplImage* ConvertedImage, int color_space)
{
// Space Color RGB - Nothing to do!
if(color_space == 1)
cvCopy(RGBImage, ConvertedImage);
// Space Color Ohta
if(color_... | TOOL | 0.90262 | 5.487958 |
8da61fee-9325-4bd9-b2f2-08e25287b2ed | FutureWL/ZHIYE_CSPJS | 01_算法/03_递推算法/02_阶乘计算/main.cpp | #include <iostream>
using namespace std;
// 计算n的阶乘的函数(使用递推)
int factorial(int n) {
int result = 1;
for (int i = 2; i <= n; i++) {
result *= i;
}
return result;
}
int main() {
int n;
cout << "请输入要计算阶乘的正整数: ";
cin >> n;
int fact = factorial(n);
cout << n << "的阶乘为: " << fact ... | ALGO | 0.999772 | 4.730439 |
216433be-ddfe-4cbf-b6d2-11f8298e79b7 | pei0948/dataStructure | leetcode/productExceptSelf/productExceptSelf.cpp | class Solution {
public:
vector<int> productExceptSelf1(vector<int>& nums) {
vector<int> result;
int len=nums.size();
if(len<2)
{
return result;
}
result.resize(len, 0);
result[len-1]=1;
for(int i=len-2; i>=0; i--)
{
res... | ALGO | 0.999986 | 5.552822 |
117e142e-67b2-4806-bdc7-bf28b4f601d2 | xiaoyaojunma/shade | libs/skia/src/pathops/SkPathOpsRect.cpp | #include "SkPathOpsCubic.h"
#include "SkPathOpsLine.h"
#include "SkPathOpsQuad.h"
#include "SkPathOpsRect.h"
void SkDRect::setBounds(const SkDLine& line) {
set(line[0]);
add(line[1]);
}
void SkDRect::setBounds(const SkDQuad& quad) {
set(quad[0]);
add(quad[2]);
double tValues[2];
int roots = 0;... | TOOL | 0.851631 | 5.216005 |
7e63c131-15c1-462d-b0c9-716f288a9b0e | Zhenghao-Liu/LeetCode_problem-and-solution | 1365.有多少小于当前数字的数字/solution1.cpp | //根据值排序后,下标即是有多少个数比它小
class Solution {
public:
vector<int> smallerNumbersThanCurrent(vector<int>& nums) {
int nums_size=nums.size();
vector<int> idx;
idx.reserve(nums_size);
for (int i=0;i<nums_size;++i)
idx.push_back(i);
sort(idx.begin(),idx.end(),[&nums](const i... | ALGO | 0.999999 | 5.761046 |
d68bf783-0909-4218-b8ab-d1c792b518ae | berndpfrommer/gtsam-tagslam | examples/Pose2SLAMExampleExpressions.cpp | /**
* @file Pose2SLAMExampleExpressions.cpp
* @brief Expressions version of Pose2SLAMExample.cpp
* @date Oct 2, 2014
* @author Frank Dellaert
*/
// The two new headers that allow using our Automatic Differentiation Expression framework
#include <gtsam/slam/expressions.h>
#include <gtsam/nonlinear/ExpressionFactor... | ALGO | 0.998995 | 7.536937 |
12b1c1d5-6fae-4f66-a3a4-3b332bc6e619 | jer22/OI | hdu/bestcoder23/1001/1001.cpp | #include <cstdio>
#include <cstring>
#include <algorithm>
#include <iostream>
using namespace std;
int T;
int arr[1111];
int n;
int main() {
freopen("1001.in", "r", stdin);
scanf("%d", &T);
while (T--) {
scanf("%d", &n);
memset(arr, 0, sizeof(arr));
int sum = 0;
for (int i = 0; i < n; i++) {
scanf("%d",... | ALGO | 0.999639 | 3.955932 |
e751740c-68c1-4d9d-b01c-b5afeeb5828b | PauloMiranda98/Grupo-Preparatorio-para-OBI-2019 | Contest 12º semana/C.cpp | #include <bits/stdc++.h>
using namespace std;
typedef pair<int, int> pii;
const int MAXN = 110;
const int INF = 0x3f3f3f3f;
int mat[MAXN][MAXN];
int d[MAXN][MAXN];
int n;
int dy[] = {0, 0, -1, 1};
int dx[] = {-1, 1, 0, 0};
//Verificar se posso ir para um local na matriz
bool pode(int i, int j){
if( (i>=1) and (i... | ALGO | 0.999592 | 3.848785 |
4b7f6b5d-be32-4849-919f-d3ef8d6c5bbd | bobot/CVC4.old-svn | src/theory/uf/theory_uf_model.cpp | /********************* */
#include "theory/theory_engine.h"
#include "theory/uf/theory_uf_model.h"
#include "theory/uf/equality_engine.h"
#include "theory/uf/theory_uf.h"
#include "theory/quantifiers/term_database.h"
#define RECONSIDER_FUNC_DEFAULT_VALUE
#define ... | TOOL | 0.913936 | 6.110213 |
cb3238bf-45a0-4a46-aede-7429a9d17660 | Subbuleo23/finding-nemo | Algo++/Arrays/FactoSum.cpp | #include "iostream"
using namespace std;
int main(int argc, char* argv[])
{
int ary[1000000];
int n;
cin>>n;
int arr[n];
for(int i=0;i<n;i++) {
cin>>arr[i];
}
int result[n];
for(int i=0;i<n;i++) {
result[i]=1;
}
for(int i=0;i<n;i++){
if(arr[i]>=107) {
... | ALGO | 0.999618 | 3.690405 |
4f685bdc-d339-475c-aeaa-78d2772aee38 | isavita/advent_generated | cpp/day14_part1_2023.cpp |
#include <iostream>
#include <fstream>
#include <vector>
#include <string>
using namespace std;
void tiltNorth(vector<string>& platform) {
int rows = platform.size();
int cols = platform[0].size();
for (int col = 0; col < cols; ++col) {
int emptyRow = -1;
for (int row = 0; row < rows; ++... | ALGO | 0.996674 | 7.197181 |
7284aba5-504f-46f5-a2c0-23fd70a80d3e | kjh01140/codetree-TILs | 241030/숫자로 이루어진 사각형/rectangle-with-a-number.cpp | #include <iostream>
using namespace std;
void PrintNum (int n){
int num=0;
for(int i=0; i<n;i++){
for(int j=0;j<n;j++){
if(num==9) num=0;
cout<<++num<<" ";
}
cout << endl;
}
}
int main() {
int N;
cin >> N;
PrintNum(N);
// 여기에 코드를 작성해주세요.
... | ALGO | 0.99991 | 4.224143 |
ebb0ec2e-a3ae-4c90-ae6e-4ada2513d578 | joshualass/CP | Solutions/Contests/CodeForces/CF1581/A1581.cpp | #include <bits/stdc++.h>
typedef long long ll;
typedef long double ld;
using namespace std;
const ll MOD = 1000000007;
void solve() {
int n; cin >> n;
ll res = 1;
for(int i = 3; i <= n * 2; i++) {
res *= i;
res %= MOD;
}
cout << res << '\n';
}
signed main() {
ios_base::sync_wit... | ALGO | 0.999975 | 5.213821 |
95f62c19-947e-441f-9f5e-079744d3b422 | raincross7/code-similarity | codes/train_code/problem070/problem070_318.cpp | #pragma region
#include <bits/stdc++.h>
using namespace std;
inline void ci(void){
return;
}
template <typename First, typename... Rest>
void ci(First& first, Rest&... rest){
cin >> first;
ci(rest...);
return;
}
inline void co(void){
cout << "\n";
return;
}
template <typename First, typename... Rest>
void c... | ALGO | 0.999373 | 4.621906 |
04f7cdfd-29a6-406b-998e-06ebc4c7adcf | seemantaggarwal/CODEFORALL | ALGOS in C++/TREES/buildheightbalancetree.cpp | #include<iostream>
using namespace std;
class node
{
public:
int data;
node *left;
node *right;
node(int d)
{
data=d;
right=NULL;
left=NULL;
}
};
node *buildtree(int arr[], int s, int e)
{
int mid = (e+s)/2;
if(s>e)
{
return NULL;
}
node *root = new node(arr[mid]);
root->left = buildtree(arr,s,mid-... | ALGO | 0.999906 | 4.608912 |
6c96f9bc-2dba-4b3d-9a29-7d236b5da9f8 | Tittanc/Reponame | InterviewPrep/Arrays/LeetCode/JumoGame2.cpp | #include<iostream>
#include<vector>
using namespace std;
int Jump(vector<int> &nums) {
//Write your code here
if (nums.size() <= 1) return 0;
int ladder = 0;
int stair = 1;
int jump = 0;
for (int level = 0; level < nums.size(); level++) {
if (level == nums.size() - 1) {
return j... | ALGO | 0.999926 | 4.22599 |
451b2f13-6bba-492b-ab7d-70225cb7a894 | ThreatToSurvival/PROGRAMMING_HOMEWORKS | ДЗ-5 (26.12.2018)/Задание 4.cpp | //
#include <iostream>
using namespace std;
int main()
{
unsigned long long int d, c;
long long int* f = new long long int[d + 1];
cin >> d >> c;
for (unsigned long long int i = 0; i < d + 1; i++)
cin >> f[i];
long long int b = f[d];
for (unsigned long long int i = d - 1; i >= 1; i--)
b = f[i] + b ... | ALGO | 0.99994 | 3.266166 |
99055c3a-bf3a-45f2-bfa8-1e9036aa871d | NeverLeave2006/PAT_B | PAT_B_1029.cpp | #include <iostream>
#include <set>
using namespace std;
string toUpper(string &s){
for(int i=0;i<s.length();i++){
if(s[i]>='a'&&s[i]<='z'){
s[i]+=('A'-'a');
}
}
return s;
}
int main()
{
string s,b;
getline(cin,s);
getline(cin,b);
set<char> SetChar;
toUpper(s);
toUpper(b);
for(int i=0;i<b.length();i++... | ALGO | 0.999783 | 3.345341 |
f56d6251-1021-44af-bc50-e300b2295e7c | mahade10/OperatingSystemCode | deadlock.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
int n, m, i, j, k,c=0;
n = 5;
m = 3;
int alloc[5][3],max[5][3],avail[3],temp[3]={0},instance[3]={0};
cout<<"Enter instance\n";
for(i=0;i<m;i++){
cin>>instance[i];
}
cout<<"Enter allocation\n";
for(i=0;i<n;i++){
... | ALGO | 0.999965 | 3.597009 |
2d2328a4-4126-4d0a-9cf1-7990efa8ad08 | a-dev1/CP-Repo | _TLE/Trees/E_Gardener_and_Tree.cpp | #include <bits/stdc++.h>
#define code_brains \
; \
ios_base::sync_with_stdio(false); \
cin.tie(NULL); \
cout.tie(0);
using namespace std;
typedef unsigned long long ull;
typedef long long ll;
typedef long double lld;
const int MAX_N = 1e5 + 1... | ALGO | 0.999884 | 5.295212 |
f8891fc8-e9fb-43d2-8eab-704534a7e0b4 | kassonlab/gmxapi | src/gromacs/linearalgebra/gmx_lapack/slagts.cpp | #include <stdlib.h>
#include <cmath>
#include "gromacs/utility/real.h"
#include "../gmx_lapack.h"
#include "lapack_limits.h"
void
F77_FUNC(slagts,SLAGTS)(int *job,
int *n,
float *a,
float *b,
float *c__,
float *d__,
int *in,
float *y,
float *tol,
int *info)
{
int i__1;
float d__1, d__2, d__4... | ALGO | 0.999901 | 4.52934 |
925bc132-6a06-417c-a4d8-a729109d161d | RajaBabu15/DSA_Learning | Tetrahedron.cpp | #include<bits/stdc++.h>
using namespace std;
const int mod = 1000000007;
vector<vector<int>> mul(const vector<vector<int>> &a, const vector<vector<int>>&b) {
vector<vector<int>> ans(4, vector<int>(4));
for (int i = 0; i < 4; i++) {
for (int j = 0; j < 4; j++) {
int tmp = 0;
for (int k = 0; k < 4; k++) {
... | ALGO | 0.999976 | 4.609997 |
e9f81224-1e65-430e-bed3-31b21ca448ac | fedom/Algorithms | graph/weighted_digraph/weighted_di_topological.cpp | #include "weighted_di_topological.h"
#include <queue>
namespace graph {
WeightedDiTopological::WeightedDiTopological(WeightedDigraph *g) : is_dag_(false) {
//InitUseDfs(g);
InitWithIndegreeTable(g);
}
bool WeightedDiTopological::IsDAG() {
return is_dag_;
}
std::vector<int> WeightedDiTopological::Order() {... | ALGO | 0.999858 | 5.941668 |
2092e1a7-6bd9-4bf8-92a2-ad589fcf265c | yfyfly/moveit2 | moveit_ros/planning/planning_request_adapter_plugins/src/add_time_optimal_parameterization.cpp | /* Author: Ioan Sucan, Michael Ferguson */
#include <moveit/planning_request_adapter/planning_request_adapter.h>
#include <moveit/trajectory_processing/time_optimal_trajectory_generation.h>
#include <class_loader/class_loader.hpp>
namespace default_planner_request_adapters
{
using namespace trajectory_processing;
st... | TOOL | 0.870166 | 7.579091 |
66e8c7fd-0a59-40aa-9f37-a9034173f831 | 6boris/Algorithm | Platform/nowcoder/inerview/Chapter_2/03-SubArrayMaxSum.cpp | #include<algorithm>
#include<cmath>
#include<deque>
#include<iostream>
#include<set>
#include<string>
#include<sstream>
#include<stack>
#include<string.h>
#include<vector>
#include<map>
#include<utility>
#include<queue>
#include<iterator>
#include<math.h>
#include<malloc.h>
#define TIME std::ios::sync_with_stdio(false)... | ALGO | 0.978625 | 3.878092 |
701f1adc-450d-453a-b632-9f492ff7d8cb | TejasAgrawal007/DSA | Stack_usingLinkList.cpp | #include <iostream>
#include<list>
using namespace std;
class Stack{
list<int> ll;
public:
void push(int val)
{
ll.push_front(val);
}
int top()
{
return ll.front();
}
void pop()
{
... | ALGO | 0.989202 | 4.416424 |
683ea7d1-0f25-4a22-a636-a4724f2feeb3 | lakshits11/LeetCode | 0015-3sum/0015-3sum-06-30-2025-18-50-55.cpp | class Solution {
public:
vector<vector<int>> ans;
vector<int> temp;
void twos(int x, int i, vector<int> nums)
{
int lo=i+1,hi=nums.size()-1;
while(lo<hi)
{
if(nums[lo]+nums[hi]<x) lo++;
else if(nums[lo]+nums[hi]>x) hi--;
else {
... | ALGO | 0.999982 | 5.795609 |
2d760a59-7446-4707-b329-8ed67b02e630 | sangam-verma9/DSA_ARSH | arrays/majority_elelemnt.cpp | #include <bits/stdc++.h>
using namespace std;
// optimized approach here we assume first element is major then traverse if same element
// then increase count else count-- or change major element according to count
class Solution
{
public:
int majorityElement(vector<int> &nums)
{
int ans = nums[0];
... | ALGO | 0.999937 | 5.211114 |
94b385bf-2a3f-4e17-b000-dd9f22760b2d | adobe/chromium | third_party/mesa/MesaLib/src/mesa/drivers/dri/i965/brw_fs_vector_splitting.cpp | /**
* \file brw_wm_vector_splitting.cpp
*
* If a vector is only ever referenced by its components, then
* split those components out to individual variables so they can be
* handled normally by other optimization passes.
*
* This skips vectors in uniforms and varyings, which need to be
* accessible as vectors f... | ALGO | 0.94319 | 7.626048 |
bcc4217e-3b6d-4f80-94d0-d3957d9fd999 | tralf-strues/hash-table-optimize | src/dictionary.cpp | #include <ctype.h>
#include <string.h>
#include <stdint.h>
#include "dictionary.h"
#include "hash_functions.h"
const size_t DEFAULT_DEFINITIONS_CAPACITY = 3;
const float DEFINITIONS_EXPAND_MULTIPLIER = 1.8;
const size_t MAX_WORD_LENGTH = 128;
struct Parser
{
char* buffer;
size_t bufferSize;
... | TOOL | 0.862262 | 4.858716 |
aebb8852-ab59-4ced-ad28-26e2b8fb4dba | 113bommy/deepmind_codecontests_refine | cpp_gold_filter_file/cpp_train_7446_4.cpp | #include <bits/stdc++.h>
using namespace std;
const int MAX = 5e5 + 5;
char s[MAX];
int main() {
int n, a, b, T;
cin >> n >> a >> b >> T;
vector<int> t(2 * n);
long long sum = 0;
int l = 1, r = n, res = 0;
scanf("%s", s);
for (int i = 0; i < n; i++) {
if (s[i] == 'w')
t[i] = t[i + n] = b + 1;
... | ALGO | 0.999749 | 3.821315 |
c58ba945-cada-4eef-aea5-500c5e0f44a6 | phuicy/ROBOOP | newmat/tmt6.cpp | /// \ingroup newmat
///@{
/// \file tmt6.cpp
/// Part of matrix library test program.
//#define WANT_STREAM
#define WANT_MATH
#include "include.h"
#include "newmatap.h"
#include "tmt.h"
#ifdef use_namespace
using namespace NEWMAT;
#endif
/**************************** test program ******************************/
... | TEST | 0.955404 | 5.631795 |
e8577aa8-4b90-4a62-9f11-859f7a1ce23b | metehkaya/Algo-Archive | Problems/LeetCode/Solutions/2451.Odd_String_Difference.cpp | class Solution {
public:
string oddString(vector<string>& words) {
map<vector<int>,vector<string>> mp;
for(string s : words) {
int n = s.length();
vector<int> v;
for( int i = 1 ; i < n ; i++ )
v.push_back(s[i]-s[i-1]);
mp[v].push_back(s... | ALGO | 0.999756 | 5.533055 |
38c6f8c3-6c89-45bd-95fa-7f8588ad7c1e | ehtesam75/Codeforces-Solutions | Greedy Algorithms/B. Beautiful Array.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define FASTER ios_base::sync_with_stdio(false); cin.tie(NULL);
#define endl '\n'
const int N = 2e5 + 7;
int a[N];
void solve(){
int n, k, b; ll s; cin >> n >> k >> b >> s;
ll min_sum = 1ll * k * b;
ll max_sum = 1ll * k * b + (k-1) + 1... | ALGO | 0.999275 | 3.518655 |
30a22cc6-97b8-4ebe-b536-78e8b7ba220a | BirdCatcherGamesOrg/bci-sgdk-opponentsearch | OpponentSearch/Source/SharedSearchSpace/Private/BTTask_SharedSearchSpaceMove.cpp | #include "BTTask_SharedSearchSpaceMove.h"
#include "AIController.h"
#include "CliqueHandler.h"
#include "ConsoleVariableUtilities.h"
#include "SharedSearchSpaceBlackboardUtils.h"
#include "SharedSearchSpaceSubsystem.h"
#include "BehaviorTree/BTFunctionLibrary.h"
#include "BehaviorTree/Tasks/BTTask_MoveTo.h"
#include "N... | ALGO | 0.91749 | 6.776055 |
4e05d5de-9313-4976-ab35-ef58327e38cb | athena-paper/athena | lib/Transforms/IPO/LoopExtractor.cpp | #include "llvm/Transforms/IPO.h"
#include "llvm/ADT/Statistic.h"
#include "llvm/Analysis/LoopPass.h"
#include "llvm/IR/Dominators.h"
#include "llvm/IR/Instructions.h"
#include "llvm/IR/Module.h"
#include "llvm/Pass.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Transforms/Scalar.h"
#include "llvm/Transforms/Ut... | TOOL | 0.871125 | 7.865064 |
f3b141b5-9b51-4e78-8e13-a3b38019a266 | hieuvd341/Algorithm | Leetcode/924. Minimize Malware Spread/solve.cpp | #include <iostream>
#include <vector>
#include <algorithm>
#include <unordered_map>
using namespace std;
void dfs(int node, vector<vector<int>> &graph, vector<bool> &visited, vector<int> &component)
{
visited[node] = true;
component.push_back(node);
for (int neighbor = 0; neighbor < graph.size(); neighbor+... | ALGO | 0.999989 | 6.026442 |
91b0ab1b-ff0e-44d7-a4f8-cb67b75bc835 | veerviren/Competitive-Programming | codeforces/practice/B_Planning_The_Expedition.cpp | /*-------------------------------------------------------
Competitive programming
Name: Viren Variya (direction_)
Nothing is impossible, as you believe you can do it
You can do it!!!
-------------------------------------------------------*/
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define en... | ALGO | 0.999987 | 4.525243 |
28674b5c-2be9-44c9-883a-e880448768b4 | baobuibk/coffeeSorter_Jetsonnano | system/src/external_devices/calculate_2kit.cpp | #include "external_devices.hpp"
uint8 external_devices::calculate_2kit( uint16 center_pxl[100][2],
uint16 time_send[100],
uint8 channel_send[100])
{
}
| TOOL | 0.852726 | 3.461833 |
4e8ff390-14b5-4edc-b038-48f61e7ceb96 | BhandariSakshi/C-Plus-Plus-Programs | RecursionFactorSum.cpp | # include <iostream>
using namespace std;
class Recursion
{
public:
int Sum(int iNo);
};
int Recursion :: Sum(int iNo)
{
static int i = 1;
static int iSum = 0;
if (i <= (iNo/2))
{
if (iNo % i == 0)
{
iSum = iSum + i;
}
i++;
Sum(iNo);... | ALGO | 0.999701 | 5.368446 |
1bf0b6ff-1ec7-469c-8fbe-74280deb8ceb | maycherryblossom/Problem-Solving | daily/2022/November/w2/2798.cpp | #include<bits/stdc++.h>
//블랙잭
int N, M;
int cards[100];
int ans = 0;
int main(){
scanf("%d %d", &N, &M);
for (int i=0, j; i<N; i++){
scanf("%d", &j);
cards[i] = j;
}
for (int i=0; i<N; i++){
for (int j=i+1; j<N; j++){
for (int k=j+1; k<N; k++){
int s... | ALGO | 0.999982 | 4.518132 |
a0a27332-24b9-44f5-b0c0-af7eee2088ee | amirabdjamal-nuvending/Amir-Tutorial | Data Structure/PROGRAM CHAPTER 2 - STUDENT/Example 2.32.cpp | #include<iostream>
#include <stdio.h>
#include <stdlib.h>
using namespace std;
struct Node
{
int Data;
Node *next;
}*top;
void push(int value);
void display();
int main()
{
int i=0;
top=NULL;
int value;
push(5);
display();
push(15);
display();
push(25);
display();
... | ALGO | 0.995896 | 3.954458 |
eae80d84-49c0-4a2d-822c-cb8d5ffa061b | loannt401/DSA_PTIT | THUC HANH 2/kiemtracaccapdaungoac.cpp | #include<bits/stdc++.h>
using namespace std;
int check(string s){
stack<char> st;
for(int i=0;i<s.size();i++){
if(s[i] == '(' || s[i] == '[' || s[i] == '{'){
st.push(s[i]);
}
else {
if(st.empty()) return 0;
else {
if(s[i] == ')' && st.top() == '(') st.pop();
else if(s[i] == ']' && st.top() == '... | ALGO | 0.999532 | 4.679008 |
3ea2df8d-8140-4a40-bb64-615ae130e9dd | florentk/iTETRIS | ns-3.7/src/mobility/geoLib/PolarStereographic.cpp | #include "PolarStereographic.hpp"
#define GEOGRAPHICLIB_POLARSTEREOGRAPHIC_CPP "$Id: PolarStereographic.cpp 6785 2010-01-05 22:15:42Z karney $"
RCSID_DECL(GEOGRAPHICLIB_POLARSTEREOGRAPHIC_CPP)
RCSID_DECL(GEOGRAPHICLIB_POLARSTEREOGRAPHIC_HPP)
namespace GeographicLib {
using namespace std;
const Math::real Polar... | ALGO | 0.987619 | 6.732853 |
0f8de033-c686-4af9-aaec-cddce8824f66 | GNAQ/Algorithm-Contest-Archive | Template/Matrix_BSGS.cpp | #include<cstdio>
#include<iostream>
#include<cstring>
#include<cmath>
#include<cstdlib>
#include<algorithm>
#include<iterator>
#include<vector>
#include<map>
#define ll long long
using namespace std;
int P,n,Mat_Mod;
struct Mat
{
int a[310][310],dem;
Mat(){ memset(a,0,sizeof a); dem=0; }
bool operator < (const ... | ALGO | 0.999953 | 3.131961 |
850a86f1-31f9-4229-ba79-63412122483e | wingsit/QP | eigen/doc/examples/Tutorial_ReductionsVisitorsBroadcasting_broadcast_simple_rowwise.cpp | #include <iostream>
#include <Eigen/Dense>
using namespace std;
int main()
{
Eigen::MatrixXf mat(2,4);
Eigen::VectorXf v(4);
mat << 1, 2, 6, 9,
3, 1, 7, 2;
v << 0,1,2,3;
//add v to each row of m
mat.rowwise() += v;
std::cout << "Broadcasting result: " << std::endl;
std:... | ALGO | 0.997555 | 4.266137 |
d482f25a-276d-4b93-8b55-8b675ec2c671 | IRVANDANI1/mobile_programming_ca224 | windows/runner/utils.cpp | #include "utils.h"
#include <flutter_windows.h>
#include <io.h>
#include <stdio.h>
#include <windows.h>
#include <iostream>
void CreateAndAttachConsole() {
if (::AllocConsole()) {
FILE *unused;
if (freopen_s(&unused, "CONOUT$", "w", stdout)) {
_dup2(_fileno(stdout), 1);
}
if (freopen_s(&unuse... | TOOL | 0.998799 | 6.776823 |
1509e22b-00b5-4af4-b40a-bc5dabbea615 | QianhaoIan/cs225_potd | potd-q29/TreeNode.cpp | #include "TreeNode.h"
#include <iostream>
TreeNode * deleteNode(TreeNode* root, int key) {
// your code here
//base case
if (root == NULL) return root;
if (key < root->val_){
root->left_ = deleteNode(root->left_, key);
}
else if (key > root->val_) {
root->right_ = deleteNode(root->right_, key);
}
else {
... | ALGO | 0.999739 | 3.760448 |
98fcb5ca-9968-408e-ae22-eb1fcfa2ca0d | Qsaa/Algorithms | Algorithm/2_Beautiful_string.cpp | //Красотой строки назовем максимальное число идущих подряд одинаковых букв. (красота строки abcaabdddettq равна 3)
//Сделайте данную вам строку как можно более красивой, если вы можете сделать не более k операций замены символа.
//
//Формат ввода
//В первой строке записано одно целое число k(0 ≤ k ≤ 109)
//Во второй ст... | ALGO | 0.999928 | 5.037642 |
3eeefd1f-ce72-4884-8eb7-d18f67187760 | soham1192k/Leetcode-Solutions | 1947-maximum-compatibility-score-sum/1947-maximum-compatibility-score-sum.cpp | class Solution {
public:
int m,n;
int dp[9][(1<<8)+10];
int func(vector<vector<int>>&students,vector<vector<int>>&mentors,int idx,int mask){
if(idx<0||mask==0) return 0;
if(dp[idx][mask]!=-1) return dp[idx][mask];
int ans=0;
int n_mask=0;
for(int i=0;i<m;i++){
... | ALGO | 0.999962 | 5.772918 |
d0407a98-5ec8-4995-ac3a-739d60f3985c | ishandutta2007/codeforces | sirshokoladina/normal/504/C.cpp | #include <bits/stdc++.h>
using namespace std;
#ifdef SG
#include <debug.h>
#else
#define show(...)
#define debug(...)
#define deepen(...)
#define timer(...)
#endif
#define ARG4(_1,_2,_3,_4,...) _4
#define forn3(i,l,r) for (int i = int(l); i < int(r); ++i)
#define forn2(i,n) forn3 (i, 0, n)
#define forn(...) ARG... | ALGO | 0.999953 | 4.039174 |
eb019b53-082c-48dc-a611-9c7026054c10 | ishandutta2007/codeforces | jjleo/normal/1606/D.cpp | #include <bits/stdc++.h>
#define maxn 1000086
using namespace std;
int t;
int n, m;
int a[maxn];
pair<int, int> f[maxn], g[maxn], F[maxn], G[maxn];
inline pair<int, int> get(pair<int, int> &a, pair<int, int> &b){
return {min(a.first, b.first), max(a.second, b.second)};
}
int Id[maxn];
pair<int, int> p[maxn], q[maxn]... | ALGO | 0.999273 | 3.302452 |
b398b06b-da00-4901-b42d-13c76df4121e | Embarcadero/RADStudio12Demos | CPP/Multi-Device Samples/User Interface/GridExplorer/MainForm.cpp | //---------------------------------------------------------------------------
//---------------------------------------------------------------------------
#include <fmx.h>
#pragma hdrstop
#include "MainForm.h"
#include "sysdyn.h"
#include "System.Classes.hpp"
// ----------------------------------------------------... | TOOL | 0.856986 | 4.737031 |
947edc1a-19cd-4d89-90ca-53bca77847ff | iqtree/decenttree | flatmatrix.cpp | #include "flatmatrix.h"
#include <utils/progress.h>
#include <utils/stringfunctions.h> //for contains
#include <math.h> //for log10
#include <iostream> //for std::fstream
#include <sstream> //for std::stringstream
#if USE_GZSTREAM
#include <utils/gzstream.h> //for ogzstream
#else
#include <fstream> ... | TOOL | 0.893711 | 6.391747 |
263b5035-e0d1-4419-be73-6b965d494f71 | OrlowskiWojtek/MonteCarloPhysics | 11_lab/src/utils.cpp | #include "utils.hpp"
#include "photon_difussion.hpp"
void task_2()
{
for(int i = 0; i < 4; i++){
PHOTON_DIFFUSION_2D photon;
photon.nlayers = 3;
photon.xmax = 0.2;
photon.x_source = 0.1;
photon.dx_source = 0.0;
photon.x_detect = 0.15;
photon.dx_detect = 0.01... | ALGO | 0.986336 | 3.608697 |
1b89ca4b-f294-4876-bb36-3f112ab46b82 | Manish-CS25/A2Z_DSA_Leetcode | 1711-find-valid-matrix-given-row-and-column-sums/find-valid-matrix-given-row-and-column-sums.cpp | class Solution {
public:
vector<vector<int>> restoreMatrix(vector<int>& rowsum,
vector<int>& colsum) {
int n = rowsum.size();
int m = colsum.size();
vector<vector<int>> ans(n, vector<int>(m, 0));
int i = 0;
int j = 0;
while (i <... | ALGO | 0.999991 | 6.391477 |
f7fe0d7c-e4cd-476c-93c6-147674233999 | GaganKumar-26/DSA-Practice | patterns/p2.cpp | #include<iostream>
using namespace std;
int main(){
int n;
cin>>n;
int i=1;
int count = 1;
while(i<=n){
int j=1;
while(j<=n){
cout<<count<<" ";
count = count + 1 ;
j = j + 1;
}
cout<<endl;
i = i + 1;
}
} | ALGO | 0.999966 | 3.680371 |
325c763a-fedf-4d49-a51b-020217d20997 | yagyeshgoyal/LeetCode | 1146-greatest-common-divisor-of-strings/1146-greatest-common-divisor-of-strings.cpp | class Solution {
public:
string gcdOfStrings(string str1, string str2) {
string p;
string q;
if(str1.length() <= str2.length()){
p = str2;
q = str1;
}
else{
p = str1;
q = str2;
}
vector<string>v;
string... | ALGO | 0.999938 | 5.945163 |
03703b36-a23e-47f0-950f-336ccdc977f3 | hoangmanhkhiem/laptrinhonline.club | OngDanCuaBob.cpp | #include<stdio.h>
main(){
int n, a, b;
scanf("%d", &n);
while(n--){
scanf("%d %d", &a, &b);
printf("%d\n", a+b);
}
} | ALGO | 0.998988 | 3.18667 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.