uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
3adcfd8d-0447-4bcb-8a93-c1f02c4a6a8c | proydakov/codeforces | Codeforces_Round_#235/A/solution.cpp | #include <cmath>
#include <iostream>
int main()
{
std::ios::sync_with_stdio(false);
int n; int x;
std::cin >> n;
std::cin >> x;
int acc = 0;
for(int i = 0; i < n; i++) {
int val;
std::cin >> val;
acc += val;
}
int count = 0;
count += std::abs(acc / x);
... | ALGO | 0.999633 | 3.717443 |
ef55e6fb-edf2-40b7-a337-124521cf34c0 | zhaoxuan666/CodeStudyEveryday | 前序遍历.cpp | /**
* Definition for binary tree
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode(int x) : val(x), left(NULL), right(NULL) {}
* };
*/
class Solution {
public:
vector<int> preorderTraversal(TreeNode *root) {
stack<TreeNode*> S;
vector<int> V;
... | ALGO | 0.999994 | 5.5704 |
889d8605-5551-41d9-8baf-5286b5acfe93 | kpu/moses-interp | moses/LM/ORLM.cpp | #include <limits>
#include <iostream>
#include <fstream>
#include "moses/FactorCollection.h"
#include "moses/Phrase.h"
#include "moses/InputFileStream.h"
#include "moses/StaticData.h"
#include "ORLM.h"
using std::map;
namespace Moses
{
bool LanguageModelORLM::Load(const std::string &filePath, FactorType factorType,
... | TOOL | 0.979998 | 6.045994 |
084402a5-5125-4ee9-b830-d7a3fc16b00f | yandex/perforator | contrib/libs/llvm18/lib/CodeGen/StackColoring.cpp | #include "llvm/ADT/BitVector.h"
#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/DepthFirstIterator.h"
#include "llvm/ADT/SmallPtrSet.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/Statistic.h"
#include "llvm/Analysis/ValueTracking.h"
#include "llvm/CodeGen/LiveInterval.h"
#include "llvm/CodeGen/MachineBasicB... | TOOL | 0.902942 | 7.703067 |
0bb8acf8-c823-406c-838f-54833dd41a4a | MunoLike/KyoPro | abc313/c/main.cpp | #include <bits/stdc++.h>
#include <atcoder/all>
using namespace std;
using i32 = int32_t;
using i64 = int64_t;
using u32 = uint32_t;
using u64 = uint64_t;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(a) (a).begin(), (a).end()
const i32 dy[] = {-1, 0, 1, 0, -1, -1, 1, 1};
const i32 dx[] = {0, 1, 0, ... | ALGO | 0.999935 | 4.59852 |
559b17d0-25a3-463a-9c90-8d36369078c9 | bhatia786/DSA | check sorted or not using recursion.cpp | #include <iostream>
#include<vector>
using namespace std;
bool checkSorted(vector<int>& arr,int i,int& n){
if(i==n-1){
return true;
}
if(arr[i]<=arr[i+1]&&i+1<n){
return checkSorted(arr,i+1,n);
}
else{
return false;
}
}
int main() {
vector<int>arr{1,2,3,5,2};
int n=a... | ALGO | 0.999974 | 5.109382 |
a7f21773-7adc-4041-a667-58528a3d94c7 | ishandutta2007/codeforces | thenymphsofdelphi/normal/499/A.cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
int n, m, sum = 0;
cin >> n >> m;
int a[n], b[n];
int t = 0, h;
for (int i = 0; i < n; i++){
cin >> a[i] >> b[i];
sum += b[i] - a[i] + 1;
h = a[i] - t - 1;
sum += h % m;
t = b[i];
}
cout << sum;... | ALGO | 0.999975 | 3.727883 |
c6aece27-8861-4b8b-852f-122c7e403833 | avidLearnerInProgress/leetcode-solutions | task_scheduler.cpp | class Solution {
public:
/*
Idea:
-> To work on the same task again, CPU has to wait for time n, therefore we can think of as if there is a cycle, of time n+1, regardless whether you schedule some other task in the cycle or not.
-> To avoid leaving the CPU with limited choice of tasks and having to sit there cooli... | ALGO | 0.999984 | 6.72891 |
4921bb1c-8191-4138-b1b0-371c66eb9142 | nghuunghiaa111/test_wallet_core | src/Aion/Signer.cpp | #include "Signer.h"
#include "../Hash.h"
#include "../uint256.h"
#include <boost/multiprecision/cpp_int.hpp>
using namespace TW;
using namespace TW::Aion;
Proto::SigningOutput Signer::sign(const Proto::SigningInput& input) noexcept {
using boost::multiprecision::uint128_t;
auto key = PrivateKey(Data(input.p... | ALGO | 0.962674 | 6.917515 |
6ec8f6ec-15ab-4fa9-8a01-863d1b73fb5c | vaibhaviDixit/AdvancedC | ADS/programs/58-59/ten.cpp | /*
Given a positive weighted undirected graph, find the minimum weight cycle in it.
Input: [(0, 1, 4),(0, 7, 8),(1, 2, 8),(1, 7, 11),(2, 3, 7),(2, 8, 2),(2, 5, 4),(3, 4, 9),(3, 5, 14),(4, 5, 10),(5, 6, 2),(6, 7, 1),(6, 8, 6),(7, 8, 7)]
Output: 14
*/
// c++ program to find shortest weighted cycle in undirected graph
... | ALGO | 0.999898 | 6.237021 |
ac693fa7-692e-4abd-9ff2-4a80827b3dec | Behzad35/U-Net | src/main.cpp | #include <iostream>
#include "unetFuncs.h"
#include "processImages.h"
#include "initWeights.h"
#include "ConvStruct.h"
int main(int argc, char *argv[]){
verbose=false;
debug=false;
learning_rate = 0.001; // this is alpha in the adam optimiser
if(argc<4){std::cout<<"Usage: [imgsize] [batchsize] [num_of... | DATA | 0.879971 | 3.673649 |
f77c0b57-255d-48e8-86a6-efee4e04073a | RaidenDev/mangos | src/bindings/scripts/scripts/eastern_kingdoms/scarlet_monastery/boss_herod.cpp | /* ScriptData
SDName: Boss_Herod
SD%Complete: 95
SDComment: Should in addition spawn Myrmidons in the hallway outside
SDCategory: Scarlet Monastery
EndScriptData */
#include "precompiled.h"
#include "escort_ai.h"
enum
{
SAY_AGGRO = -1189000,
SAY_WHIRLWIND = -1189001,
SAY_ENRAGE ... | TOOL | 0.927022 | 6.870764 |
8e55692e-37d8-4ad8-af40-70d6c3300c49 | lmcampos/PyPupilExt | 3rdparty/spii/thirdparty/Eigen/doc/examples/tut_matrix_coefficient_accessors.cpp | #include <iostream>
#include <Eigen/Dense>
using namespace Eigen;
int main()
{
MatrixXd m(2,2);
m(0,0) = 3;
m(1,0) = 2.5;
m(0,1) = -1;
m(1,1) = m(1,0) + m(0,1);
std::cout << "Here is the matrix m:\n" << m << std::endl;
VectorXd v(2);
v(0) = 4;
v(1) = v(0) - 1;
std::cout << "Here is the vector v:\n... | ALGO | 0.998382 | 3.687909 |
c9b4cceb-8e6f-499f-b381-4bd8e8acfbd4 | A-transformer/fusedsegmamba | monai/csrc/filtering/bilateral/bilateralfilter_cpu.cpp | #include <math.h>
#include <torch/extension.h>
#include "utils/tensor_description.h"
#include "utils/tensor_indexing.h"
template <typename scalar_t>
void BilateralFilterCpu(torch::Tensor inputTensor, torch::Tensor outputTensor, float spatialSigma, float colorSigma) {
// Getting tensor description.
TensorDescripti... | ALGO | 0.97721 | 6.964032 |
272147d8-e198-4ae7-aab3-594076019cfa | RealityRipple/UXP | dom/media/webaudio/blink/HRTFPanner.cpp | #include "HRTFPanner.h"
#include "HRTFDatabaseLoader.h"
#include "FFTConvolver.h"
#include "HRTFDatabase.h"
#include "AudioBlock.h"
using namespace std;
using namespace mozilla;
using dom::ChannelInterpretation;
namespace WebCore {
// The value of 2 milliseconds is larger than the largest delay which exists in any ... | ALGO | 0.952524 | 6.776605 |
0c1d27d3-5ec2-4711-b8ce-49bf924735fb | rishabh27goel/DSA-Extra-Questions | Leetcode/Maximum_Candies_You_Can_Get_from_Boxes.cpp | #include <iostream>
#include <vector>
#include <queue>
using namespace std;
class Solution {
public:
int maxCandies(vector<int>& status, vector<int>& candies, vector<vector<int>>& keys, vector<vector<int>>& containedBoxes, vector<int>& initialBoxes) {
ios_base::sync_with_stdio(false);
cin.t... | ALGO | 0.999919 | 5.448349 |
7ebf4cdb-3d7b-4be0-a433-ad669b309524 | Vedika21K/tnpflutter1 | 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 |
88871ef4-a63e-42d4-8720-1f65ae679ef8 | INOXBEAT/machine-learning-first-project | venv/Lib/site-packages/sklearn/utils/src/MurmurHash3.cpp | // Note - The x86 and x64 versions do _not_ produce the same results, as the
// algorithms are optimized for their respective platforms. You can still
// compile and run any of them on any platform, but your performance with the
// non-native version will be less than optimal.
#include "MurmurHash3.h"
//-------------... | ALGO | 0.998272 | 7.214447 |
ba03076f-0f13-40df-bf2d-13d224610a7c | Pedr0o0o/MetodyNumeryczne | kwadraty/kwadraty/Źródło.cpp | #include<iostream>
#include<math.h>
using namespace std;
double xsinFun(double x)
{
return x * x * sin(x) * sin(x) * sin(x);
}
double expFun(double x)
{
return exp(x * x) * (x - 1);
}
double horner(double wsp[], int st, double x)
{
if (x == 0) return wsp[st];
else {
double wynik = wsp[0];
for (int i = 1; i... | ALGO | 0.999992 | 4.095779 |
5cb9937e-15b8-464e-8701-6270c059b727 | SatyamJindal/Competitive-Programming | codeforces/Chess For Three.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
int n;
cin>>n;
int flag=0;
int curr1=1,curr2=2,spec=3;
for(int i=0;i<n;i++)
{
int x;
cin>>x;
if(x==spec)
{
flag=1;
}
else
{
if(x==curr1)
{
swap(spec,curr2);
}
else
{
swap(spec,curr1);
}
}
}
if(flag==1) cout<<... | ALGO | 0.999979 | 3.398599 |
34fd8cb4-706a-41f4-8647-176f8f306060 | liuwh08/LeetCode | flatten_Test.cpp | #include "flatten.h"
#include <iostream>
using namespace std;
int main(int argc, char *argv[])
{
TreeNode* root = new TreeNode(1);
TreeNode* right = new TreeNode(5);
TreeNode* left = new TreeNode(2);
root->right = right;
root->left = left;
Solution s;
s.flatten(root);
cout<< root->val << root->right->... | ALGO | 0.998414 | 4.032871 |
e356c057-210b-495d-9eac-5f7821ded119 | indrajohn7/Problem-Solving | geeks_for_geeks/dynamic_programming/hard/all_paren.cpp | #include<bits/stdc++.h>
using namespace std;
struct node {
char* expr;
int pos_start;
int pos_end;
int val;
node(char* str, int p_s, int p_e, int v)
{
expr = new char[strlen(str)];
strncpy(expr, str, strlen(str));
pos_start = p_s;
pos_end = p_e;
val = v;
}
};
int get_val(int first, char symbol, int... | ALGO | 0.999641 | 4.241774 |
d851fb76-026e-425f-83ca-c262e19c588a | imperiumcointeam/ImperiumCoin | src/addrman.cpp | #include "addrman.h"
#include "hash.h"
using namespace std;
int CAddrInfo::GetTriedBucket(const std::vector<unsigned char> &nKey) const
{
CDataStream ss1(SER_GETHASH, 0);
std::vector<unsigned char> vchKey = GetKey();
ss1 << nKey << vchKey;
uint64 hash1 = Hash(ss1.begin(), ss1.end()).Get64();
CDat... | ALGO | 0.970691 | 6.083518 |
d204146a-3674-44e6-9208-fa8c9908ea44 | hsheric0210/Algorithm-Coding | cpp/AJIT-new/경시대회-2/80030/80030.cpp | /*
서로 다른 소수들의 합
https://<IP_ADDRESS>/contest/18/problem/80030
https://deefer.tistory.com/140
https://www.acmicpc.net/problem/3908
*/
#include<iostream>
#include<vector>
using namespace std;
int i, j, k, l, m, n, o, p, q, **dp;
vector<int> primes;
int main()
{
vector<int> primes;
// dp테이블 heap에 할당 (StackOverflow 방지)
... | ALGO | 0.999917 | 4.425976 |
206c1bdf-62c8-4157-a85a-f5fbf394c929 | JiangWZW/Gitea_Blender_NPR | intern/cycles/util/string.cpp | #include <stdarg.h>
#include <stdio.h>
#include <algorithm>
#include <cctype>
#include "util/foreach.h"
#include "util/string.h"
#include "util/windows.h"
#ifdef _WIN32
# ifndef vsnprintf
# define vsnprintf _vsnprintf
# endif
#endif /* _WIN32 */
CCL_NAMESPACE_BEGIN
string string_printf(const char *format, ...... | TOOL | 0.936467 | 5.806148 |
ae384e88-d0b5-4cdc-b22c-6e9809b9728b | sunnysiddhu21/Leetcode-Problems | 1442-number-of-operations-to-make-network-connected/number-of-operations-to-make-network-connected.cpp | class DisjointSet {
public:
vector<int> rank, parent, size;
DisjointSet(int n) {
rank.resize(n + 1, 0);
parent.resize(n + 1);
size.resize(n + 1);
for (int i = 0; i <= n; i++) {
parent[i] = i;
size[i] = 1;
}
}
int findUPar(int node) {
... | ALGO | 0.999935 | 5.861748 |
8b2a8541-4151-4a22-8712-c385b143f08c | OwaisK4/Competitive-Programming | Codeforces/1300/H_Beppa_and_SwerChat.cpp | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define int long long
#define all(a) a.begin(), a.end()
#define vi vector<int>
#define seed chrono::high_resolution_clock::now().time_since_epoch().count()
#define file_read(filepath) freopen(filepath, "r", stdin);
#d... | ALGO | 0.99996 | 4.381476 |
a2681831-ccca-4ceb-baee-45efe739e248 | VaibhavVerma16113108/Competitive-Programming | Codeforces/Collecting-Coins.cpp | #include <iostream>
#include <vector>
using namespace std;
int main()
{
int t;
cin >> t;
while (t--)
{
int a, b, c, n;
cin >> a >> b >> c >> n;
if ((n + a + b + c) % 3)
{
cout << "NO" << endl;
}
else
{
int k = (n + a + b + ... | ALGO | 0.999637 | 4.150579 |
3d6a8256-d0ce-4678-80e1-7d3d4143be41 | Shubhamsahu1101/cpp | Dividing_into_Groups.cpp | #include <bits/stdc++.h>
#define forall(it, cont) for (auto it = cont.begin(); it != cont.end(); it++)
#define forl(i, a, b) for (int i = a; i < b; i++)
#define forr(i, a, b) for (int i = a; i >= b; i--)
#define int long long
#define pb push_back
#define M 1000000007
#define yes cout << "YES" << endl
#define no cout <<... | ALGO | 0.999928 | 3.345279 |
7546b36e-7b2c-4a03-8e80-eca740b54211 | Sahilraj3107/leetcode | 0518-coin-change-ii/0518-coin-change-ii.cpp | class Solution {
public:
int f(int idx,int amount, vector<int>& coins,vector<vector<int>>& dp){
if(amount==0)return 1;
if(idx ==0)return (amount%coins[0]==0);
if(dp[idx][amount]!=-1)return dp[idx][amount];
int notTake = f(idx-1,amount,coins,dp);
int Take =0;... | ALGO | 0.99987 | 5.744908 |
308e76b8-5817-4a77-aef7-85a9afe3d57b | vivek-ydv/DSA-CPP | DSA Programs/Graphs/03_BFS.cpp | #include <bits/stdc++.h>
using namespace std;
vector<int> bfs(int V, vector<int> adj[])
{
vector<int> vis(V + 1, 0); // declearing a visited array intilised all values as '0'
queue<int> q;
vector<int> bfs;
// since graph may be disconnected so run a for loop
for (int i = 1; i <= V; i++) // as our g... | ALGO | 0.999783 | 4.788559 |
ffa59268-4fdb-4a2b-a283-096764ae2306 | Mazen-Ghanaym/CP-Templates | Number_Theory/Euclidean.cpp | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define ll long long
#define ull unsigned long long
#define ld long double
#define int long long
#define nl "\n"
#define oo 1e9 + 1
#define OO 1e18 + 1
#define sp ' '
#define sz(x) (int)(x.size())
#define MOD 10000000... | ALGO | 0.999414 | 3.612607 |
1a58ef2d-8ee5-40da-9dd6-0d14eead6cb9 | ishandutta2007/codeforces | leafy/normal/1084/D.cpp | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N=600005;
int n;
ll w[N],f[N],a[N];
struct edge{int to,w;};
vector<edge> G[N];
ll ans=0;
void dfs(int u,int fa){
f[u]=w[u];
for(int i=0;i<G[u].size();i++){
edge e=G[u][i];
if(e.to==fa) continue;
dfs(e.to,u);
... | ALGO | 0.999962 | 4.013649 |
2c3de437-d3b8-442d-9a00-5c55f373037e | raincross7/code-similarity | codes/train_code/problem460/problem460_438.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int, int>;
#define rep(i, n) for (ll i = 0; i < (n); ++i)
#define sz(x) int(x.size())
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a >... | ALGO | 0.999952 | 3.914576 |
68341b0c-7624-4c95-8474-dfafb2877a93 | 7Dsilva/Practice | BuySell.cpp | #include<bits/stdc++.h>
using namespace std;
// g++ -o BuySell.exe BuySell.cpp && ./BuySell.exe
// bruteforce: uses 2 for loops and will take n^2
int main(){
vector<int> prices = {7,6,4,3,1};
int n = prices.size();
int res = 0;
for(int i=0;i<n;i++){
int x = prices[i];
for(int j=... | ALGO | 0.999177 | 4.30218 |
2bcd6e3c-5a1e-4f01-aefa-b12ba2146126 | AbdulMoeez060/Labwork | DSA Lab 10/testLinkedList.cpp | #include"myLL.h"
int main()
{
cout << "****** TEST LINKED LIST CPP ****** \n" << endl;
myLL<char> obj;
if (obj.isEmpty())
{
cout << "Obj Is Empty" << endl;
}
else
{
cout << "Not empty" << endl;
}
cout << "Adding Values" << endl;
obj.insertAtEnd('L');
obj.insertAtEnd('i');
obj.insertAtEnd('n');
obj.i... | TEST | 0.907095 | 4.621741 |
2500efd3-27e7-465a-8bd8-a3808c554d14 | BeneditoNogueira/test | graph/prim.cpp | // C++ program to implement Prim's Algorithm
#include <iostream>
#include <queue>
#include <vector>
using PII = std::pair<int, int>;
int prim(int x, const std::vector<std::vector<PII> > &graph) {
// priority queue to maintain edges with respect to weights
std::priority_queue<PII, std::vector<PII>, std::greate... | ALGO | 0.999989 | 5.55471 |
969e3cfd-a4ac-45f0-acdb-b8e9b88a99e2 | egunnarsson/mypt | src/eRenderer/AABVH.cpp |
#include <stack>
#include <queue>
#include <functional>
#include "Log.h"
#include "AABVH.h"
#include "Scene.h"
#include "Mesh.h"
#include "Triangle.h"
AABVH::Element::Element() :
m_isLeaf(true),
m_mesh(nullptr),
m_triangle(nullptr),
m_chunkIndex(0),
m_triangleIndex(0)
{
}
AABVH::Element::Element(AABox aabox, ... | ALGO | 0.999367 | 6.737317 |
247c9faf-7dcb-48dd-aef8-34465fed059c | SANDEEP-9657/CPP_Learning | Friendly Pair.cpp | // Friendly Pair
#include<bits/stdc++.h>
using namespace std;
bool isFriendlyPair(int a , int b){
int SumA = 0;
int SumB = 0;
int i;
for(i=1;i<=a/2;i++){
if(a%i == 0){
SumA = SumA+i;
}
}
for(i=1;i<=b/2;i++){
if(b%i == 0){
SumB = SumB+i;
}... | ALGO | 0.999932 | 5.024407 |
4a975ea7-1cfa-4d8c-ae16-41a838393c11 | YttriumWillow/OI | Contests/2023/SC/1018/ZJ-S00106/string/string.cpp | #include <iostream>
#include <cstring>
#include <queue>
#define rep(i, a, b) for(int i = (a); i <= (b); ++i)
using namespace std;
const int N = 3e4 + 10, M = 1e4 + 10;
struct tree
{
int son[26];
bool leaf;
} tr[260010];
string s[N];
int cnt, ans, n, din[26];
bool st[N];
int h[26], e[M], ne[M], idx;
inline void ... | ALGO | 0.999983 | 3.971253 |
5021a519-3783-4c0c-9b2b-9f18bd606b99 | cschpc/heat-equation | 2d/mpi/core.cpp | /* Main solver routines for heat equation solver */
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>
#include <mpi.h>
#include "heat.h"
/* Exchange the boundary values */
void exchange(field *temperature, parallel_data *parallel)
{
double *data;
double *sbuf_up, *sbuf_down, *r... | ALGO | 0.999992 | 4.952834 |
43f8bc89-ba45-45fe-aaf0-6b2256a0c1fb | ishandutta2007/codeforces | kostya_by/normal/274/A.cpp | #include <iostream>
#include <cstdio>
#include <cmath>
#include <vector>
#include <map>
#include <set>
#include <string>
#include <cstring>
#include <algorithm>
#include <iomanip>
#include <queue>
#include <cstdlib>
#include <ctime>
#include <stack>
#include <fstream>
typedef unsigned long long ull;
#define mp make_pa... | ALGO | 0.999758 | 3.647357 |
d474345a-f3ec-466e-bcca-3b30b883fe88 | AnnalisaRapthap/Lab-4b | answer8.cpp | #include<iostream>
using namespace std;
int sumofdigits(int a)
{
static int rem,sum=0;
if(a)
{
rem=a%10;
sum=sum+rem;
sumofdigits(a/10);
}
else
return 0;
return sum;
}
int main()
{
int n,s;
cout << "Enter the number" << endl;
cin >> n;
s=sumofdigits(n);
cout << "The sum of digits=" << s;
}
| ALGO | 0.999931 | 4.474468 |
486d489a-aa74-4e8f-982c-e4ded87dfafd | askmuhsin/path-planning | src/Eigen-3.3/doc/examples/tut_arithmetic_dot_cross.cpp | #include <iostream>
#include <Eigen/Dense>
using namespace Eigen;
using namespace std;
int main()
{
Vector3d v(1,2,3);
Vector3d w(0,1,2);
cout << "Dot product: " << v.dot(w) << endl;
double dp = v.adjoint()*w; // automatic conversion of the inner product to a scalar
cout << "Dot product via a matrix product... | ALGO | 0.997754 | 4.012072 |
b0699fbe-18fa-4062-8ee2-33dcce7a40df | sarvex/leetcode-object-pascal | solution/1000-1099/1010.Pairs of Songs With Total Durations Divisible by 60/Solution.cpp | class Solution {
public:
int numPairsDivisibleBy60(vector<int>& time) {
int cnt[501]{};
int ans = 0;
for (int& t : time) {
int s = 60;
for (int i = 0; i < 17; ++i) {
if (s - t >= 0 && s - t < 501) {
ans += cnt[s - t];
... | ALGO | 0.99965 | 5.545289 |
cd2e902a-0ae6-46b6-abb1-a25033707ebb | camil0palacios/Competitive-programming | solutions/COJ/4287 - TGarden [PROGRESIVO13]/solution.cpp | #include <bits/stdc++.h>
#define endl '\n'
using namespace std;
struct cell{
int x, y, t;
cell(){}
cell(int _x, int _y, int _t): x(_x), y(_y), t(_t){}
bool operator<(cell & o){
return x < o.x;
}
};
int dx[4] = {1,0,-1, 0};
int dy[4] = {0,1, 0,-1};
int bfs(queue<cell> & q, set<pair<int,int... | ALGO | 0.999967 | 5.33884 |
e43075f5-ecc9-49bf-8398-eb3962f6a2dd | tanu-k/code | hq9+.cpp | #include <bits/stdc++.h>
#include <string>
using namespace std;
int main(int argc, char const *argv[])
{
char p[100];
int i;
cin >> p;
for(i = 0; i < strlen(p); i++) {
if(p[i] == 'H' || p[i] == 'Q' || p[i] == '9') {
cout << "YES" << endl;
return 0;
}
}
cout << "NO" << endl;
return 0;
} | ALGO | 0.997812 | 3.570904 |
24cff2a4-e2e5-49e0-84cf-752bf081ceb0 | junbum000921/algorithm | cpp/dp4.cpp | #include <stdio.h>
#include <iostream>
using namespace std;
int main(){
int n;
cin >> n;
n++;
int dp[1001] = {0,};
dp[1] = 1;
dp[2] = 2;
dp[3] = 4;
for(int i=4; i<=n; i++){
dp[i]=dp[i-1]+dp[i-2]+dp[i-3];
}
cout<<dp[n]<<endl;
return 0;
} | ALGO | 0.999988 | 3.460474 |
0e67f752-e78a-4d5d-bc64-6e867b239c6f | sjx95/codeforces | 1520/p1520a.cpp | #include <iostream>
#include <bitset>
using namespace std;
void solve() {
int n;
cin >> n;
string str;
cin >> str;
char last = 0;
bitset<128> flags;
for (char c : str) {
if (c == last)
continue;
if (flags[c]) {
cout << "NO" << endl;
return;
}
flags[c] = true;
last = c;
}
cout << "YES" << ... | ALGO | 0.999932 | 4.505385 |
95e68bc7-5831-4fc4-9106-15fe874fa605 | ishandutta2007/codeforces | faustaadp/normal/581/B.cpp | #include<bits/stdc++.h>
using namespace std;
long long ma,n,i,a[100100],b[100100];
int main()
{
cin>>n;
for(i=1;i<=n;i++)
{
cin>>a[i];
}
b[n]=0;
ma=a[n]+1;
for(i=n-1;i>=1;i--)
{
if(a[i]>=ma)
{
b[i]=0;
ma=a[i]+1;
}
else
{
b[i]=ma-a[i];
// ma++;
}
}
for(i=1;i<=n;i++)
{
if(i==n)
co... | ALGO | 0.99997 | 3.344608 |
0e5e37b3-f0fd-490a-9e36-9adef38d09e3 | junior0803/PSP_emulator | ext/SPIRV-Cross/spirv_cfg.cpp | #include "spirv_cfg.hpp"
#include "spirv_cross.hpp"
#include <algorithm>
#include <assert.h>
using namespace std;
namespace SPIRV_CROSS_NAMESPACE
{
CFG::CFG(Compiler &compiler_, const SPIRFunction &func_)
: compiler(compiler_)
, func(func_)
{
build_post_order_visit_order();
build_immediate_dominators();
}
... | ALGO | 0.998074 | 6.262017 |
bb25a205-e736-4a41-a934-c54ecf1209a1 | Niladree60/LeetCodeSolutions | LeetCode929.cpp | class Solution {
public:
int numUniqueEmails(vector<string>& emails) {
set<string> st;
for(auto x : emails)
{
string temp = "";
for(int i =0 ; i < x.size() ; i++)
{
if(x[i] == '.') {
continue;
}
... | ALGO | 0.998421 | 5.735474 |
2ca13b26-2e20-495e-93ff-c5b93785efdf | ansh-prasad/Leet-Code | 229. Majority Element II.cpp | class Solution {
public:
vector<int> majorityElement(vector<int>& nums) {
int n = nums.size();
if (n == 0)
return {};
int candidate1 = 0, candidate2 = 0, count1 = 0, count2 = 0;
for (int num : nums) {
if (num == candidate1) {
count1++;
... | ALGO | 0.99999 | 5.837377 |
93671a5f-de0d-4bb6-9902-8e7b27468578 | 20190511/codetree-TILs | Programmers/42579.cpp | //1235 ~ 1300 (25분)
//https://school.programmers.co.kr/learn/courses/30/lessons/42579
#include <string>
#include <vector>
#include <iostream>
#include <queue>
#include <map>
using namespace std;
struct node {
int idx;
int plays;
const bool operator< (const node& a) const {
return plays < a.pla... | ALGO | 0.999903 | 5.081108 |
1152a933-ed3e-473e-ac37-d3bb7ebc81e7 | vassbar/Codeforces | 50B.cpp | #include <cstdio>
#include <iostream>
#include <vector>
int main(){
const int N = 256;
std::vector<long long> counts(N,0);
std::string input; getline(std::cin, input);
for(long k = 0; k < input.size(); k++){++counts[input[k]];}
long long total(0);
for(long k = 0; k < N; k++){total += cou... | ALGO | 0.999709 | 4.248233 |
d4de1484-3755-4834-aa1b-f5f29c528b5b | 113bommy/deepmind_codecontests_refine | cpp_source_filter_file/cpp_train_9016_19.cpp | #include <bits/stdc++.h>
using namespace std;
multiset<int> s;
long long a[100005];
int main() {
int n, k, m;
cin >> n >> k >> m;
for (int i = 0; i < n; i++) {
cin >> a[i];
s.insert(a[i] % m);
}
int vis = -1;
for (int i = 0; i < m; i++) {
if (s.count(i) >= k) vis = i;
}
if (vis == -1)
co... | ALGO | 0.999992 | 3.413329 |
d1a28406-fcfb-4543-a7b9-76bd114d4396 | natalieagus/AdaptiveSurface | offlineReverb/TheEngineSample/QuadraturePhaseEnvelopeFollower.cpp | #include "QuadraturePhaseEnvelopeFollower.h"
QuadraturePhaseEnvelopeFollower::QuadraturePhaseEnvelopeFollower(){
setHighpassCoefficients();
setLowpassCoefficients();
bandpassFilter = vDSP_biquad_CreateSetup(bandpassCoefficients,2);
allpassCascade1 = vDSP_biquad_CreateSetup(ap1coefficients, ALLPASS_CASC... | ALGO | 0.998509 | 4.934833 |
24f84540-df24-4168-8572-4cc06f86e923 | vinayak05/SimpleMotionPlanner | submission/src/Eigen-3.3/doc/examples/make_circulant2.cpp | #include <Eigen/Core>
#include <iostream>
using namespace Eigen;
// [circulant_func]
template<class ArgType>
class circulant_functor {
const ArgType &m_vec;
public:
circulant_functor(const ArgType& arg) : m_vec(arg) {}
const typename ArgType::Scalar& operator() (Index row, Index col) const {
Index index = ... | ALGO | 0.998735 | 5.538595 |
2aa89d69-7b4e-4ab5-bada-50b0540c6c05 | hyuncat/RichCluster | src/DistanceMatrix.cpp | //
// DistanceMatrix.cpp
// richCluster
//
// Created by Sarah on 6/2/25.
//
#include <stdio.h>
#include "DistanceMatrix.h"
#include <Rcpp.h>
int DistanceMatrix::getDistanceIndex(int t1, int t2) const {
int row_index = t1;
int col_index = t2;
return (row_index * n_terms) + col_index;
}
double DistanceMatrix... | ALGO | 0.963069 | 5.950995 |
363f49f7-e0f5-4d2c-bdbf-6b97299d7dff | subhadeep01/leetcode-problems | 2616-minimize-the-maximum-difference-of-pairs/2616-minimize-the-maximum-difference-of-pairs.cpp | class Solution {
public:
#define ll long long
bool check(int mid, vector<int>&nums, int p)
{
// see whether there are atleast p pairs with difference<=mid
int pairs=0;
for(int i=1;i<nums.size();i++)
{
if((nums[i]-nums[i-1])<=mid){
pairs++;
... | ALGO | 0.999981 | 5.368332 |
6c4d7f38-4989-4483-bc72-b2ec3f3870b2 | circleolami/dgu_computer-algorithms | Lab3/3.cpp | #include <iostream>
#include <fstream>
#include <vector>
#include <map>
#include <algorithm>
#include <cctype>
#include <cstring>
using namespace std;
bool is_valid_char(unsigned char c);
bool compare(const pair<string, int> &a, const pair<string, int> &b);
int main()
{
ifstream file("datafile.txt", ios::binary)... | ALGO | 0.954159 | 4.680405 |
7cb4fce8-3210-44fe-b2c8-ba1280143877 | DunderGG/Vehicle-State-Estimator | eigen/doc/examples/Tutorial_ArrayClass_interop.cpp | #include <Eigen/Dense>
#include <iostream>
using namespace Eigen;
using namespace std;
int main()
{
MatrixXf m(2,2);
MatrixXf n(2,2);
MatrixXf result(2,2);
m << 1,2,
3,4;
n << 5,6,
7,8;
result = (m.array() + 4).matrix() * m;
cout << "-- Combination 1: --" << endl << result << endl << e... | ALGO | 0.999711 | 4.531452 |
ebb5ef33-8016-48a4-8313-72ec6cfeba86 | Alaxe/noi2-ranking | 2018/solutions/C/MDD-Sofia/maze.cpp | #include <iostream>
#include <string>
#include <vector>
#include <algorithm>
using namespace std;
const int maxn =101;
const int maxm = 101;
bool notpassed[maxn][maxm];
pair<int, int> b;
pair<int, int> e;
vector< pair<int, int> > frontier;
int fronEnd=0;
int main()
{
ios_base::sync_with_stdio(false);
cin.tie... | ALGO | 0.999821 | 3.990163 |
54a22032-ed96-47b4-abf5-1556515d4fc3 | victormeloasm/cppfftnolib | fft.cpp | #include <iostream>
#include <vector>
#include <complex>
#include <cmath>
#include <algorithm>
#include <random>
#include <chrono>
#include <fstream>
#include <thread>
#include <windows.h>
using namespace std;
using namespace chrono;
using cd = complex<double>;
const double PI = acos(-1);
// Optimized iterative FFT ... | ALGO | 0.999707 | 4.704987 |
58d9cae3-3f78-4518-92a5-3a5c997b3334 | brokebatman3/UnemploymentAtItsPeak | 3217-Delete-Nodes-From-Linked-List-Present-in-Array.cpp | /**
* 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:
ListNode* modifiedLis... | ALGO | 0.999996 | 5.831254 |
e6c95668-1ba5-495a-9b24-6514acbc1d76 | manh610/document-c- | gapdoidayso.cpp | #include <iostream>
#include <cmath>
using namespace std;
int search (int n, long long k) {
if ( k==pow(2,n-1) )
return n;
if ( k < pow(2,n-1) )
search(n-1,k);
else
search( n-1, k - pow(2,n-1) );
}
main ()
{
int test;
cin >> test;
while ( test-- ) {
int n;
long long k;
cin >> n >> k;
char ans =... | ALGO | 0.999615 | 3.971262 |
e09d6f53-3f58-47ab-b305-33dc85d23c8b | anandhu720/Leetcode-Solutions | 241-different-ways-to-add-parentheses/241-different-ways-to-add-parentheses.cpp | class Solution {
public:
vector<int> diffWaysToCompute(string s) {
unordered_map<string,vector<int>> umap;
return dfs(s,umap);
}
vector<int> dfs(string s,unordered_map<string,vector<int>> &umap) {
vector<int> ans;
if(umap.find(s) != umap.end()) return u... | ALGO | 0.99998 | 5.658201 |
c9d1b3b7-82a7-4422-83ea-b28a8037c208 | zopsicle/blender | source/blender/freestyle/intern/view_map/BoxGrid.cpp | /** \file
* \ingroup freestyle
* \brief Class to define a cell grid surrounding the projected image of a scene
*/
#include <algorithm>
#include <stdexcept>
#include "BoxGrid.h"
#include "BKE_global.h"
using namespace std;
namespace Freestyle {
// Helper Classes
// OccluderData
///////////////
// Cell
///////... | ALGO | 0.989326 | 7.592909 |
b962559e-2e8f-4183-bddd-598be13e153a | BlissRoms/platform_external_libcxx | test/std/containers/sequences/forwardlist/forwardlist.modifiers/erase_after_one.pass.cpp | // <forward_list>
// iterator erase_after(const_iterator p);
#include <forward_list>
#include <cassert>
#include "min_allocator.h"
int main()
{
{
typedef int T;
typedef std::forward_list<T> C;
const T t[] = {0, 1, 2, 3, 4};
C c(std::begin(t), std::end(t));
C::iterator i ... | TEST | 0.980249 | 5.896083 |
59c94ac7-b662-42c6-bcba-3ecc65805135 | blackrabbit17/DVX-DOS6.22 | src/86Box-4.2.1/src/sound/munt/Analog.cpp | #include <cstring>
#include "internals.h"
#include "Analog.h"
#include "Synth.h"
namespace MT32Emu {
/* FIR approximation of the overall impulse response of the cascade composed of the sample & hold circuit and the low pass filter
* of the MT-32 first generation.
* The coefficients below are found by windowing th... | TOOL | 0.960116 | 5.608405 |
3bf6f064-0013-4324-8db8-fda9c2aa341f | chiNmoy09/Competitive_Programming | FirstAndLast.cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
int t;cin>>t;
while(t--){
int n;cin>>n;
vector<int> a;
for(int i=0;i<n;i++){
int x;cin>>x;
a.push_back(x);
}
int sum=a[0]+a[n-1];
int max=sum;
int j1=n-1,jn=n-2;
f... | ALGO | 0.999647 | 3.889315 |
61f6190c-454c-414f-99b2-3fc1dfbbc6f3 | wulianqing/AcwingSolutions | leetcode_19_删除链表倒数第n节点.cpp | #include<iostream>
using namespace std;
struct ListNode
{
int val;
ListNode *next;
ListNode(int x) : val(x), next(NULL) {}
};
class Solution {
public:
ListNode* removeNthFromEnd(ListNode* head, int n) {
ListNode *my_head = new ListNode(0);
my_head->next = head;
ListNode *back = ... | ALGO | 0.999967 | 5.03187 |
2632817e-9507-4067-a4d7-34c7e5714617 | prachishende007/AI_and_DL | Artificial_Intelligence/Assignment_2.cpp | #include <bits/stdc++.h>
using namespace std;
// colors
const vector<string> COLORS = {"Red", "Green", "Blue"};
// Adjacency map
unordered_map<string, vector<string>> adjacency = {
{"WA", {"NT", "SA"}},
{"NT", {"WA", "SA", "Q"}},
{"SA", {"WA", "NT", "Q", "NSW", "V"}},
{"Q", {"NT", "SA", "NSW"}},
... | ALGO | 0.998167 | 6.339643 |
83d7aff0-37e2-4eaf-b0f2-9cbf5ddecad8 | ashleysaliasi/cportfolio | Payroll.cpp | []
// SAVE THIS FILE AS Payroll.cpp
#include <iostream>
#include <string>
#include <iomanip>
using namespace std;
// TODO: Add function prototypes for all the declared functions
double getHighestPay (double payArray[], int maxSize);
double getLowestPay (double payArray[], int maxSize);
int getEmployeeNames (string na... | ALGO | 0.99668 | 4.094363 |
ff58527e-3742-41f9-a4a3-eb510e2c6abb | krishnas005/CPP-Codes | B_Transfusion.cpp | #include <iostream>
#include <vector>
using namespace std;
#define int long long
int32_t main() {
ios::sync_with_stdio(false);
cin.tie(nullptr); cout.tie(nullptr);
int T;
cin >> T;
while(T--) {
int n;
cin >> n;
vector<int> arr(n);
for(int &it : arr) cin >> it;
... | ALGO | 0.999847 | 5.364741 |
b8a71e73-c607-494c-8c34-265aa34a2499 | grinisrit/noa | src/noa/3rdparty/tnl-noa/Documentation/Examples/Matrices/MultidiagonalMatrix/MultidiagonalMatrixViewExample_reduceRows.cpp | #include <iostream>
#include <iomanip>
#include <functional>
#include <TNL/Matrices/MultidiagonalMatrix.h>
#include <TNL/Devices/Host.h>
template< typename Device >
void reduceRows()
{
/***
* Set the following matrix (dots represent zero matrix elements and zeros are
* padding zeros for memory alignment):
... | ALGO | 0.999544 | 5.79413 |
4965d96d-8f75-4d11-848b-e6de75841f4f | wxw1198/yrrid_msm | yrrid-msm/HostReduce.cpp | namespace Host {
template<class Field>
class HostReduce {
typedef typename Host::PointXYZZ<Field> PointXYZZ;
typedef typename Host::AccumulatorXYZZ<Field> AccumulatorXYZZ;
public:
uint32_t windows, windowBits, warps, warpsPerWindow, bucketsPerThread;
HostReduce(uint32_t initialWindows, uint32_t initi... | ALGO | 0.996488 | 5.507148 |
74838c79-c10d-469d-9f0b-b7b6c45d933a | shubhadityaburela/Dense-Hessian-Bracketing | Approach 1/eigen/bench/spmv.cpp |
//g++-4.4 -DNOMTL -Wl,-rpath /usr/local/lib/oski -L /usr/local/lib/oski/ -l oski -l oski_util -l oski_util_Tid -DOSKI -I ~/Coding/LinearAlgebra/mtl4/ spmv.cpp -I .. -O2 -DNDEBUG -lrt -lm -l oski_mat_CSC_Tid -loskilt && ./a.out r200000 c200000 n100 t1 p1
#define SCALAR double
#include <iostream>
#include <algor... | ALGO | 0.935201 | 4.293816 |
615c78a6-f29c-42e6-956a-faf137851a9a | wangsenyan/study-blog | algorithm/leetcode/16.3-sum-closest.cpp | /*
* @lc app=leetcode id=16 lang=cpp
*
* [16] 3Sum Closest
*/
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
class Solution
{
public:
int threeSumClosest(vector<int> &nums, int target)
{
sort(nums.begin(), nums.end());
long long tar = INT_MAX;
for (int i = 0; i < num... | ALGO | 0.999986 | 6.238511 |
c85024db-8c9a-4d16-b3d8-01710cd3ed8c | linnstoresund/voysys_linnStoresund | moon.cpp | using namespace std;
#include "Vec3.h"
#include "moon.h"
// Explicit constructor
moon::moon() {
position = { 0, 0, 0 };
velocity = { 0, 0, 0 };
}
// Constructor
moon::moon(int xPos, int yPos, int zPos)
{
position = { xPos, yPos, zPos };
velocity = { 0, 0, 0 };
}
// Get components from moon objects
int moon::get... | ALGO | 0.994836 | 3.882615 |
806b6a7d-8307-4dea-be6c-26836486ea4b | abdurahmonmuydinov/abdurahmon | flutter_application_2/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.9985 | 6.76775 |
82b780dc-863f-4da8-b0d6-993100b3c632 | JpKarwa/PW-Skills-PPT-program | Arrays/Assignment 3/7.cpp | /*
You are given an inclusive range [lower, upper] and a sorted unique integer array
nums, where all elements are within the inclusive range.
A number x is considered missing if x is in the range [lower, upper] and x is not in
nums.
Return the shortest sorted list of ranges that exactly covers all the missing
numbers... | ALGO | 0.999748 | 5.240942 |
bd5a3172-3068-4f25-9d9d-a87ccc43e0de | Hima0X2/codeforces | 609A.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
int n,m,i,sum=0,c=1;
cin>>n>>m;
int a[n];
for(i=0;i<n;i++){
cin>>a[i];
//sum=sum+a[i];
}
sort(a,a+n);
reverse(a,a+n);
for(i=0;i<n;i++){
sum=sum+a[i];
if(sum<m)
{
... | ALGO | 0.999985 | 3.397484 |
e46fec09-529d-4a94-a650-e0d0656d3307 | zxok365/mandrake | contest/2015-08-17-Warsaw-U-Contest-(ru110905)/I.cpp | #include <iostream>
#include <cstdio>
#include <cstring>
#include <vector>
#include <algorithm>
using namespace std;
const int N = 1000005;
pair<int, int> t[N];
int n, Max[55];
int main()
{
scanf("%d", &n);
int cnt = 0;
for(int i = 1; i <= n; i++)
{
int num;
scanf("%d", &num);
for(int j = 1; j <= num; j+... | ALGO | 0.999905 | 3.223184 |
0957b81c-e0de-4a2c-ba35-c9f795128058 | fanqiliang/riscvn | bolt/lib/Passes/LoopInversionPass.cpp | #include "bolt/Passes/LoopInversionPass.h"
#include "bolt/Core/ParallelUtilities.h"
using namespace llvm;
namespace opts {
extern cl::OptionCategory BoltCategory;
extern cl::opt<bolt::ReorderBasicBlocks::LayoutType> ReorderBlocks;
static cl::opt<bool> LoopReorder(
"loop-inversion-opt",
cl::desc("reorder unc... | ALGO | 0.977161 | 7.717616 |
a7cb5b04-b8bb-49e5-b970-5b7dd22fdd7b | SravaniSegireddy/Coding-Career-Journey | leetcode/May Challenge/Day9_ValidPerfectSquare.cpp | // Problem: https://leetcode.com/explore/featured/card/may-leetcoding-challenge/535/week-2-may-8th-may-14th/3324/
class Solution {
public:
bool checkPerSqr(int l, int r, int num){
while(l<=r){
long long int mid = l + (r-l)/2;
//long long int ans = mid*mid;
if(mid*mid == num){
... | ALGO | 0.99991 | 5.856306 |
04cb07b3-efe7-40f0-9454-b8016afa6062 | reshavsingla/CarND-MPC-Project | src/Eigen-3.3/lapack/eigenvalues.cpp | #include "lapack_common.h"
#include <Eigen/Eigenvalues>
// computes eigen values and vectors of a general N-by-N matrix A
EIGEN_LAPACK_FUNC(syev,(char *jobz, char *uplo, int* n, Scalar* a, int *lda, Scalar* w, Scalar* /*work*/, int* lwork, int *info))
{
// TODO exploit the work buffer
bool query_size = *lwork==-1;... | ALGO | 0.990218 | 4.671507 |
e09d9f5d-9cf6-4b2f-b236-1eee4c132fc7 | 113bommy/deepmind_codecontests_refine | cpp_gold_filter_file/cpp_train_590_6.cpp | #include <bits/stdc++.h>
using namespace std;
const int N = 300000 + 100;
const int oo = 1e9;
int n, q;
int gcd(int a, int b) { return !b ? a : gcd(b, a % b); }
struct line {
int a, b, c;
line() {}
line(int x1, int y1, int x2, int y2) {
a = y1 - y2;
b = x2 - x1;
c = x1 * y2 - x2 * y1;
int g = gcd(... | ALGO | 0.99994 | 4.475367 |
4ae8fc7a-7fdb-43c6-97be-8dd6a0d93152 | hexloop/ChakraCore | lib/Backend/Inline.cpp | void
Inline::Optimize()
{
this->Optimize(this->topFunc);
}
void
Inline::Optimize(Func *func, __in_ecount_opt(callerArgOutCount) IR::Instr *callerArgOuts[], Js::ArgSlot callerArgOutCount, uint recursiveInlineDepth)
{
if (!func->DoInline() || !topFunc->DoInline())
{
return;
}
bool doFixedMet... | ALGO | 0.945461 | 7.333563 |
d1ecf599-8523-4993-b106-d912de04a1e7 | Brahm03/Pok-mon-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.998693 | 6.797273 |
91492a13-5d3c-44b3-bcf6-1843f4b1c01b | Tushar2009/DSA | DP - 27-problems-playlist-striver/12_Longest common Subsequence lecture 25 and 26/tabu.cpp | #include <bits/stdc++.h>
using namespace std;
int getLengthOfLCS(string &str1, string &str2)
{
// Write your code here.
int n = str1.length();
int m = str2.length();
// right shift logic is used to tackle the case of the negative number in tabulation
// 1- Based Indexing
vector<vector<int>> dp(n... | ALGO | 0.999905 | 5.583135 |
80e8fed5-86c0-4546-85b0-ca808c617780 | pkjmesra/FaceDetection-FaceRecognition | FaceDetection/FaceRecognition/ThirdParty/OpenCV/modules/stitching/exposure_compensate.cpp | #include "exposure_compensate.hpp"
#include "util.hpp"
using namespace std;
using namespace cv;
using namespace cv::gpu;
Ptr<ExposureCompensator> ExposureCompensator::createDefault(int type)
{
if (type == NO)
return new NoExposureCompensator();
if (type == GAIN)
return new GainCompensator();
... | ALGO | 0.936858 | 4.741639 |
667015be-bfec-4c49-be20-6539a11a23f7 | nucleusbiao/A-slope-adaptive-navigation-approach-for-ground-mobile-robot | navigation-melodic-devel/costmap_converter-master/src/costmap_to_dynamic_obstacles/multitarget_tracker/HungarianAlg.cpp | #include <costmap_converter/costmap_to_dynamic_obstacles/multitarget_tracker/HungarianAlg.h>
#include <limits>
AssignmentProblemSolver::AssignmentProblemSolver() {}
AssignmentProblemSolver::~AssignmentProblemSolver() {}
track_t AssignmentProblemSolver::Solve(const distMatrix_t& distMatrixIn, size_t nOfRows, size_t n... | ALGO | 0.999982 | 6.151508 |
ea56400c-0d22-4935-97c4-6ae68d492c79 | c834606877/llvm-project | clang-tools-extra/clangd/FileDistance.cpp | #include "FileDistance.h"
#include "support/Logger.h"
#include "llvm/ADT/STLExtras.h"
#include <queue>
namespace clang {
namespace clangd {
// Convert a path into the canonical form.
// Canonical form is either "/", or "/segment" * N:
// C:\foo\bar --> /c:/foo/bar
// /foo/ --> /foo
// a/b/c --> /a/b/c... | ALGO | 0.971731 | 7.551197 |
e1f48464-ab3c-4540-9cd6-86b141c4d503 | ckj119940887/ann_gem5 | src/systemc/tests/systemc/misc/cae_test/general/control/if_test/inlining/inlining.cpp | /*****************************************************************************
inlining.cpp --
Original Author: Rocco Jonack, Synopsys, Inc., 1999-07-22
*****************************************************************************/
/*****************************************************************************... | ALGO | 0.871318 | 4.451594 |
770b7293-9a77-47d0-99e6-4ea80a0875dd | EricWay1024/Algorithm-Learning | ds/P4168/P4168.cpp | #include<algorithm>
#include<bitset>
#include<cmath>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<ctime>
#include<deque>
#include<iostream>
#include<map>
#include<queue>
#include<set>
#include<stack>
#include<string>
// #include<unordered_map>
#include<utility>
#include<vector>
#include<numeric>
#inclu... | ALGO | 0.999994 | 4.504611 |
d5155607-8ad6-46b7-b3db-b009681f7910 | ouyangmingyu/algorithm | leetcodeBAT/4.4 计算右边小于左边的元素个数.cpp | //#include<iostream>
//#include<string>
//#include<vector>
//#include<algorithm>
//#include<iostream>
//#include<functional>
//#include<queue>
//#include<queue>
//#include<stack>
//#include<set>
//
//using namespace std;
//
//class Solution {
//public:
// vector<int> countSmaller(vector<int>& nums) {
// int len = nums... | ALGO | 0.999991 | 5.223755 |
f27bfa18-f2ca-4938-88a9-45e8ede4e415 | HermanChen/Rockchip_4.2_release_libstagefright | 4.2_jb_release/libstagefright/codecs/m4v_h263/dec/src/zigzag_tab.cpp | #include "mp4dec_api.h"
#include "mp4def.h"
#include "zigzag.h"
/*----------------------------------------------------------------------------
; MACROS
; Define module specific macros here
----------------------------------------------------------------------------*/
/*----------------------------------------... | ALGO | 0.994383 | 3.532503 |
253c7f0d-6db0-4024-ab2e-5aad0acb283d | ishandutta2007/codeforces | fizzydavid/normal/1305/F.cpp | //by yjz
#include<bits/stdc++.h>
using namespace std;
#define FF first
#define SS second
#define PB push_back
#define MP make_pair
#ifndef LOCAL
#define cerr if(0)cout
#endif
typedef long long ll;
//My i/o stream
struct fastio
{
char s[100000];
int it, len;
fastio() {it=len=0;}
inline char get()
{
if (it<len) re... | ALGO | 0.99999 | 3.81738 |
75220e9d-af79-4e3d-a8c1-098746863edf | Mykhailo-Seniutovych/EspWebController | EspStm32Server/Drivers/CMSIS/NN/Examples/ARM/arm_nn_examples/gru/arm_nnexamples_gru.cpp | /**
* @ingroup groupExamples
*/
/**
* @defgroup GRUExample Gated Recurrent Unit Example
*
* \par Description:
* \par
* Demonstrates a gated recurrent unit (GRU) example with the use of fully-connected,
* Tanh/Sigmoid activation functions.
*
* \par Model definition:
* \par
* GRU is a type of recurrent neura... | ALGO | 0.918789 | 7.471897 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.