uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
3827e12c-2627-4aeb-8294-b1a58392f724 | raincross7/code-similarity | codes/train_code/problem465/problem465_304.cpp | #include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <queue>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cst... | ALGO | 0.999969 | 3.65807 |
0bb8c6a9-b86c-4c90-a70c-8bfc6211b25f | Sunil-1508/Problem-Solving | Minimize the sum of product - GFG/minimize-the-sum-of-product.cpp | //{ Driver Code Starts
#include<bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution{
public:
long long int minValue(int a[], int b[], int n)
{
// Your code goes here
long long int s=0;
sort(a,a+n);
sort(b,b+n);
reverse(b,b+n);
for(int i=0... | ALGO | 0.999961 | 5.364356 |
c612eb92-b97c-4b84-b5d4-84a7def6409c | PraphulSamavedam/CS-5330-Pattern-Recognition-and-Computer-Vision | Assignment1/Assignment1/src/extTest.cpp | #include <opencv2/opencv.hpp>
#include "../include/extensions.h"
//#include <iterator>
#include <map>
int main(int argc, char* argvs[]) {
/*char filename[250] = "C:\\Users\\Samavedam\\Desktop\\lover.jpg";
cv::Mat frame = cv::imread(filename);*/
cv::VideoCapture* capture = new cv::VideoCapture(0);
if (!capture->is... | TOOL | 0.85321 | 4.034284 |
54a1bd50-3984-4211-8a10-91ab0cb1d2a9 | mkoehnke/CarND-Path-Planning-Project | src/Eigen-3.3/doc/examples/Tutorial_ReductionsVisitorsBroadcasting_maxnorm.cpp | #include <iostream>
#include <Eigen/Dense>
using namespace std;
using namespace Eigen;
int main()
{
MatrixXf mat(2,4);
mat << 1, 2, 6, 9,
3, 1, 7, 2;
MatrixXf::Index maxIndex;
float maxNorm = mat.colwise().sum().maxCoeff(&maxIndex);
std::cout << "Maximum sum at position " << maxIndex << std:... | ALGO | 0.999775 | 4.228817 |
e87eb45e-4a1a-4a9a-bd5e-de38df4b43e6 | zenvite2/DSAA_PTIT | BIẾN ĐỔI XÂU.cpp | /*
Cho hai xâu ký tự str1, str2 bao gồm các ký tự in thường và các thao tác dưới đây:
Insert: chèn một ký tự bất kỳ vào str1.
Delete: loại bỏ một ký tự bất kỳ trong str1.
Replace: thay một ký tự bất kỳ trong str1.
Nhiệm vụ của bạn là đếm số các phép Insert, Delete, Replace ít nhất thực hiện trên str1 để trở thành str2... | ALGO | 0.999966 | 5.589671 |
52801aa4-90d5-4ff0-ba0f-8ff406de8301 | MinjungKim5/baekjoon | week04+/7682.cpp | // https://www.acmicpc.net/problem/7682
// 틱택토
#include <iostream>
using namespace std;
int position[8][3] = {{0,1,2},{3,4,5},{6,7,8},{0,3,6},{1,4,7},{2,5,8},{0,4,8},{2,4,6}};
bool winningCondition(string input, char ox) {
for (int p = 0; p < 8; p++) {
if (input[position[p][0]] == ox && input[position[p][... | ALGO | 0.999902 | 5.464238 |
43b13cd9-be73-46e2-9bb3-856b33b7ca20 | nilimmaitra/Coding-Stuff | subsets.cpp | #include <iostream>
#include <cmath>
using namespace std;
void findSubsets(int arr[], int n) {
int total_subsets = pow(2, n);
for (int i = 0; i < total_subsets; i++) {
cout << "{ ";
for (int j = 0; j < n; j++) {
if (i & (1 << j)) {
cout << arr[j] << " ";
... | ALGO | 0.999187 | 5.694991 |
f2561efe-4b44-4b54-ad10-98820d877b10 | wuxiaolang/Cube_SLAM_wu | object_slam/Thirdparty/g2o/g2o/types/types_six_dof_expmap.cpp | #include "types_six_dof_expmap.h"
#include "../core/factory.h"
#include "../stuff/macros.h"
namespace g2o {
using namespace std;
Vector2d project2d(const Vector3d& v) {
Vector2d res;
res(0) = v(0)/v(2);
res(1) = v(1)/v(2);
return res;
}
Vector3d unproject2d(const Vector2d& v) {
Vector3d res;
res(0) =... | ALGO | 0.963918 | 6.413846 |
07c866b9-e7b5-4115-9bfb-7d1cdb02f4d6 | PraveenBaghelMaurya/Data-Structure | Lecture08/nCr.cpp | #include <iostream>
using namespace std;
int factorial(int a)
{
int ans = 1;
for (int i = 1; i <= a; i++)
{
ans *= i;
}
return ans;
}
int nCr(int n, int r)
{
int answ = factorial(n) / (factorial(r) * factorial(n - r));
return answ;
}
int main()
{
int n, r;
cout << "Enter the ... | ALGO | 0.999077 | 5.621036 |
0276f61c-7822-4f4d-bbc2-7bfe5d177b27 | kwikius/quan-trunk | quan_matters/examples/lab_example.cpp | // See QUAN_ROOT/quan_matters/index.html for documentation.
#include <quan/out/velocity.hpp>
#include <quan/out/mass.hpp>
#include <quan/out/force.hpp>
#include <quan/out/time.hpp>
#include <quan/out/density.hpp>
#include <quan/out/volume.hpp>
quan::force::N Force(
const quan::mass::kg & mass_in,
... | ALGO | 0.983213 | 6.514825 |
328696f2-5127-45ab-a0f5-6fda44c9c1de | JeffreyAsuncion/CPP_freecodecamp | 3.5StatementsAndFunctions/main.cpp | #include <iostream>
int addNumbers(int first_param, int second_param){
int result = first_param + second_param;
return result;
}
int main(){
int first_number {13}; // Statement
int second_number {7};
std::cout << "First number : " << first_number << std::endl; //13
std::cout << "Second numb... | TOOL | 0.955983 | 5.390037 |
3492dd4a-db86-470f-872a-ea0c3e216e1f | ishandutta2007/codeforces | lhic/normal/923/C.cpp | #include <bits/stdc++.h>
using ll = long long;
using ld = long double;
using ull = unsigned long long;
using namespace std;
const int MAXN = 400002;
const int B = 30;
const int NODES = MAXN * B;
int cnt[NODES];
int e[NODES][2];
int a[MAXN];
int nd = 2;
int main() {
#ifdef BZ
freopen("input.txt", "r", stdin); fre... | ALGO | 0.999959 | 4.210303 |
25e89a01-ea93-40c5-8b10-eff6104a611b | Kowlooncen/Programing-Language-Learning | C/C语言 Program/G7.cpp | #include<stdio.h>
#include<string.h>
int main()
{
char a[1001];
gets(a);
int l=strlen(a);
int m=0,n=0;
for(int i=0;i<=l;i++)
{
if(a[i]>='A'&&a[i]<='Z')
{
m++;
}
if(a[i]>='a'&&a[i]<='z')
{
n++;
}
}
printf("%d %d",n,m);
}
| ALGO | 0.999403 | 3.496425 |
9a30f791-89e7-4bf3-bc51-711111fa0ce0 | CytoComp/ethereum-ObjectiveC | LocalPods/boost/1.55.0/libs/geometry/test/algorithms/intersection_segment.cpp | // Boost.Geometry (aka GGL, Generic Geometry Library)
#include <algorithm>
#include <ostream>
#include <sstream>
#include <string>
#include <vector>
#include <boost/config.hpp>
#include <geometry_test_common.hpp>
#include <boost/geometry/algorithms/correct.hpp>
#include <boost/geometry/algorithms/within.hpp>
#includ... | TEST | 0.891509 | 6.850996 |
78354ded-d88e-4b07-bc57-004fc3421c67 | lccl7/My-leetcode | PartitionList.cpp | /**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode(int x) : val(x), next(NULL) {}
* };
*/
//build two listhead point to the pointer whose value less than val and
//more than val respectively, then link them together.
class Solution {
public:
Li... | ALGO | 0.999998 | 5.136785 |
aa017657-0b5c-4f7f-85f0-f7159b23a544 | pgh08/DSA | Array/FindPivotIndex.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
int n;
cin>>n;
vector<int> nums(n);
for(int i=0; i<n; i++){
cin>>nums[i];
}
int sum = 0;
int leftsum = 0;
for(int i=0; i<n; i++){
sum += nums[i];
}
for(int i=0; i<n; i++){
if(leftsum == sum-leftsum... | ALGO | 0.999972 | 4.45955 |
7412d501-faca-4365-bdce-9dd4b507fc80 | MohitBishesh/MohitBishesh | min_max_function.cpp | // to calculate maximum of t nos.
// #include <iostream>
// # include<climits>
// using namespace std;
// int main()
// {
// int t,i;
// int max = INT_MIN;
// cin>>t;
// int arr[t];
// for(i=0; i<t;i++ )
// {
// cin>>arr[i];
// }
// for(i=0;i<t;i++)
// {
// if (arr[i... | ALGO | 0.995525 | 3.961171 |
475791a7-6118-43ab-beda-94433e20f07c | emn2/Competitive-Programming-Algorithms | Other/histogram.cpp | //Largest Rectangle in Histogram
class Solution {
public:
int largestRectangleArea(vector<int>& v) {
int ans = -1;
stack<int> s;
v.push_back(-1); //ponto de partida
for(int i = 0; i < v.size(); i++){
while(!s.empty() && v[i] < v[s.top()]){
int top = s.t... | ALGO | 0.999938 | 6.017658 |
0a8688f2-4465-42d6-89b7-c857ca2677cc | cgy4825/cppLearning | sales_item-test.cpp | #include<iostream>
#include "sales_item.h"
using namespace std;
int main(){
// Sales_item book;
// cin >> book;
// cout << book << endl;
Sales_item total;
if(cin >> total){
Sales_item trans;//保存和的变量
while(cin >> trans){
if(total.isbn == trans.isbn){
tot... | TOOL | 0.924762 | 3.641997 |
8eaef7db-3357-4e12-8bf7-ab7530e5fc1b | gberta/HFL_code | opencv_3.0/samples/cpp/points_classifier.cpp | #include "opencv2/core.hpp"
#include "opencv2/imgproc.hpp"
#include "opencv2/ml.hpp"
#include "opencv2/highgui.hpp"
#ifdef HAVE_OPENCV_OCL
#define _OCL_KNN_ 1 // select whether using ocl::KNN method or not, default is using
#define _OCL_SVM_ 1 // select whether using ocl::svm method or not, default is using
#include "o... | ALGO | 0.947209 | 3.510448 |
5d4b17fd-73f1-4204-b227-55c73fb32c95 | Sameerjha236/Leetcode | 0114-flatten-binary-tree-to-linked-list/0114-flatten-binary-tree-to-linked-list.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.99991 | 5.988617 |
1e526f1c-0e86-47aa-8a85-80787811749d | Sowmik23/CompetitiveProgramming | Hackerrank/30 Days of Code/Day 6: Let's Review.cpp | #include <bits/stdc++.h>
using namespace std;
int main(){
int t;
cin>>t;
string str, str1, str2;
while(t--){
cin>>str;
str1 = "";
str2 = "";
int len = str.size();
for(int i=0;i<len;i++){
if(i%2==0) str1+=str[i];
else str2+=str[i];
}
cout<<str1<<" "<<str2<<endl;
}
return 0;
}
| ALGO | 0.999916 | 4.030522 |
17b01116-a7fa-43a4-a201-c0323b881a29 | Adhmkty99/Vayu | llvm/lib/CodeGen/MachineDominators.cpp | #include "llvm/CodeGen/MachineDominators.h"
#include "llvm/ADT/SmallBitVector.h"
#include "llvm/CodeGen/Passes.h"
#include "llvm/InitializePasses.h"
#include "llvm/Pass.h"
#include "llvm/PassRegistry.h"
#include "llvm/Support/CommandLine.h"
using namespace llvm;
namespace llvm {
// Always verify dominfo if expensive ... | ALGO | 0.999217 | 7.744435 |
708ff931-8079-46cc-b8e9-9eede104e6be | UMich-CURLY/Lie-MPC-AMVs | casadi-linux-matlabR2014b-v3.5.5/include/casadi/core/dm_instantiator.cpp | #define CASADI_DM_INSTANTIATOR_CPP
#include "matrix_impl.hpp"
using namespace std;
namespace casadi {
template<>
DM CASADI_EXPORT DM::
solve(const DM& A, const DM& b,
const string& lsolver, const Dict& dict) {
Linsol mysolver("tmp", lsolver, A.sparsity(), dict);
return mysolver.solve(A, b, fals... | TOOL | 0.897785 | 7.237329 |
94fe8a87-8187-4a7f-87f0-c5ea4e0b8e8d | Shivam7Sharma/Social-Navigation | src/Gopher-ROS-Unity/navigation-noetic-devel/dwa_local_planner/src/dwa_planner_ros.cpp | #include <dwa_local_planner/dwa_planner_ros.h>
#include <Eigen/Core>
#include <cmath>
#include <ros/console.h>
#include <pluginlib/class_list_macros.hpp>
#include <base_local_planner/goal_functions.h>
#include <nav_msgs/Path.h>
#include <tf2/utils.h>
#include <nav_core/parameter_magic.h>
//register this planner as... | TOOL | 0.920936 | 3.660928 |
9f2ab00a-b555-474f-8f5e-138ef1a6cc38 | Yuvraj02/Data-Structures-and-Algorithms | Binary Tree/binary_tree.cpp | #include <iostream>
#include <vector>
using namespace std;
class Node {
public:
int data;
Node *left;
Node *right;
Node(int data){
this->data = data;
this->left = NULL;
this->right = NULL;
}
};
Node *buildTree (Node *root){
cout<<"Enter Value : ";
int data;
cin>>dat... | ALGO | 0.999822 | 4.349193 |
74c00bba-2950-4c2f-89b6-b76377bc5dd8 | vidit8patel/Solutions | 17-letter-combinations-of-a-phone-number/17-letter-combinations-of-a-phone-number.cpp | class Solution {
public:
vector<string> phone = {"", "", "abc", "def", "ghi", "jkl", "mno", "pqrs", "tuv", "wxyz"};
vector<string> letterCombinations(string digits) {
if(digits.empty())
return {};
vector<string> ans;
ans.push_back("");
for(auto digit: digits)
... | ALGO | 0.999916 | 6.720393 |
62b62a8d-0d7c-482d-9627-b0ea2ae79799 | JN513/codigosc- | c++/maiorarea.cpp | #include <bits/stdc++.h>
using namespace std;
int main(void){
int a,b,c,d;
cin >> a >> b >> c >> d;
if(a*b > c*d) cout <<"Primeiro\n";
else if(c*d > a*b) cout <<"Segundo\n";
else cout <<"Empate\n";
return 0;
} | ALGO | 0.999989 | 3.906186 |
7e1a2bf9-7323-4b1d-8cc6-fe7fd63f1ce8 | raincross7/code-similarity | codes/train_code/problem107/problem107_2.cpp | #include <iostream>
using namespace std;
int main() {
for (;;) {
int a, b;
cin >> a >> b;
if (!a && !b) return 0;
int n, dp[16][16];
bool M[16][16];
for (int x = 0; x < a; x++)
for (int y = 0; y < b; y++)
M[x][y] = true;
cin >> n;
for (int i = 0; i < n; i++) {
int... | ALGO | 0.997744 | 3.983986 |
3f62e9ad-1f08-4229-81bb-8835eb018fda | AvadheshChamola/LeetCode | 188_Best_Time_to_Buy_and_Sell_Stock_IV.cpp | /*
188. Best Time to Buy and Sell Stock IV
Hard
You are given an integer array prices where prices[i] is the price of a given stock on the ith day, and an integer k.
Find the maximum profit you can achieve. You may complete at most k transactions.
Note: You may not engage in multiple transactions simultaneously (i.e.,... | ALGO | 0.999856 | 6.306278 |
5a32f65a-d875-42bf-9b24-893b12ad8c7a | SKKU-ESLAB/specinfer.cpp | examples/lookahead/lookahead.cpp | #include "arg.h"
#include "common.h"
#include "sampling.h"
#include "log.h"
#include "llama.h"
#include <cstdio>
#include <string>
#include <vector>
#include <algorithm>
struct ngram_data {
bool active = false;
llama_seq_id seq_id = -1;
std::vector<int> i_batch;
std::vector<llama_token> tokens;
};
... | ALGO | 0.977207 | 7.684603 |
3263aba0-4584-4017-87f6-acf2f5a274cd | ECO-chain/ecochain | src/consensus/merkle.cpp | #include "merkle.h"
#include "hash.h"
#include "utilstrencodings.h"
/* WARNING! If you're reading this because you're learning about crypto
and/or designing a new system that will use merkle trees, keep in mind
that the following merkle tree algorithm has a serious flaw related to
duplicate tx... | ALGO | 0.999868 | 7.659094 |
5566b2bc-c837-43c5-99f1-9fe4fa399901 | hadardasim/code_jam | CodeJamTemplate/Project2/Source2.cpp | // question 2
#include <iostream>
#include <vector>
#include <algorithm>
template<typename T> void PrintCase(int nCase, T _value)
{
std::cout << "Case #" << nCase + 1 << ": " << _value << std::endl;
}
// question 2
int main()
{
int nTests;
std::cin >> nTests;
for (int nCase = 0; nCase < nTests; ++nCase)
{
int... | ALGO | 0.968097 | 4.760691 |
7fbf00e7-89c9-46c7-a23e-def4fe4971ff | ugetit/vitis_ai | src/vai_library/tracker/src/ftd/ftd_filter_linear.cpp | #include "ftd_filter_linear.hpp"
#include <glog/logging.h>
#include <tuple>
namespace xilinx {
namespace ai {
cv::Rect_<float> ConvertBboxToZL(const cv::Rect_<float> &bbox) {
cv::Rect_<float> z;
z.x = bbox.x + bbox.width / 2.f;
z.y = bbox.y + bbox.height / 2.f;
z.width = bbox.width * bbox.height;
z.height ... | ALGO | 0.998437 | 5.91715 |
2903c48c-9727-41fa-acef-c057832812e5 | ayushpatel497/Daily_POTD | Day022_2025/Q022_Leetcode.cpp | class Solution {
public:
vector<vector<int>> highestPeak(vector<vector<int>>& isWater) {
// Q. Map of Highest Peak
int directionX[4] = {0, 0, 1, -1};
int directionY[4] = {1, -1, 0, 0};
int rowSize = isWater.size();
int colSize = isWater[0].size();
vector<vector<int>> ... | ALGO | 0.99999 | 6.554135 |
6b65c23a-b871-4ad9-8253-8219f0839324 | achyutvardhan/competative | codechef/Read_Pages.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define f(i,a,b) for (ll i = a; i < b; i++)
#define r(i,a,b) for (ll i = a; i > b; i--)
#define vll vector<ll>
#define mll map<ll,ll>
#define pll pair<ll,ll>
#define mp map<pll,ll>
///.........Bit_Manipulation...........///
#define MSB(mask) 63-__... | ALGO | 0.999654 | 3.96612 |
b3a251e1-9a02-4130-a3f4-92bcbf678b6f | MyckollWinchester/cp-problems | leetcode/2044.count-number-of-maximum-bitwise-or-subsets.cpp | /*
* @lc app=leetcode id=2044 lang=cpp
* [2044] Count Number of Maximum Bitwise-OR Subsets
* https://leetcode.com/problems/count-number-of-maximum-bitwise-or-subsets
* Fri Oct 18 2024, 20:35:24 (UTC-3)
* Myckoll Winchester
*/
#include <bits/stdc++.h>
using namespace std;
// @lc code=start
class Solution {
public:
... | ALGO | 0.999972 | 6.169626 |
8df01956-6519-4350-9a3c-3df575f29d2a | PaukIsUha/optimizing_formating_code | predictions/submissions-aizu-coop-gpt35/Codenet/p00207/240015030/response_5.cpp | #include <iostream>
using namespace std;
int** Board;
bool isOK;
int xs, ys, xg, yg;
void DFS(int c, int x, int y) {
if (Board[x][y] != c) {
return;
} else if (x == xg && y == yg) {
isOK = true;
return;
}
Board[x][y] = 0;
DFS(c, x + 1, y);
DFS(c, x, y + 1);
DFS(c, x - 1, y);
DFS(c, x, y - ... | ALGO | 0.998636 | 4.606654 |
b7547eb2-e8b7-4a5d-939e-dfd16cf74b48 | rc0609/sudoku-solver | SudokuSolver.cpp | /*
File title: SudokuSolver.cpp
Author: Ramisha Chowdhury
Breif Description: Project 6 This program will implement SudokuSolver class.
This is the implementation.
*/
#include "SudokuSolver.hpp"
#include <iostream>
#include <cmath>
#include <fstream>
#include <sstream>
SudokuSolver::SudokuSolver() //Default Construct... | ALGO | 0.851782 | 4.972037 |
f4afddde-7235-4733-932e-135e967b16d3 | TheNoumanDev/Hacktoberfest | C++ Contribution/Counting Sort.cpp | //------ AI Programming ---------
// Counting Sort Algorithm
// Join our underground coding movement @freecodecs (c) June, 2019.
#include<iostream>
using namespace std;
int Max(int Arr[], int N){
int max = Arr[0];
for(int i=1; i<N; i++)
if(Arr[i] > max)
max = Arr[i];
return max;
}
int Min(int Arr[], int N){
... | ALGO | 0.999966 | 5.273847 |
c49a992f-a1f2-457c-9b10-c377fe266e81 | sngvahmed/Problem | solving problem/greedy/George and Round.cpp | #include <cstring>
#include <string.h>
#include <map>
#include <deque>
#include <queue>
#include <stack>
#include <sstream>
#include <bitset>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <fstream>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <algorithm>
#include <vector>
#include <... | ALGO | 0.999936 | 3.268899 |
1adc9cb2-8b8b-4119-a8ea-ed0ab1396793 | AkifAzwad/cp_repo | atcoder/E - Average and Median.cpp | #include "bits/stdc++.h"
using namespace std;
/////////data types/////////
using ll = long long;
/////////constants/////////
const int mod = 1e9 + 7, N = 1e5 + 100;
int n;
int a[N];
double mx;
//////////methods//////////
double fun1(int i, int sum, int cnt) {
cout << i << " " << sum << " " << cnt << endl;
if (i == ... | ALGO | 0.999775 | 3.71777 |
6bbfb6f6-1635-4b2d-994c-02492a31042c | uditamujumdar/LeetCode | 1765-merge-in-between-linked-lists/merge-in-between-linked-lists.cpp | /**
* Definition for singly-linked list.
* 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), next(next) {}
* };
*/
class Solution {
public:
ListNode* mergeInBetw... | ALGO | 0.999983 | 4.963107 |
ee656542-e81e-4e77-ba77-33fbba5fe905 | Dawid-Witkowski/WIT | 2019-2023/semestr-5/Algorytmy i struktury danych 1/PPR/programy-z-cwiczen/2021-wiosna/zaoczne/C07/01_IZ02P05/C07_IZ02P05_0003.cpp | #include <fstream>
#include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <iomanip>
///Linux ctrl + d
///Windows ctrl + z potem ENTER
using std::istringstream;
using std::stringstream;
using std::string;
using std::getline;
using std::cin;
using std::cout;
using std::endl;
using std::vector... | TOOL | 0.912458 | 3.155937 |
349fd73b-12fb-4669-8218-fbc841b1b5ef | eric2003/OneFLOW | example/1d-heat-equation/ftcs/cpp/02c/main.cpp | #include "cgnslib.h"
#include <iostream>
#include <vector>
#include <numbers>
#include <cmath>
#include <fstream>
#include <iomanip>
#include <string>
#include <map>
#include <algorithm>
class Grid;
void ReadCgnsGrid( const std::string & filename );
void ReadCgnsGridBaseZone( const std::string & filename );
double co... | ALGO | 0.898652 | 3.946797 |
2e827f0b-dde3-4f1b-8e92-910a0174e837 | zhuhezhang/polynomial-addition-and-subtraction | PolynomialAdditionAndSubtractionFun.cpp | //Աʵ
#include "PolynomialAdditionAndSubtraction.h"
#include <iostream>
#include <windows.h>
using namespace std;
Data* Data::insert(float c,int e) //ô˺thisָָĺ
{
link=new Data(c,e,link);
return link;
}
Polynomal Polynomal::Execute() ... | ALGO | 0.995192 | 3.143452 |
dae79a45-6e72-4140-8557-d6f301879603 | Blackfury7/LeetCode | 1897-redistribute-characters-to-make-all-strings-equal/1897-redistribute-characters-to-make-all-strings-equal.cpp | class Solution {
public:
bool makeEqual(vector<string>& words) {
int cnt[26] = {};
for (auto &w : words)
for (auto ch : w)
++cnt[ch - 'a'];
return all_of(begin(cnt), end(cnt), [&](int c) { return c % words.size() == 0; });
}
}; | ALGO | 0.999859 | 5.831071 |
2c58b3c4-4577-41fd-aed8-1259f3c117ff | ishandutta2007/codeforces | qoo2p5/normal/628/B.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ull unsigned ll
#define ld long double
#define sz(x) (int) x.size()
#define mp(a, b) make_pair(a, b)
#define pb(a) push_back(a)
#define eq(a, b) abs(a - b) < EPS
#ifdef DEBUG
#define debug(x) cerr << "\033[31m" << x << "\033[39m" << endl;
#... | ALGO | 0.999944 | 4.841094 |
e4af99ec-e089-4fd4-a5cd-765dcf651a51 | Linestro/gem5_Y | src/systemc/tests/systemc/misc/examples/a2901/a2901_alu_inputs.cpp | /*****************************************************************************
a2901_alu_inputs.cpp --
Original Author: Martin Janssen, Synopsys, Inc., 2002-02-15
*****************************************************************************/
/*******************************************************************... | TOOL | 0.922676 | 4.690553 |
7675197b-633a-41e9-af8b-a807044553f0 | DarrenTheConfused/CSE-30 | Lab-1/app.cpp | #include <iostream>
#include <Functions.h>
using namespace std;
int main(){
bool x = true;
x = even(0);
if(x == false){
cout << "Zero is not an even number." << endl;
}
else{
cout << "Zero is an even number." << endl;
}
int y = 0;
y = sum(100);
cout << "The sum of 100 is: ";
cout << y << endl;
re... | TOOL | 0.939138 | 4.798075 |
b387e2ea-b2f9-4743-9ca5-309517104254 | Dunkkkk/algorithm | Dp/kakao-등굣길.cpp | #include <string>
#include <vector>
using namespace std;
int cache[101][101];
bool arr[101][101];
int ga,se;
bool check(int y,int x){
return x>=1 and x<=ga and y>=1 and y<=se;
}
int dp(int y,int x){
int& ret = cache[y][x];
if(ret != 0) return ret;
if(y==se and x==ga) return 1;
if (check(y+1, x) a... | ALGO | 0.999941 | 5.301776 |
599ce289-f5f1-45d1-8947-921d91e8605f | y00gi/Data_Structures_and_Algorithms_Coding_Ninjas | Recursion 2/Staircase.cpp | int staircase(int n){
/* Don't write main().
* Don't read input, it is passed as function argument.
* Return output and don't print it.
* Taking input and printing output is handled automatically.
*/
if(n==0){
return 1;
}
if(n==1 || n==2){
return n;
}
... | ALGO | 0.99994 | 4.22165 |
5856a36a-e82c-4890-b98c-54ea686fe095 | sraaphorst/functional-programming-in-cpp | src/ch02/listing2_12.cpp | /**
* listing2_12.cpp
*
* By Sebastian Raaphorst, 2019.
*/
#include <algorithm>
#include <iostream>
#include <iterator>
#include <vector>
#include "person.h"
// Naive recursive implementation: not tail-recursive.
template<typename Filter, typename Iterator>
std::vector<std::string> names_for(Iterator people_begi... | ALGO | 0.980585 | 6.204911 |
0fe331dd-6e1d-4e64-ac77-253da7b3b4d0 | tmolnar18/ORB-SLAM | Thirdparty/g2o/g2o/core/optimization_algorithm_gauss_newton.cpp | #include "optimization_algorithm_gauss_newton.h"
#include <iostream>
#include "../stuff/timeutil.h"
#include "../stuff/macros.h"
#include "solver.h"
#include "batch_stats.h"
#include "sparse_optimizer.h"
using namespace std;
namespace g2o {
OptimizationAlgorithmGaussNewton::OptimizationAlgorithmGaussNewton(Solve... | ALGO | 0.998513 | 6.715468 |
afe7e13d-1bc4-4b69-a3de-f8341357da08 | gitInitArjunn/DailyLeet | MinimumCostWorkers.cpp | // 857, Minimum Cost to hire K workers
class Solution {
public:
double mincostToHireWorkers(vector<int>& quality, vector<int>& wage, int k) {
int n = quality.size();
vector<pair<double, int>>workers;
for(int i =0; i<n; i++){
workers.emplace_back((double)wage[i]/quality[i], qualit... | ALGO | 0.999883 | 5.141045 |
13759226-e56e-4c25-ad8a-30e0d53ceb85 | muhaiminverse/DS_study | Assingment/lab-mid/test2.cpp | #include <iostream>
#include <algorithm>
#include <set>
int main()
{
int n;
std::cin >> n;
int a[n];
for (int i = 0; i < n; i++)
std::cin >> a[i];
// Use a set to remove duplicates
std::set<int> s;
for (int i = 0; i < n; i++)
s.insert(a[i]);
// Copy the elements from ... | ALGO | 0.999973 | 4.601269 |
89009b6b-d3ba-4fda-8302-04dc66036ecd | SuetoneCarneiro/beecrowd-problems | Beecrowd-problems/beecrowd3147.cpp | #include <bits/stdc++.h>
using namespace std;
int main(){
// Humanos, elfos, anões, orcs, wargs, águias(exército extra)
int h, e, a, o, w, x;
int bem, mal;
cin >> h >> e >> a >> o >> w >> x;
bem = h + e + a + x;
mal = o + w;
if(bem > mal || bem == mal) cout << "Middle-earth is saf... | ALGO | 0.999846 | 3.822815 |
963c9f3b-65eb-4c50-abda-944464c3707b | poro0542/ITSA_forcpp | c_mm27_easy.cpp | #include <iostream>
#include<string>
#include<iomanip>
using namespace std;
int main(){
int a,b;
while(cin>>a>>b){
if(b<a){
int temp=b;
b=a;
a=temp;
}
cout<<(a+b)*(b-a+1)/2<<endl;
}
}
| ALGO | 0.999819 | 3.904726 |
781d9a04-f465-409a-b7df-2230711132b4 | praymeta/Code-Up-Algorithm | BOJ_26004_HIARC.cpp | #include <iostream>
using namespace std;
int main(void) {
int n, min_hiarc = 100000, hiarc[5] = {0, };
string str;
cin >> n >> str;
for(int i = 0; i < str.length(); i++) {
if(str[i] == 'H') hiarc[0]++;
else if(str[i] == 'I') hiarc[1]++;
else if(str[i] == 'A') hiarc[2]++;
... | ALGO | 0.998238 | 3.826532 |
5b2aa1b3-e582-46dd-92dd-890c15ccf0af | tinkunath/DSA-with-all-language | Shell_Sort/Shell_Sort.cpp | // C++ implementation of Shell Sort
#include <iostream>
using namespace std;
int Shell_Sort(int array[], int size)
{
for(int gap = size / 2; gap > 0; gap /= 2)
{
for(int i = gap; i < size; i++)
{
int temp = array[i], j;
for(j = i; j >= gap && array[j - gap] > temp; j -... | ALGO | 0.999936 | 5.707827 |
816615eb-2267-478f-8b82-02f4cd05e831 | Yasith763/C- | QHEAP_in_hackkerrank.cpp | #include <cmath>
#include <cstdio>
#include <vector>
#include <set>
#include <iostream>
#include <algorithm>
using namespace std;
int main() {
int q;
cin >> q;
set<int> s;
for (int i = 0; i < q; i++) {
int t, v;
cin >> t;
switch (t) {
case 1:
... | ALGO | 0.99952 | 4.634106 |
8baa739a-b207-48d3-a2d7-b6b402b2f870 | leibidontknow/lb-cpp-codes | codeforces/CF895DIV3/C.cpp | /*************************************************************************
> File Name: C.cpp
> Author: lbdontknow
> Mail: <EMAIL>
> God bless no BUG
************************************************************************/
#include<bits/stdc++.h>
using namespace std;
int T;
int check(int x){
for(int i = 2 ; i... | ALGO | 0.999886 | 4.335084 |
4cd1222e-84c9-4ae0-87e3-e95b070d07b4 | rcmoura/ProgramacaoComputadores | Aulas 2025/1 semestre/soma20.cpp | #include <iostream>
using namespace std;
int main()
{
int a, b, r,s;
cout << "Entre com um numero: "; cin >> a;
cout << "Entre com outro numero: "; cin >> b;
r = a + b;
if (r > 20 )
{
s = r + 8;
cout << "Resultado -> " << s;
}
else
{
s = r - 5;
cout << "Resultado -> " << s;
}
} | ALGO | 0.963091 | 3.612733 |
a86daf97-0e33-4eec-bea4-ae213d8dcbb0 | Johniel/contests | atcoder/abc027/A/main.cpp | // atcoder/abc027/A/main.cpp
// author: @___Johniel
// github: https://github.com/johniel/
#include <bits/stdc++.h>
#define each(i, c) for (auto& i : c)
#define unless(cond) if (!(cond))
using namespace std;
typedef long long int lli;
typedef unsigned long long ull;
typedef complex<double> point;
template<typename... | ALGO | 0.999962 | 5.64904 |
bcf277c1-1321-4627-a129-6a541118634a | ishandutta2007/codeforces | teapotd/normal/1077/F2.cpp | #define _USE_MATH_DEFINES/////////////////////////////////////////////////////
#include <bits/stdc++.h>//////////////////////////////////////////////////////
#ifdef LOC////////////////////////////////////////////////////////////////////
#include "debuglib.h"/////////////////////////////////////////////////////////
#els... | ALGO | 0.999974 | 4.171544 |
13b96aed-8ad6-4bb7-97b4-c93e9d3a8d86 | ioqoo/PS | Algorihm Category/etc/1135.cpp | #include <bits/stdc++.h>
#define all(vt) vt.begin(),vt.end()
const int MAX = 53;
using namespace std;
int N;
vector<int> graph[MAX];
int cnt[MAX];
bool cmp(const int &a, const int &b){
return cnt[a] > cnt[b];
}
int solve(int curr){
int ret = 0;
for (auto next: graph[curr]){
cnt[next] = sol... | ALGO | 0.999837 | 3.994445 |
19e36066-3ebd-48cf-8cfd-7b16a80b1fde | EagleEyeKestrel/Leetcode | 501-600/567. 字符串的排列/template的副本.cpp | class Solution {
public:
bool checkInclusion(string s1, string s2) {
int cnt[128] = { 0 };
int m = s1.size(), n = s2.size();
if (n < m) return false;
for (char c: s1) cnt[c]++;
for (int r = 0; r < n; r++) {
cnt[s2[r]]--;
if (r >= m) cnt[s2[r - m]]++;
... | ALGO | 0.999973 | 6.019617 |
e54de56c-2de5-49d1-9912-932ca0b1ad65 | FelipeEiji/SPOJ | NSTEPS.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
int T, x, y;
cin >> T;
while(T--)
{
cin >> x >> y;
if(x == y)
{
if(x&1)
cout << x+y-1 << endl;
else
cout << x+y << endl;
}
else if(x == y+2)
... | ALGO | 0.999748 | 4.294474 |
6e79ac72-72fb-430f-bfba-d70d46922b42 | marcosotomac/ADS_CS | hash tables/hashtables.cpp | #include <iostream>
class HashTable
{
private:
static const int TABLE_SIZE = 10000;
int D[TABLE_SIZE] = {0};
public:
int hash(int num)
{
return num % TABLE_SIZE;
}
void insert(int key, int value)
{
D[hash(key)] = value;
}
int get(int key)
{
return D[ha... | ALGO | 0.999933 | 6.908608 |
d0d4241a-da0a-46aa-bcc9-1f4687b40234 | MikamiTetsuro365/Atcoder | ABC082/C.cpp | #include "bits/stdc++.h"
using namespace std;
typedef long long int ll;
typedef pair<ll, ll > pi;
typedef pair<pair<ll, ll >, ll > pii;
vector<ll > vec;
vector<vector<ll > > vec2;
ll MOD = 1000000007;
int main(){
ll N; cin >> N;
map<ll, ll > mp;
for(ll i = 0; i < N; i++){
ll t = 0; cin >> t... | ALGO | 0.999902 | 3.422548 |
64b9feee-4bde-4b30-9944-a435852c5703 | Jaycelation/CPP-PTIT | 2D-Array/CPP0270.cpp | #include <bits/stdc++.h>
using namespace std;
int convolution(int a[300][300], int b[3][3], int x, int y) {
int s = 0;
for (int i = 0; i < 3; ++i) {
for (int j = 0; j < 3; ++j) {
s += a[i+x][j+y]*b[i][j];
}
}
return s;
}
int main() {
int t;
cin >> t;
while (t-... | ALGO | 0.999932 | 3.580875 |
c9473f9d-a72d-49ca-8c90-74f47c18668b | theplatters/utillib | main.cpp | #include <iostream>
#include <vector>
#include "sorting.h"
#include "LinkedList.h"
#include "BinaryTree.h"
#include <cmath>
using namespace std;
int main() {
BinaryTree<int> tree[10];
cout << endl << "Create tree:" << endl;
tree[0].makeTree(tree[9], 1, tree[9]);
tree[0].printBinaryTree();
tree[1]... | TEST | 0.99437 | 5.334643 |
639b4beb-95f2-4745-bc76-7ebb738e7ac1 | Cleverprogrammer-69/DSA-Practice | Arrays/uniqueOccur.cpp | #include<iostream>
#include<vector>
#include<map>
using namespace std;
bool uniqueOccurences(vector<int>& arr){
map<int, int> mp;
vector<int> occurences;
for(auto element:arr){
mp[element]++;
}
for(auto element:mp){
// cout << element.first<<" "<< element.second<<endl;
occurences.push_back(eleme... | ALGO | 0.997849 | 5.120406 |
a516970c-4b38-4098-8da5-c1a0a0da1568 | kronos/Task-solutions | leetcode.com/210.cpp | class Solution {
vector<bool> visited;
vector<bool> visiting;
public:
bool dfs(int v, const vector<vector<int>>& edges, stack<int>& r) {
if (visited[v]) {
return true;
}
if (visiting[v]) {
return false;
}
bool good = true;
visiting[v]... | ALGO | 0.999999 | 6.079083 |
9d938fa0-6ba2-4c70-a394-f0464728aa2e | Mihirpathakji/Leetcode-Problem-solving-Tracker | 2083-three-divisors/three-divisors.cpp | class Solution {
public:
bool isThree(int n) {
int count =0;
for(int i =1;i*i<=n;i++){
if(n%i==0){
count++;
if( (i!=n/i) ){
count++;
}
}
}
return count==3;
//Tc : sqrt(n);
//Sc... | ALGO | 0.999818 | 5.527069 |
211bb8e7-54f6-446b-9b8a-ef7da42e9152 | TusharCSE35/Online-Programming | Lighit OJ/1053 - Higher Math.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
int T,a,b,c,i;
cin >> T;
for(i = 1; i <= T; i++)
{
cin >> a >> b >> c;
if((a*a + b*b == c*c) || (a*a + c*c == b*b) || (c*c + b*b == a*a))
{
cout << "Case " << i << ": " << "yes" << endl;
}
els... | ALGO | 0.999812 | 4.345939 |
08b99db5-9a2f-45fe-bc12-97385ca91abd | Harshit16112000/DSA | 2609-distinct-prime-factors-of-product-of-array/distinct-prime-factors-of-product-of-array.cpp | class Solution {
public:
int distinctPrimeFactors(vector<int>& nums) {
set<int> st;
for (int i = 0; i < nums.size(); i++) {
primes(nums[i], st);
}
return st.size();
}
void primes(int n, set<int>& st) {
for (int i = 2; i * i <= n; i ++) {
while... | ALGO | 0.999829 | 6.049259 |
7413e619-9993-4577-82ea-87f6e825d28e | MdAjharulIslam/LeetCode | 3202-find-the-maximum-length-of-valid-subsequence-ii/3202-find-the-maximum-length-of-valid-subsequence-ii.cpp | class Solution {
public:
int maximumLength(vector<int>& nums, int k) {
vector<vector<int>> dp(k, vector<int>(k, 0));
int maxLen = 0;
for (int num : nums) {
for (int j = 0; j < k; ++j) {
int remainder = num % k;
maxLen = max(maxLen, dp[rema... | ALGO | 0.999836 | 6.041566 |
4a98a720-4c35-49db-a6be-284eeffe4070 | drotarovSprievodca/GenerovanieBDD | GenerovanieBDD/BestOrder.cpp | #include "BestOrder.hpp"
BestOrder::BestOrder(bool generate_graph_before_order, bool generate_graph_after_order) :
Strategy(false, generate_graph_before_order, generate_graph_after_order)
{}
BestOrder::~BestOrder() {}
void BestOrder::process_function(teddy::bss_manager& default_manager, int number_of_vars, teddy... | ALGO | 0.997738 | 5.115536 |
a64de534-e2dc-4805-b7dd-cf96708463ce | Liren4396/TinyWebServer | config.cpp | #include "config.h"
/**
* @brief 构造函数 - 设置服务器默认配置
*
* 初始化各项服务器配置的默认值
*/
Config::Config() {
PORT = 9006; // 默认端口号为9006
LOGWrite = 0; // 默认同步写入日志
TRIGMode = 0; // 默认使用LT+LT模式
LISTENTrigmode = 0; // 监听socket使用LT模式
CONNTrigmode = 0; // 连接socket使用LT模式
OPT_LIN... | CONFIG | 0.888028 | 5.586763 |
196c7e38-8536-457c-97dd-3a9b9685284c | eddy14627/CodeForces-Practice | oct/17 oct 2023/1.cpp | #include <bits/stdc++.h>
using namespace std;
void solve()
{
int n, m;
cin >> n >> m;
int intiXor = 0;
vector<int> cnt(32);
for (int i = 0; i < n; i++)
{
int num;
cin >> num;
for (int j = 0; j < 32; j++)
{
if (num & (1 << j))
cnt[j]++;
... | ALGO | 0.999987 | 4.662775 |
fee9d468-737b-4dd6-8460-36c2626f5c7a | sarvex/leetcode-g-forth | solution/2500-2599/2555.Maximize Win From Two Segments/Solution.cpp | class Solution {
public:
int maximizeWin(vector<int>& prizePositions, int k) {
int n = prizePositions.size();
vector<int> f(n + 1);
int ans = 0;
for (int i = 1; i <= n; ++i) {
int x = prizePositions[i - 1];
int j = lower_bound(prizePositions.begin(), prizePosi... | ALGO | 0.999968 | 5.405985 |
05b2adca-0898-4c9a-aa48-6acf03ff6952 | luciocf/CP-Problems | BOI/BOI 2011/plagiarism.cpp | // BOI 2011 - Plagiarism
// Lúcio Cardoso
// wtf?
#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5+10;
int a[maxn];
int main(void)
{
int n;
scanf("%d", &n);
for (int i = 1; i <= n; i++)
scanf("%d", &a[i]);
sort(a+1, a+n+1);
int l = 1;
long long ans = 0;
for (int r = 1; r <= n; r++)
... | ALGO | 0.999142 | 3.734844 |
8ec19888-dc4a-4661-9d3b-9a96c7e64b15 | vilve-aman/DataStructuresAndAlgorithms | Recursion/miscellaneous/keycombination.cpp | #include <bits/stdc++.h>
using namespace std;
int Output=0;
void op(int n, int currOutput, bool cpyFlag=0, int cpyBuffer=0){
// cout<<n<<" "<<currOutput<<"\n";
int co1 = currOutput,co2 = currOutput,co3 = currOutput,co4 = currOutput;
// base case
if (n==0){
if (currOutput > Output){
... | ALGO | 0.999995 | 4.082336 |
34442aaf-173c-42c1-a375-fbd5c7b6f462 | Thien-anh-De/DSA_soure_code | CODE_PTIT/DSA06048.cpp | //y tuong
//khi ban dau mang a la 1 day dc sap xep( ptu be nhat luon dung dau mang)
//nhung sau K lan doi cho thi ptu cuoi day bi day len dau
//vay so K se bang vi tri hien tai cua so be nhat
//--> can tim ra vi tri cua so be nhat cua mang
#include <bits/stdc++.h>
using namespace std;
int main() {
int t;
cin >... | ALGO | 0.999957 | 4.685095 |
ecdaba00-28fa-4b5c-b8c4-383f77f524de | KitauraHiromi/atcoder | ABC115/c.cpp | #include <bits/stdc++.h>
#include <iostream>
#include <utility> // pair
#include <string>
#include <vector>
#define MAX_N 100001
#define INF 1000000001
#define FOR(i, a, b) for(int i=a; i<b; i++)
#define REP(i, n) for(int i=0; i<n; i++)
#define RER(i, n) for(int i=n-1; i>=0; i--)
#define ALL(v) v.begin() v.end()
#defin... | ALGO | 0.99991 | 3.759479 |
24525ea8-47da-4f0f-8f5a-dabc739e7ff8 | fmorenovr/ComputerScience_UCSP | MCC203-Computacion_Grafica/Trabajo_2_Fast-Winding-Numbers/fast-winding-number-soups/libigl/python/py_igl/copyleft/py_swept_volume.cpp | m.def("swept_volume", []
(
const Eigen::MatrixXd& V,
const Eigen::MatrixXi& F,
const std::function<Eigen::Affine3d (const double)> & transform,
const size_t steps,
const size_t grid_res,
const size_t isolevel,
Eigen::MatrixXd& SV,
Eigen::MatrixXi& SF
)
{
return igl::copyleft::swept_volume(V, F, transf... | ALGO | 0.992169 | 6.617258 |
d5d07eb9-e808-4535-84b5-2575b7ae7c46 | DPChanny/ps | Baekjoon/13913.cpp | #include<iostream>
#include<queue>
#include<string>
#include<stack>
using namespace std;
int visit[100001];
int main(void) {
for (int _n(0); _n < 100001; _n++)
visit[_n] = -1;
int n, k, t(0), s, c;
cin >> n >> k;
queue<int> q;
visit[n] = -2;
q.push(n);
while (true) {
s = q.size();
for (int _q(0); _q < s... | ALGO | 0.999985 | 3.619904 |
ea72a815-3976-4cc0-ab2f-0d084dd1350a | elphony/onegin | qsort.cpp | #include "qsort.h"
void q_sort(void* array, size_t left, size_t right, size_t size, compare_func comparator)
{
if (left >= right)
return;
char* pivot = (char*)array + left * size;
size_t l_hold = left;
size_t r_hold = right;
while (left < right)
{
while ((comparator((char*... | ALGO | 0.999758 | 5.154091 |
6bc07b72-a17d-470d-a2e2-d2f9e4911e00 | onlyearthquake/HUST | hust_net/lab1/Lab1/Lab1.cpp | #include<thread>
#include<mutex>
#include<condition_variable>
#include<queue>
#include "socketLib.h"
#pragma comment(lib,"ws2_32.lib")
#define MAX_THREAD_NUM 100
#define CONFIG_FILE_PATH "D:/config.txt"
using namespace std;
mutex resource_mutex;
char filename[NAME_BUFF_SIZE];
queue<unsigned int> client_queue = queue... | WEB | 0.904571 | 3.628364 |
17c3295d-74fd-4b0a-8d2d-9009334de0c2 | shakti2000/Leetcode-and-GFG-Solutions | 29-divide-two-integers/29-divide-two-integers.cpp | class Solution {
public:
int divide(int D, int d)
{
long dividend = (long) D;
long divisor = (long) d;
if (dividend == INT32_MIN && divisor == -1)
return INT32_MAX;
bool negative_result = (dividend < 0) ^ (divisor < 0);
divisor = labs(divisor);
div... | ALGO | 0.999715 | 5.646567 |
80d1b2d3-6bba-4edc-957b-5c48e585bd8b | hitczw/automatic-sokoban-solver | sokoban_project/src/main.cpp | #include <cstdio>
#include <iostream>
#include <fstream>
#include <string>
#include <limits>
#include "game_solver.h"
#include "draw.h"
using namespace std;
void read_file(int& mm, int& nn, string& temp){
mm=0;
nn=0;
temp.clear();
ifstream file_read;
file_read.open("box.txt",ios::in);
if (!fi... | ALGO | 0.996925 | 3.841789 |
a8b521a8-28c2-47c1-b2bd-45283300f39d | aldalee/acm-journey | acm-ecnu/Code03_SelectSort.cpp | // https://acm.ecnu.edu.cn/contest/563/problem/C/
// Created by HuanyuLee on 2022/10/14.
// AC
#include <iostream>
using namespace std;
int main(){
long n = 100000;
cout << n << endl;
int arr[n];
for (int i = n; i > 0; --i) {
cout << i << " ";
}
} | ALGO | 0.99923 | 4.189942 |
bf989d60-4307-4169-aad7-f99aa5504bc4 | KongCXA/PreTOI17 | HashTable/Find_Data.cpp | /*
Author : KongCXA
Language: C++
Algo : Hash Table
*/
#include <bits/stdc++.h>
using namespace std;
#define M 99999989
#define hs 10000019
int h[hs];
long long pw[2][5050];
int main()
{
int i,j,a,b,n,m,x,y,key,num,ans=0;
scanf("%d %d %d %d",&a,&b,&n,&m);
for(i=0;i<=5000;i++)
{
pw[0][i] = (i*i)%M;
pw[1][i]... | ALGO | 0.999901 | 3.136883 |
9f7f4696-4457-4c1c-a708-ce3087d1aa5c | vjord-it/Sofia-University-Code-Bank | Design and Analysis of Algorithms Practicum/my_HW_solutions/HW1_Flowers.cpp | #include <cstdio>
#include <algorithm>
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
using namespace std;
int N, L, D, x1, A, B;
const int inp = 1e5;
int rain[inp];
int rain1[inp];
bool inputCheck(int r)
{
if (rain[0] > D || L - rain[r - 1] - 1 > D)
return false;
for (i... | ALGO | 0.99991 | 3.810308 |
bca8e546-cd7b-4885-b932-ab80b5258ff2 | arm/arm-toolchain | libc/src/stdfix/rounduhr.cpp | #include "rounduhr.h"
#include "src/__support/common.h"
#include "src/__support/fixed_point/fx_bits.h"
#include "src/__support/macros/config.h"
namespace LIBC_NAMESPACE_DECL {
LLVM_LIBC_FUNCTION(unsigned short fract, rounduhr,
(unsigned short fract x, int n)) {
return fixed_point::round(x, n);
}
... | ALGO | 0.971634 | 7.398036 |
dafe7c58-5a40-4c6f-93cc-85b56010aeb7 | Park-MinJe/codetree-TILs | 240308/거울에 레이저 쏘기 2/shoot-a-laser-in-the-mirror-2.cpp | // #include <iostream>
// using namespace std;
// int n, k,
// curY, curX,
// dir; // 0-N, 1-E, 2-S, 3-W
// char** map;
// int main() {
// // 격자 크기
// scanf("%d", &n);
// // 맵의 정보
// map = new char*[n+1];
// for(int i = 1; i<=n; ++i){
// map[i] = new char[n+1];
// }
// ... | ALGO | 0.999717 | 4.028398 |
1a8e0674-7b62-498b-8f8f-c77e7823c40c | ishandutta2007/codeforces | -armageddon-/normal/1499/C.cpp | //Original Code:
//#include <self/utility>
//#include <self/debug>
//using namespace std;
//
//int n;
//int c[100005];
//int a[100005];
//int b[100005];
//ll fa[100005],fb[100005];
//int m;
//
//inline ll solve2()
//{
// ll sm=0,mx=llinf;
// for(int i=0;i<n;i++){
// chmin(mx,a[i]);
// sm+=a[i];
// fa[i]=1LL*(n+m-i-1... | ALGO | 0.999934 | 4.163077 |
603a8770-eb35-43bc-9e51-1c0a00a25cdb | M0D4/Competitive-Programming-Problems-Solutions | CodeForces/GNU C++17 (64)/1077A | Frog Jumping/117047273.cpp | #include <bits/stdc++.h>
using namespace std;
#define fori( tt,aa) for(long long i= tt; i<aa; i++)
#define forj( yy,bb) for(long long j=yy; j<bb; j++)
#define fork( uu,cc) for(long long k=uu; k<cc; k++)
#define sz(v) v.size()
#define all(v) v.begin(), v.end()
#define endl "\n";
#define pb push_bac... | ALGO | 0.999689 | 3.949506 |
4d90ddda-cab2-40a5-9929-2ac93aa1c3b8 | alecjacobson/libigl-link-example | main.cpp | #include <igl/matlab_format.h>
//#include <igl/matlab/MatlabWorkspace.h>
#include <igl/readDMAT.h>
#include <igl/get_seconds.h>
#include <igl/triangle/triangulate.h>
#include <CGAL/Exact_predicates_exact_constructions_kernel.h>
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
#include <igl/copyleft/cgal... | ALGO | 0.958954 | 4.493158 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.