uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
92071157-9211-4e76-9c10-530112632d6d | Ehsan973/flutter_calculator_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 |
cd626bd9-73cb-4e55-994d-b31aa6d18903 | TSStudio/C-course-template | leetcode/27.cpp | #include <bits/stdc++.h>
using namespace std;
class Solution {
public:
int removeElement(vector<int>& nums, int val) {
int l = 0, r = nums.size();
while (l < r) {
if (nums[l] == val) {
nums[l] = nums[--r];
} else {
l++;
}
... | ALGO | 0.999906 | 6.07442 |
152203ca-d533-46d8-ab23-53c1ec03238a | Raghav354/Striver-s-A2Z-Sheet | Linked List/Medium DLL/removeDuplicates.cpp | Node *removeDuplicates(struct Node *head)
{
if (head == NULL || head->next == NULL)
{
return head;
}
Node *curr = head;
while (curr != NULL && curr->next != NULL)
{
if (curr->data == curr->next->data)
{
curr->next = curr->next->next;
if (curr->next... | ALGO | 0.997988 | 3.889402 |
54cc8d5f-3791-4c65-b80f-0dcafc3d85ea | nid-amn/cpc_24 | week2/16_boolean_matrix.cpp | #include<bits/stdc++.h>
using namespace std;
class Solution{
public:
void booleanMatrix(vector<vector<int> > &matrix)
{
// code here
int rows=matrix.size(),cols=matrix[0].size();
int r[rows],c[cols];
for(int i=0;i<rows;i++){
r[i]=0;
}
f... | ALGO | 0.99983 | 4.596467 |
4ff4fc80-f3a5-4307-9753-cbbcc57686c8 | AYglazk0v/practicum_Cpp_developer | sprint0_free/Итоговые_проект/Ранжирование_по_TF-IDF/main.cpp | #include <algorithm>
#include <iostream>
#include <map>
#include <set>
#include <string>
#include <cmath>
#include <utility>
#include <vector>
using namespace std;
const int MAX_RESULT_DOCUMENT_COUNT = 5;
string ReadLine() {
string s;
getline(cin, s);
return s;
}
int ReadLineWithNumber() {
int result;
cin... | ALGO | 0.998551 | 5.443879 |
dee7777b-d1d8-42c4-91a6-68adfcb53a99 | YashhhCodesHere/Cpp-DSA-Questions-Practice | Class & Lab Practics/LAB 11/Q1.cpp | #include <iostream>
#include <vector>
using namespace std;
class Graph {
private:
int numVertices;
vector<vector<int>> adjMatrix;
vector<vector<int>> adjList;
public:
Graph(int vertices) {
numVertices = vertices;
adjMatrix.resize(vertices, vector<int>(vertices, 0));
adjList.res... | ALGO | 0.999439 | 6.116148 |
a7a58c61-a59a-4300-affc-3c56eeca5a9f | HelloFancyWorld/OOP2023 | OOPFinal/p1/test.cpp | #include<iostream>
using namespace std;
void f(int& x) {
x += 1;
cout << -1 << endl;
}
void f(int&& x) {
int& y = x; // (1)
const int& z = y + 1; // (2)
cout << 0<< endl;
f(y); // (3)
}
int main() {
int a = 1;
f(a); // (4)
cout ... | ALGO | 0.906282 | 3.878221 |
2759080d-146a-4444-9531-e8da1bd09124 | hfzhmp/Latihan-SABIT-Academy | latihan-4-1.cpp | #include <iostream>
using namespace std;
void hitungJumlahGenap(int n) {
if (n < 0) {
cout << "N tidak boleh negatif." << endl;
return;
}
int jumlah = 0;
for (int i = 0; i < n; i++) {
jumlah += 2 * i;
}
cout << "Jumlah dari " << n << " bilangan genap pertama adalah: " << jumlah << endl;
}
int... | ALGO | 0.998014 | 5.946889 |
7c2ec8c0-eb5d-4d6d-93ba-75582c73de14 | ishandutta2007/codeforces | wzyyn/normal/1374/C.cpp | #include<bits/stdc++.h>
#define ll long long
#define ull unsigned ll
#define uint unsigned
#define pii pair<int,int>
#define pll pair<ll,ll>
#define IT iterator
#define PB push_back
#define fi first
#define se second
#define For(i,j,k) for (int i=(int)(j);i<=(int)(k);i++)
#define Rep(i,j,k) for (int i=(int)(j);i>=(int)... | ALGO | 0.999861 | 3.438977 |
1169603d-0ecd-463e-b715-d69e29210817 | Nafyaz/my-codes | Codeforces GYM/103430H(2).cpp | #include<bits/stdc++.h>
using namespace std;
#define ll long long
#define ff first
#define ss second
ll n;
ll m[200005], k[200005];
map<ll, ll> freq;
vector<pair<ll, ll>> v;
set<ll> sentMessages;
double findExpected()
{
ll i;
double ret = 0;
for(i = 0; i < n; i++)
{
if(sentMessages.find(m[... | ALGO | 0.999993 | 3.942415 |
ef38904e-ed1e-4062-9843-d4e1d76b8f76 | MahajanYashasvi156/LeetCoding | Consecutive 1's not allowed - GFG/consecutive-1s-not-allowed.cpp | // { Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
#define ll long long
// } Driver Code Ends
//User function template for C++
/*
Link - https://practice.geeksforgeeks.org/problems/consecutive-1s-not-allowed1912/1/#
TC - O(N)
SC - O(1)
Approach - maintain two variables to track no of strings of ... | ALGO | 0.999826 | 5.872179 |
d7995dfd-4056-430b-b5ab-e43adc3ff829 | selfrender/Windows-Server-2003 | printscan/ui/uicommon/wiacrc32.cpp | #include "precomp.h"
#pragma hdrstop
#include "wiacrc32.h"
namespace WiaCrc32
{
/*
This is the precomputed data table for the CRC32 algorithm as specified in
IS0 3309. See RFC-1662 and RFC-1952 for implementation details and
references.
To calculate this table, use the following function:
vo... | TOOL | 0.911374 | 5.989651 |
a722f185-228b-4c55-adde-b206be6338e0 | Toufiquer/phitron | parsonal-practice/17 August/test.cpp | #include <bits/stdc++.h>
using namespace std;
class Node{
public:
int val;
Node *left;
Node *right;
Node(int val){
this->val = val;
this->left = NULL;
this->right = NULL;
}
};
void getInput(Node* &root){
queue<Node*> qNode;
qNode.p... | ALGO | 0.999945 | 4.264799 |
c43ceb60-b17c-41eb-8b95-d21efe769422 | Hiyabye/Baekjoon | 01xxx/01991.cpp | #include <iostream>
using namespace std;
typedef struct Node {
char data;
Node *left;
Node *right;
} Node;
class BinaryTree {
private:
public:
Node *root;
Node *newNode(char data) {
Node *node = new Node();
node->data = data;
node->left = nullptr;
node->right = nullptr;
return node;
}... | ALGO | 0.999928 | 4.376619 |
91e1d116-58c8-4600-986f-e9a43f3871fb | sangyong-99/algorithm_study | algorithm_study/baekjoon/백트래킹/1759.cpp | //
// 1759.cpp
// algorithm_study
//
// Created by 신상용 on 8/25/24.
//
#include <bits/stdc++.h>
using namespace::std;
int L, C;
char vowels[5]{'a', 'e', 'i', 'o', 'u'};
int main() {
cin >> L >> C;
char arr[C];
for(int i = 0; i < C; i++) {
cin >> arr[i];
}
sort(arr, arr+C);
int initA... | ALGO | 0.999998 | 4.908103 |
ac700ab6-61ee-41e1-a8ec-8749025d088b | koosaga/olympiad | ICPC/WF/wf2015_f.cpp | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <limits.h>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <algorithm>
#include <string>
#include <functional>
#include <vector>
#include <numeric>
#include <deque>
#include <utility>
#include <bitset>
#includ... | ALGO | 0.999939 | 3.179115 |
69073037-fdb0-4c3e-aa55-5c1fb04fed7e | yellowjung/codingstudy | Solution/23290.cpp | #include <iostream>
#include <vector>
#include <algorithm>
#include <queue>
#include <cstring>
#define MAX 5
using namespace std;
struct fish{
int x;
int y;
int dir;
};
int n = 4, m , s, maxEating;
int tempRoute[3], route[3];
int smellMap[MAX][MAX];
vector<fish> fishMap[MAX][MAX], cMap[MAX][MAX];
pair<int... | ALGO | 0.999923 | 4.057201 |
4f1fbf23-3c93-42e0-bdeb-743ad4e8091c | ShubhamKapil04/Placement | Pattern And loops/For Loop/sumn.cpp | #include<iostream>
using namespace std;
int main(){
int n;
cout << " Enter any number: ";
cin >> n;
int sum = 0;
for (int i = 1; i <= n; i++)
{
sum = sum + i;
}
cout << sum;
} | ALGO | 0.994036 | 3.478663 |
c0860e0c-c2eb-4f8a-a954-1db252cb182e | msft-mirror-aosp/platform.hardware.qcom.media | msm8996/mm-video-v4l2/vidc/vdec/src/frameparser.cpp | #include <stdio.h>
#include <stddef.h>
#include <stdlib.h>
#include <fcntl.h>
#include <stdarg.h>
#include <string.h>
#include <errno.h>
#include <unistd.h>
#include <pthread.h>
#include <ctype.h>
#include <sys/stat.h>
#include <sys/ioctl.h>
#include <sys/mman.h>
#include <sys/time.h>
#include <sys/poll.h>
#include <st... | TOOL | 0.861303 | 3.996777 |
1a0256f1-10a6-4552-abf4-2fba70a00ede | 1mSSong/problems | ct7_5.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int binarySearch(vector<int>& arr, int target, int start, int end) {
if (start > end)
return -1;
int mid = (start + end) / 2;
if (arr[mid] == target)
return mid;
else if (arr[mid] > target)
return binarySearch(arr, target, sta... | ALGO | 0.999995 | 4.82654 |
2a0e676c-730f-473b-a0db-318dfe00a8d3 | Codesmith28/cpp_practice | recursions/Tiling_problem.cpp | #include<bits/stdc++.h>
using namespace std;
int tileWay(int n)
{
if(n==0)
{
return 0;
}
if(n==1)
{
return 1;
}
return tileWay(n-1) + tileWay(n-2);
}
int main()
{
cout<<"You are provided with 2*1 tile.\n"<<"Enter n for 2*n board: \n";
int n;
cin>>n;
cout<<t... | ALGO | 0.999378 | 3.926766 |
d2fe6cf9-8818-4195-bc65-2fa1085ac5ad | sarvex/leetcode-giz | solution/0500-0599/0567.Permutation in String/Solution.cpp | class Solution {
public:
bool checkInclusion(string s1, string s2) {
int n = s1.size(), m = s2.size();
if (n > m) {
return false;
}
vector<int> cnt(26);
for (int i = 0; i < n; ++i) {
--cnt[s1[i] - 'a'];
++cnt[s2[i] - 'a'];
}
... | ALGO | 0.999974 | 6.440907 |
e083ee55-36cf-4123-ab5a-e5b9d4e05860 | eezstreet/Cairn-OpenJK | codemp/rd-dedicated/tr_main.cpp | // tr_main.c -- main control flow for each frame
#include "tr_local.h"
#include "ghoul2/g2_local.h"
trGlobals_t tr;
refimport_t ri;
void R_AddTerrainSurfaces(void);
/*
** R_CullLocalPointAndRadius
*/
int R_CullLocalPointAndRadius( const vec3_t pt, float radius )
{
vec3_t transformed;
R_LocalPointToWorld( pt, tr... | TOOL | 0.86767 | 5.624515 |
3209d33b-2a50-427c-9c0c-7d2d2c678d01 | jaywangpku/Algorithm | ccf-1/4.1-3.cpp | #include <iostream>
#include <cstdio>
using namespace std;
int main()
{
int n;
double ans = 0;
cin >> n;
for(int i = 0; i < n; i++){
int temp;
cin >> temp;
ans += temp;
}
ans = ans/n;
printf("%.2f\n", ans);
return 0;
}
| ALGO | 0.990548 | 3.32727 |
486ac93d-d0d8-4ed3-acf6-29a2b124c41f | wwar-lock/codes | GFG/Must_Do/rearrage_maxmin.cpp | // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Do not continue reading if you dont want to die..............XD
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// When I wrote this, only God and I understood what I was doing
// Now, God only knows
// Aditya Sharma --------... | ALGO | 0.99994 | 4.084434 |
26f82658-d52b-4191-a46e-015753918321 | The-No-Hands-company/RudeBase3D | third_party/libigl/libigl-2.5.0/include/igl/frame_field_deformer.cpp | #include <Eigen/Dense>
#include <Eigen/Sparse>
#include <vector>
#include "cotmatrix_entries.h"
#include "cotmatrix.h"
#include "vertex_triangle_adjacency.h"
namespace igl
{
class Frame_field_deformer
{
public:
IGL_INLINE Frame_field_deformer();
IGL_INLINE ~Frame_field_deformer();
// Initialize the optimizer... | ALGO | 0.999565 | 5.852856 |
3bea0af0-8fde-4834-b7e6-7dd2cbf92050 | Grandediw/Esercizidiw | Code/es2.8blocco2/es2.8blocco2/main.cpp | //
// main.cpp
// es2.8blocco2
//
// Created by Stefano Tonini on 26/01/21.
//
#include <iostream>
using namespace std;
void swap(int array[]){
for (int j=0; j<10; j++) {
for (int i=0; i<=9; i++) {
while(array[i]<array[(i+1)])
array[i]=array[(i+1)];
}
}
cout ... | ALGO | 0.998243 | 4.131651 |
7fe9d171-177a-4d98-badf-5cbfe385b7fc | typr7/practice | judge/leetcode/leetcode783.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.999968 | 6.454082 |
e2e05677-0874-4585-81bb-20539a9eef46 | pincher-chen/lammps-induced-dipole | src/DIPOLE/atom_vec_dipole.cpp | #include <cmath>
#include <cstdlib>
#include "atom_vec_dipole.h"
#include "atom.h"
#include "comm.h"
#include "domain.h"
#include "modify.h"
#include "fix.h"
#include "memory.h"
#include "error.h"
using namespace LAMMPS_NS;
/* ---------------------------------------------------------------------- */
AtomVecDipole::A... | TOOL | 0.921228 | 6.891705 |
e9068af6-9e14-42a3-8f03-6ff488be4502 | Chan531/Programmers_level2 | 튜플.cpp | #include <string>
#include <vector>
using namespace std;
vector<int> solution(string s) {
int idx = 2;
vector<vector<int>> arr;
vector<int> answer, num, arrnum(100001);
string n = "";
while (idx < s.length())
{
if (s[idx] == '}')
{
arr.push_back(num);
nu... | ALGO | 0.999561 | 4.453873 |
5004f73d-a299-45b4-9ac9-9c7e7e4096e6 | Coach-Academy/Winter-1-2023 | Level 2 Class 1/Practice G4/Week 13/H.cpp | #include<bits/stdc++.h>
#define ll long long
#define endl '\n'
using namespace std;
void doWork() {
ll n,r,avg;
cin >> n >> r>> avg;
vector<pair<ll,ll> > v(n);
ll sum =0;
for (int i = 0; i < n; ++i) {
cin >> v[i].second >> v[i].first;
sum += v[i].second;
}
sort(v.begin(), v... | ALGO | 0.99948 | 3.839999 |
b5f7373c-1497-4ebc-8254-37905d92d315 | yuhuan12/yuhuan | source/module_hsolver/genelpa/elpa_new_real.cpp | #include "elpa_new.h"
#include "elpa_solver.h"
#include "my_math.hpp"
#include "utils.h"
#include <cfloat>
#include <complex>
#include <cstring>
#include <fstream>
#include <map>
#include <mpi.h>
#include <regex>
using namespace std;
extern map<int, elpa_t> NEW_ELPA_HANDLE_POOL;
int ELPA_Solver::eigenvector(double* ... | ALGO | 0.999758 | 3.030302 |
f5217fdc-7cd8-4fa2-9868-d2e1febb42e0 | PaukIsUha/optimizing_formating_code | predictions/full_output_predicted_submissions/Codenet/p02269/386755947/4.cpp | #include <cstdio>
using namespace std;
bool d[33554432];
char k[128];
int c(char str[12]) {
int ans = str[0], i = 1;
for (i; str[i] != '\0'; i++) {
ans <<= 2;
ans += k[str[i]];
}
return ans;
}
int main() {
k['A'] = 0;
k['C'] = 1;
k['G'] = 2;
k['T'] = 3;
int n;
scanf("%d", &n);
char s[7];
... | ALGO | 0.998907 | 4.009952 |
a5f0fa50-4897-4529-af4a-61d6988efa63 | Kikols17/Kutils | tests/valid_tests/partitionpointK_end.cpp | #include <bits/stdc++.h>
int n;
using namespace std;
int main(int argc, char* argv[]) {
n = atoi(argv[1]);
int* array = (int*)malloc(n*sizeof(int));
for (int i=0; i<n; ++i) {
array[i] = i;
cout << array[i] << endl;
}
cout << endl;
cout << (partition_point(array, array+n, []... | ALGO | 0.996557 | 4.073491 |
b509234c-88d2-40b1-bb6e-8d52782c831a | Micro-ice-ice/Navier-Stokes-equations | source_dir/doc/examples/Tutorial_ReductionsVisitorsBroadcasting_maxnorm.cpp | #include <iostream>
#include <Eigen/Dense>
int main()
{
Eigen::MatrixXf mat(2,4);
mat << 1, 2, 6, 9,
3, 1, 7, 2;
Eigen::Index maxIndex;
float maxNorm = mat.colwise().sum().maxCoeff(&maxIndex);
std::cout << "Maximum sum at position " << maxIndex << std::endl;
std::cout << "The correspondin... | ALGO | 0.999925 | 4.271511 |
163e615d-3f53-4f6b-b562-26b9ab26fdb0 | Anik-Modak/CompetitiveProgramming | Codeforces/DZY Loves Chessboard.cf.cpp | //Anik_Modak
#include<bits/stdc++.h>
#define MAX 105
#define mem(x,y) memset(x,y,sizeof(x));
#define pii pair<int,int>
using namespace std;
int dx[] = {1, -1,0, 0};
int dy[] = {0, 0, 1, -1};
bool visited[MAX][MAX];
int lev[MAX][MAX];
char grid[MAX][MAX];
int row, column;
bool valid(int x, int y)
{
if(x>=0 && x<r... | ALGO | 0.999948 | 3.521438 |
7584ec61-f5de-434d-8b50-3b7ba789217a | riyanurdiansyah/helthy | 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 |
02ae70a2-f615-4375-a553-13c922f41454 | Diegoriv-era/CS315 | pj2/Worm.cpp | /* Diego Rivera Project 2 */
#include "Worm.hpp"
#include <string>
#include "Cell.hpp"
#include <array>
#include <sys/uio.h>
#include <unistd.h>
#include <stdlib.h>
#include <sys/time.h>
#include <sgtty.h>
#include <curses.h>
#include <signal.h>
#include <iostream>
using namespace std;
// const int MAX_QSIZE = 2000;
... | TOOL | 0.973247 | 3.950871 |
e591db88-8a9d-4ab5-8af0-1eded9a62bd3 | AospExtended/platform_external_libcxx | test/std/algorithms/alg.sorting/alg.binary.search/equal.range/equal_range.pass.cpp | // <algorithm>
// template<ForwardIterator Iter, class T>
// requires HasLess<T, Iter::value_type>
// && HasLess<Iter::value_type, T>
// constexpr pair<Iter, Iter> // constexpr after c++17
// equal_range(Iter first, Iter last, const T& value);
#include <algorithm>
#include <vector>
#include <cassert>
... | TEST | 0.990074 | 6.972918 |
8fa04e49-2e98-41bc-8be2-ed0cd6d65b51 | Rvvijays/leetcode | 761-employee-free-time/employee-free-time.cpp | /*
// Definition for an Interval.
class Interval {
public:
int start;
int end;
Interval() {}
Interval(int _start, int _end) {
start = _start;
end = _end;
}
};
*/
class Solution {
public:
vector<Interval> employeeFreeTime(vector<vector<Interval>> schedule) {
vector<pai... | ALGO | 0.999963 | 5.234237 |
d0b3cf15-17a0-4e32-bbee-183b536ad776 | Protecia/NNvision | darknet_nvenc/opencv-4.3.0/samples/cpp/camshiftdemo.cpp | #include "opencv2/core/utility.hpp"
#include "opencv2/video/tracking.hpp"
#include "opencv2/imgproc.hpp"
#include "opencv2/videoio.hpp"
#include "opencv2/highgui.hpp"
#include <iostream>
#include <ctype.h>
using namespace cv;
using namespace std;
Mat image;
bool backprojMode = false;
bool selectObject = false;
int ... | ALGO | 0.923168 | 6.418211 |
bb355a57-8a62-47cc-9b2c-dce7df176053 | quangan16/Luyen_Code | C++/src/MT05.cpp | #include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
void Input(vector<vector<int>> &v, int m, int n){
for(int i = 0; i < m ; i++){
for(int j = 0; j < n; j++){
cin>>v[i][j];
}
}
}
void Output(const vector<vector<int>> &v, int m, int n){
for(int i = 0; i... | ALGO | 0.999784 | 3.543977 |
56528b83-6c65-4ff8-a0e1-5da2095111c7 | zzy5510/UR5-grasp-and-kinect-demo-on-gazebo | src/UR_with_Robotiq_grasp_gazebo/depends/ros_controllers/diff_drive_controller/src/odometry.cpp | /*
* Author: Luca Marchionni
* Author: Bence Magyar
* Author: Enrique Fernández
* Author: Paul Mathieu
*/
#include <diff_drive_controller/odometry.h>
#include <boost/bind.hpp>
namespace diff_drive_controller
{
namespace bacc = boost::accumulators;
Odometry::Odometry(size_t velocity_rolling_window_size)
:... | ALGO | 0.936067 | 6.891716 |
a92966d3-e570-471f-989b-0bd4c6262a50 | ArchishmanSengupta/competitive-coding | Goldman Sachs/AbsMinimumDiff.cpp | /*
Q1. FIND THE MINIMUM abs DIFFERENCE BETWEEN THE ELEMENTS OF TWO ARRAYS
Approach nlogn + nlogn :- sorting and two-pointers approach
1. Sort the array
2. Use two pointers for each array and compare the two elements
3. Store the minimum difference in a result variable which is initially set to INT_... | ALGO | 0.999982 | 5.411766 |
9c27d9d2-4e96-4cc5-9861-46a4ee52580e | oxygen-hunter/Flashboom | data/big-vul-100/add_attention_code/Mixtral/top0-100/fair-distribution-of-cookies-Solution.distributeCookies/177896_nan.cpp | static void become_daemon(const char *pidfile)
{
#ifndef _WIN32
pid_t pid, sid;
pid = fork();
if (pid < 0) {
exit(EXIT_FAILURE);
}
if (pid > 0) {
exit(EXIT_SUCCESS);
}
if (pidfile) {
if (!ga_open_pidfile(pidfile)) {
g_critical("failed to create pidfile")... | TOOL | 0.986786 | 4.326027 |
d7a3c8e0-7b4a-4661-8d5e-638e5fedac6c | NikitaNikson/soc_engine_fixed | trunk/editors/ECore/Engine/nv_algebra.cpp | #include "stdafx.h"
#pragma hdrstop
#ifndef nv_algebraH
#include "nv_math.h"
#endif
#ifndef _WIN32
#define _isnan isnan
#define _finite finite
#endif
mat3::mat3()
{
}
mat3::mat3(const nv_scalar* array)
{
Memory.mem_copy(mat_array, array, sizeof(nv_scalar) * 9);
}
mat3::mat3(const mat3 & M)
{
Memory.mem_cop... | TOOL | 0.940646 | 3.550656 |
e0b764ff-9f30-4b8e-be58-13cea6e92997 | ssearobber/boost_realize | libs/compute/example/batched_determinant.cpp | #include <iostream>
#include <Eigen/Core>
#include <Eigen/LU>
#include <boost/compute/function.hpp>
#include <boost/compute/system.hpp>
#include <boost/compute/algorithm/transform.hpp>
#include <boost/compute/container/vector.hpp>
#include <boost/compute/types/fundamental.hpp>
namespace compute = boost::compute;
//... | ALGO | 0.999881 | 6.384509 |
c7144619-d9dc-4e11-9f74-b6ebb1fc96d8 | Shivika-Rawat/practice-codes | prefixSum2DarrAdv2.cpp | //(Row-wise)
//Calculating the horizontal sum for each row in the matrix.
#include<bits/stdc++.h>
using namespace std;
int rectangleSum(vector<vector<int>> &mat,int l1,int r1,int l2,int r2){
int sum=0;
//Prefix some array row wise.
for(int i=0;i<mat.size();i++){
for(int j=1;j<mat[0].size();j++){
ma... | ALGO | 0.999695 | 3.149194 |
89ca0311-304f-4308-b9a6-5ac62ad15140 | rfabbri/trifocal-sample | src/openMVG_Samples/multiview_robust_essential/robust_essential.cpp | // This file is part of OpenMVG, an Open Multiple View Geometry C++ library.
#include "openMVG/cameras/Camera_Pinhole.hpp"
#include "openMVG/features/feature.hpp"
#include "openMVG/features/sift/SIFT_Anatomy_Image_Describer.hpp"
#include "openMVG/features/svg_features.hpp"
#include "openMVG/geometry/pose3.hpp"
#includ... | TOOL | 0.961584 | 6.627565 |
81cf45f0-a3f1-434c-b421-29957fd1c755 | kailaix/AdFem.jl | deps/Strain1/StrainOpUnivariate.cpp | #include "tensorflow/core/framework/op_kernel.h"
#include "tensorflow/core/framework/tensor_shape.h"
#include "tensorflow/core/platform/default/logging.h"
#include "tensorflow/core/framework/shape_inference.h"
#include<cmath>
#ifdef USE_GPU
#include "tensorflow/core/util/gpu_kernel_helper.h"
namespace tensorflow{
ty... | ALGO | 0.860058 | 5.895996 |
69d91f22-1325-4713-b2d0-1295883bd0d3 | yashupadhyay-1/cpp-basic- | class37.cpp | //circular linked list
#include<iostream>
using namespace std;
class Node{
public:
int data;
Node* next;
Node(int d){
this->data=d;
this->next=NULL;
}
};
void insertNode(Node* &tail,int d){
if(tail==NULL){
Node* node1 = new Node(d);
node1->next=node1;
... | ALGO | 0.9999 | 4.477146 |
19343bec-5b0e-4844-8bf4-6f93727c440c | shanjidaaf/DSA_codes | 2252421087(Kruskal's).cpp | #include<bits/stdc++.h>
using namespace std;
struct Edge{
int src,dest,weight;
};
struct Subset{
int parent,level;
};
bool compareEdges(const Edge& a,const Edge&b){
return a.weight<b.weight;
}
class Graph{
int v;
vector<Edge>edges;
public:
Graph(int n){
v=n;
}
void addEdge(... | ALGO | 0.999925 | 4.673493 |
9d0bef21-990d-4f13-bd46-69bb8331a8c4 | sarvex/leetcode-nim | solution/0700-0799/0739.Daily Temperatures/Solution.cpp | class Solution {
public:
vector<int> dailyTemperatures(vector<int>& temperatures) {
int n = temperatures.size();
vector<int> ans(n);
stack<int> stk;
for (int i = 0; i < n; ++i) {
while (!stk.empty() && temperatures[stk.top()] < temperatures[i]) {
ans[stk.t... | ALGO | 0.999988 | 6.658303 |
8e70c17d-c7bb-421e-875e-01910de3abf3 | jimlin2004/UVA | Math/MatrixPower/10229/10229.cpp | #include <bits/stdc++.h>
using namespace std;
// 用矩陣快速冪去算費氏數列
long long mod = 0;
struct Matrix
{
vector<vector<long long>> vals;
int m;
int n;
Matrix(int m, int n)
{
this->m = m;
this->n = n;
vals.assign(m, vector<long long>(n, 0));
}
Matrix operator * (const Ma... | ALGO | 0.999989 | 4.32767 |
95c28b0b-76e8-432d-b215-06553dd3e117 | bmnielsen/Stardust | src/General/Squads/CorsairSquad.cpp | #include "CorsairSquad.h"
#include "Units.h"
#include "Players.h"
#include "UnitUtil.h"
#include "Geo.h"
#include "Strategist.h"
#include "Workers.h"
#include "DebugFlag_CombatSim.h"
#if INSTRUMENTATION_ENABLED_VERBOSE
#define CVIS_LOG_TARGET_SELECTION false
#endif
#if INSTRUMENTATION_ENABLED
#define CVIS_BOARD_VAL... | ALGO | 0.998103 | 6.171081 |
72b93d2e-65bf-42fc-8b8e-d040ea809f50 | cormoran/CompetitiveProgramming | src/contest/atcoder/abc/abc004/D/main.comp.cpp | #include<cstdio>
#include<cstdlib>
#include<iostream>
#include<algorithm>
#include<vector>
#include<stack>
#include<queue>
#include<set>
#include<string>
#include<cmath>
#include<cassert>
#include<map>
using namespace std;
typedef pair<int,int> pii;
typedef long long ll;
typedef ll int__;
#define rep(i,j) for(int__ (i... | ALGO | 0.995466 | 3.201769 |
51dd8a36-d192-4810-803c-bb36446fbbda | Aakash231217/DSA-Sheet | 2160.cpp | class Solution {
public:
int minimumSum(int num) {
vector<int>a(4);
for(int i=0;i<a.size();i++){
a[i]=num%10;
num=num/10;
}
sort(a.begin(),a.end());
return (a[0]*10) +(a[1]*10) +a[2]+a[3];
}
};
| ALGO | 0.999853 | 6.127407 |
5441fd0f-310b-4b2c-a451-13dea04fa749 | rosediliara/pathfinding-jpsw-algorithm | anyangle/polyanya/utils/meshmerger.cpp | // Takes mesh from stdin, outputs to stdout.
#include <iostream>
#include <vector>
#include <string>
#include <memory>
#include <cassert>
#include <numeric>
#include <climits>
#include <cmath>
#include <queue>
using namespace std;
bool pretty = false;
// We need union find!
struct UnionFind
{
vector<int> parent;
... | ALGO | 0.989936 | 5.86451 |
95394103-e21b-47db-8a36-43be34acb757 | ankush788/DSA-file | graph/dijstra_algor.cpp | // /use to find the m.s.t
#include <bits/stdc++.h>
using namespace std;
void dijstra_algo(vector<pair<int, int>> adj[], int v, int sv, vector<int> &distance)
{
vector<int> visited(v, 0);
distance[sv] = 0;
priority_queue<pair<int, int>, vector<pair<int, int>>, greater<pair<int, int>>> pq;
pq.push({dis... | ALGO | 0.999936 | 4.218349 |
0474d670-0978-4b27-8584-14838ce451bd | CMU-BeanBurrito/comp-prog | CF/CF1999/F.cpp | /*
Author: BeanBurrito
*/
#include <iostream>
#include <cstdio>
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
using namespace std;
using ll = long long;
#define MOD 1'000'000'007
#define MAXN 200'000
vector<ll> fact (MAXN+1);
v... | ALGO | 0.999963 | 4.500025 |
e4ea3a9e-48b6-4b2f-b173-27ee1fc261ae | vfolunin/archives-solutions | ACMP/1672.cpp | #include <iostream>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <string>
using namespace std;
int main() {
freopen("input.txt", "r", stdin);
freopen("output.txt", "w", stdout);
int a, b;
cin >> a >> b;
cout << (a && b ? min(a, b) : max(a, b));
} | ALGO | 0.999683 | 3.34198 |
78da8325-2a8b-4ffa-95e5-04095c307c60 | devararendy/tcp_proxy | sdk/boost_1_77_0/libs/graph/test/transitive_closure_test.cpp | #include <iostream>
#include <cstdlib>
#include <ctime>
#include <boost/graph/vector_as_graph.hpp>
#include <boost/graph/adjacency_list.hpp>
#include <boost/graph/adjacency_list_io.hpp>
#include <boost/graph/graph_utility.hpp>
#include <boost/graph/transitive_closure.hpp>
#include <boost/timer/timer.hpp>
using namesp... | ALGO | 0.992558 | 6.856215 |
509cd8cf-6624-4c89-ad7b-b1bbac906ecb | noviorlu/RealTimeRendering | Lab2/prt/src/warp.cpp | #include <nori/warp.h>
#include <nori/vector.h>
#include <nori/frame.h>
NORI_NAMESPACE_BEGIN
Point2f Warp::squareToUniformSquare(const Point2f &sample) {
return sample;
}
float Warp::squareToUniformSquarePdf(const Point2f &sample) {
return ((sample.array() >= 0).all() && (sample.array() <= 1).all()) ? 1.0f :... | ALGO | 0.99541 | 4.937801 |
f33246e6-5196-409d-a5a9-8b05eb24807e | KeenyJin/BAEKJOON | Priority Queue/11286.cpp | #include <iostream>
#include <queue>
#include <cmath>
using namespace std;
template <class T> struct absless {
bool operator() (const T& x, const T& y){
if(abs(x)!=abs(y)) return abs(x)>abs(y);
else return x>y;
}
typedef T first_argument_type;
typedef T second_argument_type;
typedef... | ALGO | 0.999974 | 3.99045 |
9e296cf8-b6d9-4aff-91c0-eaa0f6dddfd6 | Kareem-Mahrous-TOT/tot_grocery | POS_grocery/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.998451 | 6.76073 |
03f92c06-2e5a-478f-9018-1b902a7393ba | mingc39/BOJ | 10000/10942.cpp | #include <stdio.h>
int a[2000][2000] = {0,};
int s[2000], n;
int f(int start, int end) {
// Ȯߴ
if(a[start][end] != 0) return a[start][end];
// ڿ ִ (̰ ¦϶ ȣ )
if(start > end) return 1;
// Ӹ Ȯ
if(start == end) a[start][end] = 1; // ̰ 1̸ Ӹ
else if(s[start] == s[end]) a[start][end] = f(start + 1, ... | ALGO | 0.999992 | 4.026031 |
a1013761-d910-43c7-8881-a02b1b82f504 | PrernaPandeykp/DSA_Practice | Array/find_the_dublicate_number.cpp | #include<iostream>
#include <vector>
using namespace std;
int findDuplicate(vector<int>& nums) {
int slow=nums[0],fast=nums[0];
do{
slow=nums[slow];
fast=nums[nums[fast]];
}
while(slow!=fast);
fast=nums[0];
while(slow!=fast){
... | ALGO | 0.999982 | 4.479127 |
f86f3643-c880-4782-a0c9-adeed65320ef | Vinay-Yadav01/CrackYourInternship | 0817-design-hashmap/0817-design-hashmap.cpp | class MyHashMap {
vector<list<pair<int, int>>> bucket;
int size = 10000;
public:
MyHashMap() { bucket.resize(size); }
/** value will always be non-negative. */
void put(int key, int value) {
int bucket_no = key % size;
auto& chain = bucket[bucket_no];
for (auto& it : chain)... | ALGO | 0.999595 | 6.021387 |
9fe9d0ad-59a9-4769-a785-54fc8fc9db32 | Lee-Gahyeon0/CodeTree | 250517/괄호 문자열의 적합성 판단/parentheses-string.cpp | #include <iostream> // 기본 입출력을 사용하기 위한 헤더파일
#include <string> // 스트링 사용 위한 헤더파일
#include <stack> // 스택 자료구조를 사용하기 위한 헤더파일
using namespace std;
string str; // 괄호 문자열 입력받을 string형 변수 str 선언
bool solution(string str) { // 괄호 적합성 판단 함수 선언
stack<string> s; // 괄호의 짝을 맞추기 위해 사용할 스택 선언
for (int i = 0; i < str.siz... | ALGO | 0.999974 | 6.200238 |
69da8e87-3603-49df-b8ff-7e99c44024ed | sbashar/HackerRankCPP | ThirtyDaysOfCode/DataTypes/application.cpp | #include<iostream>
#include<iomanip>
#include "solution.h"
using namespace std;
int main() {
// Fixed values
int fixedInteger = 4;
double fixedDouble = 4.0;
string fixedString = "HackerRank ";
// Input variables
string inputString;
int inputInteger;
double inputDouble;
// Read in... | TOOL | 0.890312 | 4.732309 |
c1b14703-4975-4344-b9bf-bc909d3d188f | cmd05/stroustrup-ppp-solutions | chap15/Graphs/Graphs/main.cpp | #include "Simple_window.h"
#include "Graph.h"
#include <cmath>
const long double PI = atan(1) * 4;
const double euler_c = std::exp(1.0);
double one(double) { return 1; }
double slope(double x) { return x / 2; }
double square(double x) { return x*x; }
double sloping_cos(double x) { return cos(x) + slope(x); }
double ... | ALGO | 0.934654 | 4.580642 |
bf0c7d0d-cdb3-4446-b9b8-4ef42c56818a | psmedley/qt-creator-os2 | src/plugins/qmldesigner/components/curveeditor/animationcurve.cpp | #include "animationcurve.h"
#include "curvesegment.h"
#include "detail/curveeditorutils.h"
#include <QEasingCurve>
#include <QLineF>
#include <QPainterPath>
#include <sstream>
namespace QmlDesigner {
AnimationCurve::AnimationCurve()
: m_type(AnimationCurve::ValueType::Undefined)
, m_fromData(false)
, m_... | TOOL | 0.875822 | 7.113083 |
3612cdab-b6be-42bc-b4e3-851754e360b2 | acc-cosc-1337-spring-2020-hl/acc-cosc-1337-spring-2020-KaylaR10 | src/homework/04_vectors/main.cpp | #include<iostream>
#include <string>
#include "vectors.h"
using std::vector;
using std::cin;
using std::cout;
/*
use a vector of int with values 8, 4, 20, 88, 66, 99
Prompt user for 1 for Get Max from vector and 2 for Get primes.
Prompt user for a number and return max value or list of primes
and display them to scre... | ALGO | 0.947752 | 4.032528 |
0bf1765c-162a-4dfa-b3bd-1728e810a788 | JackieZhai/ICPC_Training | Spring_Training/ACM-ICPC/Round6/A.cpp | #include <bits/stdc++.h>
using namespace std;
int gcd(int a, int b)
{
if(b==0)
return a;
else
return gcd(b, a%b);
}
int p, q;
int main()
{
while(scanf("%d%d", &p, &q)!=EOF)
{
printf("%d\n", p+q-gcd(p, q));
}
return 0;
}
| ALGO | 0.999778 | 3.876841 |
cbacdec2-65d8-4f9c-921e-efbdf3bce5c0 | GuessEver/ACMICPCSolutions | CodeVS/1169/1169.cpp | #include<cstdio>
#define max(a,b) ((a)>(b)?(a):(b))
int n,m;
int f[100][100][100][100];
int a[100][100];
int main()
{
scanf("%d%d",&n,&m);
for(int i=1;i<=n;i++)
for(int j=1;j<=m;j++) scanf("%d",&a[i][j]);
f[1][1][1][1]=a[1][1];
for(int i=1;i<=n;i++)
for(int j=1;j<=m;j++)
for(int t=1;t<=n;t++)
for(int k=1;k<... | ALGO | 0.999962 | 3.191552 |
e31ebf94-ac8e-473b-9e5f-344837455346 | andyyang200/CP | Competitive Programming/Contests/USACO/Contests/2014 - 2015/December/Silver/Marathon/marathon.cpp | #include <iostream>
#include <stdio.h>
#include <sstream>
#include <fstream>
#include <string>
#include <string.h>
#include <vector>
#include <deque>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <algorithm>
#include <functional>
#include <utility>
#include <bitset>
#include <cmath>
#include ... | ALGO | 0.999965 | 4.270441 |
62c7ab70-5cdd-4580-a63e-cf6381923154 | andreea-popa22/LeetCode-problems | 0141-LinkedListCycle.cpp | class Solution {
public:
bool hasCycle(ListNode *head) {
ListNode* slow = head;
ListNode* fast = head;
while (slow && fast && fast->next) {
slow = slow->next;
fast = fast->next->next;
if (slow == fast){
return true;
}
... | ALGO | 0.999912 | 5.567399 |
54f11f4f-e82e-4773-8c80-bc81c7cce80f | Rotzen823/Problemas-de-Programacion-Competitiva | Online Judge/Estructuras de Datos Lineales/Queue y Deque/10172 - The Lonesome Cargo Distributor.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int t;
cin >> t;
while(t--){
int n, s, q, res = -2;
cin >> n >> s >> q;
stack<int> carrier;
queue<int> plataforms[n + 1];
int cargos = 0;
for(int k = 1; k <= n; k++){
int m, x;
cin >> m;
cargos += m;
while(m--){
cin >> x;
... | ALGO | 0.999692 | 3.454978 |
fda726a1-ae0a-4973-8194-9e4fa2565a93 | MoOo2mini/SSUalgo | 이예슬/15596.cpp | #include <vector>
long long sum(std::vector<int> &a) {
long long ans = 0;
int size = 0;
size = a.size();
while (size > 0)
{
ans += a[size - 1];
size--;
}
return ans;
}
| ALGO | 0.999599 | 3.65326 |
94b34cc2-8cd9-44fd-b6fd-a5810948a8a6 | snhobbs/LPC84x_Bootloader | LPC845_Bootloader/src/startup_lpc845.cpp | #if defined (DEBUG)
#pragma GCC push_options
#pragma GCC optimize ("Og")
#endif // (DEBUG)
#if defined (__cplusplus)
#ifdef __REDLIB__
#error Redlib does not support C++
#else
//*****************************************************************************
//
// The entry point for the C++ library startup
//
//********... | CONFIG | 0.90953 | 7.267736 |
5a2d7637-1c99-4205-87b6-7ed8139949d0 | RisabhKedai/DS_Algo_Leetcode | CONTEST/Weekly_Contest_380/3008._Find_Beautiful_Indices_in_the_Given_Array_II.cpp | /*
* @Author: lenovo
* @Date: 2024-01-14 18:11:02
* @Last Modified by: lenovo
* @Last Modified time: 2024-01-14 20:25:28
*/
class Solution {
private:
vector<int> computeLPS(string x) {
vector<int> lps(x.length());
int ind = 1;
int len = 0;
if(x.length() == 0){
return lps;
}
lps[0] = 0;
while(ind ... | ALGO | 0.99979 | 5.527855 |
a474eb8a-9f85-4725-ae22-0992f5569581 | ak-akash03/75-DAY-DSA-CHALLENGE | Day06 - Home Work/01.cpp | // write a check if a number is prime or not
#include<iostream>
using namespace std;
void checkPrime(int n){
int count = 0;
for (int i = 2; i < n; i++){
if(n%i == 0){
count++;
}
}
if(count > 0){
cout<<"this is not prime number : ";
}else{
cout<<"this... | ALGO | 0.999458 | 3.007339 |
9ba803cf-0f6b-471a-9a8e-51e4d3782025 | coin-or/Bcp | Bcp/src/LP/BCP_lp_msgproc.cpp | #include "BCP_message.hpp"
#include "BCP_lp_user.hpp"
#include "BCP_lp_node.hpp"
#include "BCP_lp_pool.hpp"
#include "BCP_lp.hpp"
#include "BCP_lp_functions.hpp"
//#############################################################################
void BCP_lp_check_ub(BCP_lp_prob& p)
{
while (true){
// call receive w... | ALGO | 0.989507 | 4.944868 |
ecf4ce3b-c644-4cf5-9be2-8294168ea1ea | swapnil-tayal/DSA | 3380-maximum-area-rectangle-with-point-constraints-i/3380-maximum-area-rectangle-with-point-constraints-i.cpp | typedef pair<int, int> Point;
typedef long long ll;
class Solution {
public:
struct PointHash {
size_t operator()(const Point& p) const {
return hash<int>()(p.first) ^ hash<int>()(p.second);
}
};
bool hasPointsInsideOrOnBorder(int x1, int y1, int x2, int y2, const unordered_set<... | ALGO | 0.999991 | 6.202421 |
9555fcff-9e99-40bb-bf36-56e7b90dfe20 | sarvex/leetcode-crystal | solution/0000-0099/0012.Integer to Roman/Solution.cpp | class Solution {
public:
string intToRoman(int num) {
vector<string> cs = {"M", "CM", "D", "CD", "C", "XC", "L", "XL", "X", "IX", "V", "IV", "I"};
vector<int> vs = {1000, 900, 500, 400, 100, 90, 50, 40, 10, 9, 5, 4, 1};
string ans;
for (int i = 0; i < cs.size(); ++i) {
wh... | ALGO | 0.999838 | 6.448987 |
91a270ee-af9c-45c1-95f8-0e2e730811c3 | realharshgautam/GeeksforGeeks | Easy/Sum of all substrings of a number/sum-of-all-substrings-of-a-number.cpp | //{ Driver Code Starts
#include<bits/stdc++.h>
using namespace std;
// } Driver Code Ends
#include <iostream>
#include <string>
#define MOD 1000000007
class Solution
{
public:
long long sumSubstrings(string s)
{
int n = s.length();
long long sum = 0;
long long lastSum = 0;
long... | ALGO | 0.999955 | 6.704236 |
ac5fd40e-30b4-432d-8345-4db98f59cdf0 | aniketmdinde/DSA | 8.Recursion/9.OptimizedPowerFunction/PowerOptimized.cpp | #include <iostream>
using namespace std;
int powerOptimized(int a, int n)
{
if (n == 0)
return 1;
int subProblem = powerOptimized(a, n / 2);
int subProblemSq = subProblem * subProblem;
if (n & 1) // check if odd number
return a * subProblemSq;
return subProblemSq;
}
int main()
{... | ALGO | 0.999899 | 4.988729 |
fc834389-6777-41f1-bfb2-3a11a3e293fe | OscarCordova94/301-BOOTCAMP | Day 4/Linked Lists/link_list_examples.cpp | #include "unit_tests/linked_list_utils.h"
#include <iostream>
using namespace std;
void PrintList(Node *head) {
Node *curr = head; // start search at the head
cout << "head->";
while (curr != nullptr) { // when curr is nullptr, stop the loop
cout << curr->value << "->";
curr = curr->... | ALGO | 0.980465 | 5.705922 |
b3f6a880-4e83-4551-bff8-6a829a618774 | phoenix104104/LapSRN | matconvnet/matlab/src/bits/impl/pooling_cpu.cpp | // @file pooling_cpu.cpp
// @brief Pooling block implementation (GPU)
// @author Andrea Vedaldi
// @author Karel Lenc
#include "pooling.hpp"
#include "../data.hpp"
#include <algorithm>
#include <limits>
/* ---------------------------------------------------------------- */
/* ... | ALGO | 0.999003 | 7.149261 |
404df1e3-797e-4ec5-9719-ce887088d2f0 | mystic-01/LeetCode | 242-valid-anagram/242-valid-anagram.cpp | class Solution {
public:
bool isAnagram(string s, string t) {
std::ios::sync_with_stdio(false);
std::cin.tie(nullptr);
if (s.length() != t.length()) return 0;
vector<int> v(26);
for (auto i = 0; i < s.length(); i++) {
v[s[i] - 'a']++;
v[t[i] - 'a'... | ALGO | 0.999996 | 5.993131 |
2294830d-34c1-4653-a965-dd2a8980156d | apazala/StudentsMarksSum | StudentsMarksSum/Source.cpp | #include <stdio.h>
int marks_summation(int* marks, int number_of_students, char gender) {
int sum = 0;
int i;
for (i = (gender == 'b' ? 0 : 1); i < number_of_students; i += 2)
sum += marks[i];
return sum;
}
int main() {
int number_of_students;
char gender;
int sum;
scanf("%d", &number_of_students);
int ... | ALGO | 0.999149 | 3.086603 |
e6d88441-8eac-4e41-ab6a-6937b79c73a7 | a-zadorozhnaia/cpp-search-server | search-server/process_queries.cpp | #include "process_queries.h"
#include <execution>
#include "search_server.h"
std::vector<std::vector<Document>> ProcessQueries(
const SearchServer& search_server,
const std::vector<std::string>& queries)
{
std::vector<std::vector<Document>> documents_lists(queries.size());
std::transform(std::executi... | WEB | 0.982292 | 6.896234 |
9776fb13-4674-48ce-bb01-8da8a98faa6b | hackerpranavpandey/LeetCode | 1331-rank-transform-of-an-array/1331-rank-transform-of-an-array.cpp | class Solution {
// private:
// int hcf(int n1,int n2){
// if(n2==0)
// return n1;
// return hcf(n2,n1%n2);
// }
public:
vector<int> arrayRankTransform(vector<int>& arr) {
// the logic of hcf is not correct it is simple sorting
if(arr.size()==0)
return... | ALGO | 0.999987 | 5.229194 |
7af6d978-4d12-4092-bbc6-6914b78c81b5 | gaurav-singh20/Neo | stack4.cpp | #include <iostream>
#include <stack>
using namespace std;
int main() {
stack<int> myStack;
while (true) {
int choice;
cin >> choice;
switch (choice) {
case 1: {
int value;
cin >> value;
myStack.push(value);
br... | ALGO | 0.992477 | 5.300447 |
9282b33c-10f5-47ae-96f4-71b4c33e39a5 | benjamin09111/basic-programation | Ayudantías 2023 I Semestre/repaso-solemne-2/especial-1.cpp | #include<iostream>
using namespace std;
/*
Un programa se encarga de realizar el
recuento de numeros pares, impares
mediante puntajes.
Para eso, cada numero ingresado se
evalua.
Si el numero es par, el puntaje de pares
se aumenta en 2.
Si el numero es impar, el puntaje de impares
se aumenta en 1.
Cree una funcin... | ALGO | 0.998467 | 4.308129 |
4d6b6343-3885-4982-b92e-c8754e149a5a | Daggerhub/Data-Structure-Algorithm | Greedy algorithm/busyMan.cpp | #include<iostream>
#include<algorithm>
#include<vector>
using namespace std;
bool compare (pair<int,int>p1,pair<int,int>p2){
return p1.second < p2.second;
}
int main(){
int t,n,s,e;
cin>>t;
vector<pair<int,int>> v;
while(t--){
cin >> n;
for(int i = 0; i< n; i++){
cin >> s>> e;
v.push_back(make_pair(... | ALGO | 0.99996 | 4.159029 |
00a4be8c-1ebf-4903-9c1d-809e13adbf79 | sainanda59/CP-CF | 01_Leetcode_FAANG/Light_Ryuzaki/Concatenation_of_array.cpp | class Solution {
public:
vector<int> getConcatenation(vector<int>& nums) {
int n=nums.size();
for(int i=0;i<n;i++)
{
nums.push_back(nums[i]);
}
return nums;
}
};
| ALGO | 0.998646 | 5.433876 |
6953d095-7ce7-4962-961d-47ad05575ca8 | harit1412/DSA | array/leader_Arr2.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
int n;
cin >> n;
vector<int> v;
for (int i = 0; i < n; i++)
{
int ele;
cin >> ele;
v.push_back(ele);
}
int temp = v.at(n - 1);
cout << temp << " ";
for (int i = n - 2; i >= 0; i--)
{
if(v.at... | ALGO | 0.999974 | 3.55281 |
64427e26-9e66-4f41-baf1-69430371f970 | marialymperaiou/C | Algorithm examples/Kruskhal.cpp | #include<stdio.h>
#include<stdlib.h>
long long int i,m,j,k,a,b,u,v,n,t,v1,v2,ne=1;
long long int max,maxcost=0,d=0,kk,parent[300000];
long long int find(long long int i);
long long int uni(long long int i,long long int j);
int main(){
scanf("%lld",&n);
scanf("%lld",&m);
sca... | ALGO | 0.999935 | 3.529144 |
8eea16bb-159e-4153-9454-35e0f828bb39 | sakshee15/LeetCode_Solutions | 1185-find-in-mountain-array/1185-find-in-mountain-array.cpp | /**
* // This is the MountainArray's API interface.
* // You should not implement it, or speculate about its implementation
* class MountainArray {
* public:
* int get(int index);
* int length();
* };
*/
class Solution {
public:
int findInMountainArray(int target, MountainArray A) {
i... | ALGO | 0.99998 | 6.194873 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.