uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
77cc780d-ce17-4063-bd2a-0d40901ce0be | balajibalasubramaniam/ardupilot | libraries/AP_Compass/Compass_learn.cpp | #include <AP_Math/AP_Math.h>
#include "AP_Compass.h"
// don't allow any axis of the offset to go above 2000
#define COMPASS_OFS_LIMIT 2000
/*
* this offset learning algorithm is inspired by this paper from Bill Premerlani
*
* http://gentlenav.googlecode.com/files/MagnetometerOffsetNullingRevisited.pdf
*
* Th... | ALGO | 0.985765 | 5.398358 |
b9322c9a-0e5d-4e50-b355-e88f384db706 | rowansherif/Evently | 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.998733 | 6.76775 |
755f131d-1469-4835-b94f-5ebbd50a5af3 | 1102pipi/DS_team9 | node/apache-ignite-2.16.0-bin/platforms/cpp/odbc/src/config/connection_string_parser.cpp | #include <vector>
#include "ignite/common/utils.h"
#include "ignite/odbc/utility.h"
#include "ignite/odbc/ssl_mode.h"
#include "ignite/odbc/config/connection_string_parser.h"
#include "ignite/odbc/config/config_tools.h"
#include "ignite/odbc/nested_tx_mode.h"
namespace ignite
{
namespace odbc
{
names... | TOOL | 0.969434 | 7.606209 |
477ebacf-fe58-463e-a768-edeeaef30fd6 | jackyteoh/CS1124 | 11.16.2016 Notes - Linked Lists pt. 2.cpp | #include <iostream>
#include <string>
#include <vector>
using namespace std;
class LList;
class LListItr;
class LListNode {
public:
LListNode(int newData = 0, LListNode* newPtr = nullptr) : data(newData), next(newPtr) {}
friend class LList;
friend class LListItr;
private:
int data;
LListNode* next;
};
class LL... | ALGO | 0.987694 | 4.595965 |
22b060d9-78bb-4b46-9ccf-fa7fe901a9bd | vkflco08/algorithm_practice | 프로그래머스/1/340198. [PCCE 기출문제] 10번 / 공원/[PCCE 기출문제] 10번 / 공원.cpp | #include <string>
#include <vector>
#include <algorithm>
#include <iostream>
using namespace std;
bool check(int mat, vector<vector<string>> park, int i, int j) {
if (i + mat > park.size() || j + mat > park[0].size()) {
return false;
}
for(int k = i; k < i + mat; k++){
for(int l =... | ALGO | 0.99962 | 5.149481 |
3a6c2335-ce1d-461e-989e-e107cf1678f5 | Pr-att/Music-App | windows/runner/utils.cpp | #include "utils.h"
#include <flutter_windows.h>
#include <io.h>
#include <stdio.h>
#include <windows.h>
#include <iostream>
void CreateAndAttachConsole() {
if (::AllocConsole()) {
FILE *unused;
if (freopen_s(&unused, "CONOUT$", "w", stdout)) {
_dup2(_fileno(stdout), 1);
}
if (freopen_s(&unuse... | TOOL | 0.9988 | 6.76073 |
07b71885-f5fe-45e7-8b2e-ff3c164cdeef | TDLoi123/code-basic | bai5.cpp | #include<bits/stdc++.h>
using namespace std;
string Sinh(string s){
int l=s.size();
for (int i=l-1; i>=0; i--){
if(s[i]=='0'){
s[i]='1';
return s;
} else {
s[i]='0';
}
}
return s;
}
bool check(string s){
int n=s.size();
for(int i=0; i<n/2; i++){
if(s[i]!=s[n-i-1]){
return false;
}
}
retur... | ALGO | 0.999977 | 4.133818 |
75755a3d-7e7c-4b21-921b-982a8e889884 | TheHimanshuBairwa/DSA-COURSE | DSA FOR PLACEMENTS 2022/DP by ADITYA VERMA/Lect-23 Print Longest common Subsequence/main.cpp | //
// main.cpp
// Lect-23 Print Longest common Subsequence
//
// Created by Himanshu Bairwa on 08/08/22.
//
/* PRINTING LONGEST COMMON SUBSEQUENCE */
#include<iostream>
#include<vector>
using namespace std;
string printingLCS(string s1,string s2,int n, int m){
vector<vector<int>> dp(n+1, vector<int>(m+1... | ALGO | 0.996247 | 5.366943 |
62f77838-81b0-4f2e-b16c-f45c4f34b00e | agustinaa235/FinalesTaller | 2c 2020/4 fecha/ejercicio8.cpp | /*Implemente una función C++ denominada SoloMuliplos que reciba una lista de
elementos numéricos y un elemnto numérico x. La función debe devolver una nueva
lista con los elementos de la primera que sean múltiplos de x:*/
#include <iostream>
#include <list>
#include <algorithm>
template <class T>
std::list<T> SoloMu... | TOOL | 0.995638 | 4.000116 |
b518a767-a14e-4f22-b083-28db8361368c | WangXi730/cpptest | DataStructure/hash.cpp | #include<iostream>
#include<vector>
#include<list>
using namespace std;
enum state {nil,del,used};
template<class Type>
class Hash_1;
template<class Type>
class Hash_node1 {
public:
friend class Hash_1<Type>;
//췽
Hash_node1():data(Type()),s(nil) {}
Hash_node1(Type val):data(val),s(used){}
private:
Type data;
sta... | ALGO | 0.998234 | 4.050048 |
0fc205e3-a25d-43d7-8700-7276e84d0cf2 | prernachhabra/Dual-Arm-Manipulation- | src/moveit/moveit_core/kinematics_metrics/src/kinematics_metrics.cpp | /* Author: Sachin Chitta */
#include <moveit/kinematics_metrics/kinematics_metrics.h>
#include <Eigen/Dense>
#include <Eigen/Eigenvalues>
#include <boost/math/constants/constants.hpp>
namespace kinematics_metrics
{
double KinematicsMetrics::getJointLimitsPenalty(const moveit::core::RobotState& state,
... | ALGO | 0.998182 | 7.168238 |
1ae9d498-d2e0-4f4d-a781-1a0e6984b4e4 | abdelqayyim/C-Tic-Tac-Toe | build-mac/Boost/libs/geometry/example/c06_custom_polygon_example.cpp | // Boost.Geometry (aka GGL, Generic Geometry Library)
#include <boost/geometry/geometry.hpp>
#include <boost/geometry/geometries/register/point.hpp>
#include <boost/geometry/geometries/register/ring.hpp>
struct my_point
{
my_point(double an_x = 0, double an_y = 0)
: x(an_x)
, y(an_y)
{}
... | TOOL | 0.961086 | 7.845809 |
b21fcc6b-3bfd-41c7-9fab-f8823ea80701 | AvishrantsSh/CodeForces | Little Pony and Sort by Shift.cpp | #include <bits/stdc++.h>
#define ll long long
using namespace std;
int main()
{
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
ll size, shift = 0, prev = INT_MIN, first = INT_MIN;
ll order_shift = 0;
cin >> size;
while (size)
{
ll tmp;
cin >> tmp;
if (siz... | ALGO | 0.999951 | 3.831599 |
62efda9d-f16e-4e96-bfda-cee5584214ef | samad-yar-khan/dsa-problemset | BST/rightView.cpp | #include "bt1.cpp"
//https://practice.geeksforgeeks.org/problems/right-view-of-binary-tree
vector<int> rightView(BinaryTreeNode<int> *root)
{
vector<int> ans;
queue< BinaryTreeNode<int> *> pendingNodes ;
pendingNodes.push(root);
pendingNodes.push(NULL);
//the logic is that the Nul... | ALGO | 0.999328 | 4.81445 |
b1570072-9b1e-4c5d-a967-1b8766288ebe | Yukariko/acm | problem/2597/test.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
int N;
scanf("%d",&N);
vector<set<int>> a(N * 2);
for(int i=0; i <= N; i++)
a[i].insert(i);
double begin = 0, end = N;
for(int t=0; t < 3; t++)
{
int l, r;
scanf("%d%d",&l,&r);
int lpos = begin + 0.5, rpos = begin + 0.5;
for(int i=begin + ... | ALGO | 0.999506 | 3.390527 |
b135982b-9a07-4fb8-880b-8011cc2e736b | GeeKY03/cppcodesolutions | cd.cpp | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<long long int> vlli;
#define pb push_back
#define endl '\n'
#define IOS ios_base::sync_with_stdio(0);cin.tie(0);
const int N=2e5+5;
vi adj[N];
bool visited[N];
vi cd;
void dfs(int curr){
cd.pb(curr);
visited[cu... | ALGO | 0.999991 | 4.080858 |
1c38bcc0-11cf-45e7-8073-3bd8b43fed22 | pdrsouza99/ED | Material 04/Exercicio1.cpp | #include <iostream>
using namespace std;
// Função para ordenar o vetor usando Bubble Sort (crescente)
void bubbleSort(int arr[], int n) {
for (int i = 0; i < n - 1; i++) {
for (int j = 0; j < n - i -1; j++) {
if (arr[j] > arr[j + 1]) {
// Troca os elementos
int ... | ALGO | 0.999964 | 5.443221 |
0033420d-880b-4456-80ef-cc14a848c581 | AhmedMostafa79/problem-solving | Problem-Solving/Codeforces/Phase 3-3/Data Structures/Round 332 C - Day at the Beach.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define all(v) ((v).begin()),((v).end())
#define rall(v) ((v).rbegin()),((v).rend())
#define Fast ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define close(n) return cout<<n,0;
#define files freopen("closing.in", "r", stdin); freopen("closi... | ALGO | 0.999928 | 4.614971 |
476af5c1-8511-4a3a-9b1b-2de2da0d040b | ReZeroS/LeetCode | 1021.Remove Outermost Parentheses/test.cpp | class Solution {
public:
string removeOuterParentheses(string S) {
int num = 0;
bool first_left = false;
int len = S.size();
string answer = "";
for(int i = 0; i < len; ++i){
if(S[i] == '(') {
num++;
if(!first_left) {
... | ALGO | 0.999772 | 6.032017 |
a309423c-b88f-4cd8-8772-86481f06c8d9 | 101magikarp101/USACO | math/diluc-and-kaeya.cpp | #include <iostream>
#include <algorithm>
#include <vector>
#include <set>
#include <queue>
#include <map>
#include <cmath>
#include <iomanip>
#include <cstring>
#include <bitset>
#include <string>
#include <unordered_map>
#include <deque>
#include <climits>
using namespace std;
#define ll long long
#define MOD 9982443... | ALGO | 0.99982 | 5.059286 |
0631f674-9f8e-4a71-96b7-1804a53848ef | ABB00717/leetcode | problems/cpp/55.Jump-Game.cpp | #include <queue>
#include <set>
#include <vector>
class Solution {
public:
bool canJump(std::vector<int> &nums) {
int farthest = 0;
for (int i = 0; i < nums.size(); i++) {
if (i > farthest) return false;
farthest = std::max(farthest, i + nums[i]);
if (farthest >= nums.size() - 1) return tru... | ALGO | 0.999946 | 6.384797 |
5d0763b7-2de1-4900-a749-2f66c8834986 | SongHayoung/BOJ | 1149.cpp | #include <iostream>
#include <math.h>
#include <string>
#include <algorithm>
#include <cstring>
#include <vector>
#include <cstdio>
using namespace std;
#define MAXSIZE 1001
int cost[3][MAXSIZE];
int cache[3][MAXSIZE];
int n;
int dp(int color,int depth)
{
int &ret = cache[color][depth];
if (ret != -1)
return ret... | ALGO | 0.999311 | 3.586812 |
58c288e2-6cb4-4e54-b6b4-744dfe69d6d4 | sabbirahmedfahim/ProblemSolving | Codeforces/G_White_Black_Balanced_Subtrees.cpp | // resolved
#include <bits/stdc++.h>
#define nl '\n'
#define ll long long
#define all(c) c.begin(),c.end()
#define print(c) for(auto e : c) cout << e << " "; cout << nl
using namespace std;
const int N = 4E4 + 5;
vector<int> adjList[N], adjList2[N];
bool vis[N];
pair<int, int> WB[N];
string s;
bool addedContribution[... | ALGO | 0.999874 | 3.92531 |
f770bf71-22ad-4d8f-907b-d0091336f118 | altera-fpga/hls-samples | Tutorials/Features/optimization_targets/src/optimization_targets.cpp | class Kernel;
#if defined(FPGA_SIMULATOR)
constexpr int kInputSize = 10;
#else
constexpr int kInputSize = 1000;
#endif
typedef int RGBType;
typedef std::vector<RGBType> RGBVec;
typedef float GreyType;
typedef std::vector<GreyType> GreyVec;
// Return the execution time of the event, in seconds
double GetExecutionTime... | ALGO | 0.950425 | 6.662394 |
624d8d1f-2bcb-42e1-bc71-b63c496ab1fc | DNLD2017/turret_control | ros_nodes/dlnd/src/localization.cpp | #include "tf/LinearMath/Quaternion.h"
#include "tf/LinearMath/Matrix3x3.h"
#include "tf/transform_datatypes.h"
#include "visualization_msgs/Marker.h"
#include "geometry_msgs/PoseStamped.h"
#include "dlnd/localization.h"
#include "dlnd/vibes.h"
#include <string>
#define D_VCT std::vector<double>
#define D_TBL std::vecto... | TOOL | 0.997445 | 4.461167 |
d3514a7c-3408-429c-bbad-6430dea5fc55 | mj426382/TwoTapesToSingleTape | turing_machine.cpp | #include <cassert>
#include <cstddef>
#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <set>
#include <string>
#include "turing_machine.h"
using namespace std;
class Reader
{
public:
bool is_next_token_available()
{
return next_char != '\n' && next_char != EOF;
}
string next_... | ALGO | 0.979191 | 4.692283 |
93bc8d86-6241-4f9a-98cf-b29e41b14e43 | ciwomuli/NOIP2017exercise | 2018-9-10/P1197.cpp | #include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
const int maxn=400005;
struct Edge{
int u,v;
Edge(int u,int v):u(u),v(v){}
};
int fa[maxn];
vector<Edge> edges;
vector<int> G[maxn];
int out[maxn];
int d[maxn];
bool broken[maxn];
int find(int x){
return x==fa[x]?x:fa[x]=find(fa... | ALGO | 0.999938 | 3.98746 |
087ae02a-a0ab-455c-af1e-164f2643eb6a | Sartech-B/Competitive-Programming | CodeForces/p47.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
string a;
cin>>a;
int cnt = 0;
bool f = 0;
for(int i=0; i<a.length(); i++)
{
if(i<=a.length()-3 && a[i]=='W' && a[i+1]=='U' && a[i+2]=='B')
{
f = 1;
i += 2;
}
else
{
if(f && cnt>0) cout<<" ";
cout<<a[i];
f = 0;
cnt++;
}
}
... | ALGO | 0.999458 | 3.304531 |
ac8c1a2d-17ec-46e9-9f7e-c7f06ed1bf22 | kkt474/sort | 栈与队列/栈.cpp | // 初始化栈
stack<int> stack;
// 元素入栈
stack.push(1);
stack.push(3);
stack.push(2);
stack.push(5);
stack.push(4);
// 访问栈顶元素
int top = stack.top();
// 元素出栈
stack.pop(); // 无返回值
// 获取栈的长度
int size = stack.size();
// 判断是否为空
int empty = stack.empty();
// 基于链表实现的栈
class LinkedListStack {
private:
ListNode* stackTop;... | ALGO | 0.99945 | 4.872365 |
d86d01b0-bbc5-4fa7-9bdb-0c5404a1da8c | sarvex/leetcode-emoji-code | solution/1000-1099/1021.Remove Outermost Parentheses/Solution.cpp | class Solution {
public:
string removeOuterParentheses(string s) {
string ans;
int cnt = 0;
for (char& c : s) {
if (c == '(') {
if (++cnt > 1) {
ans.push_back(c);
}
} else {
if (--cnt) {
... | ALGO | 0.999902 | 6.235264 |
544505c8-b9d9-4408-99bd-78a616713db4 | ldhulipala/PWSA-Star | xytheta/pwsa_project/PWSA/test/grid/other/hull.cpp |
#include <iostream>
#include "datagen.hpp"
#include "geometryData.hpp"
#include "sequence.hpp"
#include "benchmark.hpp"
namespace pbbs {
#include "defaults.hpp"
using namespace sequence;
template <class ET, class F>
pair<intT,intT> split(ET* A, intT n, F lf, F rf) {
intT ll = 0, lm = 0;
intT rm = n-1, ... | ALGO | 0.999762 | 6.06846 |
e6874bd2-9614-45fe-843f-9ff0566752f7 | 0-jij-0/CompetitiveProgramming | Problems Archive/0000 - 0999/0521 - Two Bracket Sequences.cpp | #include <iostream>
#include <string>
#include <algorithm>
using namespace std;
string s, t; int n, m;
int dp[201][201][201];
int choice[201][201][201];
int min_length(int i, int j, int ps) {
if (i == n && j == m) { choice[i][j][ps] = 3; return ps; }
if (dp[i][j][ps] != -1) { return dp[i][j][ps]; }
bool bi = (i <... | ALGO | 0.999912 | 3.768548 |
a06ef2b0-394d-4664-9da7-79463c8215a6 | daocrossover/Leetcode-Cpp | 23. Merge k Sorted Lists/Solution2.cpp | // Divide And Conquer Solution:
// Pair up k lists and merge each pair.
// After the first pairing, k lists are merged into k/2 lists with average 2N/k length,
// then k/4, k/8 and so on.
// Repeat this procedure until we get the final sorted linked list.
// Time Complexity: O(Nlogk)
// Space Complexity: O(1)
#include... | ALGO | 0.999938 | 6.019483 |
43d438dc-426f-4202-a86a-52a0d3ae6fba | BorodiBogdan/Z-Builders-9th-Grade | functiiVoid.cpp | #include <iostream>
using namespace std;
int suma(int v[],int n)
{
if(n==1) return v[0];
else return v[n-1]+suma(v,n-1);
}
void suma2(int v[], int n, int &s)
{
if(n==1) s=v[0];
else
{
suma2(v,n-1,s);
s=s+v[n-1];
}
}
int sumcif(int n)
{
if(n<10) return n;
return sumcif... | ALGO | 0.999516 | 3.327358 |
c773ba29-a922-4a52-8ebe-4e242f523dbe | TheProjecter/igatools | tests/mortar/old/mortar_integration_terms_old.cpp |
#include <igatools/base/function_lib.h>
#include <igatools/geometry/mapping_lib.h>
#include <igatools/geometry/identity_mapping.h>
#include <igatools/geometry/ig_mapping.h>
//#include <igatools/io/reader.h>
#include <igatools/basis_functions/space_tools.h>
#include <igatools/basis_functions/bspline_space.h>
#include <... | ALGO | 0.994528 | 6.175202 |
2d7f6313-c9ab-4f09-8e7d-13909261b0a7 | ImtiazAhmedAkash/Problem-Solving | uva/567.cpp | /* In the Name of ALLAH, the most gracious, the most merciful */
// Risk
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define nl '\n'
#define deb(x) cerr << #x << " = " << x << nl
const int inf = 1e9;
const ll INF = 1e18;
const int mod = 998244353;
const int N = 21;
static int t = 1;
void s... | ALGO | 0.999381 | 5.203363 |
a7956b37-0af2-44e3-9486-91225db9d4a7 | jonatanvar/Gu-a-de-ejercicios-estructura-de-datos | Grupo_#4_100_ejercicios/100_Ejercicios_/EJERCICIO_69/procedimientos.cpp | // Autor: Jorge Mendoza
// Fecha: 22/07/2025.
#include "funciones.h"
#include <iostream>
using namespace std;
// Función para comprobar si la cola está llena.
bool estaLlena(const Cola& cola) {
return cola.contador == MAX_TAMANIO_COLA;
}
// Función para agregar un elemento al final de la cola (enqueue).
bool en... | TOOL | 0.927849 | 5.706474 |
f8cafc26-ddf8-41e2-8abe-9e9674007c0b | assanix/ADS_23 | lab8/rk.cpp | #include <bits/stdc++.h>
using namespace std;
int main(){
string s = "kbtu", t= "uttbkkbubtuk"; // входные данные
// считаем все степени p
const int p = 31;
vector<long long> p_pow (max (s.length(), t.length()));
p_pow[0] = 1;
for (size_t i=1; i<p_pow.size(); ++i)
p_pow[i] = p_pow[i-1] * p;
// считаем хэши от в... | ALGO | 0.999903 | 4.485239 |
15446d5e-ba75-422d-937e-86ed51ba19e3 | sarvex/leetcode-small-basic | solution/0400-0499/0401.Binary Watch/Solution.cpp | class Solution {
public:
vector<string> readBinaryWatch(int turnedOn) {
vector<string> ans;
for (int i = 0; i < 12; ++i) {
for (int j = 0; j < 60; ++j) {
if (__builtin_popcount(i) + __builtin_popcount(j) == turnedOn) {
ans.push_back(to_string(i) + ":" ... | ALGO | 0.998277 | 6.699302 |
338499c8-46c6-44b6-b275-6fbff3849634 | Muuurain/Practice_Cpp | SCU/scu2025 training/scu25_day12/B.cpp | #include <bits/stdc++.h>
using namespace std;
const int N = 105;
typedef long long ll;
ll dis[N][N];
ll org[N][N];
int main() {
ios::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
int n, m;
cin >> n >> m;
for(int i = 0; i < N; i++) {
for(int j = 0; j < N; j++) {
... | ALGO | 0.999973 | 4.995594 |
89238545-d978-413e-a2bd-83d0f7b1fc72 | wangqinghe95/Code-Leetcode | Q033_Search in Rotated Sorted Array.cpp |
/*暴力遍历*/
class Solution {
public:
int search(vector<int>& nums, int target) {
int i = 0;
for (int num : nums){
if (num == target){
return i;
}
i++;
}
return -1;
}
};
/*二分查找-变形*/
/*
旋转有序数组对于有序数组的区别在于部分区域有序
所以如果要使用二分法就需要对其有额外的步骤... | ALGO | 0.99999 | 5.967916 |
28d01044-8a5f-4401-b4db-662b7eac1498 | yzzupgo/MFTCG | Data/abc170_b/puja_dhar/wa/14316261.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
int x,y,d;
cin>>x>>y;
d=y/x;
if(d<=4&&d>=2)
cout<<"Yes"<<endl;
else
cout<<"No"<<endl;
}
| ALGO | 0.999924 | 3.164949 |
28952dff-f44f-424a-ad1c-0e07dd0be07e | skavy359/Algorithmic-Huddle | CodeForces-Problems/Fake News (Easy).cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
string s;
cin >> s;
string x = "heidi";
int i = 0;
for (char c : s)
{
if (c == x[i])
{
i++;
}
if (i == x.length())
{
cout << "YES" << endl;
return 0;
}
... | ALGO | 0.999978 | 3.436408 |
4359f5de-031e-44e7-83ea-4e71b47d1d53 | lazy-abhay/SolvedProblems | CodeForces/March/5th/1979B.cpp | /* Coded by lazy_abhay */
#include <bits/stdc++.h>
using namespace std;
#define endl "\n"
#define int long long
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
int32_t main(void)
{
cin.tie(nullptr);
ios_base::sync_with_stdio(false);
auto abhay = [&](int __t) -> void
{
... | ALGO | 0.999851 | 5.392304 |
e2646073-a8ba-4d24-8c2e-c85f9b777971 | tr1ten/DNA | codeforces/misc/XorPathCp.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long LL;
template <class T>
inline void read(T &x) {
x = 0;
char c = getchar();
bool f = 0;
for (; !isdigit(c); c = getchar()) f ^= c == '-';
for (; isdigit(c); c = getchar()) x = x * 10 + (c ^ 48);
x = f ? -x : x;
}
template <class T>... | ALGO | 0.999947 | 3.872997 |
4d6cc5a9-280f-4bb0-9c62-46c6ac389265 | hei0v0/Algorithm-Exercises | PAT (Basic Level) Practice/1039.cpp | #include <iostream>
#include <string>
using namespace std;
int book[256] = {0};
int main() {
string a, b;
cin >> a >> b;
for (int i = 0; i < a.length(); i++) book[a[i]]++;
int result = 0;
for (int i = 0; i < b.length(); i++) {
if (book[b[i]] > 0)
book[b[i]]--;
else
... | ALGO | 0.999987 | 3.634077 |
52d65736-3d57-4375-aa2b-4ab4cef58460 | 113bommy/deepmind_codecontests_refine | cpp_gold_filter_file/cpp_train_12675_10.cpp | #include <bits/stdc++.h>
using namespace std;
int q[107], l, r, x, y, a, b, tmp, top, cnt, res = 1, i, j;
bool check(int x) { return x >= l && x <= r; }
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
cin >> l >> r >> x >> y;
if (y % x)
cout << 0 << endl;
else {
for (tmp = (y /= x), i = 2; i * i... | ALGO | 0.999927 | 3.837085 |
5dba110f-c8ce-4197-8e79-cbf3d5103ce8 | anupamkaul/robot_ball_chaser | practice/localization/kalman/eigenLib/doc/examples/function_taking_ref.cpp | #include <iostream>
#include <Eigen/SVD>
using namespace Eigen;
using namespace std;
float inv_cond(const Ref<const MatrixXf>& a)
{
const VectorXf sing_vals = a.jacobiSvd().singularValues();
return sing_vals(sing_vals.size()-1) / sing_vals(0);
}
int main()
{
Matrix4f m = Matrix4f::Random();
cout << "matrix m:... | ALGO | 0.999824 | 5.283265 |
b56b2468-ae18-4fd7-a191-3494fddc3042 | hacktheinterview/hacktheinterview | problems/103/header.cpp | #include <iostream>
#include <cstdio>
#include <algorithm>
#include <cstring>
#include <string>
#include <cctype>
#include <stack>
#include <queue>
#include <list>
#include <vector>
#include <map>
#include <sstream>
#include <cmath>
#include <bitset>
#include <utility>
#include <set>
#include <numeric>
#include <ctime>... | ALGO | 0.999037 | 5.78508 |
a1d293eb-8191-4ae1-9f79-f8e5bd7da6e4 | JeongKyuho/BOJ | 15353.cpp | #include <cstdio>
#include <string.h>
int main() {
int n1, n2, idx = 0, p = 0, s1, s2, ans[10001];
char c1[10001], c2[10001];
scanf("%s%s", c1, c2);
s1 = strlen(c1); s2 = strlen(c2);
while (s1 || s2 || p) {
if (s1) n1 = c1[(s1--) - 1] - '0';
if (s2) n2 = c2[(s2--) - 1] - '0';
ans[idx++] = (n1 + n2 + p) % 10;... | ALGO | 0.999961 | 3.684596 |
de6a9194-58fb-4e3b-96dc-d252bba4f285 | pndh/pndh | circle.cpp | #include <bits/stdc++.h>
using namespace std;
#define int long long
#define pb push_back
int k, n;
const int mx=1e6+5;
const int inf=1e18;
void read(){
cin >> k >> n;
}
void solve(){
int sum=0;
int flag=true;
for (int i=1;i<=n;i++){
int a;
char b;
cin >> a >> b;
if (!fl... | ALGO | 0.999288 | 4.209481 |
f10b9d57-51dc-472f-add4-8a8e2ecd6371 | Anuragislam41571/tapbar | 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.998733 | 6.76775 |
16ec2e84-8bfd-43d4-b877-d65970f45805 | andrewqt/Competitive-Programming | DMOJ/dmopc18c4p2/dmopc18c4p2.cpp | #include <bits/stdc++.h>
using namespace std;
int N;
bool dp[500000];
int arr[1000];
int main(){
scanf("%d", &N);
dp[0] = 1;
int maxi = 0;
int tot = 0;
for(int i = 1; i<=N; i++){
scanf("%d", &arr[i]);
tot += arr[i];
}
for(int i =1 ; i<=N; i++){
for(int j = tot/2; j... | ALGO | 0.999744 | 3.658709 |
c02c4281-0d72-45dd-a211-0f37bdcab962 | flinke/TDCV-L | ObjectDetectionAndClassification/opencv/sources/samples/tapi/squares.cpp |
#include "opencv2/core.hpp"
#include "opencv2/core/ocl.hpp"
#include "opencv2/core/utility.hpp"
#include "opencv2/imgproc.hpp"
#include "opencv2/imgcodecs.hpp"
#include "opencv2/highgui.hpp"
#include <iostream>
using namespace cv;
using namespace std;
int thresh = 50, N = 11;
const char* wndname = "Square Detection ... | TOOL | 0.995126 | 6.857757 |
bdaab578-40f2-4b19-89ea-aef5d83eb34e | Pavitragandhi/GFG_solutions | Difficulty: Basic/Implement stack using array/implement-stack-using-array.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
class MyStack {
private:
int arr[1000];
int top;
public:
MyStack() { top = -1; }
int pop();
void push(int);
};
// } Driver Code Ends
// Function to push an integer into the stack.
/*
class MyStack
{
private:
int arr[10... | ALGO | 0.998479 | 6.199469 |
da927d44-22dc-4d0c-aff3-88455da5876c | mejibyte/competitive_programming | ICPC Live Archive/4807 - Cocircular Points/4807.cpp | // Accepted
using namespace std;
#include <algorithm>
#include <iostream>
#include <iterator>
#include <numeric>
#include <sstream>
#include <fstream>
#include <cassert>
#include <climits>
#include <cstdlib>
#include <cstring>
#include <string>
#include <cstdio>
#include <vector>
#include <cmath>
#include <queue>
#incl... | ALGO | 0.999941 | 4.563426 |
197382e1-200c-47d6-bcef-ca953889c85f | Brnn043/2110211-Intro-Data-Structure | something Q2/85 Car Brake/try_this_problem.cpp | #include <bits/stdc++.h>
using namespace std;
int n,m,k;
vector<pair<int,int>> v;
set<pair<int,int>> s;
map<int,int> mp;
int main() {
ios_base::sync_with_stdio(0); cin.tie(0);
cin>>n>>m>>k;
for(int i=0;i<n;i++) {
int t,d;
cin>>t>>d;
v.push_back({t,d});
}
sort(v.begin(),v.en... | ALGO | 0.999894 | 3.601386 |
71f02351-0251-4244-874e-1faf63ee1715 | corelab-src/DuroHLS-llvm | llvm/lib/Transforms/Scalar/ConstantProp.cpp | #include "llvm/ADT/Statistic.h"
#include "llvm/Analysis/ConstantFolding.h"
#include "llvm/Analysis/TargetLibraryInfo.h"
#include "llvm/Transforms/Utils/Local.h"
#include "llvm/IR/Constant.h"
#include "llvm/IR/InstIterator.h"
#include "llvm/IR/Instruction.h"
#include "llvm/Pass.h"
#include "llvm/Transforms/Scalar.h"
#in... | TOOL | 0.967224 | 7.8399 |
2c67cd8c-2c4d-44e7-888f-27ab6fe4925a | rainboyOJ/problems | other_oj/noiopenjudge/ch0107/35/solutions/rainboy.cpp | /*-----------------
* author: Rainboy
* email: <EMAIL>
* time: 2019年 07月 22日 星期一 12:24:19 GMT
* problem: luogu-P1098
*----------------*/
#include <bits/stdc++.h>
using namespace std;
int p1,p2,p3;
char str[1000];
char tmp[500];
int idx = 0;
int main(){
scanf("%d%d%d",&p1,&p2,&p3);
scanf("%s",str+1);
... | ALGO | 0.999973 | 3.746447 |
d92f9cb3-e59a-4f06-80be-cccbdcca558b | zzm99/Algorithm-Training | 图/332. 重新安排行程——Hierholzer 欧拉路径算法.cpp | // 找欧拉路径 Hierholzer 算法
class Solution {
public:
unordered_map<string, priority_queue<string, vector<string>, std::greater<string>>> vec;
vector<string> stk;
void dfs(const string& curr) {
while (vec.count(curr) && vec[curr].size() > 0) {
string tmp = vec[curr].top();
vec[cu... | ALGO | 0.999997 | 6.250287 |
021c91ab-8114-4242-98ea-769d52206c14 | cielavenir/procon | spoj/tyama_spojNHAY_bwt_TLE.cpp | #include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cstdio>
using namespace std;
struct SAComp{
const int h,*g;
SAComp(const int h, const int* g) : h(h), g(g) {}
bool operator()(const int a, const int b){
return a == b ? false : g[a] != g[b] ? g[a] < g[b] : g[a+h] < g[b+h];
}
}... | ALGO | 0.99975 | 3.467127 |
77815315-63e9-432d-b901-710683ab8b72 | SleeptMooN/Railway-Network-Management | Tests/Manager.cpp | #include "Manager.h"
#include <limits>
#include <queue>
#include <iostream>
#include <vector>
#include <unordered_map>
/**
* This function reads the networks.csv file.
* @param networks
*/
void Manager::read_networks(vector<Network> &networks) {
string stationA;
string stationB;
string capacity_str;
... | DATA | 0.926462 | 3.641403 |
e0531a4b-7a84-4797-87f4-8fae32a7984a | SysCV/vis4d_cuda_ops | src/box_iou_rotated/box_iou_rotated_cpu.cpp | template <typename T>
void box_iou_rotated_cpu_kernel(
const at::Tensor& boxes1,
const at::Tensor& boxes2,
at::Tensor& ious) {
auto num_boxes1 = boxes1.size(0);
auto num_boxes2 = boxes2.size(0);
for (int i = 0; i < num_boxes1; i++) {
for (int j = 0; j < num_boxes2; j++) {
ious[i * num_boxes... | ALGO | 0.995174 | 6.789037 |
4b12db04-2e60-4215-b367-571724b970ca | Mr-Phoebe/ACM-ICPC | 比赛源码/2016 Multi-University Training Contest 07/G.cpp | #include <cstdio>
#include <cassert>
#include <vector>
#include <algorithm>
using namespace std;
typedef long long lli;
const int N = 1000 + 10;
const int M = 1000 + 10;
lli f[N][M];
int cnt[N][M], bst[N][M];
vector<int> V[N], E[N], T[N];
int A[N], ans[N];
lli res;
int n, m, s;
void dfs1(int u, int p)
{
int v, i,... | ALGO | 0.999905 | 3.810097 |
a50cf54b-9b05-4e35-ab11-b1b0e54776da | ALPSim/ALPS | tool/archive_index.cpp | /* $Id$ */
#include <alps/config.h>
#include <fstream>
#include <string>
#include <list>
#include <iostream>
#include <algorithm>
#include <iomanip>
#include <boost/lexical_cast.hpp>
#include "archive_index.hpp"
#include "archive_node.hpp"
#include "archive_xml.hpp"
#include <alps/parapack/parapack.h>
#ifdef USEP... | TOOL | 0.877279 | 3.581364 |
b349e9ae-b2b0-4012-8d99-9a0301958492 | Harshvardhan-Patil-264/DSA | Arrays/commonElements.cpp | #include <bits/stdc++.h>
using namespace std;
vector <int> resultarr(vector <int> &arr1, vector <int> &arr2){
sort(arr1.begin(), arr1.end());
sort(arr2.begin(), arr2.end());
vector <int> result;
int i = 0, j = 0;
while(i < arr1.size() && j < arr2.size()){
if(arr1[i] == arr2[j]){
result.push_back(arr1[i]);... | ALGO | 0.999964 | 4.533452 |
413e3329-aa7e-4d87-9d1b-60a853e0850f | HarshMahalwar/C-Learning | binary_search/powxn.cpp | #include <bits/stdc++.h>
#define ll long long int
#define qw priority_queue<int>
#define qwd priority_queue<int, vector<int>, greater<int>>
#define pp pair<int, int>
#define func \
ios_base::sync_with_stdio(false); \
cin.tie(NULL);
#define test \
int t; \
cin >> t; \
wh... | ALGO | 0.999986 | 5.253009 |
9c9f34ec-d6b6-4bb9-a896-990c620d11ea | JinHyeokOh01/OOP | lesson 8/8-8_swap_with_reference.cpp | #include <iostream>
using namespace std;
void swap(int& x, int& y);
int main() {
int num1 = 5;
int num2 = 10;
cout << " num1 " << num1 << endl;
cout << " num2 " << num2 << endl;
swap(num1, num2);
cout << "ٲ num1 " << num1 << endl;
cout << "ٲ num2 " << num2 << endl;
return 0;
}
//μ const ̸ μ ٲ.
void ... | ALGO | 0.996888 | 5.138138 |
48f48e37-9d77-40e9-8060-2b52287e41ab | timroty/HammingCode | src/file.cpp | #include <fstream>
#include <vector>
#include <iostream>
#include "include/constants.hpp"
#include "include/file.hpp"
using namespace std;
namespace File {
vector<int> read(char* inputFilePath) {
vector<int> values;
ifstream inputFile(inputFilePath);
if (!inputFile.is_open()) {
cerr << "Error ... | TOOL | 0.855531 | 4.791461 |
ade0b515-04f4-400c-88be-a1f5d6277ea0 | kailasheia/bloc-app | windows/runner/utils.cpp | #include "utils.h"
#include <flutter_windows.h>
#include <io.h>
#include <stdio.h>
#include <windows.h>
#include <iostream>
void CreateAndAttachConsole() {
if (::AllocConsole()) {
FILE *unused;
if (freopen_s(&unused, "CONOUT$", "w", stdout)) {
_dup2(_fileno(stdout), 1);
}
if (freopen_s(&unuse... | TOOL | 0.998859 | 6.785645 |
8ccb9410-0a6f-444f-9ce3-c82fbf371fcf | stillbreeze/Online-Stereo-Calibration | gtsam/3rdparty/Eigen/bench/quat_slerp.cpp | #include <iostream>
#include <Eigen/Geometry>
#include <bench/BenchTimer.h>
using namespace Eigen;
using namespace std;
template<typename Q>
EIGEN_DONT_INLINE Q nlerp(const Q& a, const Q& b, typename Q::Scalar t)
{
return Q((a.coeffs() * (1.0-t) + b.coeffs() * t).normalized());
}
template<typename Q>
EIGEN_DONT_INL... | ALGO | 0.996792 | 6.251058 |
e7e75d7a-dd17-449c-8c71-83c1e5551e29 | Nyatl/acm-archive | snws 2018/round 2/b_rayker.cpp | #define _CRT_SECURE_NO_DEPRECATE
#include <string>
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <queue>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <ioman... | ALGO | 0.999982 | 3.498735 |
311c8ecc-e529-41f2-af83-68a2d8e5393e | ChaomengOrion/CompetitiveSave | Codeforces/Codeforces Round 968 (Div. 2)/C_Turtle_and_Good_Pairs copy.cpp | #include <bits/stdc++.h>
using i64 = long long;
#define cin std::cin
#define cout std::cout
#define endl std::endl
#define DEBUG(n) cout << "DEBUG: " << n << endl;
int count = 0;
void solve()
{
int n;
std::string s;
cin >> n;
std::vector<char> strs(n);
std::string ans = "";
char last = 0;
... | ALGO | 0.999968 | 5.545126 |
5b10d0e8-fbd9-498c-86e1-f7a8330cc18f | matriiix67/cpp-primer | ch05/exercise5.21.cpp | #include <iostream>
using std::cin; using std::cout; using std::endl;
#include <string>
using std::string;
int main()
{
string curr, prev;
bool no_twice = true;
while (cin >> curr)
{
if (isupper(curr[0]) && prev == curr)
{
cout << curr << ": occurs twice in succession." << e... | ALGO | 0.999798 | 5.056392 |
41419095-f3f7-4277-b6fb-359e76ebcc2d | jgreen01/king-tree-table | treemap.cpp | #include "treemap.h"
#include <QList>
#include <QString>
#include <QRect>
#include <QDebug>
#include <QPainter>
#include <QPen>
#include <QBrush>
#include <blocks.h>
treemap::treemap(QWidget *parent, double width_in,
double height_in, QList<blocks> &list) :
QWidget(parent){
winWidth = width_... | TOOL | 0.903482 | 4.714386 |
536d3535-bc67-46a6-a0ef-a7fff903ce93 | Mafiadoener36/NekoX-final-750-noHistory | TMessagesProj/jni/third_party/openh264/src/codec/encoder/core/src/svc_mode_decision.cpp | #include "mv_pred.h"
#include "ls_defines.h"
#include "svc_base_layer_md.h"
#include "svc_mode_decision.h"
namespace WelsEnc {
//////////////
// MD for enhancement layers
//////////////
void WelsMdSpatialelInterMbIlfmdNoilp (sWelsEncCtx* pEncCtx, SWelsMD* pWelsMd, SSlice* pSlice,
... | ALGO | 0.999657 | 5.507785 |
b0848269-034f-411d-8517-9aed224a71ff | yangfut/Leetcode | c++/754_Reach-a-Number.cpp | class Solution {
public:
int reachNumber(int target) {
int tar = abs(target), sum = 0;
for(int i = 1; i <= (2*tar); ++i){
sum += i;
if(sum >= tar && (sum-tar) % 2 == 0) return i;
}
// should never be here
return -1;
}
}; | ALGO | 0.999976 | 5.615827 |
d14efa6d-a5cb-4510-9c0e-a3baa4b1cc23 | MeowBoy326/FRIES | FRIES_core/src/llvm-project/mlir/lib/Dialect/Linalg/Transforms/Vectorization.cpp | #include "mlir/Analysis/SliceAnalysis.h"
#include "mlir/Dialect/Affine/Analysis/LoopAnalysis.h"
#include "mlir/Dialect/Affine/IR/AffineOps.h"
#include "mlir/Dialect/Arithmetic/IR/Arithmetic.h"
#include "mlir/Dialect/Func/IR/FuncOps.h"
#include "mlir/Dialect/Linalg/Analysis/DependenceAnalysis.h"
#include "mlir/Dialect/L... | ALGO | 0.961287 | 6.832681 |
5b15ec6f-2d0b-4e3c-959a-5dc10425433b | gunesims/leetcode-solutions | 1866-restore-the-array-from-adjacent-pairs/restore-the-array-from-adjacent-pairs.cpp | class Solution {
public:
vector<int> restoreArray(vector<vector<int>>& adjacentPairs) {
unordered_map<int, vector<int>> mp ;
for(auto it : adjacentPairs){
mp[it[0]].push_back(it[1]) ;
mp[it[1]].push_back(it[0]) ;
}
vector<int> ans ;
for(auto i :mp){
... | ALGO | 0.999983 | 5.682415 |
3614e6ec-8635-44e8-9772-8de082ef5f7f | PerfectLifeG/Algorithm-Competition | PracticeMakesPerfect/2023Summer/7.16_/a.cpp | #include<bits/stdc++.h>
using namespace std;
// #define int long long
#define all(x) x.begin(),x.end()
#define no cout<<"No"<<endl
#define yes cout<<"Yes"<<endl
typedef pair<int,int> PII;
const int N=200010;
const int mod=998244353;
const int INF=0x3f3f3f3f;
void solve()
{
int n,m,k;
cin>>n>>m>>k;
int a,b;c... | ALGO | 0.999917 | 4.475781 |
f03951b5-4650-46da-b281-19ad52801046 | Lyle-Lee/CodeWorks | leetcode/993_cousins-in-binary-tree/lc993(DFS).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.99999 | 5.926543 |
99b6c0af-93d2-4e77-ad28-d5c40f04aa09 | ankit-0369/Solving-DSA-Problems | 0011-container-with-most-water/0011-container-with-most-water.cpp | class Solution {
public:
int maxArea(vector<int>& height) {
int n= height.size();
int max= INT_MIN;
// for(int i=0; i+1<n; i++){ O(n^2)
// for(int j=i+1; j<n; j++){
// int h= (height[i]>height[j]) ? height[j] : height[i];
// int a= h* ... | ALGO | 0.999975 | 6.332822 |
f26e00fa-f201-434b-884a-8bc5f1c1165f | Xushi8/Code | 2024/July/2023niuke3/gen.cpp | #include <algorithm>
#include <iostream>
#include <random>
#include <fstream>
#include <array>
#include <bitset>
using namespace std;
using i64 = int64_t;
int main()
{
mt19937 rng(random_device{}());
uniform_int_distribution<int64_t> uni(1, int64_t(9e18));
constexpr int N = 10000000;
ofstream ofs("/h... | TOOL | 0.903141 | 3.435107 |
6fae1123-3434-453c-a445-3d814a456cc3 | dosomethingbyme/408 | 数据结构/严版教材/数据结构第2版-书中算法(C语言版)/第8章/8.12.cpp | //㷨8.12
#include <iostream.h>
#include <string.h>
#include <stdlib.h>
#include <math.h>
#define MAXNUM_KEY 8 //ؼֵ
#define RADIX 10 //ؼֻʱʮĻ
#define MAX_SPACE 10000
typedef char KeysType; //ؼΪַ
typedef int InfoType; //
typedef struct
{
KeysType keys[MAXNUM_KEY]; ... | ALGO | 0.999905 | 4.416905 |
8c726439-3aa7-4c4c-868f-d904cda1e5cd | SahooAbhijeet/DATASTRUCTURES_AND_ALGORITHMS | src/LinkedList/intersectionOfTwoLL.cpp | #include<bits/stdc++.h>
using namespace std;
class Node {
public:
int data;
Node* next;
Node(int data1, Node* next1 ) {
data = data1;
next = next1;
}
Node(int data1) {
data = data1;
next = NULL;
}
};
void insertNode(Node*& head, int val) {
Node* newNode = n... | ALGO | 0.999912 | 4.980149 |
9730b7a5-7200-4690-bd1b-726365ea7e99 | Tudat/tudat | src/astro/mission_segments/improvedInversePolynomialWall.cpp | #include "tudat/basics/utilityMacros.h"
#include "tudat/astro/mission_segments/improvedInversePolynomialWall.h"
namespace tudat
{
namespace mission_segments
{
//! Evaluate the function value for a given (in-plane) azimuthal angle.
double ImprovedInversePolynomialWall::evaluate( const double anAzimuthalAngle )
{
... | ALGO | 0.999517 | 7.263069 |
bd0bcdf7-ed70-45e8-94bc-f305628c5368 | omerjerk/code | shpath.cpp | #include <stdio.h>
#include <stdlib.h>
#include <limits.h>
#include <iostream>
#include <queue>
using namespace std;
inline void scan(int *a) {
register char c=0;
while (c < 33)
c = getchar();
*a = 0;
while (c > 33) {
*a = *a * 10 + c - '0';
c = getchar();
}
}
static void p... | ALGO | 0.999726 | 5.162556 |
905f1af3-000a-41fa-826c-bb2a657e16ea | bisc67/Tribes | xCore/Entropy/D3DEngine/d3deng_draw.cpp | ///////////////////////////////////////////////////////////////////////////
// INCLUDES
///////////////////////////////////////////////////////////////////////////
#include "e_Engine.hpp"
///////////////////////////////////////////////////////////////////////////
// DEFINES
///////////////////////////////////////////... | TOOL | 0.921335 | 4.527512 |
970c64b2-29c4-42db-b15c-45704974a7f1 | DeyaneiraAltamiranoCordero/FirstListPractice | PracticeList/PracticeList.cpp | #include <iostream>
class Dog {
private:
int age;
std::string name;
bool hasOwner;
std::string breed;
public:
Dog(int _age, const std::string& _name, bool _hasOwner, const std::string& _breed) :
age(_age), name(_name), hasOwner(_hasOwner), breed(_breed) {}
bool getHasOwner() {
... | TOOL | 0.988803 | 6.025024 |
57a8d096-08a2-4ae9-9c20-80b537fce5a8 | jacksontcollier/topcoder-srm | srm-672/div-2/500/SubstitutionCipher.cpp | #include <iostream>
#include <string>
#include <vector>
#include <sstream>
#include <set>
#include <map>
#include <list>
#include <queue>
#include <algorithm>
#include <cmath>
using namespace std;
class SubstitutionCipher {
public:
string decode(string a, string b, string y);
};
string SubstitutionCiph... | ALGO | 0.999916 | 4.42707 |
d16f7874-6ff7-4cea-8952-549dc6090841 | sarvex/leetcode-ruby | solution/2400-2499/2408.Design SQL/Solution.cpp | class SQL {
public:
unordered_map<string, vector<vector<string>>> tables;
SQL(vector<string>& names, vector<int>& columns) {
}
void insertRow(string name, vector<string> row) {
tables[name].push_back(row);
}
void deleteRow(string name, int rowId) {
}
string selectCell(string n... | TOOL | 0.913689 | 6.284689 |
100e1743-f73e-43ea-bd60-2105c1f4757e | xiaohuihuigh/cpp | acm/cf/372A.cpp | #include<bits/stdc++.h>
using namespace std;
int x[600000];
int main(){
ios::sync_with_stdio(false);
int n;
while(cin>>n){
ios::sync_with_stdio(false);
for (int i = 0;i<n;i++){
cin>>x[i];
}
sort(x,x+n);
int ans = n;
int pt = n/2;
for(int i = 0... | ALGO | 0.999157 | 4.029409 |
9da43a28-06d8-463d-af3b-acec8a28ef6a | Wole308/graphtinker | graphtinker/commonutility.cpp | #include <string.h>
#include "graphtinker.h"
unsigned int graphtinker::max(unsigned int A, unsigned int B){
if(A>B) { return A; }
else { return B; }
return A; //should never get here
} | ALGO | 0.950239 | 3.153498 |
421a2d65-64e0-4e36-afaa-fc15660b0b34 | rotyan/data_structure | review/algorithm2_2.cpp | //【完成版】单链表的查找、插入、删除【教材版本,主要是增删查的函数返回值为node】
#include <cstdio>
#define NUM 5 //新建的单链表节点个数
struct node{
int data;
node* next;
};
//array为初始化时输入数据域所在数组
node* Create(int array[]) {
node *pre, *p, *head;
head = new node;
//头节点root没有数据域
head->next = NULL;
pre = head;
for (int i = 0; i < NU... | ALGO | 0.999972 | 3.874457 |
2a98c6a8-376d-4b35-8b56-dc26194e0cda | krishnak2002/DSA_CPP | SinglyLinkedList/Size.cpp | #include<iostream>
using namespace std;
class Node{
public:
int val;
Node* next;
Node(int val){
this->val = val;
this->next = NULL;
}
};
void display(Node* head){
Node* temp = head;
while(temp!=NULL){
cout<<temp->val<< " ";
temp = temp->next;
}
cout<<en... | ALGO | 0.998811 | 4.335019 |
03e7ff0e-8885-4674-881d-c05a3141043d | gshanemiller/kvbench | benchmark/thirdparty/folly/experimental/settings/Settings.cpp | #include <folly/experimental/settings/Settings.h>
#include <map>
#include <folly/Synchronized.h>
namespace folly {
namespace settings {
namespace detail {
namespace {
using SettingsMap = std::map<std::string, SettingCoreBase*>;
Synchronized<SettingsMap>& settingsMap() {
static Indestructible<Synchronized<SettingsM... | TOOL | 0.918452 | 7.830606 |
9c12a98b-f32a-47a3-9eeb-48d28031aa9f | Shohan-Rahman/Phitron | C++ for DS/Practice day - 2 -w1/W_Mathematical_Expression.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
int a,b,c;
char s,q;
cin >> a >> s >> b >> q >> c;
if(s=='+')
{
if(a+b==c)
{
cout << "Yes" << endl;
}
else
{
int ans=a+b;
cout << ans;
}
}
else if(s=... | ALGO | 0.99997 | 3.674716 |
f20be962-53b8-49c5-8f79-8fcf5748ecc0 | Amber-MD/cpptraj | src/Analysis_CalcDiffusion.cpp | #include "Analysis_CalcDiffusion.h"
#include "CpptrajStdio.h"
#include "DataSet_double.h"
#include "ProgressBar.h"
#include "OnlineVarT.h"
#include <algorithm> // std::min, std::copy
#include <cmath> // sqrt
#ifdef _OPENMP
# include <omp.h>
#endif
#ifdef MPI
#include "DataSet_Coords_CRD.h"
#endif
/** CONSTRUCTOR */
An... | ALGO | 0.998997 | 5.590427 |
739b52dc-1570-4ac6-85a3-454b3cdf6138 | ishandutta2007/codeforces | kostia244/normal/827/B.cpp | #include<bits/stdc++.h>
#define all(x) x.begin(), x.end()
using namespace std;
using ll = long long;
const int maxn = 1<<21, mod = 1e9 + 7;
int n, k, d[maxn];
vector<array<int, 2>> edges;
signed main() {
cin.tie(0)->sync_with_stdio(0);
cin >> n >> k;
queue<int> lft;
int fi = 0, se = 0;
lft.push(1);
int sz = 1;
w... | ALGO | 0.999993 | 3.901582 |
aaf27ad4-f6d7-4102-b9d7-0206aa9d0d6e | Upsurge-11/DSA | Leetcode/CPP/permutationInString.cpp | #include <bits/stdc++.h>
using namespace std;
bool checkInclusion(string s1, string s2)
{
int n1 = s1.size();
int n2 = s2.size();
if (n1 > n2)
return false;
vector<int> count1(26, 0);
vector<int> count2(26, 0);
for (int i = 0; i < n1; i++)
{
count1[s1[i] - 'a']++;
count2[s2[i] - 'a']++;
}
... | ALGO | 0.999987 | 4.955855 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.