uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
adb55319-301b-45d1-aa3f-cf0c96304023 | neozhangthe1/experimental-code-archive | sna/acrush/cpp/Source/lsp/glib/linalg.cpp | ///////////////////////////////////////////////////////////////////////
// Sparse-Column-Matrix
void TSparseColMatrix::PMultiply(const TFltVV& B, int ColId, TFltV& Result) const {
Assert(B.GetRows() >= ColN && Result.Len() >= RowN);
int i, j; TFlt *ResV = Result.BegI();
for (i = 0; i < RowN; i++) ResV[i] = ... | ALGO | 0.998147 | 4.356798 |
ec9b3df6-4229-4e06-95bc-603dd2f28fc4 | fdreserve/fdr-chain-old-version | src/rpcblockchain.cpp | #include "checkpoints.h"
#include "main.h"
#include "rpcserver.h"
#include "sync.h"
#include "util.h"
#include <stdint.h>
#include "json/json_spirit_value.h"
#include "utilmoneystr.h"
#include "base58.h"
using namespace json_spirit;
using namespace std;
extern void TxToJSON(const CTransaction& tx, const uint256 has... | WEB | 0.897342 | 6.015356 |
3c33aa74-43a6-4bed-8618-61448ceea7a4 | SKLCS/JobDu | caoshen/1384.cpp | #include <iostream>
#include <vector>
#include <cstdio>
using namespace std;
int findT(vector<vector<int> >& matrix, int t) {
int m, n;
m = matrix.size();
n = matrix[0].size();
int i = 0, j = n - 1;
while (i < m && j >= 0) {
int rtop = matrix[i][j];
if (rtop == t)
return true;
else if (rtop > t) {
--j... | ALGO | 0.99998 | 3.883818 |
90559321-1995-4b68-904e-e12266a5c9b4 | Mokuroh54/Comp_Prog | Codeforces/2101-2500/2001-2100/2061-2070/2069D_Palindrome_Shuffle.cpp | /*
___
(o,o)
< . >
--"-"---
Rowlet is orz
_ _ _
>(.)__ >(.)__ >(.)__
(___/ (___/ (___/
I am dum duck
Tooting Bec
*/
#include <bits/stdc++.h>
using namespace std;
#define FF first
#define SS second
#define ll long long
#define ld long double
#define ull unsigned ll
#define endl "\n"
#define EPS 1... | ALGO | 0.999922 | 4.673807 |
a23cb141-45d9-4914-98d6-8466ca44c465 | sakura745/CLion2Leetcode | leetcode/editor/cn/62-unique-paths.cpp | /**
一个机器人位于一个 m x n 网格的左上角 (起始点在下图中标记为 “Start” )。
机器人每次只能向下或者向右移动一步。机器人试图达到网格的右下角(在下图中标记为 “Finish” )。
问总共有多少条不同的路径?
示例 1:
输入:m = 3, n = 7
输出:28
示例 2:
输入:m = 3, n = 2
输出:3
解释:
从左上角开始,总共有 3 条路径可以到达右下角。
1. 向右 -> 向下 -> 向下
2. 向下 -> 向下 -> 向右
3. 向下 -> 向右 -> 向下
示例 3:
输入:m = 7, n = 3
输出:28
示例 4:
输入:m = 3, n =... | ALGO | 0.999916 | 5.517253 |
d8017a57-ab76-4e5c-b334-f84fa5a0c43c | ArtNazarov/leetcode-solutions | 434-number-of-segments-in-a-string/number-of-segments-in-a-string.cpp | #include <sstream>
class Solution {
public:
int countSegments(string s) {
stringstream st(s);
int cnt = 0; string w;
while (st >> w){
if (w.size()!=0) cnt++;
};
return cnt;
}
}; | ALGO | 0.999482 | 5.078026 |
2700db2b-ef9b-46e7-9c4a-ffe6819ea0d7 | Banbury/starshatter-open | Opcode/OpcodeLib/OPC_AABBCollider.cpp | ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////... | ALGO | 0.998527 | 7.669437 |
37df006a-8727-45f1-b8ca-28abc55167fd | cartogrobot/robotmoose_cartogrobot | cartogrobot/occupancy_grid/occupancy_grid.cpp | /*
* occupancy_grid.h
* Author: Aven Bross, Max Hesser-Knoll
* Date: 11/29/2015
*
* Description:
* Probabilistic occupancy grid
*/
#include "occupancy_grid.h"
OccupancyGrid::OccupancyGrid(std::size_t size, Probability p0, Probability pFree, Probability pOcc)
{
_l0 = std::log(p0 / (1 - p0));
_lOcc = std::log(... | ALGO | 0.981192 | 5.934681 |
1b57d823-6862-4b31-8016-30dbb2d13430 | otamic/ElectricCircuit-OS | matrix.cpp | #include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include "matrix.h"
const int overflow = 0;
void ini_vector(Vector & V, int n) {
V = (ElemType *)malloc(n*sizeof(ElemType));
if (!V) exit(overflow);
memset(V, 0, n*sizeof(ElemType));
}
void ini_matrix(Matrix & M, int n, int m) {
... | ALGO | 0.999967 | 3.721558 |
5bac4516-e138-495e-996c-88665a6811fa | siemens/fluffi | core/FluffiTester/testApplications/src/ReportingCrashSharedMemFeeder/ReportingCrashSharedMemFeeder.cpp | #include "stdafx.h"
#include "SharedMemIPC.h"
//cp ../../../../bin/libsharedmemipc.so .
//g++ --std=c++11 -I../../../../SharedMemIPC/ -o ReportingCrashSharedMemFeeder stdafx.cpp ReportingCrashSharedMemFeeder.cpp libsharedmemipc.so -Wl,-rpath='${ORIGIN}'
#if defined(_WIN32) || defined(_WIN64)
#else
// trim from end (i... | TOOL | 0.937432 | 4.387709 |
59f5a942-bc07-4943-b469-8d190b46173c | NguyenGiangDev/Code_Basic_C- | thlthdtKhachsanDaHinh.cpp | #include<iostream>
using namespace std;
class Khachsan
{
protected:
int sodem;
public:
virtual void Nhap()
{
cin>>sodem;
}
virtual int Tinhphiphong()
{
return 0;
}
virtual int PhanLoai()
{
return 0;
}
};
class preminum: public Khachsan
{
protected:
int ph... | ALGO | 0.966576 | 3.136273 |
b4996243-6757-42c1-b14b-a3675e44a5f5 | iyungui/TIL-codetree | 241126/최소공배수 구하기/find-the-least-common-multiple.cpp | #include <iostream>
using namespace std;
void lcm(int n, int m) {
int i = 1;
int j = 1;
int lcm;
while(true) {
if (n * i == m * j) {
lcm = m * j;
break;
}
if (n * i < m * j) {
i++;
} else {
j++;
}
}
cout << ... | ALGO | 0.999964 | 4.911258 |
40fba985-8bb0-4e2c-b7e0-ea6c5119c1f2 | h-beeen/Algorithm | 001_Sort/10989_수 정렬하기 3.cpp | #include <iostream>
#include <algorithm>
using namespace std;
int main (void)
{
ios::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
int arr[10005] = {};
int a, num = 0;
cin >> a;
for(int i = 0; i < a; i++)
{
cin >> num;
arr[num]++; // input 3 -> arr[3]++;
}
... | ALGO | 0.999799 | 3.468809 |
73931e68-4670-4347-b78d-060818ea744e | joaoreis28/Maratona-ClubeDeProgramacao | Codeforces/cf1811E.cpp | #include <stdio.h>
typedef long long ll;
int a [45], asize;
void to_base9(ll k)
{
asize = 0;
if(k == 0 )
{
a[0] = 0 ;
asize = 1;
}
while (k)
{
a[asize++] = k % 9;
k = k / 9;
}
}
int main(void)
{
ll k;
int t;
scanf("%d", &t);
while (t--)
... | ALGO | 0.999622 | 3.962883 |
55e74c5d-a1fb-46ca-8686-50b0257135ca | Xuechun-Hu/possion_reconstrction | libigl/include/igl/flood_fill.cpp | template <typename Derivedres, typename DerivedS>
IGL_INLINE void igl::flood_fill(
const Eigen::MatrixBase<Derivedres>& res,
Eigen::PlainObjectBase<DerivedS> & S)
{
using namespace Eigen;
using namespace std;
typedef typename DerivedS::Scalar Scalar;
const auto flood = [&res,&S] (
const int xi,
co... | ALGO | 0.990027 | 5.372252 |
c40a3dfd-01af-44e3-8f3a-803642945217 | fxingan/Algorithm | 2113419_H1.2/2113419_H1.2_Q2/2113419_H1.2_Q2/2113419_H1.2_Q2.cpp | #include <iostream>
using namespace std;
int main()
{
float n, m, a, b;
cin >> n >> m >> a >> b;
float p = m / b;
if (m / b <= a) {
int t;
t = n / m;
cout << t * b + a * (n - m * t);
}
else {
cout << n * a;
}
return 0;
} | ALGO | 0.998443 | 3.28355 |
9a39809f-66a8-4d8b-aa17-066b4634b25e | lanhuong1999/Data-Structures-and-Algorithms | Contest8/bai20/main.cpp | #include <bits/stdc++.h>
using namespace std;
typedef map<string,bool>msb;
typedef pair<string,int>psi;
const string base="1238004765";
string left(string s){
string s1=s;
s1[0]=s[3];
s1[1]=s[0];
s1[2]=s[2];
s1[3]=s[7];
s1[4]=s[4];
s1[5]=s[1];
s1[6]=s[6];
s1[7]=s[8];
s1[8]=s[5];... | ALGO | 0.999567 | 4.010611 |
c2bd8810-0abe-4059-8927-5e7539d0bc1c | yipu3/algorithm-practice | USACO/Section1/2/dualpal.cpp | /*
ID: firstaw1
PROG: dualpal
LANG: C++
*/
#include<algorithm>
#include<iostream>
#include<cstring>
#include<cstdlib>
#include<climits>
#include<sstream>
#include<vector>
#include<cstdio>
#include<string>
#include<stack>
#include<queue>
#include<cmath>
#include<map>
#include<set>
typedef long long ll;
using namespace ... | ALGO | 0.998998 | 3.478774 |
82b351c1-ae67-4de1-aa38-ea3f0333e7e8 | rajeshsaha782/AI | minimum_path.cpp | #include<iostream>
using namespace std;
int main()
{
int matrix[5][5]={};
for(int i=0;i<5;i++)
{
for(int j=0;j<5;j++)
{
int x;
cout<<"Enter cost:";
cin>>x;
matrix[i][j]=x;
}
}
int a=0,b=0,cost=matrix[0][0];
for(int i=0;i... | ALGO | 0.999713 | 3.039768 |
63cf3e94-8fe1-45b6-aaa2-2de644dbcd38 | XessX/Angry_Bird_Alike | boost/libs/graph/example/tiernan_print_cycles.cpp | //[tiernan_print_cycles
#include <iostream>
#include <boost/graph/directed_graph.hpp>
#include <boost/graph/tiernan_all_cycles.hpp>
#include "helper.hpp"
using namespace std;
using namespace boost;
// The cycle_printer is a visitor that will print the path that comprises
// the cycle. Note that the back() vertex of... | ALGO | 0.999621 | 6.569889 |
b154edec-fe25-4334-9d9c-0eb70d7665e9 | datsu0/cpp | atcoder/AtcoderBeginnersSelection/easy/10.cpp | #include <iostream>
#include <algorithm>
#include <stack>
#include <queue>
#include <vector>
#include <utility>
#include <map>
#include <string>
#include <math.h>
using namespace std;
int main() {
int a,b,c;
string s;
cin >> a;
cin >> b >> c;
cin >> s;
cout << a + b + c << " " << s << endl;
... | ALGO | 0.937313 | 3.091828 |
1389eb2b-e7c1-4833-aa4f-76325cc8430c | smundhra-git/Kattis_Solutions | exammanipulation.cpp | #include <iostream>
#include <vector>
#include <string>
#include <sstream>
#include <unordered_map>
#include <unordered_set>
#include <cmath>
#include <set>
#include <climits>
#include <queue>
#include <stack>
using namespace std;
typedef vector<int> vi;
typedef pair<double, double> ii;
typedef vector<ii> vii;
typede... | ALGO | 0.999907 | 5.384458 |
2035470e-1fcb-4b68-9b9e-36e0fb0ac5e9 | mcdonalds532/CS008-Final-Presentation | Applications/Autocorrect/Word.cpp | #include "Word.h"
Word::Word(const std::string& word) : word(word), priority(0) {}
int Word::getPriority() const
{
return priority;
}
void Word::calculatePriority(const std::string& inputWord)
{
if(inputWord.empty())
{
priority = 0;
return;
}
int priorityValue = 0;
int wordSi... | ALGO | 0.998002 | 5.741174 |
0a053eb2-2493-42b1-9a44-670b471e8d14 | sakshieng/DSA-Sheet | Array/challeValley.cpp | // https://codeforces.com/problemset/problem/1760/D
#include<bits/stdc++.h>
//sakshi codes here
using namespace std;
#define ll long long
#define mod (int)(1e9 + 7)
void solve()
{
ll n;cin>>n;
vector<ll>a(n);
for (auto &&i : a)
{
cin >> i;
}
int cnt = 1,flg = 1;
for(int i=1;i<n;++i){
... | ALGO | 0.999915 | 4.828834 |
42ac63e4-5d80-4186-b75c-39511df6f8e1 | Ritik2221999/DSA | Linked List/removeDuplicateFromSortedLL.cpp | #include<bits/stdc++.h>
using namespace std;
class Node {
public:
int data;
Node* next;
Node(int data) {
this -> data = data;
this -> next = NULL;
}
};
void insertAtEnd(Node* &tail, int data) {
Node* newNode = new Node(data);
tail -> next = ... | ALGO | 0.99987 | 5.282319 |
183457de-1a0f-4870-a021-c9b8b9ebb185 | Nishant-Bhosale/Competitive-Programming-CPP | CodeForces_Problems/Medium Problems/IQtest.cpp | #include<iostream>
#include<vector>
#include<utility>
using namespace std;
int main(){
int n, num;
cin>>n;
vector<pair<int, int>> odds;
vector<pair<int, int>> evens;
for(int i = 0; i<n; i++){
cin>>num;
if(num % 2 == 0){
evens.push_back({num, i+1});
}else{
odds.push... | ALGO | 0.999368 | 3.988947 |
b7310458-408e-4b54-a367-1cba481040fc | wallbreaker01/Competitive-Programming | A_Showstopper.cpp | #include<bits/stdc++.h>
typedef long long int ll;
using namespace std;
#define yes cout<<"YES"<<endl
#define no cout<<"NO"<<endl
/* Vogoban please code ta accept korai dew >.< */
void solve()
{
ll n,c=0;;
cin >> n;
ll s[n];
for (ll i = 0 ; i < n ; i++) cin>>s[i];
ll v[n];
for (ll i = 0 ; i < n... | ALGO | 0.999932 | 3.434561 |
dd37d097-cd52-45b3-9343-a23422ff60f3 | FryeLun/algorithm-journey | LanQiao/2017/P8647.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int n, k;
const int MAXN = 1e5 + 5;
int a[MAXN][2];
bool check(int m) {
int sum = 0;
for(int i = 0; i < n; i++) {
sum += (a[i][0] / m) * (a[i][1] / m);
}
return sum >= k;
}
int main() {
ios::sync_with_stdio(false);
ci... | ALGO | 0.999988 | 4.553419 |
1ef35592-a0c7-4999-80bc-0d713f55688d | beamiter/cbp | cbp/cppad/example/multi_thread/team_example.cpp | /*
$begin team_example.cpp$$
$spell
CppAD
$$
$section Using a Team of AD Threads: Example and Test$$
$mindex thread$$
$head Purpose$$
This example demonstrates how use a team of threads with CppAD.
$head thread_team$$
The following three implementations of the
$cref team_thread.hpp$$ specifications are included:
$t... | TEST | 0.962436 | 7.118873 |
ec422544-2937-44ca-9c11-a850711d0e27 | sqiemanqieman/Leetcode-vscode | header/337.打家劫舍-iii.cpp | /*
* @lc app=leetcode.cn id=337 lang=cpp
*
* [337] 打家劫舍 III
*/
// @lc code=start
// Definition for a binary tree node.
#define RUN_IN_LOCAL
#ifdef RUN_IN_LOCAL
struct TreeNode {
int val;
TreeNode *left;
TreeNode *right;
TreeNode() : val(0), left(nullptr), right(nullptr) {}
TreeNode(int x) : va... | ALGO | 0.999938 | 6.44338 |
af2f371c-2bec-42d6-b86c-9595fedd488c | ParasAnxi/LeetCode-CPP | Q0701-0800/767. Reorganize String.cpp | class Solution
{
public:
string reorganizeString(string s)
{
int len = s.length();
vector<int> v(26, 0);
for (auto x : s)
{
v[x - 'a']++;
if (v[x - 'a'] > (len + 1) / 2)
return "";
}
priority_queue<pair<int, char>> pq;
... | ALGO | 0.999995 | 5.668992 |
5b646d7d-7d77-4149-a620-f808f93cdf98 | ghOst-vedant/CPP | Loops/patterns/alphabet/alpha-triangle-rev.cpp | /* A
B A
C B A
D C B A
*/
#include<iostream>
using namespace std;
int main()
{
int n, i = 1, j;
char ch='A';
cin >> n;
while (i <= n)
{
j = 1;
while (j <= i)
{
cout<<char('A'+ i - j )<<" ";
j++;
}
cout<<endl;
... | ALGO | 0.999835 | 3.238288 |
5414803c-f987-4e8e-8581-0ce6baa9583d | Abhinav-0103/DSA-CPP | 22. Binary Tree/Top View of a Tree/code.cpp | #include<iostream>
#include<vector>
#include<queue>
#include<map>
using namespace std;
class Node {
public :
int data;
Node* left;
Node* right;
Node(int val) {
data = val;
left = NULL;
right = NULL;
}
};
void topView(Node* root) {
if... | ALGO | 0.999984 | 5.808586 |
39af7fed-4d45-4674-ab3e-607fe5e249a8 | leenaaq/Practice | 프로그래머스/2/12953. N개의 최소공배수/N개의 최소공배수.cpp | #include <string>
#include <vector>
#include <algorithm>
#include <iostream>
#include <numeric>
using namespace std;
int cal(int n1, int n2){
//cout << (n1 * n2) / gcd(n1, n2) << "\n";
return (n1 * n2) / gcd(n1, n2);
}
int solution(vector<int> arr) {
int answer = arr[0];
sort(arr.begin(), arr.end());
... | ALGO | 0.999967 | 5.255607 |
8f9544fa-8e76-475b-8d8d-a3b79bee40f5 | jaredjxyz/SDCNanodegree | CarND-Path-Planning-Project/src/Eigen-3.3/doc/examples/Tutorial_ArrayClass_mult.cpp | #include <Eigen/Dense>
#include <iostream>
using namespace Eigen;
using namespace std;
int main()
{
ArrayXXf a(2,2);
ArrayXXf b(2,2);
a << 1,2,
3,4;
b << 5,6,
7,8;
cout << "a * b = " << endl << a * b << endl;
}
| ALGO | 0.995128 | 3.51756 |
f06e2ef1-1b05-4e96-8718-27abd8436a30 | 7-Mangodish/DSA-PTIT | Sort_Search/c4_sap_xep_theo_gia_tri_tuyet_doi.cpp | #include<bits/stdc++.h>
#define mod 1000000007
#define ll long long
#define forl(i,a,b) for(int i=a; i<b; i++)
#define forb(i,a,b) for(int i=a; i<=b; i++)
using namespace std;
int x;
bool cmp(int a, int b){
// if(abs(x-a)<abs(x-b))
// return true;
// return false;
return abs(a-x) <abs(b-x);
}
int main(){
int t;
... | ALGO | 0.999925 | 3.379736 |
60e1b995-e4ae-4cc0-8e7c-e89197641fd5 | MaggieLee01/Coding | Binary08_FindInMountainArray/findInMountainArray.cpp | /*һ ɽ mountainArr㷵ܹʹ mountainArr.get(index) target С ± index ֵ
± index뷵 -1
Ϊɽ飿 A һɽĻ
ȣA.length >= 3
Σ 0 < i < A.length - 1 £ i ʹã
A[0] < A[1] < ... A[i-1] < A[i]
A[i] > A[i+1] > ... > A[A.length - 1]
㽫 ֱӷʸɽ飬ͨ MountainArray ӿȡݣ
MountainArray.get(k) - ᷵Ϊk Ԫأ± 0 ʼ
MountainArray.length() - ᷵ظij
ע⣺
MountainArray.ge... | ALGO | 0.999995 | 5.465629 |
e99b7e7c-e5dc-475e-84b5-745bafe3976d | TheMozg/SystemC | src/sysc/datatypes/int/sc_nbexterns.cpp | /*****************************************************************************
sc_nbexterns.cpp -- External functions for both sc_signed and sc_unsigned
classes. These functions work on two parameters u and
v, and copy the result to the first parameter u. This
... | TOOL | 0.924607 | 5.949254 |
9850f37b-3f4b-4786-a844-143b5ef57c09 | butnik666/hermes2d | tutorial/13-newton-elliptic-1/main.cpp | #include "hermes2d.h"
#include "solver_umfpack.h"
#include "function.h"
// This example shows an introductory application of the Newton's
// method to a nonlinear elliptic problem. We use zero Dirichlet boundary
// conditions and a constant initial guess for the Newton's method.
// The treatment of nonzero Dirichl... | ALGO | 0.999901 | 5.778675 |
27d9ff42-1458-4e23-a0bb-152a8534647a | Kopriwchin/FMI-Work | Introduction in Programming - First Sem/12-21-22/zad5.cpp | #include <iostream>
using namespace std;
int checkPalindrome(char str[], int first, int last) {
if (first < last + 1) {
first++;
last--;
return checkPalindrome(str, first, last);
}
if (first == last) {
return 1;
}
if (str[first] != str[last]) {
return 0;
... | ALGO | 0.99959 | 5.138499 |
a62ca106-23ff-4079-9327-3011833bb104 | JasonCeng/MultipartyPSI-Pro | thirdparty/win/miracl/miracl_osmt/source/curve/trans.cpp | //
// Simple Program to transform an elliptic curve
// to the simplified Weierstrass form.
//
// See "Elliptic Curve Public Key Cryptosystems", Menezes,
// Kluwer Academic Publishers, Chapter 3
//
// Requires: big.cpp
//
// cl /O2 trans.cpp big.cpp miracl.lib
// g++ -O2 trans.cpp big.cpp miracl.a -o trans
//
//
#i... | ALGO | 0.997712 | 4.08293 |
a9d5bbd7-3250-49b2-9abe-0e99d2261998 | eyeaadil/DSA | 1073-number-of-enclaves/number-of-enclaves.cpp | class Solution {
public:
typedef pair<int,int>P;
vector<vector<int>>directions{{0,1},{0,-1},{1,0},{-1,0}};
int numEnclaves(vector<vector<int>>& grid) {
int m = grid.size();
int n = grid[0].size();
queue<P>que;
//Push all sources (boundary land cells) into the queue.
... | ALGO | 0.999985 | 6.559895 |
bade4afe-fb99-4ddc-af93-b102e1408e29 | TanmayVig/6Companies30days | day25-31[Walmart]/t6q14.cpp | #include <bits/stdc++.h>
using namespace std;
class Solution
{
public:
// Function to find the largest number after k swaps.
string max = "0";
void util(string str, string &max, int k, int pos)
{
if (k == 0)
return;
char c = str[pos];
for (int i = pos + 1; i < str.l... | ALGO | 0.999991 | 5.46503 |
dbe8f5e3-7400-453b-8084-f389ef37af0a | tejaram15/submitted-solutions | codeforces soln-3.cpp | #include <bits/stdc++.h>
#define int long long
using namespace std;
const int MAXN = 1001 * 1001;
vector < pair < int , int > > a [ MAXN ] ;
int aa [ MAXN ] = {} , mark [ MAXN ] = {} , ans = 0 ;
void dfs(int u , int x , int f)
{
if(x>aa[u])
f = 1 ;
if(f)
ans++;
for(auto v : a[u])
{
... | ALGO | 0.99939 | 3.629115 |
4a9b0179-a258-4a15-85aa-30f1ee7c35a4 | gauravsingh0793/js_chai-or-code | 15-3sum/3sum.cpp | class Solution {
public:
vector<vector<int>> threeSum(vector<int>& nums) {
int n = nums.size();
vector<vector<int>> ans;
sort(nums.begin(), nums.end());
for(int i=0; i<n; i++){
if(i>0 && nums[i] == nums[i-1]) continue;
int j = i+1, k = n-1;
w... | ALGO | 0.999947 | 6.095444 |
49554d20-0518-436c-af54-b2192d18b826 | Zu-rin/AtCoder | AtCoder_Grand_Contest/AGC011/AGC011B.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
typedef long long ll;
int Judge(int tag, vector<ll> &d) {
ll i, x = 0;
for (i = 0; i <= tag; i++)
x += d[i];
for (; i < d.size(); i++) {
if ((x << 1) < d[i])
return false;
x += d[i];
}
return true;
}
int Search(vector<ll> &... | ALGO | 0.999887 | 4.07884 |
163e5975-3757-4ceb-9da9-bc55e7658b95 | OMFGB/frameworks_base | tools/aidl/search_path.cpp | #include <unistd.h>
#include "search_path.h"
#include "options.h"
#include <string.h>
#ifdef HAVE_MS_C_RUNTIME
#include <io.h>
#endif
static vector<string> g_importPaths;
void
set_import_paths(const vector<string>& importPaths)
{
g_importPaths = importPaths;
}
char*
find_import_file(const char* given)
{
str... | TOOL | 0.936157 | 5.820211 |
802f9805-c3f1-40c1-958c-30293443e265 | HamzaMiann/Luna-Game-Engine | BulletPhysicsWrapper/physics/bullet/BulletCollision/NarrowPhaseCollision/btRaycastCallback.cpp | //#include <stdio.h>
#include "BulletCollision/CollisionShapes/btConvexShape.h"
#include "BulletCollision/CollisionShapes/btTriangleShape.h"
#include "BulletCollision/NarrowPhaseCollision/btSubSimplexConvexCast.h"
#include "BulletCollision/NarrowPhaseCollision/btGjkConvexCast.h"
#include "BulletCollision/NarrowPhaseCo... | ALGO | 0.958856 | 5.788608 |
0887c1b1-6f63-4e64-b873-96ab728cbef7 | Berglid/StewartPlatform | includes/eigen-3.3.7/doc/examples/Tutorial_ArrayClass_mult.cpp | #include <Eigen/Dense>
#include <iostream>
using namespace Eigen;
using namespace std;
int main()
{
ArrayXXf a(2,2);
ArrayXXf b(2,2);
a << 1,2,
3,4;
b << 5,6,
7,8;
cout << "a * b = " << endl << a * b << endl;
}
| ALGO | 0.995218 | 3.527115 |
9183864a-4c23-48c4-9b7f-36f57a17b7df | Yxin1a/yancy_server | thirdparty/boost_1_87_0/libs/geometry/example/ml02_distance_strategy.cpp | // Boost.Geometry (aka GGL, Generic Geometry Library)
// Contributed and/or modified by Vissarion Fysikopoulos, on behalf of Oracle
#include <boost/geometry.hpp>
#include <boost/geometry/strategies/cartesian/distance_pythagoras.hpp>
#include <boost/geometry/geometries/point_xy.hpp>
using namespace boost::geometry;
i... | ALGO | 0.962587 | 5.158525 |
15ee525e-ae4c-4883-916b-537ebaf45a61 | bakunowski/final_project_goldsmiths | GranularSynth/eigen-eigen-323c052e1731/lapack/cholesky.cpp | #include "lapack_common.h"
#include <Eigen/Cholesky>
// POTRF computes the Cholesky factorization of a real symmetric positive definite matrix A.
EIGEN_LAPACK_FUNC(potrf,(char* uplo, int *n, RealScalar *pa, int *lda, int *info))
{
*info = 0;
if(UPLO(*uplo)==INVALID) *info = -1;
else if(*n<0) ... | ALGO | 0.999423 | 5.98889 |
236252c6-067d-4f77-a6be-76d5676ceedb | TienHuong/leetcode | 1700/1615.cpp | //https://leetcode.com/problems/maximal-network-rank/description/
//There is an infrastructure of n cities with some number of roads connecting these cities. Each roads[i] = [ai, bi] indicates that there is a bidirectional road between cities ai and bi.
//
//The network rank of two different cities is defined as the to... | ALGO | 0.999735 | 6.119827 |
902accfc-fd5e-43b0-99a1-050bf5af5d3c | ADIL0025/LeetCode | 2032-largest-odd-number-in-string/largest-odd-number-in-string.cpp | class Solution {
public:
string largestOddNumber(string num) {
for (int i = num.length() - 1; i >= 0; --i)
if ((num[i] - '0') & 1)
return num.substr(0, i + 1);
return "";
}
}; | ALGO | 0.999574 | 6.300808 |
830b8f95-2b08-4f29-9b59-7583c04dab73 | rberrypi/CellVista | boost/libs/graph/example/sloan_ordering.cpp | #include <boost/config.hpp>
#include <vector>
#include <iostream>
#include <boost/graph/adjacency_list.hpp>
#include <boost/graph/sloan_ordering.hpp>
#include <boost/graph/properties.hpp>
#include <boost/graph/bandwidth.hpp>
#include <boost/graph/profile.hpp>
#include <boost/graph/wavefront.hpp>
using std::cout;
using... | ALGO | 0.99996 | 6.518653 |
b0abd399-958c-4471-b7f8-e3067b229d93 | sarvex/leetcode-malbolge | solution/0000-0099/0089.Gray Code/Solution.cpp | class Solution {
public:
vector<int> grayCode(int n) {
vector<int> ans;
for (int i = 0; i < 1 << n; ++i) {
ans.push_back(i ^ (i >> 1));
}
return ans;
}
}; | ALGO | 0.999967 | 6.050643 |
988b05a3-2eeb-471e-8ab4-bedc006a3ea1 | AlgorithmStudyClass/SWExpertAcademy | hyunho/samsung/SDS_Algorithm_Lecture/#8_Geometry/11758_ccw.cpp | /*
11758. ccw
https://www.acmicpc.net/problem/11758
기하
ccw
*/
#include<iostream>
using namespace std ;
struct col {
int x , y ;
} ;
col list[3] ;
int main() {
for( int i = 0 ; i < 3 ; i++ )
scanf("%d %d" , &list[i].x , &list[i].y ) ;
int ans = 0 ;
int idx = 0 ;
while( idx < 3 ) {
ans += ( ( list[idx].x... | ALGO | 0.999991 | 4.684797 |
73cd5dd8-04b4-4764-91a0-e7822b6a5a8e | triton-lang/triton | third_party/nvidia/lib/TritonNVIDIAGPUToLLVM/TensorMemoryToLLVM.cpp | #include "Dialect/NVGPU/IR/Dialect.h"
#include "DotOpToLLVM/MMAHelpers.h"
#include "PatternTritonGPUOpToLLVM.h"
#include "TritonNVIDIAGPUToLLVM/PTXAsmFormat.h"
#include "Utility.h"
#include "mlir/Conversion/LLVMCommon/Pattern.h"
#include "mlir/Dialect/LLVMIR/NVVMDialect.h"
#include "triton/Conversion/TritonGPUToLLVM/Ut... | TOOL | 0.883157 | 7.407182 |
f1bafcae-aa15-4427-8264-0b7463a879aa | Shubhamsahu1101/cpp | B_Sequence_Game.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.99991 | 4.204745 |
3a4965d1-d90f-4236-835c-e644df59d8c0 | whoJake/MCubeEditor | src/3rdparty/pugixml-1.14/docs/samples/traverse_predicate.cpp | #include "pugixml.hpp"
#include <string.h>
#include <iostream>
// tag::decl[]
bool small_timeout(pugi::xml_node node)
{
return node.attribute("Timeout").as_int() < 20;
}
struct allow_remote_predicate
{
bool operator()(pugi::xml_attribute attr) const
{
return strcmp(attr.name(), "AllowRemote") == ... | TOOL | 0.854475 | 5.917541 |
292eaaf0-a337-418e-a516-4b781035bd55 | codingwill/competitive-programming | Arkavidia/2021/C.cpp | #include <bits/stdc++.h>
#include <chrono>
/*
** Author: wkwkwill (Willy I. K.)
** 2020/12/01
*/
using namespace std;
using ll = long long int;
/*===================== CONSTANT =====================*/
const ll BIG = 1e18 + 1;
const ll MOD = 1e9 + 7;
const int m = 998244353;
/*============== FUNCTION INITIALIZATION =... | ALGO | 0.999932 | 5.399809 |
ad981518-336a-4aae-a1fc-1715446aa46c | antonioooooooooooo/codeforces | 800/510A - Fox And Snake.cpp | #include <iostream>
using namespace std;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
int n, m;
cin >> n >> m;
for (int i = 0; i < n; i++) {
for (int j = 0; j < m; j++) {
if (i % 2 == 0 || (j == 0 && i % 4 == 3) || (j == m - 1 && i % 4 != 3)) {
cout << "#";
} el... | ALGO | 0.999833 | 3.455298 |
30a8e81a-cd7f-4540-a2d1-99b9c2f01e67 | alexhausen/examples | algorithms/hacker-rank/cpp/attending-workshops.cpp | // https://www.hackerrank.com/challenges/attending-workshops/problem?isFullScreen=true
#include<bits/stdc++.h>
using namespace std;
//Define the structs Workshops and Available_Workshops.
struct Workshop {
int start;
int end;
int duration;
};
struct Available_Workshops {
Workshop* workshops;
int... | ALGO | 0.999983 | 5.014198 |
fae5dbd0-9ae5-4d1d-8c7c-58264241895f | Abdullahbottar/C-pf | lab3/Source2.cpp | //#include <iostream>
//using namespace std;
//void fibonacciseries(int n)
//{
// int z = 1;
// int pre = 0;
// int sum = 0;
// for (int i = 0; i < n; i++)
// {
// sum = sum + pre;
// pre = z;
// z = sum;
// cout << sum << ",";
// }
//
//}
//int main()
//{
// int p;
// cout << "enter the value of p:";
// cin >> p;
... | ALGO | 0.996288 | 3.822165 |
8f0003e9-4988-4a11-96e7-36f133652d15 | blmarket/icpc | blmarket/gcj2012/R1C/A.cpp | #include <algorithm>
#include <iostream>
#include <cstdlib>
#include <cstring>
#include <cstdio>
#include <sstream>
#include <numeric>
#include <iterator>
#include <queue>
#include <set>
#include <map>
#include <vector>
#define mp make_pair
#define pb push_back
#define sqr(x) ((x)*(x))
#define foreach(it,c) for(typeof... | ALGO | 0.999431 | 3.24413 |
5b1c26e8-c34f-4752-8d1b-0c93a7af6a2a | Dice101mahi/CP | maximum_sum.cpp | #include <bits/stdc++.h>
using ll = long long;
#define fm(i, m, n) for(int (i) = 0 ; (i) < (m) ; i += n)
#define fn(i, n, m) for(int (i) = (n) ; (i) < (m) ; (i)++)
#define f(i, m) for(int (i) = 0 ; (i) < (m) ; (i)++)
using namespace std;
void init_code(){
#ifndef ONLINE_JUDGE
freopen("input.txt", "r", st... | ALGO | 0.999902 | 3.95581 |
54202fdf-6e40-47f7-9c74-96e852735f9f | dannygto/a31_422_v33_android | hardware/qcom/camera/QCameraParameters.cpp | #define LOG_TAG "QCameraParams"
#include <utils/Log.h>
#include <string.h>
#include <stdlib.h>
#include "QCameraParameters.h"
namespace android {
// Parameter keys to communicate between camera application and driver.
const char QCameraParameters::KEY_SUPPORTED_HFR_SIZES[] = "hfr-size-values";
const char QCameraParame... | CONFIG | 0.856793 | 6.176345 |
b78105ac-c945-4588-8a0b-e61f79518c2a | 27-aditya/LeetSols | 0518-coin-change-ii/0518-coin-change-ii.cpp | class Solution {
public:
int change(int amount, vector<int>& coins) {
int n = coins.size();
vector<vector<int>>dp(n, vector<int>(amount+1, 0));
for(int i = 0; i <= amount; i++){
dp[0][i] = (i % coins[0] == 0);
}
for(int i = 1; i < n; i++){
for(int ta... | ALGO | 0.999719 | 5.685477 |
7a4db48b-a09f-4908-b247-9a2f8284812b | habiburrahmantalha/UVA-online-Judge | 468Key_to_Success.cpp | //unfinished
#include<stdio.h>
#include<string.h>
#include<algorithm>
using namespace std;
struct l_f
{
char l;
int f;
};
bool comp(l_f i,l_f j)
{
return i.f>j.f;
}
int main()
{
l_f a[130],b[130];
int tc,i,m,n,in1,in2;
char key[1000],encode[1000];
scanf("%d",&tc);
while(tc--)
{
... | ALGO | 0.999813 | 3.077448 |
f1403bab-cb23-40ac-9436-7563f234dd8b | shahJainam961/Problem-Solving | CompaniesQuestions/media.net/companyQuery1.cpp | #include<bits/stdc++.h>
using namespace std;
int up[200001][20];
vector<int> adj[200001];
void binaryLifting(int node, int parent){
up[node][0] = parent;
for(int i=1; i<20; i++){
if(up[node][i-1]!=-1)
up[node][i] = up[up[node][i-1]][i-1];
else up[node][i] = -1;
}
for(int child : adj[node]){
if(child!=p... | ALGO | 0.999974 | 4.143433 |
2bef9a47-4ca1-44a6-942b-e59394a11d64 | NiceFungal/Template | SA.cpp | #include<cstdio>
#include<cstring>
#include<iostream>
using namespace std;
inline int getint()
{
bool f = 0;
char ch;
for(; !isdigit(ch = getchar()); f |= ch == '-');
int v = ch - '0';
for(; isdigit(ch = getchar()); v = v * 10 + ch - '0');
return f ? -v : v;
}
const int maxn = 100005;
char s[maxn];
int n;
int... | ALGO | 0.999938 | 3.584293 |
6a6616d9-2236-4ff0-9b18-b851d7b41c94 | Hany-Kim/MyAlgo | DX_알고리즘_특강/마니또_test.cpp | #include <iostream>
#include <vector>
#include <queue>
#include <limits>
using namespace std;
const int INF = numeric_limits<int>::max(); // Ѵ ʱȭ
struct Edge {
int to;
int cost;
};
vector<int> dijkstra(const vector<vector<Edge>>& graph, int start) {
int n = graph.size();
vector<int> dist(n, INF); ... | ALGO | 0.999719 | 5.146935 |
361b7a21-0b52-4117-8c30-562ec287c306 | Professional-CPP/edition-6 | Examples/Ch20/01_AlgorithmOverview/04_FindIfLambda.cpp | import std;
using namespace std;
// Function template to populate a container of ints.
// A constraint enforces that the container supports push_back(int).
template<typename Container>
requires requires(Container& c, int i) { c.push_back(i); }
void populateContainer(Container& cont)
{
while (true) {
print("Enter ... | ALGO | 0.930967 | 5.073393 |
9c40fd7e-ec89-49ae-9f37-ff5889ce824f | Sakib577/CPP_Programming | Codeforces/Short_sort_1873A.cpp | #include <iostream>
#include <vector>
#include <algorithm>
#include <map>
#define fast_io \
ios_base::sync_with_stdio(false); \
cin.tie(nullptr)
#define all(v) v.begin(), v.end()
#define revall(v) v.rbegin(), v.rend()
#define deb(x) cout << #x << " = " << x << '\n';
#define newl cout << en... | ALGO | 0.999906 | 4.042899 |
e477badb-b5fc-4fbd-bf35-7cf14d9c8492 | alexandraback/datacollection | solutions_1674486_0/C++/praveendhinwa/A.cpp | #include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <deque>
#include <queue>
#include <set>
#include <map>
#include <algorithm>
#include <functional>
#include <utility>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <cstdio>
#include <cstring>
using namespace std;
#defin... | ALGO | 0.999891 | 3.880925 |
428bafa7-cb6b-4728-9bcf-7c52b88270ee | ehnryx/acm | samara-2018-cf101755/d.cpp | #include <bits/stdc++.h>
using namespace std;
#define _USE_MATH_DEFINES
typedef long long ll;
typedef long double ld;
typedef pair<int,int> pii;
typedef complex<ld> pt;
typedef vector<pt> pol;
const char nl = '\n';
const ll INF = 0x3f3f3f3f;
const ll INFLL = 0x3f3f3f3f3f3f3f3f;
const ll MOD = 1e9+7;
const ld EPS = 1e... | ALGO | 0.999984 | 4.004911 |
da97f323-8eb2-452b-be33-2b78743036e5 | sksatyam/1000_days_of_code | DSA/Cpp/Data Structures/Array/twosum.cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
int ar_size,tnum;
cout << "Enter the size of the array: ";
cin>> ar_size;
int array[ar_size];
cout<< "Enter the elements: ";
for(int i = 0;i<ar_size;i++){
cin >> array[i];
}
cout<<"Enter the targeted number: ";
cin >> ... | ALGO | 0.999893 | 4.684744 |
36bc5b22-ec29-449f-b894-75525fb7baf4 | Lincito-31/Preseleccion | Kattis/Job Expenses.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int t,a;
ll sum=0;
int main(){
ios_base::sync_with_stdio(0);
cin.tie(0);cout.tie(0);
cin >> t;
while(t--){
cin >> a;
if(a<0){
sum-=a;
}
}
cout << sum;
} | ALGO | 0.999738 | 4.152178 |
4c4cdba8-a0e4-4575-9f99-64800c230997 | Ravi-av/DSA-with-cpp | pattern10.cpp | #include<iostream>
using namespace std;
int main(){
int n;
cin>>n;
int i=1;
while(i<=n){
int j=1;
while(j<=i){
cout<<i-j+1<<" ";
j=j+1;
}
cout<<endl;
i=i+1;
}
} | ALGO | 0.99994 | 4.203564 |
0134b5c8-0407-4abb-a7c7-8c604d3f25e6 | Mr-Tony-Lee/CP_Road | Uva_record/UVA_3_star_question/11258.cpp | #include<bits/stdc++.h>
using namespace std;
#define int long long
int32_t main(){
int T ;
cin >> T;
cin.ignore();
while(T--){
string input ;
getline(cin,input);
int DP[210] = {0}; // 算 0 ~ i-1 degit 最大值的情況
for (int i = 0; i < input.size(); ++i) {
if (i... | ALGO | 0.999366 | 4.493267 |
01d9009b-e154-4238-91ce-ab4c6a6c8d3f | Mand187/School-Works | ECGR 3180 DATASTRUCT/Assignment 9 - Binary Search Trees/LeetCode/main_leetcode.cpp | #include <iostream>
#include <vector>
struct TreeNode {
int val;
TreeNode* left;
TreeNode* right;
TreeNode() : val(0), left(nullptr), right(nullptr) {}
TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}
TreeNode(int x, TreeNode* left, TreeNode* right) : val(x), left(left), right(right) ... | ALGO | 0.999953 | 7.355361 |
35c666f4-4620-40a0-bb43-1d39b9a5c246 | scalalang2/ps-old | atcoder/abc295/b.cpp | #include<bits/stdc++.h>
using namespace std;
const int maxn = 20;
int r, c;
int table[maxn][maxn];
const int WALL = -1;
const int EMPTY = 0;
int dx[4] = {0, 1, 0, -1};
int dy[4] = {1, 0, -1, 0};
void bfs(int y, int x) {
vector<vector<bool>> visited(r, vector<bool>(c, false));
queue<tuple<int, int, int>> q;... | ALGO | 0.999988 | 4.260608 |
ed4c817b-2b13-4b32-a2b1-4ee2eba1b65a | Ejlonn/Assignments | 2nd semester/week4/2.cpp | #include <stdio.h>
#include <string.h>
void rightRotate(char *str, int shift) {
int length = strlen(str);
char temp;
char *last = str + length - 1;
for (int i = 0; i < shift; i++) {
temp = *last;
for (char *ptr = last; ptr > str; ptr--) {
*ptr = *(ptr - 1);
... | ALGO | 0.997396 | 3.794527 |
7644e84e-299b-4af6-8fb6-6657ac983900 | beamiter/cbp | cppad/test_more/general/runge_45.cpp | /*
Old OdeRunge example now used just for valiadation testing of Runge45
*/
# include <cppad/cppad.hpp>
# include <iostream>
# include <cassert>
namespace { // BEGIN Empty namespace
class TestFun {
public:
TestFun(const CPPAD_TESTVECTOR(CppAD::AD<double>) &w_)
{ w.resize( w_.size() );
w = w_;
}
void Ode(... | ALGO | 0.998248 | 6.3048 |
8a806611-067e-4796-a60d-48768280081e | FeRhodium/oicode | Codeforces/908D.cpp | #include <bits/stdc++.h>
template <unsigned Mod>
class Z {
unsigned v_;
static constexpr unsigned getR() {
unsigned iv = Mod * (2 - Mod * Mod);
iv *= 2 - Mod * iv;
iv *= 2 - Mod * iv;
return iv * (Mod * iv - 2);
}
static constexpr unsigned reduce(unsigned long long x)
{return (x + static_cast<unsigned lon... | ALGO | 0.999826 | 4.284809 |
19f90bbc-b81d-4df7-8a36-c0a87ca4d9c4 | fabiankung/ROS2_WheelRobot_V1 | Version_1_0/ros2_linolidar_ws/src/ldlidar/src/tofbf.cpp |
#include "tofbf.h"
#include <math.h>
#include <iostream>
#include <algorithm>
/*!
\brief Select the radar version number and set the current speed
\param[in]
\arg version Version number of current radar
\arg speed Current radar speed
\param[out] none A circle of radar data packed
\retval ... | ALGO | 0.988735 | 3.900034 |
8961ea87-ece3-4009-9214-5910a4b712f4 | alexandraback/datacollection | solutions_2463486_1/C++/Agentchuck/main.cpp | #include <string.h>
#include <stdint.h>
#include <cstdio>
#include <cstdlib>
#include <ctype.h>
#include <cmath>
#include <string>
#include <vector>
#include <list>
#include <iostream>
#include <map>
#include <set>
#include <algorithm>
#include <queue>
#include <sstream>
#include <fstream>
using namespace std;
typedef ... | ALGO | 0.999415 | 4.254371 |
e3dd3026-06e4-47ca-a8d0-cfa5280cd8b9 | sarvex/leetcode-solidity | solution/1600-1699/1672.Richest Customer Wealth/Solution.cpp | class Solution {
public:
int maximumWealth(vector<vector<int>>& accounts) {
int ans = 0;
for (auto& v : accounts) {
ans = max(ans, accumulate(v.begin(), v.end(), 0));
}
return ans;
}
}; | ALGO | 0.999229 | 6.105198 |
fc184905-97e2-44b6-aa2d-dd4239eceaa6 | EASINTUHA/CodeChef-500-800-Rating-Solutions-in-cpp-c- | Complementary_Strand_in_a_DNA.cpp | #include<bits/stdc++.h>
using namespace std;
#define ll long long
#define ull unsigned long long
#define ff first
#define ss second
#define pb push_back
#define all(x) x.begin(), x.end()
#define sz(x) (int)(x)... | ALGO | 0.999963 | 5.058842 |
1e0785e7-c65a-4700-bc74-28ba81e8e435 | 113bommy/deepmind_codecontests_refine | cpp_gold_filter_file/cpp_train_6892_18.cpp | #include <bits/stdc++.h>
using namespace std;
int dx[4] = {-1, 1, 0, 0};
int dy[4] = {0, 0, -1, 1};
bool isone(long long, int);
int count(long long);
long long exp(long long, long long, long long);
long long GCD(long long, long long);
int cmp(long long a, long long b, long long c, long long d) {
if ((a * d) > (b * c)... | ALGO | 0.999963 | 3.553484 |
d9ababa7-a5f6-4458-9ab5-060fa493f67e | Aymccar/ardupilot_custom | libraries/AC_PID/AC_PI_2D.cpp | /// @file AC_PI_2D.cpp
/// @brief 2-axis PI controller
#include <AP_Math/AP_Math.h>
#include "AC_PI_2D.h"
const AP_Param::GroupInfo AC_PI_2D::var_info[] = {
// @Param: P
// @DisplayName: PI Proportional Gain
// @Description: P Gain which produces an output value that is proportional to the current error v... | ALGO | 0.996124 | 6.059375 |
badc1a55-c80e-44e5-a76a-8f9c7350a3dc | nityabhaskar21/ds-algo | stack_problems/nearest_greater_to_right/main.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.999966 | 5.393072 |
c2802da3-e875-45d3-b23e-e4b04ba70d3c | ishandutta2007/codeforces | endagorion/normal/1091/B.cpp | #include <iostream>
#include <tuple>
#include <sstream>
#include <vector>
#include <cmath>
#include <ctime>
#include <bitset>
#include <cassert>
#include <cstdio>
#include <queue>
#include <set>
#include <map>
#include <fstream>
#include <cstdlib>
#include <string>
#include <cstring>
#include <algorithm>
#include <nume... | ALGO | 0.999959 | 3.554943 |
9e72def5-7687-49d5-8cca-afdbe9e70f8d | GpsLypy/home | leetcode/17.电话号码的字母组合.cpp | /*
* @lc app=leetcode.cn id=17 lang=cpp
*
* [17] 电话号码的字母组合
*/
// @lc code=start
class Solution {
public:
map<char,string> map{
{'2',"abc"},
{'3',"def"},
{'4',"ghi"},
{'5',"jkl"},
{'6',"mno"},
{'7',"pqrs"},
{'8',"tuv"},
... | ALGO | 0.999812 | 6.847677 |
94e56f5e-d35b-479d-be20-fcc1cacefd4a | actium/codeforces | 0200/00/204b.cpp | #include <iostream>
#include <map>
#include <vector>
constexpr unsigned oo = ~0u;
template <typename T, typename U>
std::istream& operator >>(std::istream& input, std::pair<T, U>& v)
{
return input >> v.first >> v.second;
}
template <typename T>
std::istream& operator >>(std::istream& input, std::vector<T>& v)
{... | ALGO | 0.999847 | 4.312462 |
28c8d067-0160-43f2-bdb1-3467082a0f20 | royalneverwin/Leetcode | 最短补全词.cpp | class Solution {
public:
int cntAlpha[26];
bool IfCover(string& word){
int tmp[26];
memset(tmp, 0, sizeof(tmp));
for(int i = 0; i < word.length(); i++){
tmp[word[i]-'a']++;
}
for(int i = 0; i < 26; i++){
if(cntAlpha[i] > tmp[i])
ret... | ALGO | 0.999829 | 6.316779 |
df2a0c8e-601e-4dab-be5c-046a759ce728 | Zherr-shaal/Parallel_labs_4_5 | ПСРСЛаба4/ПСРСЛба5/PSRSLab4.cpp | #include <stdio.h>
#include<random>
#include<time.h>
#include <mpi.h>
#define MATR_ROWS 1000
#define MATR_COLS 1000
#define MATR_SIZE 1000000
double ** get_matrix(int n, int m) {//
srand(time(NULL));
double **matrix = new double*[n];
for (int i = 0; i < n; i++) {
matrix[i] = new double[m];
for (int j = 0; j <... | ALGO | 0.99987 | 3.565293 |
4de7a40b-939b-45cd-8e4d-dbb9034cdf27 | sids278/Leetcode-Codes | 1639-number-of-ways-to-form-a-target-string-given-a-dictionary/1639-number-of-ways-to-form-a-target-string-given-a-dictionary.cpp | class Solution {
public:
int dp[1100][1100];
int mod=1e9+7;
int f(int i, int j, vector<vector<int>> &v, string &target)
{
if(j==target.size()) return 1;
if(i==v.size()) return 0;
long long ans=0;
if(dp[i][j]!=-1) return dp[i][j];
if(v[i][target[j]-'a']) ans=(ans+... | ALGO | 0.999997 | 6.053235 |
429ed856-68df-402e-ad60-f8223a1d9dfb | anugrahk21/CPP-DSA | practicep30.cpp | #include <iostream>
using namespace std;
// insert data at end of head
struct node{
int data;
struct node* next;
};
void insert_end(node** head_ref,int data){
node* newnode=new node;
newnode->data=data;
newnode->next=NULL;
if(*head_ref==NULL){
*head_ref=newnode;
}
else{
... | ALGO | 0.995646 | 4.1677 |
5719c599-e1f1-49ee-885a-fb7df51a98fb | fjsadewa/AlgoProgramming | example/exercise.cpp | #include <stdio.h>
int main (){
int a,b;
printf ("Pilih 1,2 atau 3:");
scanf ("%d",&a);
if (a==1){
printf ("Congratz! You get a holiday ticket to Singapore\n");
}
else if(a==2) {
printf ("Congratz! You get a holiday ticket to Sydney\n");
}
else if(a==3) {
printf ("Congratz! You get a holiday ticket to Ja... | TOOL | 0.982119 | 3.64399 |
e312d66a-638b-4711-a706-d3281d5e0e37 | shAwmitrAcse134582/phitron_course | Data Structure/Module-24/problem-4_recap.cpp | #include<bits/stdc++.h>
#define ll long long int
#define pb push_back
#define get_out return 0
#define fast ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
using namespace std;
class student{
public:
int x;
student(int x){
this->x=x;
}
};
class cmp{
public:
bool operator()(student a, ... | ALGO | 0.999795 | 3.744545 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.