uuid stringlengths 36 36 | repo_name stringlengths 5 123 | relative_path stringlengths 5 4k | content stringlengths 33 2.85M | category stringclasses 6
values | algo_rel_score float64 0.85 1 | quality_score float64 3 8.76 |
|---|---|---|---|---|---|---|
2262d0f3-5e57-4ff5-b7aa-ab7e5f4bcae8 | Engineerbabu777/Data-Structures-and-Algorithms | Q8_Sort_Array_by_Parity/code.cpp | class Solution {
public:
vector<int> sortArrayByParity(vector<int>& nums) {
int start = 0;
int end = nums.size()-1;
while(start < end){
if(nums[start]%2 == 0){
start++;
continue;
}
if(nums[start]%2!=0 && nums[end]... | ALGO | 0.99999 | 5.640801 |
b8fa2fe5-115a-4b7b-b508-42918cd706e7 | viratsardana10/C-and-Cplusplus-Programs | Contests/Codechef/accepted/not_a_triangle.cpp | #include <iostream>
#include <cstdlib>
#include <stdio.h>
using namespace std;
long* bsearch(long *key, long* a, long min, long max);
int compare (const void * a, const void * b)
{
return ( *(long*)a - *(long*)b );
}
int main()
{
int n;
fscanf(stdin, "%d", &n);
while(n)
{
long a[n];
for(int i = 0 ; i < n; +... | ALGO | 0.999628 | 3.259654 |
1c5ebb28-5e71-4e90-906c-8fe5b28c4631 | dtarqui/Ejemplos_CPP | p2/Ejercicio 13.cpp | //13.- Mediante una funcin booleana con retorno determine si un nmero ledo desde el teclado es capica.
#include <iostream>
#include <cstdlib>
using namespace std;
bool capicua(int);
int main()
{
int num;
cout << "Ingrese el numero mayor a 9: ";
cin >> num;
if(capicua (num))
cout<<"El numero "<<num<<" es capicua"<<endl;... | ALGO | 0.995574 | 3.980992 |
5667ad5e-8e0e-41a9-afbb-debdfe31f777 | tongwh/tongwh.github.io | NA_2022/codes/ch00/pi.cpp | #include <stdio.h>
#include <stdlib.h>
#include <malloc.h>
#define MAX_INT 2147483647
void Caculate_pi()
{
double x=2, z=2;
int a=1, b=3;
while (z > 1e-15)
{
z = z*a/b;
x += z;
a++;
b += 2;
}
printf("PI = %.16f\n", x);
}
/* function: λpiֵ */
void Caculate_pi_symbol()
{
int le... | ALGO | 0.999889 | 3.311254 |
0e72d9c6-5c03-4c6d-9d22-0ae8329b9a03 | ychabez2023/codingyoel | TablasMultp.cpp | #include<iostream>
using namespace std;
int main(){
int cont;
int n;
cout<< "Ingresar numero del 1 - 12: ";
cin>> n;
for (cont=0;cont<=12;cont++){
cout << cont << "x" << n << " = " << (cont*n) << endl;
}
return 0;
}
| ALGO | 0.996071 | 3.263693 |
250d08e1-5c6d-4e2e-a861-02852cf048bb | leechangyeol/BaekJoon | 1021.cpp | #include <iostream>
#include <deque>
using namespace std;
int n, m;
deque<int> d;
int main(void)
{
cin >> n >> m;
for (int i = 1; i <= n; i++)
{
d.push_back(i);
}
int ans = 0;
for (int i = 0; i < m; i++)
{
int num, index;
cin >> num;
for (int j = 0; j < d.size(); j++)
{
if (num == d[j])
{
... | ALGO | 0.999911 | 3.676545 |
3abf7c21-9cfc-41f2-b1a8-db2f049b2041 | ishandutta2007/codeforces | jiangly/normal/1680/C.cpp | #include <bits/stdc++.h>
using i64 = long long;
void solve() {
std::string s;
std::cin >> s;
int n = s.length();
std::vector<int> s0(n + 1), s1(n + 1);
for (int i = 0; i < n; i++) {
s0[i + 1] = s0[i] + (s[i] == '0');
s1[i + 1] = s1[i] + (s[i] == '1');
}
int a... | ALGO | 0.999951 | 5.484602 |
ee22db69-c79b-4c26-9919-4ced04b1b2bf | sherzod77/Masalalar-C- | musbat yoki manfiy sonlarni sonini aniqlovchi dastur.cpp | #include<iostream>
using namespace std;
int main()
{
int a, b, c, sum;
cin >> a>> b>> c;
if ( a > 0 ) a=1;
else a = 0;
if ( b > 0) b = 1;
else b = 0;
if ( c > 0 ) c = 1;
else c = 0;
cout<< " butun sonlar soni = "<< a+b+c;
}
| ALGO | 0.998782 | 3.529451 |
69ba9ee6-5f10-4360-97b1-fb5d13f9934e | Hectorfr/CP_upv | week7/C.cpp | #include <bits/stdc++.h>
using namespace std;
#define REP(i, a, b) for (int i = a; i < b; ++i)
#define ent cout << '\n'
int main() {
int n, m, h, x, y; cin >> n >> m >> h >> x >> y;
int mars[n][m];
int maxN = INT32_MIN, manhattan = INT32_MAX, x1 = -1, y1 = -1;
REP(i, 0, n){
REP(j, 0, m){
... | ALGO | 0.999948 | 3.716167 |
e71ea857-1579-42db-882e-cbe228b8791d | thegamer1907/Code_Analysis | Codes/AC/2248.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int ar[200200];
ll sum, ans, acc;
map<ll, int> mp;
int n;
int main() {
#ifndef ONLINE_JUDGE
freopen("input.txt", "r", stdin);
#endif
cin >> n;
for(int i = 0; i < n; ++i) {
scanf("%d", ar + i);
sum += ar[i];
mp[sum] = i;
}
f... | ALGO | 0.999984 | 3.868421 |
7910a524-19c1-46e2-b428-e6d51e337af8 | Programmers-Paradise/Member-Selection-Test | 2nd_sem/Pull_Requests/SaurabhKumar_AI_53/Problem1.cpp | /*
Name - Saurabh Kumar
Email - <EMAIL>
Branch - AI
Roll no. - 53
*/
#include<iostream>
using namespace std;
int main () {
int n;
cin >> n;
while (true) {
cout << n << " ";
if (n == 1) { break; };
if (n % 2 == 0) { n = n / 2 ; }
else {n = n *3 + 1 ;}
}
cout << "\n";
return 0;
} | ALGO | 0.999982 | 4.608097 |
e31fca1c-773d-4cc5-a360-389b522e8a7d | Adityacsbs/CodeZenith-A-Daily-Odyssey | palindrome.cpp | #include <iostream>
#include <bits/stdc++.h>
using namespace std;
bool ispalindrome(string s)
{
int n = s.length();
for (int i = 0; i < n / 2; i++)
{
if (s[i] != s[n - i - 1])
{
return false;
}
}
return true;
}
bool palin(int i, string &s)
{
if (i >= s.... | ALGO | 0.999974 | 4.545157 |
f130f503-5ab0-4df3-8482-5cb3ef92e7ee | CuiMingyu/Leetcode | 9.cpp | //
// 9.cpp
//
//
// Created by Cui on 2020/1/22.
//
class Solution {
public:
int reverse(int x) {
long res = 0;
while(x){
res = res * 10 + x % 10;
x /= 10;
}
return (res<INT_MIN || res>INT_MAX) ? 0 : res;
}
};
| ALGO | 0.999646 | 5.173054 |
eba9a148-fc98-442e-9fff-2aebfc0ee4d3 | Mrsuyi/algorithm | uva/540.cpp | #include <climits>
#include <cstring>
#include <cfloat>
#include <cmath>
#include <iostream>
#include <sstream>
#include <string>
#include <algorithm>
#include <vector>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <functional>
# ifdef __GNUC__
# if __cplusplus > 199711L
# include <unordered... | ALGO | 0.99948 | 4.029121 |
3c8f7259-b072-4467-8e3e-2392d29c5004 | leer168/x-framework | library/base/algorithm/sha1/sha1.cpp |
#include "sha1.h"
#include "base/basic_types.h"
namespace base
{
// Implementation of SHA-1. Only handles data in byte-sized blocks,
// which simplifies the code a fair bit.
// Identifier names follow notation in FIPS PUB 180-3, where you'll
// also find a description of the algorithm:
// http:... | ALGO | 0.991244 | 7.729743 |
8b15cfb4-3ede-4536-b2d8-b2c5c8686d44 | pranali1718/CPP_UDEMYCOURSE | Test/Class/Area Perimeter.cpp | /*Write a program to print the area and perimeter of a triangle having sides of 3, 4 and 5 units by creating a class
named 'Triangle' with a function to print the area and perimeter.*/
#include <iostream>
using namespace std;
float base,height,side_1,side_2,side_3;
class Triangle ... | ALGO | 0.933495 | 3.919838 |
b33f1973-d82f-44e3-b190-98c99e00856b | BrianGlasheen/glowing-engine | glow/ext/JoltPhysics-5.3.0/Jolt/Physics/IslandBuilder.cpp | #include <Jolt/Jolt.h>
#include <Jolt/Physics/IslandBuilder.h>
#include <Jolt/Physics/Body/Body.h>
#include <Jolt/Physics/PhysicsSettings.h>
#include <Jolt/Core/Profiler.h>
#include <Jolt/Core/Atomics.h>
#include <Jolt/Core/TempAllocator.h>
#include <Jolt/Core/QuickSort.h>
JPH_NAMESPACE_BEGIN
IslandBuilder::~IslandB... | ALGO | 0.997291 | 5.104331 |
0e50447f-6a7b-41a8-85a6-3712583d246a | mushfiqiit/CP-Templates | Strings/SuffixArray.cpp | struct suffix_array {
vector<int> sa, lcp;
suffix_array(string& s, int lim=256) {
#define rep(i,a,b) for(int i=a;i<b;i++)
int n = s.size() + 1, k = 0, a, b; vector<int> x(s.begin(),s.end()+1), y(n),
ws(max(n, lim)), rank(n);
sa = lcp = y, iota(sa.begin(),sa.end(), 0);
for (int j = 0, p = 0; p < n; j = max(1, j * 2),... | ALGO | 0.999966 | 4.371988 |
f8a7a754-9880-4818-8d1d-e31aaf4cf61f | gifalok/rpg3 | mp/src/cryptopp/mars.cpp | // mars.cpp - originally written and placed in the public domain by Wei Dai
// includes IBM's key setup "tweak" proposed in August 1999 (http://www.research.ibm.com/security/key-setup.txt)
#include "pch.h"
#include "mars.h"
#include "misc.h"
NAMESPACE_BEGIN(CryptoPP)
void MARS::Base::UncheckedSetKey(const byte *use... | ALGO | 0.999382 | 6.945245 |
60a8f658-8aed-42ae-b844-8427db5c12e5 | Avdhesh-Varshney/CPMasterLog | LeetCode/CPP/Medium/287. Find the Duplicate Number.cpp | // Problem Link:
// https://leetcode.com/problems/find-the-duplicate-number/
// Solution:
class Solution {
public:
int findDuplicate(vector<int>& nums) {
for(int i = 0; i < nums.size(); i++) {
int b = abs(nums[i]);
if(nums[b-1] < 0)
return b;
else
... | ALGO | 0.999984 | 5.957593 |
6847c838-0cdd-43b0-acf4-4d53ca7d7af9 | MakinoRuki/TopCoder | SRM833Div1Easy.cpp | #include <iostream>
#include <cstdio>
#include <cstring>
#include <vector>
#include <algorithm>
#include <map>
#include <set>
#include <unordered_set>
#include <unordered_map>
#include <deque>
#include <cmath>
#include <queue>
#define eps 1e-10
#define M 200005
#define N 1005
#define SZ 200000002
using namespace std;
t... | ALGO | 0.999923 | 3.978108 |
f6e103ec-6a2a-4284-9546-22ab936c43b3 | Apress/beginning-cpp23 | Examples/Chapter 08/Ex8_09B.cpp | // Passing an array to a function - pass by reference improved
import std;
double average10(const double (&)[10]); // Function prototype
int main()
{
double values[] { 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0 };
// double values[] { 1.0, 2.0, 3.0 }; // Only three values!!!
std::println(... | ALGO | 0.977298 | 5.560346 |
1065494d-1777-4e90-ac67-9bd913c51918 | tempure/algorithm-advance | OJ/acwing/第51场周赛/b.cpp | #include <iostream>
#include <cstring>
#include <algorithm>
using namespace std;
const int N = 1010, M = N * N;
int n, m;
int p[M], s[M];
char g[N][N];
int dx[4] = { -1, 0, 1, 0}, dy[4] = {0, 1, 0, -1};
int get(int x, int y)
{
return x * m + y;
}
int find(int x)
{
if (p[x] != x) p[x] = find(p[x]);
retu... | ALGO | 0.99985 | 3.451292 |
1c52404c-53e1-43ce-b36c-3d3ab0e66736 | mitchkoko/ModernSmartHomeUI | 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 |
61417f36-ec13-4b80-af52-439c129e7895 | Anubhav2907/DSA | treesR/maxWidth.cpp | #include <bits/stdc++.h>
using namespace std;
struct Node
{
int key;
struct Node *left;
struct Node *right;
Node(int k)
{
key = k;
left = right = NULL;
}
};
int maxWidth(Node *root)
{
if (root == NULL)
return 0;
queue<Node *> q;
q.push(root);
int max_width... | ALGO | 0.999772 | 5.107719 |
4d05be12-1ae6-42a1-9410-96ff8d9c2be7 | ruiqini/traj-opt-admm | lib/libigl/tutorial/205_Laplacian/main.cpp | #include <igl/barycenter.h>
#include <igl/cotmatrix.h>
#include <igl/doublearea.h>
#include <igl/grad.h>
#include <igl/jet.h>
#include <igl/massmatrix.h>
#include <igl/per_vertex_normals.h>
#include <igl/readDMAT.h>
#include <igl/readOFF.h>
#include <igl/repdiag.h>
#include <igl/opengl/glfw/Viewer.h>
#include <iostrea... | ALGO | 0.99377 | 5.903661 |
6b876cb5-5b7d-47cf-8774-24b5837902e5 | MkGodh/SelectionSort | SelectionSort/SelectionSort.cpp | #include <iostream>
#include <vector>
int main()
{
std::vector<int> vec = { 7, 1, 5, 4, 6, -20, 100, 5, 3 };
for (int i = vec.size() - 1; i >= 0; i--) {
int maxind = 0;
for (int j = 0; j <= i; j++) {
if (vec[j] > vec[maxind])
maxind = j;
}
int temp = vec[i];
vec[i] = vec[maxind];
vec[maxind] = te... | ALGO | 0.999938 | 4.169417 |
f2f71144-5bfc-41e0-b5a2-a8f2ca2db4f8 | AbdullahAhmed6859/CS-224-OOP-LABS | LAB_7/question2/main.cpp | #include <iostream>
#include "Time.h"
using std::cin;
int main() {
/* Enter your code here. Read input from STDIN. Print output to STDOUT */
int hh, mm, ss;
cin >> hh >> mm >> ss;
Time t1(hh, mm, ss); //t1(hh, mm, ss)
cin >> hh >> mm >> ss;
Time t2(hh, mm, ss);
Time t3;
t3 = t1 + t2; //... | ALGO | 0.939232 | 4.179004 |
47a8d8c0-facd-4089-8699-86032ef26192 | RedBlueBird/competitive-programming | CSES/2-SortingAndSearching/SubarrayDistinctValues.cpp | #include <bits/stdc++.h>
typedef long long ll;
using namespace std;
int main() {
// freopen("../input.txt", "r", stdin);
// freopen("../output.txt", "w", stdout);
//Take inputs
ll n, k;
cin >> n >> k;
vector<int> nums(n);
for (int i = 0; i < n; i++){
cin >> nums[i];
}
//It i... | ALGO | 0.999906 | 4.379832 |
66de7e6a-18cf-4ec0-909a-62cf110b999d | AhmedBukharii/FOP | Question 3, Adding elements to an Array.cpp | #include <iostream>
#include <vector>
using namespace std;
int main() {
vector<int> a = {1, 2, 3, 4, 5};
// Adding more elements to the vector
a.push_back(6);
a.push_back(7);
a.push_back(8);
// Displaying elements of the vector
cout << "Elements in the array:" << endl;
for (int elemen... | ALGO | 0.970581 | 3.59423 |
013e979d-48b5-4777-afa6-564789a3732d | 113bommy/deepmind_codecontests_refine | cpp_source_filter_file/cpp_train_11954_55.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int n, k;
cin >> n >> k;
cout << n % k << endl;
}
| ALGO | 0.999844 | 3.512577 |
2927618c-311c-40c4-abf3-079029de053d | rodalladea/tcc2 | collector-project/opencv-2.4.9/modules/gpu/src/mssegmentation.cpp | #include "precomp.hpp"
#if !defined HAVE_CUDA || defined(CUDA_DISABLER)
void cv::gpu::meanShiftSegmentation(const GpuMat&, Mat&, int, int, int, TermCriteria) { throw_nogpu(); }
#else
using namespace std;
// Auxiliray stuff
namespace
{
//
// Declarations
//
class DjSets
{
public:
DjSets(int n);
int find(i... | ALGO | 0.999023 | 7.464777 |
1d59cf57-a0a3-49c6-9afc-4d90102c6e7e | hyeonjeongs/Algorithm | implementation/14891.cpp | #include<iostream>
#include <vector>
#include <deque>
#include <cmath>
using namespace std;
const int R = 2;
const int L = 6;
deque<int> wheel[5]; //톱니바퀴의 상태 저장
vector<int> rotation(5, 0); // 방향 저장 1: 시계, -1: 반시계, 0: 회전 없음
void decideRotation(int num, int rot) { // 몇번바퀴를 어느방향으로
if (rotation[num] != 0) {
... | ALGO | 0.999948 | 5.068539 |
50fce914-d56e-42e2-ba5d-aedecf65be0a | mayurnagrale/Codes | Heap/lengthInArrayMatrix.cpp | #include<bits/stdc++.h>
using namespace std;
int minimumDistance(vector<vector<int>> area){
return area[0].size();
}
int main(){
vector<vector<int>>area={{1,0,0},{1,0,0},{1,9,1}};
cout<<minimumDistance(area);
return 0;
} | ALGO | 0.962048 | 3.412944 |
62b67c62-5ffc-4482-8bd9-faa0d395dab1 | OsipovDmitry/FreeWorldEngine | plugins/GraphicsEnginePlugin/KdTree.cpp | #include <functional>
#include <math/MeshWrapper.h>
#include <math/MeshPainter.h>
#include "KdTree.h"
#include "GPUMesh.h"
#include "GraphicsScene.h"
#include "GraphicsModel.h"
namespace FreeWorldEngine {
namespace GraphicsEngine {
KdNode::KdNode(KdNode *pParent) :
m_pParent(pParent),
m_boundingBox(Math::buildEm... | TOOL | 0.900234 | 6.748794 |
78cc65f1-59d9-4c0c-b467-fd3c7d134848 | SJTU-ACM/Templates | Reshiram/unlimited/source/Geometry-Algorithm/Delaunay-Decomposition.cpp | /*
Delaunay Triangulation 随机增量算法 :
节点数至少为点数的 6 倍, 空间消耗较大注意计算内存使用
建图的过程在 build 中, 注意初始化内存池和初始三角形的坐标范围 (Triangulation::LOTS)
Triangulation::find 返回包含某点的三角形
Triangulation::add_point 将某点加入三角剖分
某个 Triangle 在三角剖分中当且仅当它的 has_children 为 0
如果要找到三角形 u 的邻域, 则枚举它的所有 u.edge[i].tri, 该条边的两个点为 u.p[(i+1)%3], u.p[(i+2)%3]
*/
const int N... | ALGO | 0.999944 | 5.310242 |
b694bc90-e406-423b-9bd1-67233c7478c9 | theBishal/C-plus-plus | Lab3/2.cpp | #include<iostream>
using namespace std;
class circle
{
int r,area;
#define PI 3.142
public:
void getradius()
{
cout<<"Enter the radius :"<<endl;
cin>>r;
}
void printarea()
{
area=PI*r*r;
cout<<"The area of circle is :"<<area;
}
};
int main()
{
circ... | ALGO | 0.904055 | 3.763527 |
f2d5bfcc-9d95-439a-a09c-ee4bf416bb2f | WindZQ/C_Plus_Plus_Concurrency_in_Action | Chapter_8_Designing_Concurrent_Code/8.12.cpp | class barrier
{
unsigned const count;
std::atomic<unsigned> spaces;
std::atomic<unsigned> generation;
public:
explicit barrier(unsigned count_):
count(count_), spaces(count), generation(0)
{}
void wait()
{
unsigned const my_generation = generation;
if(!--spaces)
... | TOOL | 0.97308 | 4.587764 |
5e32acbb-7f21-451e-babc-131293003dc9 | mustafadurmazer/cpp-sifirdan-uzmanliga | C++ Lists/list.cpp | #include<iostream>
#include<list>
using namespace std;
void printList(list<int> l){
list<int> :: iterator itr;
for(itr=l.begin();itr != l.end();itr++){
cout<<*itr<<endl;
}
}
int main(){
list<int> lst;
lst.push_back(15);
lst.push_back(8);
lst.push_back(12);
lst.push_front(4);
... | TOOL | 0.957631 | 3.882764 |
b9e77132-9806-41b9-bdfa-006b856faa89 | LeeKochav/cpp_hm1_b | PhoneticFinder.cpp | #include "PhoneticFinder.hpp"
#include <stdexcept>
size_t split(const string &txt, vector<string> &strs, char ch)
{
size_t pos = txt.find(ch);
size_t initialPos = 0;
strs.clear();
while (pos != string::npos)
{
strs.push_back(txt.substr(initialPos, pos - initialPos));
initialPos = ... | TOOL | 0.933143 | 5.532984 |
8ec302b6-dc4e-4e09-be72-038f967e2861 | avreetkaur84/Competitive_Programming | dp/stocks/6stocks-fee.cpp | // Question Link - https://leetcode.com/problems/best-time-to-buy-and-sell-stock-with-transaction-fee/
#include <bits/stdc++.h>
#define ll long long
using namespace std;
class Solution {
public:
int memo(int idx, int buy, vector<vector<int>> &dp, vector<int>& prices, int fee) {
if(idx>=prices.size()) retu... | ALGO | 0.999939 | 5.756159 |
4cd1e95b-a02d-418f-abc1-25bd7633ccfc | isiii555/Homework_OOP | ConsoleApplication29/ConsoleApplication29/ConsoleApplication29.cpp | #include <iostream>
using namespace std;
// Task 1.
//class Fraction {
//private:
// int numerator; // suret
// int denominator; // mexrec
//public:
// void InIt(int num,int den) {
// numerator = num;
// denominator = den > 0 ? den : 1;
// }
// Fraction Multiply(const Fraction& f2) {
// Fraction f3;
// numerator ... | TOOL | 0.907373 | 4.662651 |
5a7fc9b2-4567-4d46-aecc-a25c009dc3a6 | Imsourabh2001/DSA_450 | 0258-add-digits/0258-add-digits.cpp | class Solution {
public:
int addDigits(int num) {
int sum=0;
int n=num;
while(n>0)
{
sum=sum+n%10;
n=n/10;
if(n==0&&sum>9)
{
n=sum;
sum=0;
}
}
return sum;
}
}; | ALGO | 0.999956 | 6.401879 |
544ba77a-223e-4172-b089-9ef7c9027ccb | inpinseptipin/AuxPort | AuxPort/Core/SIMD/AuxSimd.cpp | #include "AuxSimd.h"
void AuxPort::Simd::Float256::add(std::vector<float>& result, const std::vector<float>& vec1, const std::vector<float>& vec2)
{
#if AUXSIMD && AUX64SIMD
AuxAssert(AuxPort::Env::supportsAVX(), "CPU doesn't support AVX 256 bit SIMD instructions");
AuxAssert(vec1.size() == vec2.size(), "The sizes o... | TOOL | 0.990576 | 6.426959 |
9fdfc678-a526-420f-8f4a-5b2820987923 | MartinUbl/iCe-Online-Catacore-434 | dep/sockets/Parse.cpp | /** \file Parse.cpp - parse a string
**
** Written: 1999-Feb-10 <EMAIL>
**/
#include <stdlib.h>
#include <string.h>
#include "Parse.h"
#ifdef SOCKETS_NAMESPACE
namespace SOCKETS_NAMESPACE {
#endif
/* implementation of class Parse */
Parse::Parse()
:pa_the_str("")
,pa_splits("")
,pa_ord("")
,pa_the_ptr(0)
,pa_br... | TOOL | 0.887636 | 4.30619 |
12d69222-b573-49f2-9ed7-2b17b791fdfa | xKristee29/1nfo | .history/9_ascdesc_20210307100335.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int h[10][100005];
ifstream f("ascdesc.in");
ofstream g("ascdesc.out");
int n,x,maxa=0,maxd=0,as,ds;
int main(){
int i;
f>>n;
for(i=1;i<=n;++i){
f>>h[0][i];
}
as=ds=0;
for(i=1;i<=n;++i){
if(h[0][i]>maxa){
... | ALGO | 0.999595 | 3.047498 |
c0635b15-12fb-4388-a0df-efec0ff7ae16 | murilolh/cc_ufc | 4 - Computer Graphics/Paint Brush/paint_brush.cpp | #define LINE 1
#define RECTANGLE 2
#define TRIANGLE 3
#define BORRACHA 4
#define TEXTO 5
#define LAPIS 6
#define FILLOFF 7
#define FILLON 8
#define NADA 9
#define PRETO 10
#define BRANCO 11
#define VERMELHO 12
#define CIANO 13
#define VERDE 14
#d... | TOOL | 0.861398 | 4.620934 |
b74a6a0b-fb97-4bed-81f4-d6b798cca3cc | darrylteo/cp4-solutions | 2 Data Structures and Libraries/2. library non-linear/d. Hash Table (set)/greetingcard.cpp | #include <bits/stdc++.h>
using namespace std;
// sample gives hint of 2018^2 = 1118^2 + 1680^2
struct pair_hash {
inline std::size_t operator()(const std::pair<int, int> &v) const {
return v.first * 31 + v.second;
}
};
int main() {
//freopen("input.txt", "r", stdin);
//freopen("output.txt", ... | ALGO | 0.999372 | 4.244284 |
dfcf5c85-2e45-48a3-a4e2-3e8b06bc8fa6 | aaisha7ac/DSA | Striver_Complete_Course/Strings/Basic and Easy String Problem/check_if_two_strings_are_anagram_of_each_other.cpp | /* Given two strings a and b consisting of lowercase characters.
The task is to check whether two given strings are an anagram
of each other or not. An anagram of a string is another string
that contains the same characters, only the order of characters
can be different. For example, act and tac are an anagram of ea... | ALGO | 0.99997 | 5.960262 |
904abfb5-81ce-4860-a20d-31cfad9ac83f | rohitdighe01/Cpp_Program | Operators/GreastetOfThree.cpp | #include<iostream>
using namespace std;
int main(){
cout<<"Enter 1st number: ";
int a ;
cin>>a;
cout<<"Enter 2nd number : ";
int b;
cin>>b;
cout<<"Enter 3rd number : ";
int c;
cin>>c;
if(a>b && a>c){
cout<<a<<" is largest ";
}
if(b>a && b>c){
cout<<b<<" i... | ALGO | 0.999679 | 3.199222 |
95663547-8a5c-48ee-a763-a51f56824b09 | 0xWave-Flow/android-10.0.0_r45-C2 | av/media/libcpustats/CentralTendencyStatistics.cpp | #include <stdlib.h>
#include <cpustats/CentralTendencyStatistics.h>
void CentralTendencyStatistics::sample(double x)
{
// update min and max
if (x < mMinimum)
mMinimum = x;
if (x > mMaximum)
mMaximum = x;
// Knuth
if (mN == 0) {
mMean = 0;
}
++mN;
double delta =... | ALGO | 0.992649 | 6.204975 |
cdccf11c-6901-4824-be09-4d62b5e73b03 | kcheee/Study_Algorithm | 프로그래머스/1/42840. 모의고사/모의고사.cpp | #include <string>
#include <vector>
#include <iostream>
using namespace std;
// 1번 1 2 3 4 5
// 2번 2 1 2 3 2 4 2 5
// 3번 3 3 1 1 2 2 4 4 5 5
vector<int> solution(vector<int> answers) {
vector<int> answer;
int a[5] = {1,2,3,4,5}; int b[8] = {2,1,2,3,2,4,2,5}; int c[10] = {3,3,1,1,2,2,4,4,5,5};
int n... | ALGO | 0.999972 | 5.103442 |
b2fd51f6-65c4-4bab-aece-317f38543c81 | MuVen/LeetCode | 572. Subtree of Another Tree.cpp | /**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode(int x) : val(x), left(NULL), right(NULL) {}
* };
*/
class Solution {
public:
void isubtreeutil(TreeNode* root, string& s, bool left){
if(root == nullptr){
... | ALGO | 0.999645 | 6.146335 |
392d1c4c-2cf9-4eaa-88c5-61bed836b112 | ShrutiRani7029/My_DSA | DFS.CPP | #include<bits/stdc++.h>
using namespace std;
const int N = 1e5+10;
vector<int>g[N];
bool vis[N];
void dfs(int vertex)
{
/*Take action on vertex after entering
the vertex
*/
// cout<<vertex<<endl;
vis[vertex]=true;
for(int child: g[vertex])
{
//cout<<"parent"<<vertex<<" child "<<chil... | ALGO | 0.999914 | 4.876591 |
ffb6c86f-f35d-41af-bbbd-20ffe688638e | Dengqiang1/Quick-Cocos2dx-Community | cocos/base/CCConfiguration.cpp | #include "base/CCConfiguration.h"
#include "platform/CCFileUtils.h"
NS_CC_BEGIN
extern const char* cocos2dVersion();
Configuration* Configuration::s_sharedConfiguration = nullptr;
Configuration::Configuration()
: _maxTextureSize(0)
, _maxModelviewStackDepth(0)
, _supportsPVRTC(false)
, _supportsETC1(false)
, _supp... | CONFIG | 0.901311 | 6.189393 |
cf4112a7-d5ba-41a2-b555-04f42043aae8 | Yawn-Sean/Daily_CF_Problems | daily_problems/2025/03/0322/personal_submission/cf617c_lengli.cpp | /*
lengli_QAQ
Hope there are no bugs!!!
*/
#include <bits/stdc++.h>
#define fastio std::ios::sync_with_stdio(0); std::cin.tie(0); std::cout.tie(0)
#define all(x) x.begin(),x.end()
#define pb push_back
#define i64 long long
struct Point {
i64 x, y;
Point(i64 x0 = 0, i64 y0 = 0) : x(x0), y(y0) {}
friend bool... | ALGO | 0.999338 | 4.137833 |
8344bc33-b20e-460d-be3c-3aea5d46e243 | zilixie/kinematics | libigl/include/igl/copyleft/cgal/minkowski_sum.cpp | #include "../../slice.h"
#include "../../slice_mask.h"
#include "../../LinSpaced.h"
#include "../../unique_rows.h"
#include "../../get_seconds.h"
#include "../../edges.h"
#include <CGAL/Exact_predicates_exact_constructions_kernel.h>
#include <cassert>
#include <vector>
#include <iostream>
template <
typename Derived... | ALGO | 0.998926 | 6.478438 |
21e965de-42bd-4e05-9813-2e703b5fec82 | altaf1808/LeetCode-Solutions | Arrays/Search Insert Position.cpp | /*****************************************************************************
Given a sorted array of distinct integers and a target value, return the index if the target is found. If not,
return the index where it would be if it were inserted in order.
You must write an algorithm with O(log n) runtime complexity.
E... | ALGO | 0.999943 | 6.246252 |
fc790118-ac2c-4628-8985-7bd718d62f98 | mustelad/cpp | leetcode/easy/RomanToInteger/RomanToInteger.cpp | class Solution {
public:
int romanToInt(string s) {
unordered_map <char, int> m = {
{'I' , 1},
{'V' , 5},
{'X' , 10},
{'L' , 50},
{'C' , 100},
{'D' , 500},
{'M' , 1000}};
int last = s[s.length() - 1];
int result = m[last];
for (int i = s.length() - 2; i >=0; i--){
if ( m[s... | ALGO | 0.99891 | 6.086093 |
e8b8aa26-7457-46ce-a1a7-f59c1260b085 | Abdelruhman2/IEEE-ZSB-Technica1-Rookies-23 | Task-6 IEEE/Detect Squares.cpp | class DetectSquares {
public:
int cntPoints[1001][1001] = {};
vector<pair<int, int>> points;
void add(vector<int> p) {
cntPoints[p[0]][p[1]]++;
points.emplace_back(p[0], p[1]);
}
int count(vector<int> p1) {
int x1 = p1[0], y1 = p1[1], ans = 0;
for (auto& [x3, y3] : po... | ALGO | 0.999621 | 5.005229 |
d9e61c07-480a-4fa8-b9b0-68f06653a59f | vfolunin/archives-solutions | MCCME/1398.cpp | #include <iostream>
#include <algorithm>
#include <cmath>
#include <vector>
#include <set>
#include <map>
#include <string>
using namespace std;
struct Circle {
double x, y, radius;
double distTo(Circle &that) {
return hypot(x - that.x, y - that.y);
}
friend istream &operator >> (istream &in,... | ALGO | 0.999933 | 4.488141 |
ea5ea360-60be-4c99-8f48-f921a5911dfd | Srinikal/Sriram_USACO_CF_Solutions | src/USACO/Bronze/SubsequencesSummingToSevens.cpp | #include <iostream>
using namespace std;
#define ll long long
void setIO(string s) {
freopen((s + ".in").c_str(), "r", stdin);
freopen((s + ".out").c_str(), "w", stdout);
}
int main(){
setIO("div7");
ll n;
cin >> n;
ll array[n],prefix[n+1];
int lastFound[7];
prefix[0] =0;
for(int... | ALGO | 0.9997 | 3.593793 |
b8f4960c-4a8a-45bb-b900-a09d27a9dc47 | ishandutta2007/codeforces | hank55663/normal/891/A.cpp | #include<bits/stdc++.h>
#define mp(a,b) make_pair((a),(b))
#define pii pair<int,int>
#define pdd pair<double,double>
#define pll pair<LL,LL>
#define pb(x) push_back(x)
#define x first
#define y second
#define sqr(x) ((x)*(x))
#define EPS 1e-6
#define mii map<int,int>
#define MEM(x) memset(x,0,sizeof(x))
#define MEMS(x... | ALGO | 0.999981 | 3.387812 |
eb1ffa91-1a2e-4207-8c6d-27f6a27805de | SamiulCSE1325/UVa-Problem-Solve | UVa 10107.cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
long long a,ar[10000],i;
while(cin >> a){
ar[i++] = a;
sort(ar,ar+i);
if(i%2 == 0)
cout << (ar[i/2-1]+ar[i/2])/2 << endl;
else
cout << ar[i/2] << endl;
}
return 0;
}
| ALGO | 0.999939 | 3.646289 |
029c5e38-b863-44a7-8f18-69c7f4c30f7c | Cantera/cantera-svn | src/kinetics/ReactionPath.cpp | /**
* @file ReactionPath.cpp
* Implementation file for classes used in reaction path analysis.
*/
#include "cantera/kinetics/ReactionPath.h"
#include "cantera/kinetics/reaction_defs.h"
using namespace std;
namespace Cantera
{
void SpeciesNode::addPath(Path* path)
{
m_paths.push_back(path);
if (path->be... | ALGO | 0.984625 | 6.07444 |
8ada67c5-bf3d-449a-92c0-dbb03ba20323 | oeccsy/algorithm | Algorithm/Programmers/C++/가장 먼 노드_그래프.cpp | #include <string>
#include <vector>
#include <queue>
using namespace std;
struct Node
{
int index;
int dist = 0;
vector<Node*> adj;
bool is_checked = false;
};
Node* nodes[20005];
int solution(int n, vector<vector<int>> edge) {
int max_dist = 0;
int answer = 0;
for(int i=1; i<=... | ALGO | 0.999651 | 4.859784 |
c3c983c8-57b1-4557-8787-69717548fd98 | yfliu017258/CPP_programs | CodeForce/Problems/230A.cpp | #include<bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
#define rep(i, a, b) for(int i = a; i < b; i++)
const int MAX_N = 1010;
int s, n;
pii dragon[MAX_N];
int main()
{
cin.tie(0);
ios_base::sync_with_stdio(0);
cin >> s >> n;
rep(i, 0, n){
cin >> dr... | ALGO | 0.999927 | 3.272212 |
d89d8304-c358-4d48-9164-cab34e452b87 | SpacemanCra1g/ShockSolver | 1D/SR/src/VarConvert.cpp | #include "../include/DomainClass.hpp"
#include "../include/Parameters.h"
// Most of the structure of this code is taken from the PLUTO solver
// So lots of credit to those authors
#define ENERGY_SOLVE 1
#define PRESURE_FIX_SOLVE 2
#define MIN_DENSITY 1.e-5
void Domain::Prims2Cons(double *Uin, double *Uout, int start... | ALGO | 0.99981 | 4.200475 |
fd395ddf-8a62-4815-b3c9-7f67db1e01dd | monta0315/atcoder_begin | past/hina.cpp | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (n); i++)
typedef long long ll;
int main()
{
int n;
cin >> n;
char s[100];
rep(i, n)
{
cin >> s[i];
}
rep(j, n)
{
if (s[j] == 'Y')
{
cout << "Four" << endl;
exit(0);
}
}
cout << "Three" <... | ALGO | 0.999082 | 3.973796 |
9e8f63b8-ff95-43d2-8596-2bf7304f2987 | SahilRaj1/placement-prep | dsa/graphs/10_Shortest_Path_in_Directed_Acyclic_Graphs.cpp | /* TOPIC: Shortest Path in Directed Acyclic Graphs */
// TIME COMPLEXITY: O()
// SPACE COMPLEXITY: O()
// REFERENCE: https://youtu.be/P_bfy0LOU5g
#include <bits/stdc++.h>
using namespace std;
void dfs(int node, unordered_map<int, list<pair<int, int>>> &adj, vector<bool> &visited, stack<int> &st) {
visited[node... | ALGO | 0.999996 | 5.026995 |
2f243d16-1145-4aa7-b835-72896220bee1 | SwatiRanjangit/CPP_DSA_PRACTICE | 2D_Arrays/Assignment/reverseEachWord.cpp | #include<iostream>
#include<climits>
using namespace std;
int reverse(char s[], int start, int end){
while(start < end){
swap(s[start++], s[end--]);
}
}
void reverse_wordWise(char arr[]){
int start = 0, end = 0,i;
for(i=0 ; arr[i] != '\0'; i++){
if(arr[i] == ' '){
end =... | ALGO | 0.999885 | 4.35602 |
dd224df1-3f44-4752-bce1-b44eba103c4a | manikanta2901/ubuntu | .history/practice/cpp/Codechef/InterestingXor_20210312180242.cpp | #include<bits/stdc++.h>
using namespace std;
#define ll long int
string getBinary(ll n){
ll c =0,ans = 0;
string binary = "\0";
for(ll a=0,b=0,i=0;n>0;n=n/2,i++){
a = n/2 ;
b = n%2 ;
binary += to_string(b);
// cout << binary << endl;
}
return binary;
}
ll GetMaximumPowerOf... | ALGO | 0.999708 | 4.624222 |
d34608e9-fdc4-4c54-a4f4-d9a49972b056 | ludmilagudino/TP1-C--Ludmila-Gudino-C2 | Ejercicio 11/Ejercicio 11.cpp | //Ejercicio 11: Simulación de combate simple.
//Crear un programa que pida el nombre, vida, ataque y defensa del jugador, y también los datos del enemigo.Usar una función para calcular el daño del jugador al enemigo y viceversa(ataque menos defensa).Restar los daños a las vidas de ambos personajes.Mostrar los resultado... | ALGO | 0.979713 | 4.745747 |
1cb650c0-97f4-47bb-a5e5-5d8ba9159e93 | nosuv1412/ThuatToanUngDung | Untitled2.cpp | #include <iostream>
#include <cmath>
using namespace std;
int print(int n) {
if(n==1) cout << 1;
else{
print(n-1);
cout << " " << n ;
}
}
int main()
{
print(50);
return 0;
}
| ALGO | 0.999846 | 3.80196 |
a7f8f80b-8efc-4562-907f-d3355af046ba | KMsojib/LeetCode | Array and Hashing/383. Ransom Note.cpp | /*
# Problem : 383. Ransom Note
# Time Complexity : O(n)
# space Complexity : O(n)
# C++ Solution
*/
class Solution {
public:
bool canConstruct(string ransomNote, string magazine) {
map<char, int> mp;
for (auto magazin : magazine) {
mp[magazin]++;
}
bool ok = tr... | ALGO | 0.99997 | 6.268788 |
9e2f55dd-4e63-42fa-b39a-7c03757d2146 | Sumin0916/AlgoStudy | SCCC/3week/[1761]len_of_node.cpp | #include<iostream>
#include<vector>
#include<memory.h>
const int MAX =20;
using namespace std;
vector<pair<int, int>>adj[40001];
int parent[40001][MAX];
int level[40001];
int dis_node[40001];
int visit[40001];
void dfs(int curr, int lev, int cost){
visit[curr] = 1;
level[curr] = lev;
dis_node[curr] = cos... | ALGO | 0.999992 | 4.66924 |
f09677ff-5aea-4f8a-b60b-002ba9435ad0 | ishandutta2007/codeforces | riadwaw/normal/1137/C.cpp | #include <vector>
#include <iostream>
#include <algorithm>
#include <string>
#include <pthread.h>
using namespace std;
#define all(x) begin(x), end(x)
const int maxn = 5e6 + 42;
const int maxs = 1e5 + 42;
vector<int> g[maxs], gt[maxs];
string work[maxs];
char used[maxn];
int d;
#define stack laflal
int stack[2 * ... | ALGO | 0.999942 | 4.518435 |
2c80a851-2f6b-4d87-a30a-1d97fdc1ae7f | lmc5474/Algorithm-cpp | Class051/RobotPassThroughBuilding.cpp | #include <iostream>
#include <algorithm>
using namespace std;
bool valid(int *arr, int size, int energy, int maximum){
for(int i=0;i<size;i++){
energy = 2*energy - arr[i];
if(energy < 0) return false;
if(energy > maximum) return true;
}
return true;
}
int main() {
int size;
... | ALGO | 0.999989 | 4.170378 |
f2bef4d8-cf92-42cb-9ddf-91347093d88e | irajatpandey/Practice | BST/Minimum_Element.cpp | #include<bits/stdc++.h>
#include "BinaryTree.h"
using namespace std;
class BinarySearchTree{
public:
BinaryTree<int> *root;
BinarySearchTree(){
root = NULL;
}
private:
BinaryTree<int> *deleteBST(BinaryTree<int> *root, int data){
if(root == NULL) return N... | ALGO | 0.999956 | 5.444405 |
83d23e30-0a41-4959-b560-f3e82f548d32 | MereyPolatkhan/competitive_programming_and_algorithms | _codeforces/_archive_cf/1538F.cpp | #include <iostream>
#include <algorithm>
#include <cstring>
#include <cstdio>
#include <cstdlib>
#include <string>
#include <map>
#include <set>
#include <unordered_map>
#include <unordered_set>
#include <cmath>
#include <cassert>
#include <queue>
#include <bitset>
#include <numeric>
#include <vector>
#include <ctime>
... | ALGO | 0.999638 | 3.954182 |
e2e68ed3-dca4-4054-b6d4-32bc8260ca78 | parallel101/course | slides/oldatomic/vector_atomic_push_back.cpp | #include <atomic>
#include <iostream>
#include "parallel_pool.hpp"
std::vector<int> a(10);
std::atomic<int> counter;
void t1() {
a[counter.fetch_add(1, std::memory_order_relaxed)] = 1;
a[counter.fetch_add(1, std::memory_order_relaxed)] = 3;
a[counter.fetch_add(1, std::memory_order_relaxed)] = 4;
}
void t... | ALGO | 0.93342 | 4.31788 |
bb6ae4b7-be32-4e53-8faf-4eef53132466 | ismarp2/os-virtual-memory | os-virtual-memory/os-virtual-memory.cpp | #include <iostream>
#include <fstream>
#include <vector>
#include <string>
#include <bitset>
#include <locale.h>
#include <limits>
#include <tuple>
using namespace std;
int ObterValorLinha(int bits) {
setlocale(LC_ALL, "");
string filename = "";
if (bits == 16)
filename = "addresses_16b.txt";
... | ALGO | 0.960506 | 5.133955 |
9b9ff753-cbd8-457c-9300-2bfb64f7b4b7 | rayrone/uva | 10018.cpp | #include<stdio.h>
/* Reverse and Add - 10018 */
long long inverte(long long n){
long long i,j,aux1,aux2,ant,num[11];
i=0;
aux1=10;
aux2=1;
ant=0;
while(n/aux2>0)
{
num[i]=(n%aux1-ant)/aux2;
ant=n%aux1;
aux1*=10;
aux2*=10;
i++;
}
aux1=1;
n=0;
for(j=i-1;j>=0;j--)
{
n+=aux1*num[j];
... | ALGO | 0.999719 | 3.165857 |
53d3b9d4-2997-43e2-8a84-25b4e34a2d14 | papireddy903/leetcode-papireddy | 2006-find-the-student-that-will-replace-the-chalk/find-the-student-that-will-replace-the-chalk.cpp | class Solution {
public:
int chalkReplacer(vector<int>& chalk, int k) {
long summ = 0;
for (int i = 0;i<chalk.size();i++){
summ += chalk[i];
}
int new_k = k%summ;
for (int i = 0;i<chalk.size();i++){
if (new_k < chalk[i]){
retur... | ALGO | 0.999964 | 5.74382 |
1183319e-cd4a-40b7-9d79-cca04dc01fe6 | chris-sophos/ocomp | C3/code/C3P37.cpp | #include <iostream>
using namespace std;
int main() {
int n, s;
cin >> n >> s;
int x[n + 1] { 0 };
for (int i = 1; i <= n; i++) {
cin >> x[i];
x[i] += x[i - 1];
}
unsigned int min = -1;
if (x[n] >= s) {
for (int l = 0, r = 0; r <= n; r++) {
if (x[r] < s) continue;
while (x[r] - x... | ALGO | 0.999956 | 3.576066 |
5a5342da-2732-4129-afb9-ffc4df874ff0 | Vaishnavi2701-mk/Data_Structure_CPP_Coding_Ninjas | DP-2/Knapsack_memonization.cpp | /*
Code: Knapsack (Memoization and DP)
A thief is robbing a store and can carry a maximal weight of W into his knapsack. There are N items and ith item weighs wi and is of value vi. Considering the constraints of maximum weight that knapsack can carry, you have to find and return the maximum value that thief can gener... | ALGO | 1 | 5.107983 |
57bffb54-3936-4882-923f-3d7efa02f4e5 | sh-saurabh4/geeksforgeeks | longest_bitonic_subsequence.cpp | #include<bits/stdc++.h>
using namespace std;
int lbs(vector<int>& v,int n){
vector<int> dpi(n,1);
for(int i = 1; i < n; i++){
for(int j = 0; j < i; j++){
if(v[i] > v[j])
dpi[i] = max(dpi[i],dpi[j]+1);
}
}
vector<int> dpd(n,1);
for(int i = n-2; i >= 0; i--){
for(int j = n-1; j > i; j--)... | ALGO | 0.999903 | 3.95738 |
6d56e7c6-af88-4b73-96fa-f7e3bca1a881 | svn2github/FDM | Bittorrent/libtorrent/src/ed25519/key_exchange.cpp | #include "libtorrent/ed25519.hpp"
#include "fe.h"
void ed25519_key_exchange(unsigned char *shared_secret
, const unsigned char *public_key, const unsigned char *private_key) {
unsigned char e[32];
unsigned int i;
fe x1;
fe x2;
fe z2;
fe x3;
fe z3;
fe tmp0;
fe tmp1;
int po... | ALGO | 0.999475 | 5.463734 |
534ce7d7-1601-4a08-a541-761f5e983e2a | PSukhalani-96/Programming-Practice | unique_path_with_obstacles.cpp | /*
A robot is located at the top-left corner of a m x n grid (marked 'Start' in the diagram below).
The robot can only move either down or right at any point in time. The robot is trying to reach the bottom-right corner
of the grid (marked 'Finish' in the diagram below).
Now consider if some obstacles are adde... | ALGO | 0.999949 | 6.078373 |
84e2e6fc-a53d-442a-9c4c-a6350fa02ffe | BigWhite666/UE4ImguiDumper | my_android_opencv/modules/dnn/src/ocl4dnn/src/ocl4dnn_softmax.cpp | #include "../../precomp.hpp"
#include <vector>
#include "../include/common.hpp"
#include "../include/ocl4dnn.hpp"
#include "opencl_kernels_dnn.hpp"
namespace cv { namespace dnn { namespace ocl4dnn {
template<typename Dtype>
OCL4DNNSoftmax<Dtype>::OCL4DNNSoftmax(OCL4DNNSoftmaxConfig config)
{
softmax_axis_ = config... | ALGO | 0.988609 | 6.731039 |
83ccb50f-f394-41e2-be9e-83f714f22a1e | maeri-project/FEATHER | LayoutLoop/layoutloop/src/loop-analysis/isl-analysis/isl-to-legacy-adaptor.cpp | #include "loop-analysis/isl-analysis/isl-to-legacy-adaptor.hpp"
#include <barvinok/isl.h>
#include "isl-wrapper/ctx-manager.hpp"
#include "isl-wrapper/isl-functions.hpp"
namespace analysis
{
/******************************************************************************
* Local function declarations
**************... | TOOL | 0.961239 | 7.268777 |
98392ccd-d209-4d97-9a86-fb998aef101e | hasez/tessoku | resources/B32/etc/gen_physics0523.cpp | #include<bits/stdc++.h>
using namespace std;
long long get_rand(long long lim,mt19937_64 &eg){
return (long long)(eg()%lim);
}
vector<int> solve(vector<int> a){
vector<int> dp(100005,0);
dp[0]=-1;
for(int i=1;i<100005;i++){
dp[i]=-1;
for(auto &nx : a){
if((i-nx)<0){continue;}
if(dp[i-nx]==... | ALGO | 0.998608 | 3.178181 |
c1f40e1a-ba76-455e-b118-2736ce7c7f05 | EclipseShade/Metin2-Modern-Base-Source | Extern/ExternClient/binary_include/cryptopp565/zinflate.cpp | // zinflate.cpp - written and placed in the public domain by Wei Dai
// This is a complete reimplementation of the DEFLATE decompression algorithm.
// It should not be affected by any security vulnerabilities in the zlib
// compression library. In particular it is not affected by the double free bug
// (http://www.kb.... | ALGO | 0.996762 | 4.158792 |
4375ac5b-cbd2-4a59-926f-8bf1bc861fd9 | Draco-21/CS412_chatbot | resources/Year 1/Practical/Input with Addition.cpp | #include <iostream>
using namespace std;
int main()
{
int x;
int y;
int z;
cout<<"Enter a value for x:"<<endl;
cin>>x;
cout<<"Enter a value for y:"<<endl;
cin>>y;
z=x*y*(y+x);
cout<<"Z="<<z<<endl;
return 0;
}
| TOOL | 0.992188 | 3.443857 |
c51af8c1-ccb5-42e7-b1ce-2175e9a6e7b4 | Rayeesgithub/DSA_365_Challenges | Binary-Search/find-the-row-with-maximum-number-of-1.cpp | //https://www.geeksforgeeks.org/problems/row-with-max-1s0023/1?utm_source=youtube&utm_medium=collab_striver_ytdescription&utm_campaign=row-with-max-1s
// striver
// broute force
// Initialize variables to keep track of the maximum number of 1s found
// and the index of the row containing that maximum number.
int cnt_... | ALGO | 0.999982 | 6.450172 |
670bce8e-1cce-4522-9631-be9d79f704c5 | scs/leanXopencv | src/cv/cvthresh.cpp | #include "_cv.h"
namespace cv
{
static void
thresh_8u( const Mat& _src, Mat& _dst, uchar thresh, uchar maxval, int type )
{
int i, j;
uchar tab[256];
Size roi = _src.size();
roi.width *= _src.channels();
#if CV_SSE2
__m128i _x80 = _mm_set1_epi8('\x80');
__m128i thresh_u = _mm_set1_epi8(thresh)... | ALGO | 0.996993 | 5.792084 |
0aada4dc-79d9-4879-8510-fb774ca7dc19 | zxwbj/danei | CSD1404(待补充)/STL(CSD1404,MW)/day02/partspec.cpp | #include <iostream>
using namespace std;
// 基本版本
template<typename T1, typename T2>
class Dual {
public:
static void printType (void) {
cout << "Dual<T1,T2>" << endl;
}
};
// 针对第二个类型参数取short的局部特化版本
template<typename T>
class Dual<T, short> {
public:
static void printType (void) {
cout << "Dual<T,short>" << endl;... | TOOL | 0.897131 | 4.548583 |
6d698045-2dd6-4af3-8547-08fbf7a0b9f5 | emadpres/usaco | 1/1.4/1.4.8/skidesign.cpp | /*
ID: emadpres1
TASK: skidesign
LANG: C++
*/
#include <iostream>
#include <fstream>
#include <string>
#include <algorithm>
using namespace std;
int main() {
ofstream fout ("skidesign.out");
ifstream fin ("skidesign.in");
const int MAX_N = 1000, MAX_ELEVATION = 100;
int N, elev[... | ALGO | 0.999837 | 3.845976 |
89c6c9bc-f6d7-4506-8040-db5e5f49acba | ishandutta2007/codeforces | antoine/normal/861/D.cpp | #include <iostream>
#include <algorithm>
#include <cstring>
#include <vector>
#include <string>
#include <functional>
#include <queue>
#include <set>
#include <unordered_set>
#include <map>
#include <unordered_map>
std::vector<std::pair<int, int>> getSubstrings(std::string num) {
std::vector<std::pair<int, int>> res;... | ALGO | 0.99988 | 4.793123 |
397dc7de-5ffb-4055-8446-c34ff921921b | peacecoder229/systemp | oneDNN/src/gpu/intel/ocl/bnorm/bnorm_utils.cpp | #include "gpu/intel/ocl/bnorm/bnorm_utils.hpp"
#include "common/utils.hpp"
#include "gpu/intel/compute/utils.hpp"
#include "gpu/intel/ocl/bnorm/bnorm_lookup_table.hpp"
namespace dnnl {
namespace impl {
namespace gpu {
namespace intel {
namespace ocl {
namespace bn_utils {
using namespace dnnl::impl::utils;
float get_... | TOOL | 0.913662 | 5.996028 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.