uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
75caea9b-1494-4b26-8437-ae3f59da8c31 | cioro/LSC-Mini-Project | Euler.cpp | #include"Euler.hpp"
#include<vector>
#include<cmath>
#include<iostream>
Euler::W_state::W_state() : rho(0), u(0), P(0) {}
Euler::W_state::W_state(double rho_arg, double u_arg, double P_arg) : rho(rho_arg), u(u_arg), P(P_arg) {}
void Euler::W_state::print()const {
std::cout << " rho\t " << rho << "\t u \t " << u <<... | ALGO | 0.997179 | 3.688571 |
07a6c817-e548-462c-9edf-22313bb097a5 | jji0717/ZQProject | Telewest/SNMPSvcs/LogTrapper/ini.cpp |
//ini.cpp
#ifdef _UNICODE
#define DEF_UNICODE
#undef _UNICODE
#undef UNICODE
#endif//_UNICODE
#include "ini.h"
#include <assert.h>
void GetStringList(const char* strStringList, size_t zLen, std::vector<std::string>& arrLists)
{
assert(strStringList);
std::string strGet;
const char* strNext = strStringList;
siz... | TOOL | 0.925449 | 5.201121 |
bcdb66de-6234-42e3-aea5-85b0ae439dca | raincross7/code-similarity | codes/train_code/problem246/problem246_248.cpp | #include<iostream>
//#include<vector>
using namespace std;
int main(){
long long n,T;
cin >> n >> T;
long long t[200000],ans = 0;
for(int i = 0;i < n;i++){
cin >> t[i];
if(i > 0){
ans += min(T,t[i] - t[i - 1]);
}
}
cout << ans + T << endl;
return 0;
} | ALGO | 0.999962 | 3.151015 |
937ebd35-d704-443d-9cb9-a623d4585ebb | ErickDev1218/Estrutura-de-dados-avancada | Atividades moodle/[BinTree] Soma das chaves, chave mínima e outras operações/main.cpp | #include <iostream>
#include <string>
#include "Tree.h"
using namespace std;
int main()
{
string line;
getline(cin, line);
Tree bt(line);
cout << bt.min_key() << " " << bt.sum_keys() << endl;
cout << bt.total_internal_nodes() << " " << bt.um_filho() << endl;
return 0;
} | ALGO | 0.964896 | 4.030434 |
ffa98f61-2ff9-4342-aaae-216e032b265d | sameer2800/mohit-fu | docs/dolfin/1.1.0/cpp/source/demo/undocumented/elasticity/cpp/main.cpp | #include <dolfin.h>
#include "Elasticity.h"
using namespace dolfin;
int main()
{
// Dirichlet boundary condition for clamp at left end
class Clamp : public Expression
{
public:
Clamp() : Expression(3) {}
void eval(Array<double>& values, const Array<double>& x) const
{
values[0] = 0.0;
... | ALGO | 0.990288 | 5.309593 |
4eb012c0-5f40-4f07-bda5-4e8c2c0ba7ef | GiorgosTsal/Vantage-Point-Tree | src/vptree_openmp.cpp | #include <iostream>
#include <cstdlib>
#include <tgmath.h>
#include <cmath>
#include <climits>
#include <iomanip>
#include "../inc/vptree.h"
#define LIMIT 100000
using namespace std;
//constructor
vptree::vptree(int x) {
//create-set tree ID
this->x = x;
}
//destructor
vptree::~vptree(){
}
//get my tree ID
in... | ALGO | 0.999912 | 4.091077 |
f1a52349-894e-4edd-b6b3-4369d1bc0aa0 | youmorry/atcoder | abc226/abc226_b/main.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
int main() {
int n; cin >> n;
set<vector<in... | ALGO | 0.998572 | 3.808479 |
0c78531d-2fb0-4585-9c80-7e86ea3e0a02 | nahid515023/problams-solve-online-platform | B_Make_Equal.cpp | #include <bits/stdc++.h>
using namespace std;
#define int long long
void solve()
{
int n;
cin >> n;
vector<int> v(n);
int tot = 0;
for (int &x : v)
{
cin >> x;
tot += x;
}
int x = tot / n;
if (tot % n != 0)
{
cout << "NO" << endl;
return;
}
... | ALGO | 0.999933 | 4.779858 |
15b2f307-f469-49a9-ab5b-0f55510aa9e7 | ishandutta2007/codeforces | krk/normal/3/D.cpp | #include <iostream>
#include <cstdio>
#include <queue>
#include <algorithm>
using namespace std;
typedef long long ll;
const ll Inf = 50000000001LL;
const int Maxn = 50005;
string s;
priority_queue <pair <ll, int> > Q;
bool has[Maxn];
int nxt[Maxn];
ll res;
bool getOnes(int v, int col)
{
if (col == 2) return t... | ALGO | 0.999778 | 3.669811 |
0f95ea2c-5ea2-417f-97bd-7c64d3ddda7b | FoxitFun/data-structures-and-algorithms | Cpp_ds_and_algorithms/Search_algorithms/binary_search_vector.cpp | #include <iostream>
#include <vector>
using namespace std;
int binarySearch(vector<int> &numbers, int left, int right, int to_find)
{
int mid = (left + right) / 2;
// Przypadek brzegowy #1 - znaleziono poszukiwany element:
if (to_find == numbers.at(mid))
{
return mid;
}
// Przypadek br... | ALGO | 0.999856 | 5.657322 |
4c25d5c8-4b65-4c15-8753-a1b162c5ffcc | devgoel2004/codeforces-questions | Type B/B_EffectiveApproach.cpp | #include<bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
#define endl '\n'
#define F first
#define S second
#define range(a,i,n) for(int i=a;i<n;i++)
#define M 10e7
#define e end
#define b begin
bool isLower(char s){
if(s>=97 && s<=122){
return true;
}return false;
}
bool i... | ALGO | 0.999905 | 3.757224 |
aab85a48-8aff-436a-bc2e-67074afc8346 | BhuwanSingh/DailySolvesLeetcode | 0033-search-in-rotated-sorted-array/0033-search-in-rotated-sorted-array.cpp | class Solution {
public:
int search(vector<int>& nums, int target) {
int low = 0 , high = nums.size() - 1;
while( low <= high ){
int mid = (low + high) / 2;
if(nums[mid] == target){
return mid;
}
if(nums[low] <= nums[mid]){
... | ALGO | 0.999966 | 6.182415 |
1171ab05-f5d5-4217-a7a0-d078bb413b08 | firoj04/CSE-ASSIGNMENT-2 | 10_inline_functions.cpp | #include<bits/stdc++.h>
using namespace std;
inline int cube(int a){//initialize inline function
int area = a*a*a; // 5*5*5 = 125
return area; // returning the total area to driver code.
}
int main(){
int area = 5;
cout<<"The cube of the area is: "<<cube(area)<<endl;// call the inline function and pas... | TOOL | 0.927143 | 4.242665 |
6b8187f9-783d-44c7-afba-ecccdff29e54 | Vishal-Gande/Code-for-fun | lc_153.cpp | //lc 153
// Suppose an array of length n sorted in ascending order is rotated between 1 and n times. For example, the array nums = [0,1,2,4,5,6,7] might become:
// [4,5,6,7,0,1,2] if it was rotated 4 times.
// [0,1,2,4,5,6,7] if it was rotated 7 times.
// Notice that rotating an array [a[0], a[1], a[2], ..., a[n-1]] 1... | ALGO | 0.999997 | 6.269894 |
d01314cf-e27e-4766-a926-d926586de45e | questautomata/topovert | autoremesher/thirdparty/libigl/include/igl/loop.cpp | #include "loop.h"
#include <igl/adjacency_list.h>
#include <igl/triangle_triangle_adjacency.h>
#include <igl/unique.h>
#include <vector>
template <
typename DerivedF,
typename SType,
typename DerivedNF>
IGL_INLINE void igl::loop(
const int n_verts,
const Eigen::PlainObjectBase<DerivedF> & F,
Eigen::Spars... | ALGO | 0.998477 | 5.895925 |
45ef18ea-f41c-4fd9-82dd-a8ad5d5f8091 | getoxdev/SDE_Interview_Problems | Day 20-26/Day 23/Q2.cpp | #include<bits/stdc++.h>
#define boost ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define ll long long
#define deb(x) cout << #x << "=" << x << endl
using namespace std;
void dfsUtil(vector<int> g[],int v,bool visit[])
{
visit[v]=true;
cout<<v<<" ";
for(auto it=g[v].begin();it!=g[v].end();it+... | ALGO | 0.999668 | 4.344146 |
f1e648c5-17c1-45ab-9246-3a645c2b0542 | gyqljs/ACM_template | 计算几何/凸包.cpp | #include <bits/stdc++.h>
template<typename T>
using poi = std::pair<T, T>;
#define x first
#define y second
// 对于某个凸包,凸包上一定存在一点,使得凸包上的边从这一点连出的边按照顺时针或者逆时针开始极角有序
// 大于0表示c 在向量 ab 的逆时针方向
template<typename T>
T cross(poi<T> a, poi<T> b, poi<T> c) { // 叉积
return (b.x - a.x) * (c.y - a.y) - (b.y - a.y) * (c.x - a.x);
}
... | ALGO | 0.99995 | 4.723919 |
8f833fce-245d-419a-a4cc-f74cc1a7a340 | Ivan-Krul/RouteMaker | RouteMaker/RouteMaker.cpp | #include <iostream>
#include <string>
#include <fstream>
#include <vector>
#include <iomanip>
#include <unordered_map>
#include <algorithm>
struct node {
std::vector<size_t> index_to;
std::vector<float> cost_to;
std::string name;
void push(size_t index, float cost) {
index_to.push_back(index);... | ALGO | 0.999572 | 4.797234 |
7f9398ec-879e-4019-8038-bd3b2faf4634 | vibraphone/VegaFEM-cmake | src/libintegratorDense/implicitBackwardEulerDense.cpp | #include <stdio.h>
#include <string.h>
#include "lapack-headers.h"
#include "performanceCounter.h"
#include "implicitBackwardEulerDense.h"
#include "IPIVC.h"
ImplicitBackwardEulerDense::ImplicitBackwardEulerDense(int r, double timestep, double * massMatrix, ReducedForceModel * reducedForceModel, solverType solver, dou... | ALGO | 0.999673 | 6.392863 |
0cfc70ab-f61e-43c7-93fe-c0a7dcacba24 | smallfishzzz/apitrace-gui | thirdparty/mhook/mhook-lib/mhook.cpp | #include <windows.h>
#include <tlhelp32.h>
#include <stdio.h>
#include "mhook.h"
#include "../disasm-lib/disasm.h"
#ifndef max
#define max(a,b) (((a) > (b)) ? (a) : (b))
#endif
//=========================================================================
#ifndef cntof
#define cntof(a) (sizeof(a)/sizeof(a[0]))
#endif
/... | TOOL | 0.949329 | 4.340631 |
1ece9078-dfa4-4c76-afe6-7b56585a464e | dhruv4115/CodeForces_Solutions | Round 1003/B.cpp | #include <iostream>
using namespace std;
int main() {
int t;
cin >> t;
while (t--) {
string s;
cin >> s;
int n = s.size();
bool hasPair = false;
for (int i = 0; i < n - 1; i++) {
if (s[i] == s[i + 1]) {
hasPair = true;
bre... | ALGO | 0.99985 | 4.906203 |
f23233c1-8f36-4084-a84a-38f08ce70073 | ishandutta2007/codeforces | ljc1301/normal/1326/B.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
int n;
long long pre=0,x;
scanf("%d",&n);
while(n--)
{
scanf("%lld",&x);
printf("%lld ",pre+x);
pre=max(pre,pre+x);
}
printf("\n");
return 0;
} | ALGO | 0.999845 | 3.379742 |
33e4f924-78ea-49fd-9777-5debf3cd96be | seung-in-Yoo/codetree-TILs | 240914/비교에 따른 연산/operation-based-on-comparison.cpp | #include <iostream>
using namespace std;
int main() {
int a;
int b;
cin >> a >> b;
if (a > b) {
cout << a*b << endl;
}
else {
cout << b/a << endl;
}
return 0;
} | ALGO | 0.993287 | 3.280366 |
f3c6b04c-e103-4f19-8802-975fd2f4c537 | matcha-bingsu/ALGORITHM | SWEA/D3/1208. [S/W 문제해결 기본] 1일차 - Flatten/[S/W 문제해결 기본] 1일차 - Flatten.cpp | #include <bits/stdc++.h>
using namespace std;
int calculate(int times, int *arr)
{
times++;
while (times--)
{
int smallest_idx, tallest_idx;
int mx = 0;
int mn = 101;
for (int i = 0; i < 100; i++)
{
if (arr[i] < mn)
{
small... | ALGO | 0.999729 | 3.741744 |
b2e07785-cdaf-46f2-ae01-a217f7f8bdf7 | zodiaaccc/task44main | task01/main.cpp | #include <iostream>
#include <string>
#include <cmath>
using namespace std;
void initializeArray(int* arr, int size, int minVal, int maxVal) {
for (int i = 0; i < size; i++) {
arr[i] = rand() % (maxVal - minVal + 1) + minVal;
}
}
string arrayToString(int* arr, int size) {
string result = " ";
... | ALGO | 0.998568 | 4.986527 |
cf6d8662-d08b-41b4-9b45-77e17fa1c4ab | DeCalvin2006/Codeforces | Contests/545/c/c.cpp | #include <bits/stdc++.h>
using namespace std;
int read() {
int x = 0, f = 1;
char c = getchar();
while (c > '9' || c < '0') {
if (c == '-')
f = -1;
c = getchar();
}
while (c >= '0' && c <= '9') {
x = (x << 1) + (x << 3) + c - '0';
c = getchar();
}
return x * f;
}
const int N = 1E5 + ... | ALGO | 0.99998 | 3.553376 |
1320cf3e-e8d4-4495-a380-3629a2df229e | PalDaps/Leetcode_way | Leetcode_2_TBS/source.cpp | #include <iostream>
/*
25.06.2025
10:31
: . , .
.
: . . , , .
*/
struct ListNode
{
int val;
ListNode* next;
ListNode() : val(0), next(nullptr)
{
}
ListNode(int x) : val(x), next(nullptr)
{
}
ListNode(int x, ListNode* next) : val(x), nex... | ALGO | 0.999605 | 5.949073 |
de281ed8-4ad3-4269-9dd8-55e3c99fe3e1 | DJMAXJOAA/TASK_C2 | TASK_C2/230531 두점.cpp | #include <stdlib.h>
#include <iostream>
#include <cstring>
#include <string>
#include <cmath>
using namespace std;
int main()
{
double x1, y1;
double x2, y2;
cout << "x1, y1 ǥ : ";
cin >> x1 >> y1;
cout << "x2, y2 ǥ : ";
cin >> x2 >> y2;
double distance;
distance = sqrt((x2 - x1) * (x2 - x1) + (y2 - y1) *... | ALGO | 0.991715 | 3.7003 |
d225787c-a393-40f8-9f2e-a85f04e53b86 | BVService/bvservice-openfluid-wares | stat.upper.rs/StatUpperRSSim.cpp | /**
\file StatUpperRSSim.cpp
*/
/*
<sim2doc>
</sim2doc>
*/
#include <openfluid/ware/PluggableSimulator.hpp>
DECLARE_SIMULATOR_PLUGIN
// =====================================================================
// =====================================================================
BEGIN_SIMULATOR_SIGNATURE("stat... | ALGO | 0.903953 | 6.887499 |
2749ab0b-b728-491c-bbc9-5ac57dbd8a26 | ishandutta2007/codeforces | hld67890/normal/1205/B.cpp | #include <stdio.h>
#include <algorithm>
#include <map>
#include <queue>
using namespace std;
//long long
struct node {
long long v;
node *next;
} pool[1200000] , *g[120000];
long long top;
long long n;
long long a[120000];
long long ex[120000] , tot;
map < pair<long long,long long> , long long > ma;
queue < long lo... | ALGO | 0.999911 | 3.761496 |
853a376a-7187-46b7-b1dd-9dc09cddef82 | Next-Gen-UI/Hacktober | Leetcode/0353. Design Snake Game/0353.cpp | class SnakeGame {
public:
/** Initialize your data structure here.
@param width - screen width
@param height - screen height
@param food - A list of food positions
E.g food = [[1,1], [1,0]] means the first food is positioned at [1,1], the
second is at [1,0]. */
SnakeGame(int width, int hei... | ALGO | 0.999905 | 6.208695 |
c31468d3-6776-4c71-9548-c40e4f539fb0 | ArchanPatel890/CompetitiveProgramming | Leetcode/Problem_650.cpp | #include <iostream>
#include <iomanip>
#include <fstream>
#include <sstream>
#include <cmath>
#include <string>
#include <queue>
#include <stack>
#include <unordered_set>
#include <unordered_map>
#include <map>
#include <vector>
#include <deque>
#include <algorithm>
#include <functional>
using namespace std;
class ... | ALGO | 0.99993 | 5.224708 |
9fe555de-1dad-45d7-b9e0-981df3e877b8 | fr3ak2402/GalaxySlicer | src/slic3r/GUI/CameraUtils.cpp | #include "CameraUtils.hpp"
#include <igl/project.h> // projecting points
#include <igl/unproject.h>
#include "slic3r/GUI/3DScene.hpp" // GLVolume
#include "libslic3r/Geometry/ConvexHull.hpp"
using namespace Slic3r;
using namespace GUI;
Points CameraUtils::project(const Camera & camera,
... | ALGO | 0.96922 | 6.174455 |
601b0af7-dbb0-49ca-80b2-5ce2e763bae0 | AdamMyrick1/cs372 | apps/New folder/Assignment 6 Problem 2.cpp | #include <iostream>
#include <vector>
#include <list>
#include "Graph.h"
#include "AdjacencyListGraph.h"
using namespace std;
template <typename T>
bool isSimpleCycle(Graph<T>& paramGraph, const vector<T>& path) {
if (path.size() < 3)
return false;
if (path.front() != path.back())
return fal... | ALGO | 0.991022 | 5.377277 |
15a2b5e3-8cb5-47d8-a3c0-bff932a41c0c | Gggguns/programmingLearning | c++/text_2024_7_17_day_9_3.cpp | #define _CRT_SECURE_NO_WARNINGS
#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
class Solution {
public:
bool IsContinuous(vector<int>& numbers) {
int countZero = 0, minNum = 100, index = 0;
sort(numbers.begin(), numbers.end());
int size = numbers.size();
... | ALGO | 0.999777 | 4.825623 |
2c2a489d-ea6f-447a-9464-24a4d5b08a5b | KrishnaDath17/Project1 | flutter_application_2/windows/runner/utils.cpp | #include "utils.h"
#include <flutter_windows.h>
#include <io.h>
#include <stdio.h>
#include <windows.h>
#include <iostream>
void CreateAndAttachConsole() {
if (::AllocConsole()) {
FILE *unused;
if (freopen_s(&unused, "CONOUT$", "w", stdout)) {
_dup2(_fileno(stdout), 1);
}
if (freopen_s(&unuse... | TOOL | 0.9985 | 6.76775 |
380e5282-6012-4cb6-aa68-985b6e10ee41 | SKYSCRAPERS1999/CS184-Smoke-Simulation | ext/nanogui/ext/eigen/unsupported/doc/examples/MatrixSinh.cpp | #include <unsupported/Eigen/MatrixFunctions>
#include <iostream>
using namespace Eigen;
int main()
{
MatrixXf A = MatrixXf::Random(3,3);
std::cout << "A = \n" << A << "\n\n";
MatrixXf sinhA = A.sinh();
std::cout << "sinh(A) = \n" << sinhA << "\n\n";
MatrixXf coshA = A.cosh();
std::cout << "cosh(A) = \n"... | ALGO | 0.987924 | 5.890235 |
cfd9f828-68be-4afa-8c1a-9f1a3e6d244c | zeus-iitg/cp-submissions | mos_algorithm_on_trees.cpp | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define pb push_back
#define IOS ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define ll long long
#define gcd(a,b) __gcd((a),(b))
#define lcm(a,b) ((a)*(b))/__gcd((a),(b))
#define vi vector<int>
#define vll v... | ALGO | 0.999972 | 4.370515 |
f17a6775-0607-4ffd-830a-363d6793639a | sarvex/solution-cpp | 1989.maximum_number_of_people_that_can_be_caught_in_tag.cpp | class Solution {
public:
int catchMaximumAmountofPeople(vector<int>& team, int dist) {
int ans = 0;
int n = team.size();
for (int i = 0, j = 0; i < n; ++i) {
if (team[i]) {
while (j < n and (team[j] or i - j > dist)) {
++j;
}
... | ALGO | 0.99996 | 5.44186 |
d8d1e8c0-529b-46f4-a703-dddc82299e57 | Sunny9507/dsa | 2434-design-a-number-container-system/2434-design-a-number-container-system.cpp | class NumberContainers {
public:
//Space : O(n)
unordered_map<int, int> idxToNum;
unordered_map<int, priority_queue<int, vector<int>, greater<int>>> numToIdx;
NumberContainers() {
//do nothing
}
void change(int index, int number) {
idxToNum[index] = number; //O(1)
... | ALGO | 0.999929 | 5.952495 |
302330ad-1e8f-4948-b0d5-91673722fc5c | kkmcd/R_study | DFS(AncientDic).cpp | #include <vector>
#include <cstdio>
#include <algorithm>
using namespace std;
vector<vector<int>> adj;
void makeGraph(const vector<string>& words) {
adj = vector<vector<int>>(26, vector<int>(26, 0)); //ʱ¸ 0 ڸ 26 ִ vector
for (int j = 1; j < words.size(); ++j) {
int i = j - 1, len = min(words[i].size(), words[j... | ALGO | 0.999946 | 4.525679 |
452051df-b5ad-4353-bd3b-54010bfcf475 | pratiiksha3249/practice_que | 8slip_2.cpp | // b) Create a C++ class Person with
// data members Person name, Mobile number, Age, City. Write
// necessary member functions for the following:
// i. Search the mobile number of given person.
// ii. Search the person name of given mobile number.
// iii. Search all person details of given city.
// (Use function overl... | TOOL | 0.995989 | 3.819879 |
43dea73a-9ed7-4bbe-b272-8d05134b80e6 | Denver17/Algorithms_Exercise | 挑战程序设计竞赛/2.4_数据结构/练习2_并查集/348_修复网络.cpp | #include<iostream>
#include<cstdio>
#include<vector>
#include<queue>
#include<stack>
#include<map>
#include<set>
#include<cmath>
#include<stdlib.h>
#include<algorithm>
using namespace std;
const int MAXN = 1000 + 10;
typedef pair<double, double> P;
int N;
double d;
int par[MAXN];
int _rank[MAXN];
vector<bool> isNor... | ALGO | 0.99963 | 4.185538 |
97aa0517-fcfa-4413-ac3c-e12b9161e1bc | C-2023-4-6/8209230520dengjiayi | 4.1.4.cpp | #include<iostream>
#include<string>
using namespace std;
void merge(const int list1[], int size1, const int list2[], int size2, int list3[])
{
int temp;
for (int m = 0; m < size1; m++)
list3[m] = list1[m];
for (int n = 0; n < size2; n++)
list3[size1 + n] = list2[n];
cout << "the merged list is";
for (int a =... | ALGO | 0.999501 | 3.54368 |
a1755af0-f654-481b-9aa9-8fd3031b4794 | alexandraback/datacollection | solutions_5670465267826688_1/C++/GordeevAlex/c.cpp | #include <iostream>
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <string>
#include <cmath>
#include <cstring>
using namespace std;
typedef long long ll;
typedef long double ldb;
#define forab(i, a, b) for(int i = int(a); i < int(b); ++i)
#define forba(i, b, a) for(int i = int(b) - 1; i >= int(a... | ALGO | 0.999922 | 3.459357 |
8b91517e-64ec-457f-8b5e-24d45118686c | saidavanam/DSA_prep | DSA_preparation_notes/sorting_techniques/recursive_bubble_sort.cpp | #include<iostream>
void swap(int* a,int* b)
{
int temp=*a;
*a=*b;
*b=temp;
}
void recursive_bubble_sort(int *arr,int n)
{
if (n == 1) return;
for (int j = 0; j <= n - 2; j++) {
if (arr[j] > arr[j + 1]) {
swap(&arr[j],&arr[j+1]);
}
}
//Range reduced after recu... | ALGO | 0.999935 | 4.9077 |
8227d4ba-61de-4846-bf00-19cc72e51f67 | adityam172003/DSA | C++/DSA/Tree/next_child_connect.cpp | #include<bits/stdc++.h>
using namespace std;
/*
Given a binary tree, connect the nodes that are at the same level.
The structure of the tree Node contains an addition nextRight pointer for this purpose.
Initially, all the nextRight pointers point to garbage values.
Your function should set these pointers to point... | ALGO | 0.999743 | 4.59619 |
a34ba612-7597-4223-a28b-8766f3cd045b | BenGJ10/Leetcode-Tracker-CPP | Stack and Queues/402_Remove_K_Digits.cpp | /*
LeetCode: 402. Remove K Digits
Link: https://leetcode.com/problems/remove-k-digits/
Problem:
Given a string `num` representing a non-negative integer and an integer `k`, remove `k` digits from the number so that the new number is the smallest possible.
## Brute Force Approach:
- Generate all combinations of d... | ALGO | 0.999985 | 7.406369 |
55e2172d-f505-43db-9952-d9233fb25ce9 | alzahfariski/todoflutter | 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 |
06a3316e-35aa-4d2d-a7d3-dec155e430fc | wocantudou/MNN-2.8.1 | tools/train/source/parameters/Distributions.cpp | #include "Distributions.hpp"
#include <cmath>
namespace MNN {
namespace Train {
void Distributions::uniform(const int count, const float min, const float max, float *r, std::mt19937 gen) {
std::uniform_real_distribution<float> dis(min, std::nextafter(max, std::numeric_limits<float>::max()));
for (int i = 0; i... | TOOL | 0.92198 | 4.867465 |
7b0f8635-fee5-41f5-b1ef-7b0a18a6d9bf | chungers/lab616 | third_party/cpp/boost_1_46_1/libs/graph/example/edge-connectivity.cpp | namespace boost
{
template < typename Graph >
std::pair < typename graph_traits < Graph >::vertex_descriptor,
typename graph_traits < Graph >::degree_size_type >
min_degree_vertex(Graph & g)
{
typename graph_traits < Graph >::vertex_descriptor p;
typedef typename graph_traits < Graph >::degree_s... | ALGO | 0.998739 | 7.146661 |
3763b5e0-ba1c-426f-ba98-ef26986e89c2 | AmiteshSingh45/Decode-DSA-with-CPP | TREE/PRE_IN_POST.cpp | #include<iostream>
using namespace std;
class Node{ // TREEE NODE
public:
int val;
Node* left;
Node* right;
Node(int val){
this->val=val;
this->left=NULL;
this->right=NULL;
}
};
void preorder(Node* root){
if(root==NULL) return;
cout<<root->val<<" ";
preorder(ro... | ALGO | 0.999746 | 4.707673 |
73685813-9cfc-4a73-95d8-45841273445c | zhang611/util | graph_algorithm/BVH/Scene.cpp | //
// Created by Göksu Güvendiren on 2019-05-14.
//
#include "Scene.hpp"
void Scene::buildBVH() {
printf(" - Generating BVH...\n\n");
this->bvh = new BVHAccel(objects, 1, BVHAccel::SplitMethod::NAIVE);
}
Intersection Scene::intersect(const Ray &ray) const {
return this->bvh->Intersect(ray);
}
bool Scene... | ALGO | 0.993294 | 5.768438 |
c52e1e3b-71f5-40da-88e2-53da91859ffd | skzr001/Leetcode | 57. Insert Interval/lc57.cpp | /**
* Definition for an interval.
* struct Interval {
* int start;
* int end;
* Interval() : start(0), end(0) {}
* Interval(int s, int e) : start(s), end(e) {}
* };
*/
class Solution {
public:
vector<Interval> insert(vector<Interval>& intervals, Interval newInterval) {
vector<Interva... | ALGO | 0.999741 | 5.928599 |
e4bd0991-2666-42b7-b33f-faa1f535a715 | shivdevop/Coding-questions | next-greater-element-i/next-greater-element-i.cpp | class Solution {
public:
vector<int> nextGreaterElement(vector<int>& nums1, vector<int>& nums2)
{
map<int,int> mp;
stack<int> st;
int n1=nums1.size();
int n2=nums2.size();
mp[nums2[n2-1]]=-1;//the next greater element for n-1th element of nums2
st.push(nums2[n... | ALGO | 0.999875 | 5.642853 |
edab686b-a9fb-4ddc-bb80-d135ff907c84 | master-hkshenoycse/CP | Contests/Codeforces/Div2_965/B.cpp | #include<bits/stdc++.h>
#include <iterator>
#include <iostream>
#include <numeric>
#include <math.h>
#define ll long long
#define ull long
#define mpa make_pair
#define pb push_back
#define ff first
#define pii pair<ll,ll>
#define dd long double
#define trace(x) cerr << #x << " : " << x << endl
#define ss second
#defin... | ALGO | 0.999919 | 3.298167 |
df2e35e9-b156-4da2-af8e-da38f2929e46 | PriyanshuA1507/Leetcode-Solutions | 134-gas-station/gas-station.cpp | class Solution {
public:
int canCompleteCircuit(vector<int>& gas, vector<int>& cost) {
int totalgas = 0, totalcost = 0;
for(int i=0;i<gas.size();i++){
totalgas+=gas[i];
totalcost+=cost[i];
}
if(totalcost>totalgas){
return -1;
}
int tankmaigas = 0, st... | ALGO | 0.999992 | 5.857736 |
d87a22af-0f56-4637-b6a0-47ebb6250cfa | adit2005/LEETCODE-CPP-DSA-QUESTIONS | 2792-neighboring-bitwise-xor/neighboring-bitwise-xor.cpp | class Solution {
public:
bool doesValidArrayExist(vector<int>& derived) {
int sum = accumulate(derived.begin(), derived.end(), 0);
return sum % 2 == 0;
}
}; | ALGO | 0.995543 | 5.979015 |
84ce9b53-61f8-4a7d-9acb-6202fbc4a8cc | afbiggs/gower-final-cpp-esp32 | calibration.cpp | #include "calibration.h"
// Updated Calibration Table (With Previously Applied Factors Considered)
CalibrationPoint calibrationTable[] = {
{1, 0.483234},
{5, 0.891862},
{10, 0.966865},
{20, 0.982273},
{50, 0.996319},
{70, 0.999675},
{100, 1.000000}
};
const int calibrationTableSize = sizeo... | ALGO | 0.929761 | 5.313994 |
d6a278eb-79df-4e18-8e24-def47853182d | sharma-tanish/Data-Structures-and-Algorithms | Binary Search Trees/convertBSTtoDLL.cpp | #include <iostream>
#include <queue>
using namespace std;
class Node {
public:
int data;
Node *left;
Node *right;
Node(int val) {
this->data = val;
this->left = NULL;
this->right = NULL;
}
};
void levelOrderTraversal(Node *root) {
queue<Node*> q;
q.push(root);
... | ALGO | 0.999972 | 5.965495 |
ad677268-4c50-416d-af81-0946903b2e68 | Kisna2512/Problem-Solving | Binary_tree_maximum_path_sum.cpp | class Solution {
public:
int maxPathSum(TreeNode* root) {
int maxi=INT_MIN;
fun(root,maxi);
return maxi;
}
int fun(TreeNode* root,int &maxi){
if(root==NULL) return 0;
int left=max(0,fun(root->left,maxi));
int right=max(0,fun(root->right,maxi));
... | ALGO | 0.999977 | 6.333292 |
120ae4da-f4ba-414e-af58-0b4a6efd2d02 | Nur-Alam-Limon/Competitive-Programming | CodeChef/Sequence Land.cpp | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
vector<ll>adj[302];
vector<ll>a[302];
ll v[302]={0};
ll cnt=0;
void dfs(ll n)
{
v[n]=1;
cnt++;
for(ll i=0;i<adj[n].size();i++)
{
if(v[adj[n][i]]==0)
{
dfs(adj[n][i]);
}
}
}
int main()
{
l... | ALGO | 0.999944 | 3.670328 |
bccd0ea0-8247-49f5-ad2d-65875677a2fc | tps051/Labs | newlab1v28/lab1v28.cpp | #include <iostream>
#include <string>
#include <vector>
#include <conio.h>
using namespace std;
class Vector // Объявление класса
{
public:
double x;
double y;
Vector() {}
Vector(double x, double y)
{
this->x = x;
this->y = y;
}
};
double length(int x, int y) // Функция, возвращающая длину вектора
{
retu... | ALGO | 0.994003 | 3.788357 |
4b2d719b-4c8e-4e43-87f0-6066c0adb625 | lsiddiqsunny/programming-contest | Lightoj/1186.cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
int test;
scanf("%d",&test);
for(int cs=1;cs<=test;cs++){
int n;
scanf("%d",&n);
int w[n];
int b[n];
for(int i=0;i<n;i++) scanf("%d",&w[i]);
for(int i=0;i<n;i++) scanf("%d",&b[i]);
int s[n];
... | ALGO | 0.99984 | 3.973094 |
78cef744-99da-4304-88a5-1fe58ee10ac2 | EdimarJunior/CompositionalTioco | symbolrt/CVC4/examples/nra-translate/smt2info.cpp | /********************* */
#include <cassert>
#include <iostream>
#include <string>
#include <typeinfo>
#include <vector>
#include <cvc4/api/cvc4cpp.h>
#include <cvc4/cvc4.h>
using namespace std;
using namespace CVC4;
using namespace CVC4::parser;
using namespace... | ALGO | 0.998618 | 6.727219 |
b9a885c2-e5fc-4b3f-a09d-ce3142167f0e | nh0znoisung/Online_Judge-Competitive_Programming | Atcoder/Atcoder 196/c.cpp | #include <bits/stdc++.h>
#define for0(i, n) for (int i = 0; i < (int)(n); ++i)
#define for1(i, n) for (int i = 1; i <= (int)(n); ++i)
#define forc(i, l, r) for (int i = (int)(l); i <= (int)(r); ++i)
#define forr0(i, n) for (int i = (int)(n) - 1; i >= 0; --i)
#define forr1(i, n) for (int i = (int)(n); i >= 1; --i)
#def... | ALGO | 0.999813 | 4.070705 |
d84951c3-7279-4558-b503-0544e54fafc1 | gab-o-11/AED | Semana 4/Practica/QueueUsingStack.cpp | #include <iostream>
#include <stack>
using namespace std;
class MyQueue {
stack<int> pila1;
stack<int> pila2;
public:
MyQueue() {
}
void push(int x) {
if (pila1.empty()) {
pila1.push(x);
}
else {
stack<int> temp=pila1;
while (!temp.empty... | ALGO | 0.999735 | 4.962852 |
70202bd8-35a3-45c6-81f5-873362789262 | harshit7962/LeetCode-Solutions | 494-target-sum/494-target-sum.cpp | class Solution {
public:
int findTargetSumWays(vector<int>& nums, int target) {
int sum = target;
for(int i:nums) sum+=i;
if(sum%2 || sum<0) return 0;
sum/=2;
vector<vector<int>> dp(nums.size()+1, vector<int>(sum+1, 0));
dp... | ALGO | 0.999986 | 6.147665 |
c0a43fe1-50df-441b-8fb3-decc289e3a11 | lamknh/Problem_Solving | BOJ/C++/9325.cpp | #include <iostream>
int main(int argc, char **argv){
int T, s, n, q, p, sum = 0;
scanf("%d",&T); // test case 수
for(int i=0; i<T; i++){
scanf("%d",&s); // 자동차의 가격
sum += s;
scanf("%d",&n); // 옵션 개수
for(int j=0; j<n; j++){
scanf("%d %d",&q,&p); // 특정 옵션 개수, 옵션 가격... | ALGO | 0.9926 | 3.506413 |
3b337333-4d20-4ca3-8d55-bbbc4934665d | ThomasAndreWolff/Master | src/main_greedy.cpp | #include "core/SolutionTransformer.hpp"
#include "core/UnifiedSolutionDatabase.hpp"
#include "data/DataLoader.hpp"
#include "greedy/GreedyMDVSPSolver.hpp"
#include "greedy/GreedySolutionPrinter.hpp"
#include <iostream>
#include <string>
int main(int argc, char* argv[]) {
std::cout << "=== Greedy MDVSP Solver ===" ... | ALGO | 0.996538 | 6.935277 |
c7b72360-2271-4ab9-91c9-d428cad00d2a | motl2000/vs | ybt/1346.cpp | //1346:【例4-7】亲戚(relation)
//写法1:递归查询+路径压缩,简单合并
// #include<bits/stdc++.h>
// using namespace std;
// #define N 20005
// int fa[N];
// void initFa(int n) //初始化并查集
// {
// for(int i = 1; i <= n; ++i)
// fa[i] = i;
// }
// int find(int x) //查找根节点
// {
// if(x == fa[x])
// return ... | ALGO | 0.999988 | 4.558734 |
bfb27c0d-4b62-443a-a20f-3c5b4c25dc34 | PawanKmr470/DSA_Practice_Set | DSA_CPP/10_Problems/ARH01_LRU.cpp | #include <iostream>
#include <unordered_map>
#include <list>
using namespace std;
class LRUCache
{
private:
unsigned int cachesize;
list<int> l;
unordered_map<int, int> m;
public:
LRUCache(int capacity){
cachesize = capacity;
//l.clear();
//m.clear();
}
~LRUCache() {};
... | ALGO | 0.989199 | 5.272671 |
e41ee756-db9f-4968-801b-b705f5a98bbd | md-ashraful-islam-ullas/Cpp-for-DSA | Module 7/max_in_array_of_object.cpp | # include <bits/stdc++.h>
using namespace std;
class Student
{
public:
string name;
int roll;
int marks;
};
int main()
{
int n;
cin >> n;
Student array[n];
Student mx;
mx.marks = INT_MIN;
for (int i = 0; i < n; i++)
{
cin >> array[i].name >> array[i].roll >> array[i].... | ALGO | 0.999529 | 4.19615 |
987ad631-db2e-42b8-acfe-34e28802c653 | TSAQIFKANZ/Laprak-Strukdat | LaprakModul 8/Unguided3_Searching.cpp | #include <iostream>
using namespace std;
// Fungsi untuk menghitung berapa banyak angka 4 dalam array menggunakan sequential search
int countNumber(const int data[], int size, int target) {
int count = 0;
for (int i = 0; i < size; i++) {
if (data[i] == target) {
count++;
}
}
... | ALGO | 0.999898 | 6.224984 |
7e5ffc62-0fb7-4ce8-ba5c-388d1698afb2 | BicepsCrazy/practice | Расписание на день/Расписание на день.cpp | // Расписание на день.cpp : Этот файл содержит функцию "main". Здесь начинается и заканчивается выполнение программы.
//
#include <iostream>
using namespace std;
int main()
{
int day;
setlocale(LC_ALL, "Ru");
cout << "выберите день недели\n"
<< "1.понедельник\n" << "2.Вторник\n" << "3.Среда\n" << "4.Четверг\n" <... | TOOL | 0.957775 | 3.109886 |
ccfec984-493a-4ed2-b346-dfcf7d81d37e | bhavyaGP/DAA | Practical 4/coinchange.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
int size;
cout << "Enter Size of Coin array";
cin>>size;
vector<int> coin {size};
int value ;
cout << "Enter Value:";
cin>>value;
for(int i = 0; i < coin.size(); i++)
{
cin>>coin[i];
}
sort(coin.begin(), c... | ALGO | 0.999989 | 3.743058 |
ecaa1b1d-f899-4fe0-8feb-0119d039f6c8 | stonne-simulator/stonne | pytorch-frontend/third_party/eigen/unsupported/doc/examples/MatrixSquareRoot.cpp | #include <unsupported/Eigen/MatrixFunctions>
#include <iostream>
using namespace Eigen;
int main()
{
const double pi = std::acos(-1.0);
MatrixXd A(2,2);
A << cos(pi/3), -sin(pi/3),
sin(pi/3), cos(pi/3);
std::cout << "The matrix A is:\n" << A << "\n\n";
std::cout << "The matrix square root of A is:... | ALGO | 0.999437 | 3.883457 |
4f456558-b144-4331-bdbd-1fd62bb7b5e7 | HawDinh/CodePTIT | Code_CPP/kc_bang_x.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
void TestCase(){
int n,k; cin >> n >> k;
int a[n];
set <int> st;
for (int i=0;i<n;i++) {
cin >> a[i];
st.insert(a[i]);
}
int ok=0;
for (int i=0;i<n;i++){
int x=a[i]+k;
if(st.find(x)!=st.end(... | ALGO | 0.999195 | 3.926837 |
1bd68082-f2d6-4d8f-9d8d-4e7af542bc32 | myasirnovals/CPP-language | udemy/AbdulBari/belajar-cpp-dasar/Quiz1/question4.cpp | //
// Created by myasi on 9/11/2024.
//
#include <stdio.h>
int fun(int n) {
int x = 1, k;
if (n == 1) return x;
for (k = 1; k < n; ++k)
x = x + fun(k) * fun(n - k);
return x;
}
int main() {
printf("%d", fun(5));
return 0;
}
| ALGO | 0.99992 | 5.758273 |
316617fd-8b09-4a8b-9b8d-91325abeab25 | jeetsavsani1173/LeetCode-Solution | Distance of nearest cell having 1 - GFG/distance-of-nearest-cell-having-1.cpp | //{ Driver Code Starts
#include<bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution
{
int dx[4] = { -1, 0, 1, 0};
int dy[4] = { 0, 1, 0, -1};
bool isValid(int x,int y,int n,int m)
{
return (x>=0 && x<n && y>=0 && y<m);
}
public:
//Function to find distance of n... | ALGO | 0.999964 | 6.144343 |
7aeae731-d2d2-4d49-8872-fcb256f0f09a | tarnishedAlexander/Algoritmica | tareaAlgoritmica/05-Kattis-qaly.cpp | #include <iostream>
#include <stdio.h>
#include <math.h>
#define input freopen("on.txt", "r", stdin)
using namespace std;
int main(){
input;
double n, y;
double result = 0;
int t;
cin>>t;
while (t--)
{
cin>>n>>y;
result += n*y;
}
cout<<result<<'\n';
return 0;
} | ALGO | 0.998215 | 3.616332 |
5293292b-161b-4c88-8035-e51137e4259b | ssugam10/leetcode-solutions | 3250-find-the-count-of-monotonic-pairs-i/3250-find-the-count-of-monotonic-pairs-i.cpp | class Solution {
public:
int countOfPairs(vector<int>& nums) {
const int mod = 1e9 + 7;
int dp[2005][55]; //dp[i][j] represents number of monotonic pairs of length i whose arr1[i - 1] = j
memset(dp,0,sizeof(dp));
int n = nums.size();
for(... | ALGO | 0.999995 | 5.482291 |
12d271e8-1e8a-47f9-b8d2-f53e57d2a8df | ArthurDetomi/Maratona_Treino | cses/dp/dice.cpp | #include <bits/stdc++.h>
using namespace std;
#define l long long
#define MAXN 1000001
#define MOD 1000000007
vector<l> memo(MAXN, -1);
l combinations_count(int i) {
if (i == 0 || i == 1) {
return 1;
}
if (memo[i] != -1) {
return memo[i];
}
memo[i] = 0;
for (int j = 1; j <= 6; j++) {
if... | ALGO | 0.999981 | 5.201209 |
9ccab3de-9318-4b26-ab7d-429d5ebff6af | SMiles02/CompetitiveProgramming | Codeforces/CF 900 - 999/CF0977/CF977/CF977C.cpp | #include <bits/stdc++.h>
#define ll long long
#define sz(x) (int)(x).size()
using namespace std;
int binpow(int a, int b) {
if (b == 0)
return 1;
int res = binpow(a, b / 2);
if (b % 2)
return res * res * a;
else
return res * res;
}
ll gcd(ll a,ll b)
{
if (b==0) return a;
... | ALGO | 0.999967 | 3.92265 |
04d4647e-c716-4f6a-a95b-42f197cbd8d5 | cedard234/Cedar_Leetcode_Solutions | cpp/763-Partition_Labels.cpp | #include <iostream>
#include <algorithm>
#include <vector>
#include <unordered_map>
using namespace std;
class Solution {
public:
vector<int> partitionLabels(string s) {
unordered_map<char, vector<int>> alphabet_intervals;
for (int i = 0; i< s.length(); i++){
if (alphabet_intervals.fin... | ALGO | 0.999867 | 5.384957 |
898850ee-adb5-489f-95dc-027df50813a0 | PaukIsUha/optimizing_formating_code | predictions/full_output_predicted_submissions/Codenet/p02270/594592961/5.cpp | #include <iostream>
#include <numeric>
#include <vector>
using namespace std;
vector<int> Input(const int n) {
vector<int> W;
for (int i = 0; i < n; i++) {
int w;
cin >> w;
W.push_back(w);
}
return W;
}
bool IsAllLoaded(int P, vector<int> W, int k) {
int TrackIndex = 0;
int CurrentSum = 0;
int... | ALGO | 0.999967 | 4.464653 |
5273c3e6-1aa8-43f6-85f0-a565b721fe4b | shubham1908/Leetcode-Solutions | 1903-largest-odd-number-in-string/1903-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.999887 | 6.12913 |
69b552b2-04df-4799-9959-5540ab23a910 | johan1103/baekjoonCoding | 백준문제풀이 연습/1260.cpp | #include<iostream>
#include<algorithm>
#include<vector>
#include<string>
#include<queue>
#include<cstring>
using namespace std;
int n, m, start;
int A[1001][1001];
int visit[1001];
queue<int> q;
void dfs(int start);
void bfs(int start);
void init() {
ios_base::sync_with_stdio(0);
cin.tie(0); cout.tie(0);
}
... | ALGO | 0.999965 | 3.715065 |
6fdae713-0f6b-47cc-8059-49cdad359d44 | rishav143/PEP-Data-structure | _1_1_linkedList.cpp | #include<iostream>
#include<stdlib.h>
using namespace std;
struct Node /*single linked list*/
{
int data;
struct Node* next;
};
// struct Node /*double linked list*/
// {
// int data;
// struct Node* prev;
// struct Node* next;
// };
void insertAtBeg(int data, struct Node*& head) {
struct No... | ALGO | 0.99907 | 3.807843 |
79f1e7f8-6e8c-40d9-9861-a18a24a54fef | Gurmeet-Rana/DAA | End Term Practical/DP/permutation.cpp | #include<bits/stdc++.h>
using namespace std ;
void printPermutations(string str,int i)
{
if(i>=str.length())
{
cout<<str<<" ";
return ;
}
for(int j=i;j<str.length();j++)
{
swap(str[i],str[j]);
printPermutations(str,i+1);
swap(str[i],str[j]);
}
}
int ma... | ALGO | 0.999951 | 5.027243 |
8ce315d9-387d-49d1-9596-8e000ea06edb | truongdcba/Algorithms-Samsung-and-PTIT | Đồ thị/Chuyển từ danh sách kề sang danh sách cạnh.cpp | // Cho đơn đồ thị G vô hướng liên thông được mô tả bởi danh sách kề. Hãy in ra danh sách cạnh tương ứng của G.
// Input
// Dòng đầu tiên ghi số N là số đỉnh (1
// N dòng tiếp theo mỗi dòng ghi 1 danh sách kề lần lượt theo thứ tự từ đỉnh 1 đến đỉnh N
// Output: Ghi ra lần lượt từng cạnh của đồ thị theo thứ tự tăng dần.... | ALGO | 0.998993 | 3.963958 |
faa071cd-1917-4656-bd98-cfbc516f18da | ishandutta2007/codeforces | peterr/normal/1183/B.cpp | #include <iostream>
using namespace std;
int main()
{
int q;
cin >> q;
while (q--)
{
int n, k;
cin >> n >> k;
int lo = 1e8 + 5, hi = -1;
for (int i = 0; i < n; i++)
{
int a;
cin >> a;
lo = min(lo, a);
hi = max(hi, ... | ALGO | 0.999947 | 3.862016 |
e9d405a0-1126-41cb-a54a-f20e07039d3d | ishandutta2007/codeforces | sohsoh/normal/1369/E.cpp | /*
Soheil Mohammadkhani
I will change this text here when i've got "Candidate Master":)
*/
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<ll, ll> pll;
#define all(x) (x).begin(),(x).end()
#define X first
... | ALGO | 0.999998 | 4.104777 |
3d66fc12-e08d-4a5e-b264-622627e0f7b0 | 113bommy/deepmind_codecontests_refine | cpp_source_filter_file/cpp_train_10265_4.cpp | #include <bits/stdc++.h>
using namespace std;
const int N = 21;
const long long mod = 998244353LL;
string s[N];
int32_t main() {
ios::sync_with_stdio(false);
cin.tie(NULL);
int n, m, end = -1;
cin >> n >> m;
for (int i = 0; i < n; ++i) {
cin >> s[i];
for (char c : s[i]) {
if (c == '1' && end == ... | ALGO | 0.999925 | 4.483252 |
078bae53-62c7-4bc6-8d70-f4da8441afca | de-arl/bsim | src/State/BrownianSearch.cpp | #include "BrownianSearch.h"
template <typename T>
BrownianSearch<T>::BrownianSearch(
int id,
std::mt19937 &gen,
std::uniform_real_distribution<T> &dist_x,
std::uniform_real_distribution<T> &dist_y,
std::uniform_real_distribution<T> &dist_z,
T search_duration)
: id(id), gen(gen),
dist_x(di... | ALGO | 0.998523 | 5.829681 |
2dcda0b2-f9fa-4411-8bb6-a79a65dc2071 | ico12319/Data-structures-and-algorithms | Tasks/Sorting Algorithms/QuickSort/main.cpp | #include <iostream>
template<class T>
int partition(T* arr,int size){
T pivot = arr[size / 2];
int i = 0;
int j = size - 1;
while(true){
while(arr[i] < pivot)
i++;
while(arr[j] > pivot)
j--;
if(arr[i] == arr[j])
i++;
if(i < j)
... | ALGO | 0.999906 | 5.471962 |
121c20c1-faad-4456-83c4-507849bd27e0 | yuforest/contests | past_201912/c/main.cpp | // 標準ライブラリを全て読み込む
// 本書では細かく書きませんが、下記リンクが参考になります
// https://atcoder.jp/contests/apg4b/tasks/APG4b_af
#include <bits/stdc++.h>
// stdのstd::cinのような書き方ではなくcinと書けば良くなる
using namespace std;
// デバッグ用マクロ
// 本書では細かく書きませんが、下記リンクが参考になります
// https://naskya.net/post/0002/
#ifdef LOCAL
#include <debug_print.hpp>
#define debug(...)... | ALGO | 0.999436 | 4.326932 |
8334c55e-39a7-4890-8447-3a327682e7bb | shekhar8352/C-Codes | code2_1.cpp | #include <bits/stdc++.h>
using namespace std;
void Rank()
{
int DSA1, TOC1, DM1;
int DSA2, TOC2, DM2;
cin >> DSA1 >> TOC1 >> DM1;
cout << endl;
cin >> DSA2 >> TOC2 >> DM2;
int sumDragon = DSA1 + TOC1 + DM1;
int sumSloth = DSA2 + TOC2 + DM2;
if (sumDragon > sumSloth)
{
cout << "DRAGON" << endl;
... | ALGO | 0.999693 | 5.194677 |
90d3a2ed-e8f7-414f-9a98-fda9d7b505a8 | piyush14298/A2OJ | CodeForces/B1398.cpp |
///////////////// ____ ___ _ _ _ *******************************
///////////////// | _ \_ _/ | || | *******************************
///////////////// | |_) | || | || |_ *******************************
///////////////// | __/| || |__ _| ... | ALGO | 0.999537 | 4.924418 |
5dbbca04-e26f-4a23-8941-a5b41c1fecd0 | devanathandna/CodeForces | walking_master.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int t;
cin >> t;
while (t--) {
long long sx,sy,dx,dy;
cin >> sx >> sy >> dx >> dy;
if(dy < sy){
cout << -1 << endl;
continue;
}
else{
long long count = 0;
count+=(dy - sy... | ALGO | 0.999672 | 3.647685 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.