uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
420c3b72-b06b-4856-8541-b05a0397ad81 | rockyappdev/LiveStageMMD-GLKit-GLES1 | LVSTG gles1/LVSTG gles1/Src_Bullet_282/BulletCollision/BroadphaseCollision/btQuantizedBvh.cpp | #include "btQuantizedBvh.h"
#include "LinearMath/btAabbUtil2.h"
#include "LinearMath/btIDebugDraw.h"
#include "LinearMath/btSerializer.h"
#define RAYAABB2
btQuantizedBvh::btQuantizedBvh() :
m_bulletVersion(BT_BULLET_VERSION),
m_useQuantization(false),
//m_traversalMode(TRAVERSAL_STACKLESS_CACHE_FRIE... | ALGO | 0.998891 | 6.779053 |
f402c92c-2588-44ae-b32b-1c9acb077cd2 | guduzhe123/Algorithm | src/DynamicPlan.cpp | //
// Created by zhouhua on 2020/3/8.
//
#include "../inc/DynamicPlan.hpp"
void DynamicPlan::maxProduct(vector<int>& nums) {
int result = nums[0];
int imax = 1, imin = 1;
for (int i = 0; i < nums.size(); i++) {
if (nums[i] < 0) swap(imax, imin);
imax = max(imax * nums[i], nums[i]);
... | ALGO | 0.999178 | 5.022248 |
84f0ae21-964c-400f-9e1b-ff6cd35a6208 | LiuBaiWan-Runner/vscode | C++/ProgrammingPractice/3.BinarySearch/6_copy_1.cpp | /*
* @file :6_copy_1.cpp
* @author :LiuBaiWan-Runner
* @version :V1.0.0
* @date :2023-03-14
* @brief :POJ - 2976 D - Dropping tests(二分查找+01分数规划搜索)
* :https://blog.csdn.net/qq_41037114/article/details/83023431
* :
*/
#include <iostream>
#include <cstdio>
#include <cmath>
#include <cstring>
#in... | ALGO | 0.999954 | 3.346263 |
0676d967-7eb9-4507-941c-ece1524b41b9 | Kavit900/flutter-google-maps-api-tutorial | 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 |
62b6d918-ae4d-4b44-bec2-f2dc826b8d6f | qizhou92/SHARA | SHARA/src/util/lbool.cpp | #include"lbool.h"
std::ostream & operator<<(std::ostream & out, lbool b) {
switch(b) {
case l_false: return out << "l_false";
case l_true: return out << "l_true";
default: return out << "l_undef";
}
}
char const * to_sat_str(lbool l) {
switch (l) {
case l_false: return "unsatisfiable... | TOOL | 0.88832 | 5.670726 |
2963333e-61da-4f5a-8735-bae759fe5940 | iliyian/LuoguOJ | Problems/P3275/main.cpp | // date: 2024/02/01 13:03:39
// tag: wa#01: 看似差分约束,实则缩点+拓扑排序
// 由小向大建边即可,spfa太弱了,对于这个数据范围
// 缩点后的DAG拥有很多良好性质
// i <- j
// \ /
// \ /
// o
// xi <= xj + ji, 边oi最短,且无负环
#include <bits/stdc++.h>
#define N 100005
#define inf 0x3f3f3f3f
using namespace std;
struct Edge {
int v, w;
};
vector<vector<Edge>> g, sg;
... | ALGO | 0.99959 | 4.145055 |
74d535b4-d393-4388-a260-22970a3b0ae3 | Vivek3500/365-Days-of-GFG | Easy/Find the closest number/find-the-closest-number.cpp | //{ Driver Code Starts
#include <iostream>
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution {
public:
int findClosest(int n, int k, int arr[]) {
// Perform binary search to find the insertion point for 'k'
int ind = std::lower_bound(arr, arr + n, k) - arr;
... | ALGO | 0.999996 | 5.885807 |
87a83b15-5e4d-4300-b939-82bb970fe914 | ishandutta2007/codeforces | dqa2021/normal/1227/G.cpp | #include<cstdio>
#include<algorithm>
#include<vector>
using namespace std;
int n,w[1010],seq[1010];
bool cmp(int x,int y)
{
return w[x]>w[y];
}
bool ans[1010][1010];
int id[1010],idtot,stk[1010],stktop;
vector<int> pos[1010];
void split(int x,int y,int k)
{
if (stk[x]==y)
{
for (int i=0;i<stk[x];i++) ans[pos[x][i... | ALGO | 0.999994 | 3.477525 |
588bc459-4461-4b92-881c-472846c13702 | Muzzammil-007/Parallel-Sorting-with-OpenMP-and-Pthreads | radix_omp.cpp | #include <stdlib.h>
#include <stdio.h>
#include <time.h>
#include <omp.h>
#define BASE_BITS 8
#define L 0.6
#define BASE (1 << BASE_BITS)
#define MASK (BASE-1)
#define DIGITS(v, shift) (((v) >> shift) & MASK)
#define LENGTH 100000000
void omp_lsd_radix_sort(size_t n, unsigned data[n]) {
unsigned * buffer = malloc(... | ALGO | 0.999745 | 4.573866 |
665ea6a7-384b-471b-ac6d-9ae25850fb7c | ishandutta2007/codeforces | magicspark/normal/1430/G.cpp | /*
Though leaves are many , the root is one.
Through all the lying days of my youth
I swayed my leaves and flowers in the sun.
Now I may wither into the truth.
- William Butler Yeats
*/
#pragma GCC optimize("Ofast","unroll-loops","omit-frame-pointer","inline") //Optimization flags
#pragma GCC option("arch=native... | ALGO | 0.999997 | 3.794365 |
00d43b77-6396-4b1d-a45f-68222c774ba7 | Monther-Abu-Abedalla/pereformance_test_getx | 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 |
cab77f8c-feed-4325-91f7-6d0b29e51f81 | missliker/Algorithm | Codeforces/Edu/2004/a.cpp | #include <bits/stdc++.h>
using namespace std;
using i64 = long long;
#ifdef missliker
#include "debug.h"
#else
#define debug(...) void(0)
#endif
void Solution(int T) {
int n;
cin >> n;
vector<int> a(n);
for (int i = 0; i < n; i++) {
cin >> a[i];
}
if (a.size() == 2 and abs(a.front() - ... | ALGO | 0.998749 | 4.217007 |
853ac1c8-d014-4b88-a07c-4547be7dca89 | Vaibhav10sept/DSA | NEETCODE 175/backtracking-letter-combination-of-a-phone.cpp | #include <bits/stdc++.h>
using namespace std;
vector<string> getKeypadCombination(string str, vector<string> codes) {
if (str.size() == 0) {
vector<string> baseResult;
baseResult.push_back("");
return baseResult;
}
char code = str[0];
int IntCode = code - '0';
string pattern = codes[IntCode];
string restOf... | ALGO | 0.999023 | 5.613299 |
bef79b09-dfa6-48bc-975b-3bbcf95f8c38 | dvaitam/codeforces | 0-999/800-899/800-809/808/solC.cpp | #include <bits/stdc++.h>
using namespace std;
int n, w;
int ans;
struct cha{
int b;
int index;
int c;
};
cha a[200];
bool cmp1(cha a, cha b)
{
return a.b > b.b;
}
bool cmp2(cha a, cha b)
{
return a.index < b.index;
}
int main()
{
cin >> n >> w;
for(int i = 0; i < n; i++)
{
i... | ALGO | 0.999994 | 3.481825 |
3493ceb0-2b88-4ca5-8e76-8f74f94984ed | enzo200325/AlmanaqueNTJ | codigos/Extra/mint.cpp | // Mint
//
// Inteiro automaticamente modulado
template<int mod> struct Mint {
int val;
Mint(ll v = 0) { val = v % mod; if (val < 0) val += mod; }
Mint pwr(Mint b, ll e) {
Mint res;
for (res = 1; e; e >>= 1, b = b * b) if (e & 1) res = res * b;
return res;
}
bool operator==(... | ALGO | 0.994918 | 4.861619 |
62ad09d4-3581-4c68-9332-40a34d70b5e8 | Fydcoin/FYDCoin | src/libzerocoin/SerialNumberSignatureOfKnowledge.cpp | /**
* @file SerialNumberSignatureOfKnowledge.cpp
*
* @brief SerialNumberSignatureOfKnowledge class for the Zerocoin library.
*
* @author Ian Miers, Christina Garman and Matthew Green
* @date June 2013
*
* @copyright Copyright 2013 Ian Miers, Christina Garman and Matthew Green
* @license This pr... | ALGO | 0.978397 | 6.848955 |
4a2786ba-85e9-4cbc-98f1-c85c8127aefd | Manvityagi/Codechef-Codeforces-spoj | CODEFORCES/VIRTUAL CONTESTS/Random Questions/2.cpp | #include <bits/stdc++.h>
using namespace std;
#define PB push_back
#define F first
#define S second
#define MP make_pair
#define LL long long
#define ULL unsigned long long
#define LB lower_bound
#define mod 1000000007
#define loop(i, a, b) for (int i = a; i < b; i++)
LL n, m;
const int N = 1e5+10;
vector<int> g[N];
i... | ALGO | 0.999929 | 4.922975 |
54ea65de-0f97-405a-b7f0-0708463aa963 | codyjgeorge/ProgrammingFundamentals | Data/Chapter 09/PassEntireArray.cpp | // PassEntireArray.cpp - This program quadruples the values stored in an array.
// Input: None
// Output: The original values and the quadrupled values
#include <iostream>
#include <string>
using namespace std;
void quadrupleTheValues(int[]);
int main()
{
const int LENGTH = 4;
int someNums[] = {10, 12, 2... | ALGO | 0.951245 | 4.465303 |
c2f2f392-ce5f-40c0-b638-5591784420d2 | Ehsanul-Karim-Pappu/backup_code_repo | uHunt/UVA-Solutions-master/11292 Dragon of Loowater.cpp | #include <iostream>
#include <algorithm>
using namespace std;
int heads[20005], knights[20005];
int main()
{
int n, m;
while (cin >> n >> m, n)
{
for (int i = 0; i < n; ++i)
cin >> heads[i];
sort(heads, heads + n);
for (int i = 0; i < m; ++i)
... | ALGO | 0.999961 | 3.660362 |
df12069e-51b1-4ac6-b06b-28c8579cf445 | EricGanzert/multithread | chapter5/simple_mutex.cpp | #include <iostream>
#include <thread>
#include <mutex>
using namespace std;
std::mutex globalMutex;
void worker(int i) {
globalMutex.lock();
cout << "Outputting this from thread number " << i << endl;
globalMutex.unlock();
}
int main() {
thread t1(worker, 1);
thread t2(worker, 2);
t1.join();... | ALGO | 0.945125 | 5.43165 |
97b95bcc-31a9-424b-bd1c-03c0005a2b9c | 94prathampatil/DSA-Program | Lecture 60_Queue/queueImplementation.cpp | #include <bits/stdc++.h>
class Queue
{
public:
int *arr;
int Qfront, rear, size;
Queue()
{
// Implement the Constructor
size = 100001;
arr = new int[size];
Qfront = 0, rear = 0;
}
/*----------------- Public Functions of Queue -----------------*/
bool isEmp... | ALGO | 0.999782 | 4.774427 |
76a8d0a8-6158-4556-b95e-ce5e1f4fef0e | Just-Ipavon/Algoritmi-e-Strutture-Dati | EXTRA. Esercizi/Prova di Laboratorio/Strutture Dati/ABR/AlberiBR.cpp | #include<iostream>
#include<fstream>
#include<vector>
using namespace std;
template<typename T, typename S>
class Node {
public:
T key;
S val;
Node<T, S>* parent;
Node<T, S>* right;
Node<T, S>* left;
Node(T key, S val) : key(key), val(val) {
parent = right = left = nullptr;
}
};
... | ALGO | 0.997688 | 5.762344 |
97363e15-ea6f-4c68-941c-4f00a6c765e5 | qwertier24/AC | USACOContest/uc12open_sil/bookshelf.cpp | #include <algorithm>
#include <stdio.h>
#include <string.h>
#include <map>
#include <set>
#include <iostream>
#define PROB "bookshelf"
using namespace std;
int n,L,h[100010]={0},w[100010]={0},q[100010]={0},front=0,rear=0;
long long d[100010]={0};
multiset<long long> st;
int main(){
freopen(PROB".in","r",stdin);
freop... | ALGO | 0.999969 | 3.073805 |
ac8945f2-9cdb-4f03-b7bd-97e868ef1324 | caputdraconis050630/algorithm | baek/baek_15654.cpp | #include <bits/stdc++.h>
using namespace std;
int N, M;
vector<int> input;
vector<int> V;
void solution(int cnt)
{
if (cnt == M)
{
for (int i = 0; i < M; i++)
{
cout << V.at(i) << " ";
}
cout << "\n";
cnt--;
return;
}
for (int j = 0; j < N;... | ALGO | 0.999981 | 4.219497 |
3f14b368-f0f0-4308-98fc-b7c405f158a6 | Wins0n/LeetCode | deleteDuplicates2.cpp | #include <iostream>
struct ListNode
{
int val;
ListNode* next;
ListNode(int x) : val(x), next(NULL) {}
};
class Solution
{
public:
ListNode* deleteDuplicates(ListNode* head)
{
if (head == NULL || head->next == NULL)
{
return head;
}
ListNode a(0);
... | ALGO | 0.99993 | 5.512811 |
392175a2-052b-478c-8ac0-0668f4ac3743 | prabhash1889/Code_all | codeforces/contests/epic round/3.cpp | #include <bits/stdc++.h>
using namespace std;
#include <iostream>
typedef long long ll;
typedef vector<int> vi;
ll n, m, k, q, l, r, x, y, z;
const ll template_array_size = 1e6 + 585;
ll a[template_array_size];
ll b[template_array_size];
ll c[template_array_size];
string s, t;
ll ans = 0;
void solve(int tc = 0)
{
in... | ALGO | 0.999817 | 4.175429 |
b885d06a-f468-4f24-803f-25ac71437961 | ChistyakovMaksim/lab5 | lab5/lab5.cpp | #include <iostream>
#include <mpi.h>
const int N = 5040; // Размер матрицы
double** A; // Двумерный массив для расширенной матрицы системы
double X[N]; // Решение
int countError = 0; // Количество ошибок
void deletearr() {
for (int i = 0; i < N; ++i) {
delete[] A[i];
}
delete[] A;
}
void BackGaus... | ALGO | 0.999988 | 3.6847 |
ad91ed67-0e84-45b3-b79a-7bececac3047 | intensefrenemy4275/Common-DSA | Graphs/algos/CityWithSmallestNeighboursWithinThersholdDistance.cpp | //link- https://practice.geeksforgeeks.org/problems/city-with-the-smallest-number-of-neighbors-at-a-threshold-distance/1?utm_source=youtube&utm_medium=collab_striver_ytdescription&utm_campaign=city-with-the-smallest-number-of-neighbors-at-a-threshold-distance
class Solution {
public:
int findCity(int n, int m, ve... | ALGO | 0.999986 | 6.660854 |
0be56ab3-2ba0-4caa-88aa-8aef60820823 | manikanta2901/ubuntu | SRM/elab/DAA/GraphColouring/BFS-Big P and Party.cpp | #include<bits/stdc++.h>
using namespace std;
int a;
long int b;
bool vis[1002];
int lucky[1002];
int main()
{cin>>a>>b;
for(int i=0;i<1002;i++)
lucky[i]=-1;
vector<int>g[1002];
int u,v;
for(int i=0;i<b;i++)
{
cin>>u>>v;
g[u].push_back(v);
g[v].push_back(u);
}
lucky[0]=0;
f... | ALGO | 0.999807 | 3.510155 |
a228737c-dc34-400b-9e87-27e9a7bda994 | denis-gubar/Leetcode | Breadth-first Search/2596. Check Knight Tour Configuration.cpp | class Solution {
public:
bool checkValidGrid(vector<vector<int>>& grid) {
int N = grid.size();
vector<int> dx = { -2, -2, -1, -1, 1, 1, 2, 2 };
vector<int> dy = { -1, 1, -2, 2, -2, 2, -1, 1 };
int x = 0, y = 0;
for (int i = 1; i < N * N; ++i)
{
for (int z ... | ALGO | 0.999123 | 5.449802 |
5db521c7-4784-4fa3-893a-8866aa3d0620 | Mansipawar22/Data-Structure-and-Alogorithim | CPP/1. Basic/swaping.cpp | #include<iostream>
using namespace std;
void swap(int x, int y){
int temp;
temp = x;
x = y;
y = temp;
cout << "After swaping within function:" << x << " " << y << endl;
return;
}
int main(){
int a,b;
cout << "Enter the Value of 'a' and 'b':";
cin >> a;
cin >> b;
cout <... | ALGO | 0.998951 | 4.26386 |
48bf4c58-1990-4ffc-ba48-b93874f9d507 | rafidoth/another-code-dump | cf2004b.cpp |
#include<bits/stdc++.h>
using namespace std;
typedef long long int lli;
#define MOD 1000000007
void func(){
int l,r;
int L,R;
cin >> l >> r;
cin >> L >> R;
int aLeft, aRight, bLeft, bRight;
if(R>r){
aLeft = l;
aRight = r;
bLeft = L;
bRight = R;
}else{
... | ALGO | 0.999548 | 3.373246 |
bda3da99-434f-4d00-89ea-ef43daa24b67 | ipaljak-tbtl/advent-of-code | 2021/paljak/3/large.cpp | #include <bits/stdc++.h>
using namespace std;
const int MAXB = 12;
vector<string> v;
int dec(const string b) {
int ret = 0;
for (const char bit : b) {
ret <<= 1;
ret += bit == '1';
}
return ret;
}
string rating(int bit, int lo, int hi, bool majority) {
if (lo + 1 == hi) return v[lo];
assert(bit... | ALGO | 0.99868 | 4.951148 |
37b587ae-da05-4f3f-b8e1-0119769211ea | VyugaSW/Genetic_Algorithm | main.cpp | #include "GeneticClustering.h"
#include "FilePoints.h"
#include "Point.h"
#include <random>
using namespace std;
int main() {
FilePoints<double> fp;
std::vector<Point<double>> data = fp.readFromFile("input/Mall_Customers.txt");
// Parameters for experiments
const std::vector<size_t> population_s... | ALGO | 0.999121 | 6.602059 |
f9a5037f-66ab-4d63-acc5-bec9cfeb40fb | atharva-yadav/leetcode-problem-solving | 102-binary-tree-level-order-traversal/102-binary-tree-level-order-traversal.cpp | /**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode() : val(0), left(nullptr), right(nullptr) {}
* TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}
* TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), l... | ALGO | 0.999893 | 6.178099 |
f843ef0e-2895-43a1-91ae-85414de622e6 | sswethasaravanan/Stack | balansingsymbol.cpp | #include <bits/stdc++.h>
using namespace std;
bool a(string expr)
{
stack<char>temp;
for (int i = 0; i < expr.length(); i++) {
if (temp.empty()) {
temp.push(expr[i]);
}
else if ((temp.top() == '(' && expr[i] == ')')|| (temp.top() == '{' && expr[i] == '}')|| (temp.top() == '[' && expr[i] == ']')){
temp.pop... | ALGO | 0.998706 | 5.17506 |
778d3eb5-e6fe-42a5-b628-9b3ec1f17aa6 | manishtiwari2k3/manish-223117 | 3455-minimum-length-of-string-after-operations/3455-minimum-length-of-string-after-operations.cpp | // class Solution {
// public:
// int minimumLength(string s) {
// unordered_map<char, int> charFrequencyMap;
// for (char currentChar : s) {
// charFrequencyMap[currentChar]++;
// }
// int deleteCount = 0;
// for (auto& pair : charFrequencyMap) {
// ... | ALGO | 0.999911 | 6.464445 |
d39ca029-62ab-4cb1-82a2-34b9dad44e09 | AbhaySooraj/Third-Semester | OOP/*operator.cpp | #include<iostream>
using namespace std;
class complex
{
public:
int r,i;
complex()
{
r=0;
i=0;
}
complex(int x,int y)
{
r=x;
i=y;
}
void printcom()
{
cout<<"The answer is :"<<r<<"+"<<i<<"i"<<endl;
}
complex operator *(complex const &obj)
{
complex res;
res.r=r*obj... | ALGO | 0.950316 | 4.299145 |
efa5f1d8-71cb-4776-9530-a9d180ff46dd | juarezpaulino/coderemite | problemsets/UVA/11080.cpp | /**
*
* Author: Juarez Paulino(coderemite)
* Email: <EMAIL>
*
*/
#include <cstdio>
#include <algorithm>
#include <vector>
using namespace std;
int N, M;
vector<int> adj[210];
char vis[210];
int A, B;
bool dfs(int u, int c) {
vis[u] = c;
(c) ? A++ : B++;
for (int i = 0; i < adj[u].size(); i++) {
... | ALGO | 0.999666 | 4.737225 |
6812ab24-84ac-4794-9ca4-f885e9b80848 | Ahmed-H300/cuircuit-solver | Circuits/eigen-master/doc/examples/Tutorial_ReductionsVisitorsBroadcasting_reductions_norm.cpp | #include <Eigen/Dense>
#include <iostream>
using namespace std;
using namespace Eigen;
int main()
{
VectorXf v(2);
MatrixXf m(2,2), n(2,2);
v << -1,
2;
m << 1,-2,
-3,4;
cout << "v.squaredNorm() = " << v.squaredNorm() << endl;
cout << "v.norm() = " << v.norm() << endl;
cout << "v.lpN... | ALGO | 0.998791 | 4.03798 |
ba1f5663-09a7-4012-b723-07de9503f88c | Aditya-devp/DSA-GeekforGeeks | POTD{GFG}/Max_coins.cpp | class Solution{
public:
int maxCoins(int n,vector<vector<int>> &ranges){
sort(ranges.begin(),ranges.end());
int maximum[n];
maximum[n-1]=ranges[n-1][2];
for(int i=n-2;i>=0;i--){
maximum[i]=max(maximum[i+1],ranges[i][2]);
}
int ans=0;
for(int i=0;i<... | ALGO | 0.999692 | 5.201609 |
73a1545c-4039-437f-91d0-d2726847180b | DyckerhoffRainer/sphericalDepth | src/auxLinAlg.cpp | #include <cmath>
double norm2(const double x[], int d) {
double result = 0;
for (int i = 0; i < d; i++) result += x[i] * x[i];
return sqrt(result);
}
double InnerProduct(const double x[], const double y[], int d) {
double sum = 0;
for (int i = 0; i < d; i++) sum += x[i] * y[i];
return sum;
}
void Normalize(dou... | ALGO | 0.99891 | 3.298596 |
32c623f8-8b47-49f7-8cea-8dd2b20a6aee | yuntianyi-chen/Artifacts-of-ADS-Bug-Fix-Pattern-Study | data/bug-fix file-change dataset/autowarefoundation_autoware.universe/4198/before/expansion.cpp | #include "behavior_path_planner/utils/drivable_area_expansion/expansion.hpp"
#include "behavior_path_planner/utils/drivable_area_expansion/map_utils.hpp"
#include "behavior_path_planner/utils/drivable_area_expansion/path_projection.hpp"
namespace drivable_area_expansion
{
double calculateDistanceLimit(
const lines... | ALGO | 0.999317 | 7.666232 |
76f5a01d-8594-4810-9c10-0f1ee0d38a07 | laohantuiche01/finalTask | RobotManager.cpp | #include <bits/stdc++.h>
#include "RobotManager.h"
#include "Robot.h"
#include "Infantry.h"
#include "Engineer.h"
#define int long long
void RobotManager::processCommand(int time, const std::string &command, const std::vector<int> ¶ms) //处理命令
{
int teamID = params[0];
int robotID = params[1];
if (com... | ALGO | 0.980785 | 4.029604 |
6c355121-466b-48d4-8ed6-3a2e9bb5db60 | mashfiqur05/Problem-Solving | Codeforces/682A.AlyonaAndNumbers.cpp | #include<bits/stdc++.h>
using namespace std;
#define ll long long
#define endl "\n"
#define Bismillah() ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0); /// Fast IO.
#define fraction() cout.unsetf(ios::floatfield); cout.precision(10); cout.setf(ios::fixed,ios::floatfield);
#define pb push_back
#define mem(a,b)... | ALGO | 0.999717 | 4.456069 |
25d0ba63-ab1a-4fd5-8cfe-a9d0b6777a6e | ankit7115/Recursion | Basic_Recursion/namePrint.cpp | #include<bits/stdc++.h>
using namespace std;
void print(string name,int n){
if(n==0)return;
cout<<name<<endl;
print(name,n-1);
}
int main(){
#ifndef ONLINEJUDGE
freopen("input.txt","r",stdin);
freopen("output.txt","w",stdout);
#endif
int n;
cin>>n;
print("Ankit",n);
re... | ALGO | 0.997452 | 3.604051 |
b72a868a-7800-4661-86f6-798f018c9f01 | regismeyssonnier/CSES | CSES/SortingSearching/resto_customer_ass.cpp | // CSES.cpp : Ce fichier contient la fonction 'main'. L'exécution du programme commence et se termine à cet endroit.
//
#include <iostream>
#include <fstream>
#include <vector>
#include <algorithm>
#include <limits>
#include <math.h>
#include <set>
#include <map>
#include <string>
#include <queue>
using namespace std;... | ALGO | 0.9999 | 4.708135 |
d2275d22-e018-4ee0-b2d2-1b20248a9f58 | fmidev/smartmet-plugin-timeseries | timeseries/LonLatDistance.cpp | #include "LonLatDistance.h"
#include <boost/math/constants/constants.hpp>
#include <macgyver/Exception.h>
namespace SmartMet
{
namespace Plugin
{
namespace TimeSeries
{
/// @brief Earth's quatratic mean radius for WGS-84
static const double EARTH_RADIUS_IN_METERS = 6372797.560856;
double deg_to_rad(const double& deg... | ALGO | 0.998771 | 7.192608 |
81f9929b-ecc6-40b2-8d39-6ba01f1bc1b4 | EzElephant/cses | cses_2431.cpp | #include <iostream>
#include <string>
#include <cmath>
using namespace std;
int main()
{
ios::sync_with_stdio(false);
cin.tie(0);
long long q, cnt, n, base, tmp, ans, total, before;
cin >> q;
while (q--)
{
cin >> n;
if (n < 10)
{
cout << n << "\n";
... | ALGO | 0.999881 | 4.335218 |
dcdf86f8-fe9b-4efa-ba9f-042c7c9b086e | adi-tya178/Problem-set | 1475-final-prices-with-a-special-discount-in-a-shop/1475-final-prices-with-a-special-discount-in-a-shop.cpp | class Solution {
public:
vector<int> finalPrices(vector<int>& prices) {
vector<int> v;
stack<int> st;
for(int i=prices.size()-1;i>=0;i--)
{
if(st.empty())
{
v.push_back(prices[i]);
}
else if(!st.empty() && st.top()<=pric... | ALGO | 0.999957 | 6.107425 |
b2418cc4-b7f4-4e9e-ad3e-486f1c737cd2 | USCcorpuscallosum/spiky | src/MapGenerator/dDelaunay.cpp | // Delaunay
// Class to perform Delaunay triangulation on a set of vertices
//
// Version 1.1 (C) 2005, Sjaak Priester, Amsterdam.
// - Removed bug which gave incorrect results for co-circular vertices.
//
// Version 1.0 (C) 2004, Sjaak Priester, Amsterdam.
// mailto:<EMAIL>
#include "dDelaunay.h"
namespace del {
con... | ALGO | 0.998074 | 7.093592 |
69f3a107-977e-4a52-b9cb-022280edcbf8 | sabiusa/cses | problems/money-sums/money-sums/money.cpp | //
// money.cpp
// money-sums
//
// Created by Saba Khutsishvili on 4/6/21.
//
#include <iostream>
#include <vector>
#include <set>
using namespace std;
#define ll long long
#define ull unsigned long long
const ll INF = 1e18;
int main() {
ll n, mx = 0;
cin >> n;
vector<ll> x(n+1);
for (... | ALGO | 0.999849 | 4.40637 |
0cfbea63-46af-40b8-a84f-4bedce2d6c28 | ababoomian/arvin_gcc | lab5/hakoupian_lab5_1.cpp | //Arvin Hakoupian
//Lab 5 part 1
//CS/IS 135
#include<iostream>
#include<cmath>
#include<iomanip>
/*
START
INPUT: to choose three option
OPTION 1: find area of circle
OPTION 2: find circumference of circle
OPTION 3: quit the program
CHECK THE SELECTED OPTION (with if and else statement):
- DO: corresponding instr... | ALGO | 0.987788 | 3.594944 |
5b196237-9fae-4c4b-9fc3-9da360dce21d | marinadabova/LeetCode | 101. Symmetric Tree/101solution_itt.cpp | /**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode() : val(0), left(nullptr), right(nullptr) {}
* TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}
* TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), l... | ALGO | 0.999928 | 6.696998 |
18f9f3f8-f217-474a-93a6-04f3d519c7f5 | ydavidson2021/C-Fall-2019-Projects | ArrayCalculatorfinal.cpp | // ENGR 2304 - Mini Program
// Week 8 - Arrays
//
// Yenny Davidson
// arrays-arraycalc.cpp
// This program will create an array and ask the user to enter
// values to populate it. The missing sections need to be filled
// so that the program can then calculate the sum of all values in
// the array and the average o... | ALGO | 0.971484 | 4.645619 |
c1f72088-ba8b-4a25-8351-11f0af300273 | AmpereComputingAI/oneDNN | src/cpu/x64/jit_brgemm_transpose_utils.cpp | #include "common/c_types_map.hpp"
#include "common/nstl.hpp"
#include "common/type_helpers.hpp"
#include "common/utils.hpp"
#include "cpu/x64/jit_generator.hpp"
#include "cpu/x64/jit_brgemm_transpose_utils.hpp"
namespace dnnl {
namespace impl {
namespace cpu {
namespace x64 {
using namespace dnnl::impl::format_tag;
... | ALGO | 0.967925 | 7.527921 |
02e800c5-dca8-4461-9442-1643d8962c05 | I-ArchanaDash/DS-Algo | Move all negative elements to end - GFG/move-all-negative-elements-to-end.cpp | // { Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution{
public:
void segregateElements(int arr[],int n)
{
// Your code goes here
int temp[n];
int i;
int j=0;
for(i=0;i<n;i++)
{
if(arr[i]>=0)
... | ALGO | 0.999572 | 6.036103 |
84554ac2-e56f-45e5-9b78-3bad7e48081c | Ajaybhaskar-Athi/DSA | TRIE/1_Implement_TRIE(Prefix Tree).cpp | #include <bits/stdc++.h>
using namespace std;
class Node
{
public:
Node *links[26];
bool flag;
Node()
{
flag = false;
for (auto &a : links)
a = nullptr;
}
bool containsKey(char ch)
{
return links[ch - 'a'] != nullptr;
}
void put(char ch, Node *no... | ALGO | 0.999887 | 4.744629 |
75031411-00f9-41dd-a35c-b15f80e082c4 | dampers/algorithm | 1926.cpp | #include <bits/stdc++.h>
#define swap(a,b) (a)^=(b)^=(a)^=(b)
using namespace std;
typedef long long lld;
int paper[501][501];
bool visit[501][501];
const int dx[] = {0, 0, 1, -1};
const int dy[] = {1, -1, 0, 0};
int n, m, mx;
int main()
{
int tmp = 0;
scanf(" %d %d", &n, &m);
int cnt = 0;
for(int i=0;i<n;i++)
... | ALGO | 0.999923 | 3.207544 |
2ecf73b1-9b69-4f54-9394-722a7264102f | bikramAuto/bikram-cv-builder | sources/modules/calib3d/src/homography_decomp.cpp | #include "precomp.hpp"
#include <memory>
namespace cv
{
namespace HomographyDecomposition
{
//struct to hold solutions of homography decomposition
typedef struct _CameraMotion {
cv::Matx33d R; //!< rotation matrix
cv::Vec3d n; //!< normal of the plane the camera is looking at
cv::Vec3d t; //!< translatio... | ALGO | 0.999871 | 6.207589 |
ca5f4902-eef6-4344-9404-fef026318283 | b1yay/Coding | PD/week5/Task4.cpp | #include <iostream>
using namespace std;
float projectTimeCalculation(float hours,float days,float workers);
main() {
float hours,days,workers,total ;
cout << "Enter the needed hours: " ;
cin >> hours ;
cout << "Enter the days that the firm has: " ;
cin >> days ;
cout << "Enter the number of al... | ALGO | 0.999628 | 3.471173 |
9d82b745-3998-40ac-8cf1-5cfd5e33446f | SamIam9640/codetree-TILs | 240306/알파벳 출력하기 2/print-alphabet-2.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin>>n;
char x='A';
for(int i=0;i<n;i++){
for(int j=0;j<i;j++){
cout<<" ";
}
for(int j=0;j<n-i;j++){
if(x>'Z') x='A';
cout<<x<<" ";
x++;
}
cout<<"\n";
}
return 0;
} | ALGO | 0.999724 | 3.509452 |
d9e09b9c-4386-4cc3-8d86-a73269f5b93e | CrutoSJ/GFG-Leetcode_CPP-Python | #Leetcode-Daily/974.cpp | // #Question:-
// Link-> https://leetcode.com/problems/subarray-sums-divisible-by-k/description/
// Date-> 09/06/24
// #Solution:-
#include<bits/stdc++.h>
using namespace std;
class Solution {
public:
int subarraysDivByK(vector<int>& nums, int k) {
int ans=0;
unordered_map<int,int>map;
... | ALGO | 0.999942 | 6.073439 |
e6ebeddd-3c27-486b-b762-f94065479406 | IvanRenison/ProgrammingProblems | Codeforces rounds/Educational codeforces rounds/Educational Codeforces Round 166 (Rated for Div. 2)/D.cpp | // https://codeforces.com/contest/1976/problem/D
#ifndef ONLINE_JUDGE
#define _GLIBCXX_DEBUG 1
#define _GLIBCXX_DEBUG_PEDANTIC 1
//#define _GLIBCXX_DEBUG_BACKTRACE 1
#define _GLIBCXX_CONCEPT_CHECKS 1
#define _GLIBCXX_SANITIZE_VECTOR 1
#endif
#include <bits/stdc++.h>
using namespace std;
typedef unsigned long long u... | ALGO | 0.998874 | 4.884579 |
5477cff7-a748-4544-8b11-22a9219f56e5 | Magmanat/CG2111A | rplidar_ros_pi/sdk/src/sl_crc.cpp | #include "sl_crc.h"
namespace sl {namespace crc32 {
static sl_u32 table[256];//crc32_table
sl_u32 bitrev(sl_u32 input, sl_u16 bw)
{
sl_u16 i;
sl_u32 var;
var = 0;
for (i = 0; i < bw; i++) {
if (input & 0x01) {
var |= 1 << (bw - 1 - i);
... | TOOL | 0.980675 | 4.766709 |
c2c6ad64-630b-416e-9000-63411e24803a | emanueljuliano/Competitive_Programming | cf/neerc_2018/m.cpp | #include <bits/stdc++.h>
using namespace std;
#define _ ios_base::sync_with_stdio(0);cin.tie(0);
#define endl '\n'
#define f first
#define s second
#define pb push_back
typedef long long ll;
typedef pair<int, int> ii;
const int INF = 0x3f3f3f3f;
int main(){ _
int x1, y1; cin >> x1 >> y1;
int x2, y2; cin >> x2 >>... | ALGO | 0.999851 | 3.370225 |
c902e3a4-c48d-427b-b508-ec866ec79d1a | hemantkumarpilani/master_Assignments | Advance C++ And Data Structures Assignments/CircularLinkedlistCode/main.cpp | #include"CircularLinkedlist.h"
int main(int argc, char** argv) {
int choice=0;
CircularLinkedlist l1;
while (choice!=6){
cout<<"1. Insert data at the begining\n";
cout<<"2. Insert data at the end \n";
cout<<"3. Insert data at the position\n";
cout<<"4. Delete Node based on position\n";
cout<<"5. Disp... | ALGO | 0.973924 | 3.221931 |
d3233adb-a72a-4f27-bfa2-b21294caa581 | sunmin-lee99/C-algorithm-study | 0802/recursion/BOJ_17478/조범희.cpp | #include<stdio.h>
int count = 0;
void fuc(int n) {
if (n == 0) {
for (int i = 0; i < 4 * count; i++)
printf("_");
printf("\"재귀함수가 뭔가요?\"\n");
for (int i = 0; i < 4 * count; i++)
printf("_");
printf("\"재귀함수는 자기 자신을 호출하는 함수라네\"\n");
}
else {
for (int i = 0; i < 4 * count; i++)
printf("_");
print... | ALGO | 0.999963 | 3.814458 |
3f7f21ca-fe4d-4d9f-bd3a-a86b97c8c0d3 | Abrarafi/CompetitiveProgramming | Codeforces/C_To_Become_Max.cpp | /*
author = Abrar_Rafi;
*/
#include<iostream>
#include <bits/stdc++.h>
using namespace std;
#define endl "\n"
#define ll long long int
#define ignore cin.ignore(numeric_limits<streamsize>::max(),'\n')
#define Boost ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define debug(x) cerr<<x<<endl;
#define ... | ALGO | 0.999944 | 3.398847 |
2b7b8ef9-51be-46d5-ba86-03dff256db96 | cmyang1218/Leetcode | 3809-properties-graph/properties-graph.cpp | class Solution {
public:
bool customIntersection(set<int>& setA, set<int>& setB, int k) {
vector<int> intersect_vec;
set_intersection(setA.begin(), setA.end(), setB.begin(), setB.end(), back_inserter(intersect_vec));
return (intersect_vec.size() >= k);
}
vector<int> parents;
in... | ALGO | 0.999899 | 6.01745 |
2518c2b1-198b-4323-93d3-b6b3872e099d | tusharjain2802/DSA_cpp | Apna-College/RemoveVowels.cpp | #include<iostream>
using namespace std;
int main(){
string removeVowels(string s)
{
//Your code goes here
int n = s.size();
int j=0;
for(int i=0 ; i<n ; i++)
{
if(s[i]!='a' && s[i]!='e' && s[i]!='i' && s[i]!='o' && s[i]!='u')
s[j++]=s[i];
}
return ... | ALGO | 0.999344 | 4.385016 |
0ba704bb-273b-4d68-9a75-49cc5f47cfd4 | Khram-V/Ocean | Ani/M_Karta.cpp | //
// Mario.Karta
// -
// -
//
#include "Mario.h"
int World_Map( int,Field*,Field* );
static Field Map={ 139,42,21,11 }, // Map World_Map
Plc={ 139,42,21,11 }; // Plc
static char str[Mario_Title_Length+2]="+";
//
//
//
void m_Karta()
{ ... | TOOL | 0.915506 | 3.970473 |
5135e30e-a8dd-4b58-be50-a62ff2400707 | Pyushj/Leetcode-Solutions | 797. All Paths From Source to Target.cpp | class Solution {
public:
void findPath(int src,int dest,vector<int>& currPath,vector<vector<int>>& graph,vector<vector<int>>& res)
{
if(src==dest)
{
currPath.push_back(src);
res.push_back(currPath);
... | ALGO | 0.999945 | 6.200786 |
64fa88bc-80f8-405d-912f-dbd58b62a9d6 | Demising/Coding-Programs | CS161/Assignments/(08) Assignment 8 - Hike Statistics/1.0 (Old)/hikeFunctions.cpp | /**
* @author Clayton Moeck
* @brief hikeFunctions
*/
#include <iostream>
#include <fstream>
#include <string>
#include <unordered_map>
using namespace std;
int highestPointBetween(const int heights[], int startMile, int endMile)
{
int highestPoint = 0;
for (int i = startMile; i <= endMile; i++)
{
... | ALGO | 0.999621 | 5.106196 |
374a15d7-0eea-41dc-b9cc-9e58937a91a0 | heres-aayush/Algorithms | Complete Search/meetinthemiddle.cpp | /*Problem Statement :
given an array find if any subset meets the target sum
Solution strategy :
Meet in the middle
*/
#include <bits/stdc++.h>
using namespace std;
void search(int index, const vector<int>& a, int n, vector<int>& sum, int currentSum) {
if (index == n) {
sum.push_back(currentSum... | ALGO | 0.999973 | 6.177984 |
a134a5f6-d95d-4544-9fd4-a59a26a69258 | gmltn205/newcpp | cppp/cpp_starcraft_make_name.cpp | #include <iostream>
#include <string.h>
class Marine
{
int hp;
int coord_x, coord_y;
int damage;
bool is_dead;
char *name; // 마린의이름
public:
Marine();
Marine(int x, int y, const char *name);
Marine(int x, int y);
int attack();
void be_attacked(int damage_earn);
void move(int ... | TOOL | 0.912235 | 3.95328 |
60b07f45-e4d6-4e3e-95ca-e97562c8ec4f | tamim-vaiya/unlimited-topic-list-by-YouKn0wWho | Basics/5. Very Basic Math/GCD and LCM /GreatestCommonDivisor.cpp | // Problem link: https://csacademy.com/contest/archive/task/gcd/
#include <bits/stdc++.h>
using namespace std;
#define nl '\n'
#define ll long long
int main()
{
ios::sync_with_stdio(false);
cin.tie(nullptr);
int a, b;
cin >> a >> b;
cout << gcd(a, b) << nl;
return 0;
} | ALGO | 0.999889 | 5.880548 |
3f3e63a7-63c1-4e98-810f-e45e5fea4aea | ArduPilot/ardupilot | libraries/AP_Math/matrix3.cpp | #pragma GCC optimize("O2")
#include "AP_Math.h"
// create a rotation matrix given some euler angles
// this is based on https://github.com/ArduPilot/Datasheets/blob/main/References/EulerAngles.pdf
template <typename T>
void Matrix3<T>::from_euler(T roll, T pitch, T yaw)
{
const T cp = cosF(pitch);
const T sp ... | ALGO | 0.993873 | 6.973683 |
28c73a7e-e8c1-47e9-b2cd-9f220442a717 | rishabhjain9196/Competitive-Programming | July Long Challenge 2016/Stipend.cpp | #include<bits/stdc++.h>
using namespace std;
#define ll long long
ll a[1000001];
int main()
{ ios_base::sync_with_stdio(false);
ll t,n,q,x,ans=0,mul=1ll;
int c1,c2,c3;
cin>>t;
while(t--)
{
cin>>n;
c1=c2=c3=0;
for(int i=0;i<n;i++)
{
cin>>a[i];
... | ALGO | 0.999774 | 3.741475 |
53aaf917-3daa-457a-9893-f9d6de1b9d5b | Nishithjupally/parallel-and-concurrent-programming | ProgAssn5-CS18BTECH11018/ProgAssn5-OPTIMISTIC-CS18BTECH11018.cpp | #include <bits/stdc++.h>
#include <stdlib.h>
#include <unistd.h>
#include<mutex>
#include <ctime> //for times
#include <chrono> // for timers
#include<thread> //for threads
#include<random> //for exponential distribution
using namespace std;
int n,k;
float l1,l2;
default_random_engine generator;
ifstream file... | ALGO | 0.997184 | 3.696706 |
b78ef83c-43c0-4a67-8f50-9387add6ba14 | apple/llvm-project-v5 | libcxx/test/std/numerics/rand/rand.dis/rand.dist.bern/rand.dist.bern.negbin/eval_param.pass.cpp | // <random>
// template<class IntType = int>
// class negative_binomial_distribution
// template<class _URNG> result_type operator()(_URNG& g, const param_type& parm);
#include <random>
#include <numeric>
#include <vector>
#include <cassert>
#include "test_macros.h"
template <class T>
inline
T
sqr(T x)
{
retur... | TEST | 0.966683 | 5.627142 |
9211a876-3eb9-4fbc-9606-215356182a87 | RayhanNasir/Numerical-Methods | Lagran.cpp | #include <iostream>
#define MAX 10
using namespace std;
int main()
{
int n,j;
float x[MAX],f[MAX],fp,lf,sum,xp;
cout<< "Input number of data points, n"<< endl;
cin>> n;
cout<< "Input data points x(i) and values f(i) "<< endl;
cout<< "(One set in each line)"<< endl;
for(int i=1;i<=n;i++)
... | ALGO | 0.999853 | 3.510794 |
08bdae60-0719-4b54-b935-d5746f1e8b9b | ishandutta2007/codeforces | lych_cys/normal/793/D.cpp | #include<bits/stdc++.h>
#define inf 1000000000
#define N 85
using namespace std;
int n,cnt,m,dp[N][N][N][2],a[N][N];
int solve(int x,int y,int z,int p){
if (dp[x][y][z][p]!=-1) return dp[x][y][z][p];
int &ans=dp[x][y][z][p],i; ans=inf;
if (!p)
for (i=x+1; i<=y; i++) ans=min(ans,a[x][i]+min(solve(x+1,i,z-1,1),solv... | ALGO | 0.999992 | 3.851832 |
623ac03d-896b-465a-b271-23ea8d31043c | danielferecatu/mdi | bac/2009/varianta69/varianta69-subiect1-2.c.cpp | #include <iostream>
using namespace std;
int main() {
int x, y, t=0, u=1, z;
cout << "x= ";
cin >> x;
cout << "y= ";
cin >> y;
do {
if ( x%10 > y%10 ) z = x%10;
else z = y%10;
t = t + z*u;
u*= 10;
x/= 10;
y/= 10;
}
while ( x>0 && y>0 );
cout << endl << "t=" << t;
return 0;
}
| ALGO | 0.999754 | 4.047884 |
5f9d81b6-eb9d-405d-b4df-4f246e21a19b | Vishal-Ansari/LeetCode-Repo | 1631 Path With Minimum Effort Medium.cpp | class Solution {
public:
vector<int> dx = {-1, 0, 1, 0};
vector<int> dy = {0, 1, 0, -1};
bool dfs(vector<vector<int>>& grid, int i, int j, int n, int m, int mid, vector<vector<bool>>& vis){
if(i == n - 1 && j == m - 1)
return true;
vis[i][j] = true;
for(int k = 0; k < 4; ... | ALGO | 0.999991 | 6.113545 |
88cf1158-aa07-4e5c-b2f7-3faba214b115 | kirixresearch/strata | xd/xdfs/delimitedtextold.cpp | #include <kl/klib.h>
#include "delimitedtext.h"
#include "rawtext.h"
const int DELIMITEDTEXT_BUFSIZE = 1000000; // number of bytes in each buffer
static std::string empty_string = "";
// -- DelimitedTextFile class implementation --
DelimitedTextFile::DelimitedTextFile()
{
m_filename = L"";
m_buf_file = n... | TOOL | 0.861193 | 6.450957 |
7de49638-831b-40a3-a99d-4eea20664281 | elizaveta212/OOP | main.cpp | #include <iostream>
#include <string>
#include "func.h"
using namespace std;
int main(){
string stroka;
string stroka2;
std::cin >> stroka;
stroka2 = foo(stroka);
std::cout << stroka2 << std::endl;
return 0;
}
| TOOL | 0.944941 | 3.601237 |
32eb384c-8859-4b54-95f1-4f242d522f2c | hitu1304/100DaysCodingChallenge | Day-33/Remove-duplicates-in-small-prime-array.cpp | /*plateform-> GeeksforGeeks
language used->cpp.
Problem Statement->
Given an array consisting of only prime numbers, remove all duplicate numbers from it.
Note: Retain the first occurrence of the duplicate element.
Example 1:
Input:
N = 6
A[] = {2,2,3,3,7,5}
Output: 2 3 7 5
Explanation: After removi... | ALGO | 0.999931 | 5.849315 |
7b702259-1e1b-4cc3-ba3f-46d111f8addc | AikenH/Aikens_programming_notes | CODE_Leetcode/10.正则表达式匹配.cpp | /*
* @lc app=leetcode.cn id=10 lang=cpp
*
* [10] 正则表达式匹配
*/
// @lc code=start
#include<vector>
#include<string>
using namespace std;
class Solution {
public:
bool isMatch(string s, string p) {
int m = s.size();
int n = p.size();
auto matches = [&](int i, int j) {
if (i == 0... | ALGO | 0.999829 | 5.841857 |
b63a80b9-8ded-4403-bdcb-92c7571419f2 | Mrzhugq/algorithm-leetcode | cplusplus/leetcode-question/226.翻转二叉树.cpp | /**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode() : val(0), left(nullptr), right(nullptr) {}
* TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}
* TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), l... | ALGO | 0.999998 | 6.189012 |
a8b12f51-de8d-4e37-ad72-bd41d559eabd | OganKuba/HighSchool | 2nd Satges of OI/dzialka.cpp | #include <bits/stdc++.h>
using namespace std;
#define endl '\n'
bool tab[2000][2000];
int last[2000];
struct A{
int p , h;
};
int maxi=0;
int n , a;
void count(int k){
vector<int> G;
for(int j=0 ; j<n ; j++){
if(tab[k][j]==false){
G.push_back(0);
last[j]=k;
}
else G.push_back(k-last[j]);
}
G.push_back(... | ALGO | 0.999542 | 3.350783 |
cc697187-666d-45ea-8941-9f90cd94bbb8 | Roman-n/xray-csky_borscht_sdk | utils/xrAI/game_graph_builder.cpp | ////////////////////////////////////////////////////////////////////////////
// Module : game_graph_builder.cpp
// Created : 14.12.2005
// Modified : 14.12.2005
// Author : Dmitriy Iassenev
// Description : Game graph builder
////////////////////////////////////////////////////////////////////////////
#include "... | ALGO | 0.850644 | 3.846669 |
a2a8f0f1-1a3e-4b3b-8da6-36d356d66174 | nirdesh17/codeforces | Lucky-String.cpp | #include<bits/stdc++.h>
using namespace std;
#define ll long long int
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
// char a[4]={'a','b','c','d'};
ll n;
cin>>n;
string s="abcd",g;
string a[4]={"a","b","c","d"};
for(ll i=0;i<n/4;i++)
{
g=g+s;
}
for(... | ALGO | 0.999676 | 3.569643 |
0488f536-b5fa-4d65-8760-e1ce57b27f8a | HaomingSong/SmallRobotArm_ROS | smallrobot_driver/src/smallTest.cpp | void SmallrobotRobotRos::executeCB(const control_msgs::FollowJointTrajectoryGoalConstPtr &goal)
{
std::cout << "\033[1m\033[32m SmallrobotRobotRos::executeCB start \033[0m 当前机械臂状态为"
<< (int)smallrobotRobotPtr->location.state << std::endl;
if (smallrobotRobotPtr->location.state != STOPPED)
{ /... | ALGO | 0.982275 | 3.460991 |
bd248d79-8b9e-45cb-944d-b26593dc7f15 | jh2952/learn_cpp | 4. Fundamental Data Types/Q3.cpp | /*
* User is asked to enter 2 floating point numbers. (use doubles)
* User is asked to enter a basic math operator (+ - * /)
* Program computes the answer on the numbers the user entered and prints
* the result.
* If the user enters an invalid symbol, the program should print nothing.
*/
#include <iostream>
dou... | TOOL | 0.931512 | 5.798204 |
c31fb046-da22-4fa9-9725-b6a5b950f1a7 | FelixMatrixx/23521215_23521704_23521494_23521821_23521208_23521327_BT05 | Bai136/Bai136.cpp | #include <iostream>
#include <iomanip>
using namespace std;
struct diem
{
float x;
float y;
};
typedef struct diem DIEM;
struct tamgiac
{
DIEM A;
DIEM B;
DIEM C;
};
typedef struct tamgiac TAMGIAC;
void Nhap(TAMGIAC&);
void Nhap(DIEM&);
int main()
{
TAMGIAC tg;
Nhap(tg);
return 0;
}
void Nhap(TAMGIAC& t)
{
... | TOOL | 0.920318 | 3.651502 |
3dd163bc-d520-4a0d-90cb-7c4f281131a9 | raouiyounes/Strands-project | ekz-public-lib/src/FeatureExtractor/OrbExtractor.cpp | #include "OrbExtractor.h"
#include "OrbFeatureDescriptor.h"
#include <ctime>
#include <algorithm>
#include "cv.h"
#include "highgui.h"
#include <opencv2/opencv.hpp>
#include <opencv2/opencv.hpp>
#include "opencv2/xfeatures2d.hpp"
#include "opencv2/features2d.hpp"
#include "/home/younes/Bureau/Pointer2Labs/PFE/catkin_s... | ALGO | 0.961824 | 4.980422 |
3fb05585-66c9-4762-840d-7ce8ef8b2ddd | KyeongYeongDEV/beakjoon | 10828.cpp | #include<iostream>
#include<stack>
using namespace std;
int main(){cin.tie(0); cout.tie(0); ios::sync_with_stdio(0);
int num=0,tmp2=0;
stack<int> s;
string str="";
cin >> num;
while(num--){
cin >> str;
if(str == "push"){
cin >> tmp2;
s.push(tmp2);
}e... | ALGO | 0.999049 | 4.083612 |
6b09e95c-99cf-4b17-9c41-c064d7b8a2f3 | update-ankur/C-with-DS | Opensource Programs/Find the element that appears once.cpp | // C++ program to find the element
// that occur only once
#include <bits/stdc++.h>
using namespace std;
int getSingle(int arr[], int n)
{
int ones = 0, twos = 0;
int common_bit_mask;
// Let us take the example of
// {3, 3, 2, 3} to understand
// this
for (int i = 0; i < n; i++) {
/* The expression "one & ... | ALGO | 0.999922 | 5.590599 |
1ee1a299-e3b2-48e6-81f4-566745aa7402 | nirdesh17/codeforces | Chip-Game.cpp | #include<bits/stdc++.h>
using namespace std;
#define ll long long int
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
ll t;
cin>>t;
while(t--)
{
ll n,m;
cin>>n>>m;
if(n%2==0)
{
n=1;
if(m%2==0)
cout<<"Tonya"<<end... | ALGO | 0.999876 | 4.917334 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.