uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
cef83318-f2e5-4117-a9de-e6ae6d74be6d | AMAN-349/Daily-Problem-Leetcode | 2251-number-of-ways-to-divide-a-long-corridor/number-of-ways-to-divide-a-long-corridor.cpp | class Solution {
public:
int numberOfWays(string corridor) {
const int MOD = 1e9 + 7;
int ans = 1;
int cnts = 0;
int res = 0;
int flag=0;
for (int i = 0; i < corridor.size(); i++) {
if (corridor[i] == 'S') {
cnts++;
fl... | ALGO | 0.99998 | 5.825164 |
f4fda96b-9af7-463b-a83d-c77f76118364 | joshualass/CP | Solutions/OJ/Kattis/joinstrings.cpp | #include <bits/stdc++.h>
#define I int
using namespace std;
I i = 0, l = 1, n;
const I N = 1e6;
vector<I> v[N];
string d[N];
void f(I y) {
cout << d[y];
for (I x : v[y]) f(x);
}
I main() {
cin >> n;
for (; ++i <= n;) cin >> d[i];
for (; --i > 1;) {
cin >> l >> n;
v[l].push_back(n);
... | ALGO | 0.99987 | 3.469256 |
122b8af2-7d78-46f4-9ea9-2a0570bee23b | Seirisiii/submit | posn/C1T6.cpp | #include<bits/stdc++.h>
using namespace std;
char a,b,c;
int main(){
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cin>>a>>b>>c;
char x,y;
while(cin>>x>>y and x!='X' and y!='X'){
if(x=='A'){
if(y=='R')swap(a,b);
}
else if(x=='B'){
if(y=='R')swap(c,b... | ALGO | 0.99984 | 3.931226 |
a813fbc2-734f-457b-b669-7f2ad44014c8 | openjdk/jfx22u | modules/javafx.web/src/main/native/Source/JavaScriptCore/b3/air/AirAllocateRegistersByGraphColoring.cpp | #include "config.h"
#include "AirAllocateRegistersByGraphColoring.h"
#if ENABLE(B3_JIT)
#include "AirCode.h"
#include "AirFixSpillsAfterTerminals.h"
#include "AirInsertionSet.h"
#include "AirInstInlines.h"
#include "AirLiveness.h"
#include "AirPadInterference.h"
#include "AirPhaseScope.h"
#include "AirTmpWidthInlines... | ALGO | 0.864866 | 7.559896 |
52ba6d75-646f-44e6-be4a-f7626832b05c | 10Maruf/CODEFORCES-Problem | CoverInWater.cpp | /*maruf_bro*/
#include <bits/stdc++.h>
using namespace std;
#define IO \
ios_base::sync_with_stdio(false); \
cin.tie(NULL); \
cout.tie(NULL)
#define ld long double
#define ll long long
#define vec vector<ll>
#define pb push_back
#define fcin(n) \
for ... | ALGO | 0.995298 | 3.687272 |
a8b9e72b-45b3-4def-a771-c32390de1f72 | ishandutta2007/codeforces | mnbvmar/normal/1054/E.cpp | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace std;
#define PB push_back
#define MP make_pair
#define LL long long
#define int LL
#define FOR(i,a,b) for(int i = (a); i <= (b); i++)
#define RE(i,n) FOR(i,1,n)
#define REP(i,n) FOR(i,0,(int)(n)-1)
#define R(i,n) REP(i,n)
#define VI vect... | ALGO | 0.999974 | 3.187175 |
a0b80208-5afd-47ed-be09-63f7039f0362 | RATED-R-SUNDRAM/CPP-Graph-ALgo | cycle_detection.cpp | #include <bits/stdc++.h>
using namespace std ;
const int N = 1e5;
vector<int> g[N];
bool vis[N]={0};
bool dfs(int a,int par){
vis[a]=1;
for(auto elm : g[a])
{
if (!vis[elm])
{
if(dfs(elm,a)==true)
return true;
}
else
{
if(elm!=par... | ALGO | 0.999951 | 4.777521 |
2ecbcf9b-85e3-41bb-aaea-20650b928bc1 | QuyDatSadBoy/DSA_Tong_Hop | DSU_21_4_2023/Chu_trinh_vh.cpp | #include <bits/stdc++.h>
#define ll long long
const ll mod = (ll)1e9 + 7;
#define endl "\n"
#define all(v) v.begin(), v.end()
#define ms(a) memset(a, 0, sizeof(a))
#define faster() \
ios_base::sync_with_stdio(0); \
cin.tie(0); \
cout.tie(0);
using namespace std;
vector<ll... | ALGO | 0.999965 | 5.235189 |
326607b3-af5e-49b6-b275-a62a3a17752a | johnnyoh555/Baekjoon | 24.03-1/1715_카드 정렬하기.cpp | // https://www.acmicpc.net/problem/1715
#include <iostream>
#include <queue>
using namespace std;
priority_queue<int, vector<int>, greater<int> > pq;
int N, tmp, sum;
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
cin >> N;
for (int i = 0; i < N; i++) {
cin >> tmp;
pq.push(tmp);
}
while (pq.size() > 1... | ALGO | 0.999991 | 4.065298 |
b6af9477-78e6-45a6-90e2-dd9cf57e43e6 | amlanjess/C_PLUSPLUS_Programming_Amlan-Kumar-Sarkar | Program_19_Average_TwoDifferentClass_TwoDifferentNumber.cpp | //Friend Function to find the Average of two number of different data numbers using two classes.
#include<iostream>
using namespace std;
class Amlan;
class Amlan_1
{
int a;
public:
void get(int x)
{
a=x;
}
void disp()
{
cout<<"First number is: "<<a<<endl;
}
friend float Avg(... | ALGO | 0.994353 | 5.143841 |
03707c87-e5d8-4014-8975-113313a6a506 | marioyc/Online-Judge-Solutions | TJU/2170 - Balance Trip.cpp | #include <cstdio>
#include <cstring>
#include <algorithm>
using namespace std;
struct edge{
int u,v,w;
edge(){}
bool operator < (edge X)const{
return w<X.w;
}
}E[1000];
#define MAX_SIZE 200
int parent[MAX_SIZE],rank[MAX_SIZE];
void Make_Set(const int x){
parent[x] = x; rank[x] ... | ALGO | 0.999907 | 4.514206 |
50483fca-be70-44f1-a877-ef11eb9f6cba | aniruddh-joshi/GeeksforGeeks | Medium/LCS of three strings/lcs-of-three-strings.cpp | //{ Driver Code Starts
#include<bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution {
public:
int LCSof3 (string A, string B, string C, int n1, int n2, int n3) {
int dp[n1+1][n2+1][n3+1];
memset(dp, 0, sizeof(dp));
for(int i=1; i<=n1; i++) {
... | ALGO | 0.999981 | 5.746647 |
974a0fb3-67ff-41ba-be60-c0734bdeaa18 | Bungmint/competitiveprogramming | contest/codeforces/1559/1559C.cpp | // Problem: C. Mocha and Hiking
// Contest: Codeforces - Codeforces Round #738 (Div. 2)
// URL: https://codeforces.com/contest/1559/problem/C
// Memory Limit: 256 MB
// Time Limit: 1000 ms
//
// Powered by CP Editor (https://cpeditor.org)
#pragma GCC optimize("O3")
#pragma GCC target("sse4")
#include <bits/stdc++.h>
... | ALGO | 0.999693 | 4.324189 |
24cd4f6a-90c2-43bc-8450-3383861891dc | rootid/fft | maths/threeSumUgly.cpp | //3Sum
//For example, given array S = {-1 0 1 2 -1 -4},
//A solution set is:
//(-1, 0, 1)
//(-1, -1, 2)
#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
//O(n^2) : can we do better?
//Need to avoid duplicates
vector<vector<int>> threeSum(vector<int>& nums) {
vector<vector<int> > result;
... | ALGO | 0.999861 | 4.426868 |
1a8f193e-fe7d-47cc-aa86-8a6b2144bc06 | Batishavo/Competitive-programing | 2024/05-mayo/04/97. Interleaving String.cpp | class Solution {
public:
bool isInterleave(string s1, string s2, string s3) {
if(s1=="" && s2=="" && s3==""){
return true;
}
if(s1.size()+s2.size()<s3.size() || s1.size()+s2.size()>s3.size()){
return false;
}
bool flag = false;
dp(s1,s2,s3,0... | ALGO | 0.999934 | 6.097046 |
1405b373-7246-4540-b33c-e4e4e4d85460 | xhbang/SRTP | Console-snake/reference/GreedySnake/GreedySnake/SuikayStrategy.cpp | #include "StdAfx.h"
#include "SuikayStrategy.h"
#include "Manager.h"
SuikayStrategy::SuikayStrategy(void)
{
}
SuikayStrategy::~SuikayStrategy(void)
{
}
DIRECTION SuikayStrategy::chooseDirection(CPoint snakeHead)
{
CPoint PFruit = Manager::theManager()->getFruitPalce();
if (Manager::theManager()->isLegal(CPoint(sn... | ALGO | 0.99957 | 4.601837 |
20ccd0a4-0395-4975-9bb3-7d9990f6b760 | nileshsah/Algorithms | CF510B.cpp | #include <bits/stdc++.h>
#define ll long
#define get(a) scanf("%ld", &a);
#define rep(n) for( ll i = 1; i <= n; i++ )
#define repVector(v) for( typeof(v.begin()) it = v.begin(); it != v.end(); it++ )
#define repSet(s) for( typeof(s.begin()) it = s.begin(); it != s.end(); it++ )
#define all(c) c.begin(), c.end()
#defin... | ALGO | 0.999974 | 3.4507 |
120fb656-3675-4654-9246-d0dbbfd787ff | MrKoT321/ProjectWorkshopLW | sfml.2/00/main.cpp | #include <iostream>
int main()
{
// цикл выводит числа от 1 до 100
for (int num = 1; num <= 100; num++)
{
if ((num % 3 == 0) && (num % 5 == 0))
{
std::cout << "FizzBuzz" << std::endl;
}
else if (num % 3 == 0)
{
std::cout << "Fizz" << std::endl... | ALGO | 0.996851 | 4.388106 |
76f9aec6-cf7d-479d-9659-aea81356c36a | trinhminhtriet/leetcode | solutions/2100-2199/2190.most-frequent-number-following-key-in-an-array/Solution.cpp | class Solution {
public:
int mostFrequent(vector<int>& nums, int key) {
int cnt[1001]{};
int ans = 0, mx = 0;
for (int i = 0; i < nums.size() - 1; ++i) {
if (nums[i] == key) {
if (mx < ++cnt[nums[i + 1]]) {
mx = cnt[nums[i + 1]];
... | ALGO | 0.999997 | 5.889153 |
82b78948-3224-4180-a1db-bf52621d1556 | VladimirBalun/LeetCode | Algorithms/Easy/SummaryRanges.cpp | #include "../Helpers.hpp"
// You are given a sorted unique integer array nums.
// Return the smallest sorted list of ranges that cover all the numbers in the array exactly. That is, each element of nums is covered by exactly one of the ranges, and there is no integer x such that x is in one of the ranges but not in nu... | ALGO | 0.999592 | 6.469282 |
4a20bf1e-4c1e-4390-99ac-ab04265c37a3 | HikaruMG/CPE-ProblemSolver | midterm/!Mid67_1/Mid62_smallest.cpp | #include <bits/stdc++.h>
using namespace std;
vector<long long> High;
vector<long long> Maximun;
int main() {
ios::sync_with_stdio(false);
cin.tie(NULL);
long long N, Q;
cin >> N >> Q;
High.resize(N);
for(int i = 0; i < N; i++) {
cin >> High[i];
}
Maximun.resize(N);
Maximun... | ALGO | 0.999876 | 4.054034 |
3a29ce51-8ac3-43e5-a757-757d325443b3 | Suvrojyoti/APS-2020 | Codeforces_Submissions/1185B.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
long long int n,i,j,test,n1,f,flag,f1,len;
cin>>test;
char c;
while(test--)
{
//cout<<test;
string s,s1;
flag=0;
cin>>s>>s1;
n=s.length();
n1=s1.length();
if(n1<n)
{
... | ALGO | 0.999955 | 3.941769 |
bbd4f1e5-f776-465e-904b-8ad0717d4fc9 | labmec/1m-module | targets/non-homogeneous-stretch3D-TH.cpp | #ifdef HAVE_CONFIG_H
#include <pz_config.h>
#endif
#include <iostream>
#include "pzlog.h"
#include "pzgmesh.h"
#include "TPZVTKGeoMesh.h"
#include "pzcmesh.h"
#include <TPZNullMaterial.h>
#include <pzbuildmultiphysicsmesh.h>
#include <pzskylstrmatrix.h>
#include <TPZMultiphysicsCompMesh.h>
#include <pzstepsolver.h>
#i... | TOOL | 0.89467 | 3.329882 |
a8f2d885-f068-4444-9069-0e8c404e74c1 | Tuhin114/CodeStudio | Longest Subarray With Sum K II.cpp | // CodeStudio - Longest Subarray With Sum K II
// https://www.codingninjas.com/studio/problems/longest-subarray-with-sum-k_5713505?utm_source=striver&utm_medium=website&utm_campaign=a_zcoursetuf&leftPanelTabValue=PROBLEM
// using Map
// #include <bits/stdc++.h>
// int getLongestSubarray(vector<int>& nums, int k){
... | ALGO | 0.999915 | 5.861903 |
e3dbf5a5-a626-44d7-a1a4-fe10b658f0a3 | trinhminhtriet/leetcode | solutions/1800-1899/1889.minimum-space-wasted-from-packaging/Solution.cpp | class Solution {
public:
int minWastedSpace(vector<int>& packages, vector<vector<int>>& boxes) {
int n = packages.size(), m = boxes.size();
sort(packages.begin(), packages.end());
const int mod = 1e9 + 7;
const long long inf = 1LL << 62;
long long ans = inf;
for (auto... | ALGO | 0.999981 | 5.957035 |
2da15d08-fcb5-4002-89ca-27a066bdefc7 | Sam-Roggeman/prog2 | main/cpp/linking/overloading.cpp | int muladd(int a, int b, int c) { return a * b + c; }
double muladd(double a, double b, double c) { return a * b + c; }
| TOOL | 0.952316 | 3.790557 |
e26a5b13-006f-4cc3-bed6-43d5fc569df2 | Amitkumar-007/face_recognition | opencv-master/modules/dnn/src/tensorflow/tf_importer.cpp | /*
Implementation of Tensorflow models parser
*/
#include "../precomp.hpp"
#include <opencv2/core/utils/logger.defines.hpp>
#include <opencv2/dnn/shape_utils.hpp>
#undef CV_LOG_STRIP_LEVEL
#define CV_LOG_STRIP_LEVEL CV_LOG_LEVEL_DEBUG + 1
#include <opencv2/core/utils/logger.hpp>
#ifdef HAVE_PROTOBUF
#include "tf_io.... | TOOL | 0.888962 | 6.743232 |
a2c41f2a-0a70-499b-9723-1d2c51be611c | iamkuntal2002/most_liked_questions | tree/deepestLeavesSum.cpp | #include<bits/stdc++.h>
using namespace std;
// https://leetcode.com/problems/deepest-leaves-sum | ALGO | 0.999756 | 5.385432 |
659c5e3d-1701-4071-9c2f-ac5d37263a98 | hnakamur/llvm-toolchain-8-deb | lib/IR/DomTreeUpdater.cpp | #include "llvm/IR/DomTreeUpdater.h"
#include "llvm/Analysis/PostDominators.h"
#include "llvm/IR/Dominators.h"
#include "llvm/Support/GenericDomTree.h"
#include <algorithm>
#include <functional>
namespace llvm {
bool DomTreeUpdater::isUpdateValid(
const DominatorTree::UpdateType Update) const {
const auto *From ... | TOOL | 0.996816 | 7.969401 |
594f3f23-5284-4140-bee0-7809c4fe3d52 | masterUNG/JadMarket | 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.998859 | 6.785645 |
32107807-a98d-43f3-a3c5-0a206d721333 | mahmoudabozied4/LeetCode-problems | PS/1408-String-Matching-in-an-Array.cpp | class Solution {
public:
vector<string> stringMatching(vector<string>& words) {
vector<string> ans;
for ( auto a : words)
for (auto b : words)
if (a.length() < b.length() && b.find(a) != string::npos) {
ans.push_back(a);
break;
... | ALGO | 0.999922 | 5.178088 |
2b47ccdb-3353-443b-808b-7cf3ec19fb4e | bever209/Competitive-Programming | Cpp programs/Codeforces/Random_practice/E1334.cpp | #include <bits/stdc++.h>
#define pb push_back
#define f first
#define s second
#define mp make_pair
#define pq priority_queue
using namespace std;
using ll = long long;
using pii = pair<int, int>;
using vi = vector<ll>;
using str = string;
#define endl "\n"
const ll mod=998244353;
ll binpow(ll a, ll b){
ll res =... | ALGO | 0.999939 | 5.441241 |
7fa00c8f-b325-402d-a335-96d1796cad9f | 113bommy/deepmind_codecontests_refine | cpp_gold_filter_file/cpp_train_6507_7.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
vector<string> str_list;
string str;
int max_length = 0, left_more = 0;
while (getline(cin, str)) {
max_length = max((int)str.size(), max_length);
str_list.push_back(str);
}
cout << string(max_length + 2, '*') << endl;
for (auto s : str_li... | ALGO | 0.99998 | 4.048379 |
8e064047-9263-4b03-b75a-699891e0ded0 | ghAnthonyCodes/CodeChef | Easy/shroute.cpp | /**********************************************************/
/* */
/* Anthony Meyer */
/* https://www.codechef.com/problems/SHROUTE */
/* */
/**************... | ALGO | 0.999798 | 4.638424 |
53c9b52d-6102-4a7e-8772-1fca7516e802 | ghugesachin0806/Data_Structure_n_Algorithm | 12_Graph/60_Floyd_warshall_Algorithm.cpp | // https://practice.geeksforgeeks.org/problems/implementing-floyd-warshall2042/1
#include <bits/stdc++.h>
using namespace std;
class Solution
{
public:
void shortest_distance(vector<vector<int>> &matrix)
{
// no. of nodes
int n = matrix.size();
// converting -1 to INT_MAX
// c... | ALGO | 0.99997 | 5.099813 |
2fe2bf91-b216-4505-8ace-f40bc7a7bce2 | ishandutta2007/codeforces | xellos/normal/559/C.cpp | #include <bits/stdc++.h>
// iostream is too mainstream
#include <cstdio>
// bitch please
#include <iostream>
#include <algorithm>
#include <cstdlib>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <list>
#include <cmath>
#include <iomanip>
#include <time.h>
#define dibs reserv... | ALGO | 0.99999 | 4.048544 |
f43d05db-5250-46a4-bf0d-f1c0f54763fa | surinkim/cpprestsdk-1.2.0 | Release/tests/Common/TestRunner/test_runner.cpp | // TestRunner.cpp : Defines the entry point for the console application.
//
#include <map>
#include <vector>
#include <algorithm>
#include <iostream>
#include <regex>
#ifdef WIN32
#include <Windows.h>
#include <conio.h>
#else
#include <boost/filesystem.hpp>
#include "unistd.h"
#endif
#include "../UnitTestpp/src/Test... | TEST | 0.914566 | 6.414275 |
a433c491-790a-4a7c-8ba6-317099e40f3b | ShikoDay/Labs2-vektor | VectorHandler.cpp | #include <iostream>
#include <vector>
#include <fstream>
// Шаблонный класс для работы с векторами
template <typename T>
class VectorHandler {
private:
std::vector<T> vec; // Внутреннее хранилище вектора
public:
// Конструктор по умолчанию
VectorHandler() {}
// Конструктор с параметром размера вектор... | ALGO | 0.940154 | 5.119627 |
3adb8cb2-67d5-459f-bcbf-2fe771b8b2bb | Rejaul-arim-shohag/data_structure | binary-tree/binary_tree_problem_solving_assignment/problem_2_lef_node_reverse.cpp | #include <iostream>
#include <queue>
#include <vector>
#include <algorithm>
using namespace std;
class Node
{
public:
int val;
Node *left;
Node *right;
Node(int val)
{
this->val = val;
this->left = NULL;
this->right = NULL;
}
};
Node *input_tree()
{
int val;
cin ... | ALGO | 0.999912 | 4.445971 |
93354fa8-7962-42cc-8db8-f2b1e02fd026 | futreabc/vscode | c++/树和二叉树.cpp | // #include<iostream>
// using namespace std;
// typedef struct BiNode
// {
// char data;
// int Ltag;//左标志
// struct BiNode* Lchild;
// int Rtag;//右标志
// struct BiNode* Rchild;
// }BiNode,*BiTree;
// void Vist_BiNode(BiTree T)//遍历二叉树
// {
// if(T)
// {
// cout<<T->data<<endl;//访问结点,每个结点经过三次,无论是先序,中序,后序,只是访问的时机不同
... | ALGO | 0.999822 | 3.465015 |
a107c020-0092-4122-8f49-c257a8de8008 | galazaro14/20Ejercicios | Ejercicio 11.cpp | #include<iostream>
using namespace std;
int main(){
int decimal;
short binario[8];
cout<<"Tecle el valor en decimal a convertir: "<<endl;
cin>>decimal;
for(int i=0;i<8;i++)
{
binario[i]=decimal%2;
decimal/=2;
}
cout<<"El numero en binario es: "<<endl;
for(int i=7;i>=0;i--)
{
cout<<binario[1];
... | ALGO | 0.993663 | 4.127478 |
ac5e17a6-9a68-42b0-95a2-bf01e6c74b3a | kohillyang/vio_homeworks | h003/CurveFitting_LM/app/CurveFitting.cpp | #include <iostream>
#include <random>
#include "backend/problem.h"
using namespace myslam::backend;
using namespace std;
// 曲线模型的顶点,模板参数:优化变量维度和数据类型
class CurveFittingVertex: public Vertex
{
public:
EIGEN_MAKE_ALIGNED_OPERATOR_NEW
CurveFittingVertex(): Vertex(3) {} // abc: 三个参数, Vertex 是 3 维的
virtual st... | ALGO | 0.999699 | 5.800868 |
e2948f2c-8d77-424d-8c60-0175541dfbc0 | Rahul-r-a/Training_Project | Preincrment_overloadig/main.cpp | /*Pre increment overloading operator*/
#include <iostream>
using namespace std;
class size
{
private :
int weight;
public :
size()
{
weight=69;
}
size(float Weight)
{
weight = Weight;
}... | TOOL | 0.911654 | 3.510331 |
0b5ede9b-e92c-4a5c-b00a-6a0b148ae396 | ishandutta2007/codeforces | shubham__36/normal/1348/E.cpp | #pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2,fma")
#pragma GCC optimize("unroll-loops")
#include <bits/stdc++.h>
#include <complex>
#include <queue>
#include <set>
#include <unordered_set>
#include <list>
#include <chrono>
#include <random>
#include <iostream>
#in... | ALGO | 0.999981 | 3.299808 |
d730bacd-6955-41d0-8720-45f2c42dd731 | MdRifathSharker/Competitive-programming | hudai.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int r;
cin >> r;
int sum = pow(2, r);
int a[sum][r];
for (int i = 0; i < sum; i++) {
for (int j = 0; j < r; j++) {
a[i][j] = 0;
}
}
for (int col = 0; col < r; col++) {
int block_size = pow(2, col)... | ALGO | 0.999764 | 3.677512 |
49ea4db3-056e-449d-ad44-1294dcb152b6 | Fauzan-Aldi/OpenSourceComputerVisionLibrary | modules/core/src/sum.dispatch.cpp | #include "precomp.hpp"
#include "opencl_kernels_core.hpp"
#include "stat.hpp"
#include "sum.simd.hpp"
#include "sum.simd_declarations.hpp" // defines CV_CPU_DISPATCH_MODES_ALL=AVX2,...,BASELINE based on CMakeLists.txt content
#undef HAVE_IPP
#undef CV_IPP_RUN_FAST
#define CV_IPP_RUN_FAST(f, ...)
#undef CV_IPP_RUN
#de... | ALGO | 0.996411 | 6.1695 |
401c4e4a-7109-4055-9fd5-b4836e3c963e | rockieCao/LeetCodeSolution | DP/IntegerToBreak.cpp | #include <iostream>
#include <cstdlib>
#include <string>
#include <vector>
using namespace std;
class Solution {
public:
vector<int> record;
int integerBreak(int n) { // skill: split 3 as many as possible and it can be proved
record = vector<int>(59, 0);
if (n == 2) return 1;
else return dp(n, true);
}
int... | ALGO | 0.999964 | 4.071589 |
6c012d44-46fc-4a66-a2f9-682ac42f3f0c | Tahsin005/Problem-Solving | Phitron Contest 7/A_A.cpp | // /******************************************************************/
// * *
// * |''||''| | || ||' ;''''';. '||' '|. '|' *
// * || ||| || || || || |'| | *
// * || | || |||||... | ALGO | 0.999639 | 4.521413 |
0a4b207c-d5f8-42a7-a0c5-f4b6e8f9ee9a | Mindjolt2406/Competitive-Programming | Codechef/Snackdown/Pre/INVENTRY.cpp | #include<bits/stdc++.h>
#define mt make_tuple
#define mp make_pair
#define pu push_back
#define INF 1000000001
#define MOD 1000000007
#define ll long long int
#define ld long double
#define vi vector<int>
#define vll vector<long long int>
#define fi first
#define se second
#define sc(n) scanf("%d",&n);
#define scll(n) ... | ALGO | 0.99948 | 3.399065 |
dc9ccf17-5713-4275-8821-4df8dc28f41d | ishandutta2007/codeforces | jasonlan/normal/1420/B.cpp | #include<iostream>
#include<cstdio>
#include<algorithm>
#define mid ((l+r)>>1)
using namespace std;
const int maxn=31;
int n,cnt[maxn];
inline int read(){
int res=0;
char ch=getchar(),ch1=ch;
while(!isdigit(ch))ch1=ch,ch=getchar();
while(isdigit(ch))res=(res<<3)+(res<<1)+ch-'0',ch=getchar();
return ch1=='-'?-res:r... | ALGO | 0.999399 | 3.625456 |
6a1149c5-258d-4f31-866b-83ad7696280a | alvinnardo/licode | leetcode/794.cpp | #include "../template/head.h"
#include <bits/stdc++.h>
bool validTicTacToe(vector<string> board) {
// 思路:模拟,检测不成立的情况
// 时间 O(n2),空间 O(1)
auto canWin = [&](char c) {
return board[0][0] == c && board[0][1] == c && board[0][2] == c ||
board[1][0] == c && board[1][1] == c && board[1][2] ... | ALGO | 0.999846 | 5.880558 |
288a8d6a-5375-4a8e-af46-a6350bb68287 | yangjie-zzu/cppprimeplus | chapter8/pratice5.cpp | #include <iostream>
template <typename T>
T max5(T * ary);
int main() {
int a[] = {1, 2, 3, 4, 5};
std::cout << max5(a) << std::endl;
double b[] = {1.0, 2.0, 3.0, 4.0, 5.1};
std::cout << max5(b) << std::endl;
}
template <typename T>
T max5(T * ary) {
T max = ary[0];
for (int i = 1; i < 5; i++... | ALGO | 0.999236 | 5.00748 |
bff95a67-3367-40a5-a25e-540884472811 | ishandutta2007/codeforces | deemo/normal/1097/F.cpp | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
#define F first
#define S second
#define real lasidhfuih
const int MAXN = 1e5 + 10;
const int MAXVAL = 7000 + 10;
int n, q;
bitset<MAXVAL> ans[MAXN], sv[MAXVAL], tt[MAXVAL], temp;
int main(){
ios::sync_with_stdio(false... | ALGO | 0.999288 | 4.740713 |
47a25e3c-dacb-418d-b150-3438f98a9a5c | chinoxyz/Spoj | BRIDGE.cpp | #include <cstdio>
#include <algorithm>
#include<iostream>
#include<vector>
#include<climits>
#include <complex>
#include <iostream>
#include <valarray>
#include<cstring>
#include<queue>
#include<bitset>
#include<map>
#include<set>
#include<sstream>
#include<ctime>
#include <stack>
#include <iomanip>
using namespace st... | ALGO | 0.99982 | 3.696775 |
66968cf2-ba38-47f0-b2f9-6a38c56ca98d | sofikulsk02/DSA_in_c- | 2DArrayPart1/rotateBy90.cpp | #include<iostream>
using namespace std;
int main(){
int m;
cout<<"Enter the size of the squrer matrix:";
cin>>m;
int arr[m][m];
for(int i=0; i<m; i++){
for(int j=0; j<m; j++){
cin>>arr[i][j];
}
}
for(int i=0;i<m;i++){
for(int j=i+1; j<m; j++){
... | ALGO | 0.999853 | 3.191846 |
bafc110f-4c8a-476d-b557-431e9cee2a03 | alanyang0819/test_codes | C++/Homework5.cpp | #include<iostream>
#include<cassert>
using namespace std;
void foo(int *num1, int *num2, int *num3, int decimal)
{
*num1 = decimal % 2;
decimal = decimal / 2;
*num2 = decimal % 2;
decimal = decimal / 2;
*num3 = decimal % 2;
}
int main()
{
int x;
int y;
int z;
for(int i = 0; i < 8; i++)
{
foo(... | ALGO | 0.987477 | 3.972953 |
d34affff-2d43-44ad-bfeb-73603c4fa473 | asitava1998/Image-Forensics-PRNU | wavelet_vs_BM3D/midwt_r.cpp | #include "midwt_r.h"
#define max(A,B) (A > B ? A : B)
#define mat(a, i, j) (*(a + (m*(j)+i))) /* macro for matrix indices */
void MIDWT(double *x, int m, int n, double *h, int lh, int L, double *y) {
double *g0, *g1, *ydummyl, *ydummyh, *xdummy;
long i, j;
int actual_L, actual_m, actual_n, r_o_a, c_o_a, ir, ic,... | ALGO | 0.999967 | 4.695493 |
e864841a-3df3-42b6-9dcf-529c2b89cad7 | Captain-Tim/leetcode | 0567. Permutation in String/Permutation in String.cpp | class Solution {
public:
bool checkInclusion(string s1, string s2) {
if (s1.size() > s2.size())
return false;
const int alphabet_num = 26;
vector<int> letters(alphabet_num, 0);
for (const char& c : s1)
++letters[c - 'a'];
int diff = 0;
for (con... | ALGO | 0.999933 | 6.428362 |
3478e20b-1803-4912-b9ed-9b5cd10dfcdb | wf-hahaha/ORB_SLAM2 | Thirdparty/g2o/g2o/core/estimate_propagator.cpp | #include "estimate_propagator.h"
#include <queue>
#include <vector>
#include <cassert>
#include <iostream>
#include <algorithm>
#include <fstream>
//#define DEBUG_ESTIMATE_PROPAGATOR
using namespace std;
namespace g2o {
# ifdef DEBUG_ESTIMATE_PROPAGATOR
struct FrontierLevelCmp {
bool operator()(EstimatePropa... | ALGO | 0.999889 | 5.590659 |
e22782b6-9eff-4cec-9cb2-4e42778a9f13 | north-h/Match_code | 2023/PTA/7-1_找最贵的书和最便宜的书.cpp | #include<bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
vector<pair<double, string>> a;
for(int i = 1; i <= n; i++) {
string s;
double x;
// getline(cin, s);
cin >> s;
// cout << s << endl;
cin >> x;
cout << x << endl;
a.... | ALGO | 0.998489 | 3.737485 |
d83c0e42-540b-450d-ada4-030d214c263a | Megg01/CSII201-C-Language | Lab12/HW2.cpp | #include<stdio.h>
#include<math.h>
typedef struct{
int x,y;
}Point;
typedef struct{
Point A, B, C;
double a,b,c;
}Triangle_P;
double distance(Point a,Point b){
double d=sqrt(pow(b.x-a.x, 2)+pow(b.y-a.y,2));
return d;
}
double find_area(Triangle_P g){
double p=(g.a+g.b+g.c)/2;
double s=sqrt(p*(p-g.a)*(p-g.b)*(p-g... | ALGO | 0.999483 | 4.179759 |
b81ad850-b892-40c8-99b2-70a6cff90dd7 | davidlywei/schoolProjects | 2nd_proj_warehouse/linkedList.cpp | /****************************************************************************************
Description: Source file for Linked List
Author: David Wei
Date: 11/27/14
Last Modified: Initial Revision
IDE USED: gcc version 4.8.3 (cygwin64 on Windows 7)
******************************************************... | TOOL | 0.924931 | 5.431311 |
fdc07b92-b0eb-4801-9509-45dee06ffd5a | bipulhstu/Online-Judge-Solutions | URI/1159.cpp | #include<iostream>
using namespace std;
int main()
{
int N, x, y,i,sum,count1;
while(1)
{
cin>>x;
sum=0;
if(x==0)
break;
else if(x%2==0)
{
for(i=1; i<=5;i++)
{
sum=sum+x;
x=x+2;
}
cout<<sum<<"\n";
... | ALGO | 0.999854 | 3.460142 |
18303ef6-e858-41cb-90d1-0f9a9577d62e | achen7296/Codeforces | 158B.cpp | #include <iostream>
#include <unordered_map>
using namespace std;
int getValue(unordered_map<int,int>map, int key){
if (map.find(key) != map.end()){
return map.at(key);
}else{
return 0;
}
}
int main(){
unordered_map<int, int> m;
int n, g;
cin >> n;
int out = 0;
for (in... | ALGO | 0.999926 | 4.236694 |
6dc45e7b-13f1-4cb3-8155-1746c47fe40e | Chandankr-kr/LeetCode | 210-course-schedule-ii/210-course-schedule-ii.cpp | class Solution {
public:
vector<int> res;
bool findSol(vector<vector<int>> &adj,int start,vector<bool>& visited,vector<bool>& path){
visited[start]=true;
path[start]=true;
for(auto &it:adj[start]){
if(!visited[it]){
if(findSol(adj,it,visited,path))
... | ALGO | 0.999983 | 6.17489 |
8ca09d66-76bc-44fa-b1b6-f754c25ce027 | novak-99/MLPP | MLPP/MultinomialNB/MultinomialNB.cpp | //
// MultinomialNB.cpp
//
// Created by Marc Melikyan on 1/17/21.
//
#include "MultinomialNB.hpp"
#include "Utilities/Utilities.hpp"
#include "LinAlg/LinAlg.hpp"
#include <iostream>
#include <algorithm>
#include <random>
namespace MLPP{
MultinomialNB::MultinomialNB(std::vector<std::vector<double>> inputSet, s... | ALGO | 0.998486 | 5.26804 |
5efa9cfd-026a-4f47-b371-fe69f77f96ce | nitinkaplas123/SDE-SHEET | Binary_Tree/Binary_Tree_level1/8)size_of_binary_tree.cpp | Solution 1-:
idea-:
Just add the root +left_side+right_side
using recursion
Code-: Time->O(n)
int countNodes(TreeNode* root)
{
if(root==NULL)
return 0;
return 1+countNodes(root->left)+countNodes(root->right);
}
Solution 2-:
Using level order traversal
Code-:
int countNodes(TreeNode* root) {
... | ALGO | 0.999996 | 5.926731 |
d5684860-a1e2-42b7-907e-cfe43116b20f | hack-parthsharma/LeetCode | 2150-find-all-lonely-numbers-in-the-array/2150-find-all-lonely-numbers-in-the-array.cpp | class Solution {
public:
vector<int> findLonely(vector<int>& nums) {
vector<int> ans;
unordered_map<int, int> count;
for (const int num : nums)
++count[num];
for (const auto& [num, freq] : count)
if (freq == 1 && !count.count(num - 1) && !count.count(num + 1))
ans.push_back(num)... | ALGO | 0.999825 | 5.790014 |
82da844d-7724-48e3-a2db-ad1368175d4e | Nekdash/mini_paint | mini_paint/functions.cpp | #include "Header.h"
//basic functions used throughout the entire project
int absi(int a) { // abs() analog
if (a < 0)
return a * (-1);
return a;
}
long long itc_len(string str) { // determine the length of the string
long long res = 0;
int i = 0;
while (str[i] != '\0') {
i++;
... | TOOL | 0.908312 | 3.489394 |
c2a0b329-ff87-4fa1-8079-34d293ff3c64 | NCommander/openbsd-src-with-branches | gnu/llvm/llvm/lib/CodeGen/SelectOptimize.cpp | #include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/Statistic.h"
#include "llvm/Analysis/BlockFrequencyInfo.h"
#include "llvm/Analysis/BranchProbabilityInfo.h"
#include "llvm/Analysis/LoopInfo.h"
#include "llvm/Analysis/OptimizationRemarkEmitter.h"
#include "llvm/Analysis/ProfileSummaryInfo.h"
#include "llvm/Analysis/... | ALGO | 0.996775 | 6.011407 |
b975bfe1-b984-4766-8d8d-1b37b65a629a | ollieelliot/ESP32-IoT-Board | New layout/Code/Experimental/libraries/ollieelliot-project-1_inferencing/src/edge-impulse-sdk/tensorflow/lite/micro/kernels/reduce.cpp | #include "edge-impulse-sdk/tensorflow/lite/kernels/internal/reference/reduce.h"
#include "edge-impulse-sdk/tensorflow/lite/c/builtin_op_data.h"
#include "edge-impulse-sdk/tensorflow/lite/c/common.h"
#include "edge-impulse-sdk/tensorflow/lite/kernels/internal/quantization_util.h"
#include "edge-impulse-sdk/tensorflow/l... | ALGO | 0.992794 | 7.405531 |
5c8bc129-f441-422c-be09-9c9502f5c7b4 | Luboteroa/C_PlusPlus | Bloque de Ciclos #4/CicloEjercicio_06.cpp | /* Realice un programa que calcule y muestre en la salida la suma de los cuadrados de los 10 primeros enteros mayores que cero */
#include <iostream>
#include <stdlib.h>
using namespace std;
int main()
{
int suma = 0;
for(int i = 1; i<=10; i++)
{
int cuadrado = i*i;
suma += cuadrado;
cout<<"Cuadrado de "<... | ALGO | 0.993897 | 3.638644 |
6f22cf85-c3e7-42f1-9322-395aec59384c | Masterroy1210/DSA-PROBLEMSOLVING | largest area rectangle in histogram(optimised approach).cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
int n;
cin>>n;
int height[n];
for(int i=0;i<n;i++){
cin>>height[i];
}
int left[n];
int right[n];
stack<int>st;
for(int i=0;i<n;i++){
while(!st.empty()&&height[st.top()]>=height[i]){
st.pop();
}
if(st.empty())left[i]=0;
else{
left[i] = st... | ALGO | 0.999701 | 3.934973 |
ad1b40ce-567c-4aac-bfd4-dd7f81c1abea | kushalagarwalla/leetcode | 7-reverse-integer/reverse-integer.cpp | class Solution {
public:
int reverse(int x) {
int rev=0;
while(x!=0)
{
int temp= x%10;
if((rev<INT_MIN/10)||(rev>INT_MAX/10))
return 0;
rev=(rev*10)+temp;
x=x/10;
}
return rev;
}
}; | ALGO | 0.999972 | 5.857589 |
d786adad-31b7-4b79-b55d-d7ac4be0cd76 | Aryashanish/DSA | 0025-reverse-nodes-in-k-group/0025-reverse-nodes-in-k-group.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* reverseKGro... | ALGO | 0.999993 | 5.732605 |
dc679a21-1e47-4446-bbb1-b5271f0d8edc | tal-tech/note_neatness_service | src/grpc/third_party/libcxx/test/std/containers/container.adaptors/priority.queue/priqueue.cons/ctor_comp_container.pass.cpp | // <queue>
// explicit priority_queue(const Compare& comp, const container_type& c);
#include <queue>
#include <cassert>
#include <functional>
template <class C>
C
make(int n)
{
C c;
for (int i = 0; i < n; ++i)
c.push_back(i);
return c;
}
int main()
{
std::vector<int> v = make<std::vector<in... | TEST | 0.968969 | 4.552889 |
7c83b0af-8acd-436a-9376-76481f17ec20 | stytim/RealSense-ToolTracker | extern/eigen/src/doc/examples/Tutorial_ReductionsVisitorsBroadcasting_colwise.cpp | #include <iostream>
#include <Eigen/Dense>
using namespace std;
int main()
{
Eigen::MatrixXf mat(2,4);
mat << 1, 2, 6, 9,
3, 1, 7, 2;
std::cout << "Column's maximum: " << std::endl
<< mat.colwise().maxCoeff() << std::endl;
}
| ALGO | 0.999533 | 3.779679 |
f7adf073-79e8-40dc-b6e3-772195c2d478 | zjy-dev/algorithm | LeetCode/868-二进制间距.cpp | #include "LeetCode.h"
class Solution {
public:
int binaryGap(int n) {
// l初始化为-1可以用于标识l是否代表一个二进制1
int l(-1), r(-1), ans(0);
for (int i = 31; i >= 0; i--) {
if ((n >> i) & 1) {
// 第一位是32 - 31
// 所以第i位是32 - i
r = 32 - i;
if (l != -1) {
ans = max(ans, r - l)... | ALGO | 0.999651 | 6.274202 |
0aab1982-89d5-411b-ba85-edb17a07b03f | yuntreee/Algorithm_Solved | BOJ_#4811.cpp | #include <iostream>
#include <memory.h>
#include <vector>
#include <queue>
#include <algorithm>
using namespace std;
long long dp[31][31];
//w, h
int n;
long long method(int, int);
int main() {
for (int i = 0; i < 1000; i++) {
memset(dp, -1, sizeof(dp));
cin >> n;
if (n == 0) break;
cout << method(n, 0... | ALGO | 0.99981 | 3.938244 |
08c71312-3b84-43ce-afa7-d8becd9f9818 | Al-Mahmud-2019331048/CODES | 2.Data Structure/Assignment/comfortably_stack.cpp | #include<bits/stdc++.h>
using namespace std;
stack<int>st;
int main()
{
ios::sync_with_stdio(0);cin.tie(nullptr);
long long int t;
scanf("%lld",&t);
for (int i = 0; i < t; ++i)
{
long long int n;
int q;
scanf("%d",&q);
if(q==1)
scanf("%lld",&n);
... | ALGO | 0.999057 | 4.248497 |
02e6b3ba-d253-4b2b-b660-c5038a80a191 | Jeongfeel/algorithm_code | dynamic programming/Baekjoon_13301_타일 장식물.cpp | /*
problem site : baekjoon
problem number : 13301
problem name : 타일 장식물
algorithm : dynamic programming
*/
#include <iostream>
using namespace std;
const int MAX_COUNT_OF_TILE = 80;
long long tile[MAX_COUNT_OF_TILE + 2];
void initTile();
int main() {
int N;
cin >> N;
initTile();
for (int i = 3; i <= N + ... | ALGO | 0.999955 | 4.390245 |
077df0a1-f300-4190-9269-6ad6c8725c97 | Mahudesh/Data-Structures-And-Algorithms | Sliding Window & Two Pointer Approach/Largest Number.cpp | class Solution {
public:
static bool comparator(string a, string b)
{
string s1=a+b;
string s2=b+a;
return s1>s2;
}
string largestNumber(vector<int>& nums)
{
vector<string>ans;
for(int i=0;i<nums.size();i++)
{
ans.push_back(to_string(nums[i]... | ALGO | 0.999993 | 6.329244 |
c55f4104-0241-4edc-a92f-8874d6cd2c62 | marija185/cspacevoroandrea | src/test_orientationintervals_incrementalupdates.cpp | /*
* test_orientationintervals_incrementalupdates.cpp
*
* Created on: Nov 25, 2012
* Author: sprunkc
*/
#include "cspacevoronoi.h"
#include "OrientationIntervals.h"
#include <iostream>
#include <fstream>
#include <stdio.h>
#define TESTDSTAR 1
bool compareOrientationIntervals(OrientationIntervals& incremen... | TEST | 0.92935 | 7.075824 |
e59f361e-59c0-48a9-8fc8-14b2d9b1ece0 | muhammadakfz/Algorithm-Adventures | EDU codeforces/Two Pointers Method/c1.cpp | #include <bits/stdc++.h>
#define int long long
using namespace std;
signed main() {
int n, s;
cin >> n >> s;
vector<int> a(n);
for (int i = 0; i < n; i++) {
cin >> a[i];
}
int l = 0, r = 0, sum = 0, ans = 0;
while (r < n) {
sum += a[r];
while (sum > s) {
... | ALGO | 0.999702 | 3.846022 |
7564a677-50be-4922-9bfb-e5c7a5b5af7b | heyuanYao-pku/MoConVQ | ThirdParty/eigen-3.3.8/unsupported/test/BVH.cpp | #include "main.h"
#include <Eigen/StdVector>
#include <Eigen/Geometry>
#include <unsupported/Eigen/BVH>
namespace Eigen {
template<typename Scalar, int Dim> AlignedBox<Scalar, Dim> bounding_box(const Matrix<Scalar, Dim, 1> &v) { return AlignedBox<Scalar, Dim>(v); }
}
template<int Dim>
struct Ball
{
EIGEN_MAKE_ALIGN... | TEST | 0.99032 | 6.337957 |
8e614f8a-4ba2-4114-8a19-7fc92a541fa1 | yeon-kyu/algorithm_exercise | 백준/13335 트럭.cpp | #include <string>
#include <vector>
#include <iostream>
#include <algorithm>
#include <queue>
#include <climits>
using namespace std;
int N, W, L;
queue<int> ready;
queue<int> going;
int main() {
ios::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
cin >> N >> W >> L;
for (int i = 0; i < N; i++) {
in... | ALGO | 0.99998 | 3.746156 |
8c5acef1-76ea-41c3-8443-3d05e3df2cd7 | ADITYAPRASADSAHOOS1200/dsa_aalgorithm | binarysearch.cpp/count_1s_binary.cpp | #include<bits/stdc++.h>
using namespace std;
int count(int arr[],int n){
int low=0 ,high =n-1;
while(low<=high){
int mid=(low+high)/2;
if(arr[mid]==0){
low=mid+1;
}
else{
if (mid == 0 || arr[mid-1]==0)
return(n-mid);
else
high=mid-1;
}
}
return 0... | ALGO | 0.999954 | 4.729167 |
2352c271-35ff-4fb4-bbce-678a016aa656 | takazerker/bullet4unity | bullet3/src/BulletDynamics/Featherstone/btMultiBodyDynamicsWorld.cpp | #include "btMultiBodyDynamicsWorld.h"
#include "btMultiBodyConstraintSolver.h"
#include "btMultiBody.h"
#include "btMultiBodyLinkCollider.h"
#include "BulletCollision/CollisionDispatch/btSimulationIslandManager.h"
#include "LinearMath/btQuickprof.h"
#include "btMultiBodyConstraint.h"
#include "LinearMath/btIDebugDraw.h... | TOOL | 0.991641 | 6.462009 |
e1feb494-6be3-442f-b2e5-b1f23d85ada6 | Alin123/Algorithm_DataStructure | Algorithm_DataStructure/Algorithm_DataStructure/Algorithm/Stack_Probing_Backtracking/ConversionOfNumberSystems.cpp | #include "ConversionOfNumberSystems.hpp"
void convert_recursion(Stack<char>& s, int n, int base) {
if (n > 0) {
char digit[] = {'0', '1', '2', '3', '4', '5', '6', '7',
'8', '9', 'A', 'B', 'C', 'D', 'E', 'F'};
s.push(digit[n % base]);
n = n / base;
convert_rec... | ALGO | 0.989234 | 5.175889 |
b5b9464d-a554-419a-a909-741f15f8e590 | jkjan/Baekjoon | 2851.cpp | #include <iostream>
using namespace std;
int main() {
int mushroom[10];
int lessThan = 0;
int i;
int greaterThan = 0;
for (i = 0; i < 10; i++) {
cin >> mushroom[i];
if (lessThan + mushroom[i] >= 100) {
greaterThan = lessThan + mushroom[i];
if (greaterThan == ... | ALGO | 0.99991 | 3.723881 |
0f50ff37-26e9-43b2-ab41-84a7fcb004c5 | Dreamgoing/codeforces-code | 357a.cpp | //
// Created by 王若璇 on 16/6/15.
//
#include <iostream>
#include <algorithm>
#include <cstdio>
#include <cstring>
#include <string>
using namespace std;
int main(){
ios::sync_with_stdio(false);
cin.tie(NULL);
int n;
while (cin>>n){
string s;
int before;
int after;
bool is... | ALGO | 0.992638 | 3.002308 |
4c8fbea4-6189-4da7-98e7-b7b42d0b48ba | satoshianon/SatoshiCoin | src/libmw/src/mmr/IMMR.cpp | #include <mw/mmr/MMR.h>
#include <mw/mmr/MMRUtil.h>
using namespace mmr;
mw::Hash IMMR::Root() const
{
const uint64_t num_nodes = mmr::LeafIndex::At(GetNumLeaves()).GetPosition();
if (num_nodes == 0) {
return mw::Hash{};
}
// Find the "peaks"
std::vector<uint64_t> peakIndices;
uint64... | ALGO | 0.982372 | 5.441173 |
6cc9f5ec-a0b9-4610-8538-f7dcb7e03d89 | yumaokao/leetcpp | answers/12/ans.cpp | #include <string>
#include <iostream>
#include <vector>
using namespace std;
class Solution {
public:
string intToRoman(int num) {
vector<string> rs;
rs.push_back("IVX");
rs.push_back("XLC");
rs.push_back("CDM");
rs.push_back("M ");
string result("");
... | ALGO | 0.999451 | 5.833333 |
257d2d6d-ac01-4eec-89e2-d0bee51f64ae | shankersingh01/LeetCode | 2229-maximum-fruits-harvested-after-at-most-k-steps/2229-maximum-fruits-harvested-after-at-most-k-steps.cpp | class Solution {
public:
int maxTotalFruits(vector<vector<int>>& fruits, int startPos, int k) {
int left = 0, sum = 0, maxFruits = 0;
for (int right = 0; right < fruits.size(); ++right) {
sum += fruits[right][1];
while (left <= right &&
minSteps(fruits[left... | ALGO | 0.999992 | 5.91032 |
6d7b0639-8e67-4a2c-9897-3dde8ab39299 | ishandutta2007/codeforces | social_zhao/normal/848/D.cpp | #include<bits/stdc++.h>
#define int long long
using namespace std;
int get() {
int x = 0, f = 1; char c = getchar();
while(!isdigit(c)) { if(c == '-') f = -1; c = getchar(); }
while(isdigit(c)) { x = x * 10 + c - '0'; c = getchar(); }
return x * f;
}
const int P = 1e9 + 7, N = 55;
int n, m;
int f[N][N], g[N][N], ... | ALGO | 0.999992 | 4.235496 |
fac52718-d91e-43e9-9dad-b253e47c0506 | Torbynator/ORB_SLAM3_ROS2_workspace | opencv/modules/dnn/src/ocl4dnn/src/ocl4dnn_inner_product.cpp | #include "../../precomp.hpp"
#include "../include/common.hpp"
#include "../include/ocl4dnn.hpp"
#include "../include/math_functions.hpp"
namespace cv { namespace dnn { namespace ocl4dnn {
template<typename Dtype>
OCL4DNNInnerProduct<Dtype>::OCL4DNNInnerProduct(OCL4DNNInnerProductConfig config)
{
bias_term_ = conf... | ALGO | 0.965299 | 6.646127 |
3c42b41a-f6c3-4495-8219-be2a68808417 | MengqingCao/opencv_contrib_dvpp | modules/optflow/src/simpleflow.cpp | #include "precomp.hpp"
#ifdef _MSC_VER
# pragma warning(disable: 4512)
#endif
//
// 2D dense optical flow algorithm from the following paper:
// Michael Tao, Jiamin Bai, Pushmeet Kohli, and Sylvain Paris.
// "SimpleFlow: A Non-iterative, Sublinear Optical Flow Algorithm"
// Computer Graphics Forum (Eurographics 201... | ALGO | 0.999252 | 5.298724 |
8f3023f7-fa6f-4be3-88de-053e763ba406 | ZzzzzzS/EasyMVS | core/FeatureExtraction/VocTreeMatcher.cpp | #include "VocTreeMatcher.h"
#include <opencv2/xfeatures2d.hpp>
VocTreeMatcher::Ptr VocTreeMatcher::Create(GlobalMapObject::Ptr GlobalMap)
{
return std::make_shared<VocTreeMatcher>(GlobalMap);
}
VocTreeMatcher::VocTreeMatcher(GlobalMapObject::Ptr GlobalMap)
:FeatureMatcher(GlobalMap),
m_MatcherType(MatcherType_e... | ALGO | 0.956149 | 5.770449 |
74b90b5d-512b-4c06-9d95-e926c40bcc09 | dlai87/video_processing_server_side | FaceRecog_C/src/FaceRecog_refactor.cpp | #include <iostream>
#include "Face2.h"
#include "VideoProcessing.h"
#include "FileSystem.h"
#include <boost/filesystem.hpp>
#include <boost/property_tree/json_parser.hpp>
#include "score.h"
#include "FileCreatedRecorder.h"
#include "MatchResult.h"
using namespace std;
using namespace boost::filesystem;
using boost::p... | ALGO | 0.905483 | 3.602323 |
fa21bd0a-7b79-48aa-a1db-9a0a6c332dde | ishandutta2007/codeforces | betaveros/normal/1137/A.cpp | // http://codeforces.com/problemset/problem/1137/A
// 3:41
#include <cstdio>
#include <vector>
#include <algorithm>
using namespace std;
#define fori(i,s,e) for (int i = s; i < e; i++)
const int N = 1008;
int heights[N][N];
int heightsT[N][N];
int nRows, nCols;
typedef struct Pair {
int index;
int value;
bool oper... | ALGO | 0.999992 | 3.470447 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.