uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
f0d1d262-458a-486e-81d2-d9b3d959f6cd | rahultemkar/Logic-Building | program562.cpp | #include<iostream>
using namespace std;
template <class T>
class ArrayX
{
public:
T *Arr;
int iSize;
ArrayX(int Value);
~ArrayX();
void Accept();
void Display();
bool LinearSearch(T Value);
bool BiDirectionalSearch(T Value);
bool Bi... | ALGO | 0.999852 | 4.228134 |
cf72225b-8278-404f-8228-562abc04bb2a | raincross7/code-similarity | codes/train_code/problem452/problem452_337.cpp | #include <bits/stdc++.h>
#define PI 3.14159265359
#define NIL -1
using namespace std;
const int64_t MOD = 1e9 + 7;
int main() {
int64_t N, K;
cin >> N >> K;
vector<pair<int64_t, int64_t>> v(N);
for (int64_t i = 0; i < N; i++) {
cin >> v.at(i).first >> v.at(i).second;
}
sort(v.begin(), v.end());
int64_t sum ... | ALGO | 0.999989 | 4.095016 |
18da11c1-6a20-4dde-9a4f-771e51d12a43 | Harshit-018/LeetCode | 1732-find-the-highest-altitude/1732-find-the-highest-altitude.cpp | class Solution {
public:
int largestAltitude(vector<int>& gain) {
vector<int> alt;
int ch=0;
for (int i=0;i<gain.size();i++)
{
ch+=gain[i];
alt.push_back(ch);
}
alt.push_back(0);
ch=*max_element(alt.begin(), alt.end());
return c... | ALGO | 0.999854 | 5.737669 |
14a84148-ba81-4dc9-b4ed-ea96b6aadc73 | 113bommy/deepmind_codecontests_refine | cpp_gold_filter_file/cpp_train_7461_22.cpp | #include <bits/stdc++.h>
using namespace std;
inline long long read() {
long long f = 1, ans = 0;
char c = getchar();
while (c < '0' || c > '9') {
if (c == '-') f = -1;
c = getchar();
}
while (c >= '0' && c <= '9') {
ans = ans * 10 + c - '0';
c = getchar();
}
return f * ans;
}
const long l... | ALGO | 0.999983 | 3.573807 |
fbb5d309-dbdd-4c28-a6d0-6e3dff769274 | vignatej/DataStructutesTemplate | basics/overloading.cpp | #include <bits/stdc++.h>
using namespace std;
class A{
public:
int a; int b;
A(int a, int b){
this->a = a;
this->b = b;
}
~A(){
cout<<a<<" "<<b<<" descructed\n";
}
A(const A &obj){
this->a = obj.a;
this->b = obj.b;
}
void operator+=(const A &obj){... | ALGO | 0.990342 | 4.011539 |
24f74f34-b36a-422a-a94e-327c1f68f30a | 24CSU122/C_plus_ass | Q1_.cpp | #include <iostream>
using namespace std;
int prime_no(int);
int next_prime_no(int);
int main()
{
int n;
cout<<"Enter the number: ";
cin>>n;
int m=n+1;
int result=prime_no(n);
if(result==1)
{
cout<<"The no. is prime. "<<endl;
cout<<"The next prime no. is: "<<endl;
int ... | ALGO | 0.9995 | 3.73883 |
47e6faa1-ce2f-4504-9dfc-c0e572a682a5 | hjiang13/LLMs-in-IR | processed_data/DecompiledResults_Human_x_164_O0/GPT4o_Human_x_164_O0_decompiled/test/CPP_152.cpp | #include <vector>
#include <cstdlib>
#include <cmath>
void compare(std::vector<int>& v1, std::vector<int>& v2, std::vector<int>& result) {
result.clear();
for (size_t i = 0; i < v1.size(); ++i) {
if (i < v2.size()) {
int diff = std::abs(v1[i] - v2[i]);
result.push_back(diff);
... | ALGO | 0.999024 | 5.425244 |
22263dd2-61e9-41e9-9b63-da6ed4a9b771 | idkwhttsay/cses.fi | graph-algorithms/shortest-routes-1.cpp | #include <bits/stdc++.h>
#define int long long
#define F first
#define S second
using namespace std;
const int N = 1e5+123;
const int inf = 1e18;
const int dx[4] = {-1, 0, 0, 1};
const int dy[4] = {0, -1, 1, 0};
int n,m;
vector <pair<int, int>> g[N];
int dist[N];
void solve() {
cin >> n >> m;
for(int ... | ALGO | 0.999986 | 4.471852 |
937dd3fb-d2d3-4c5b-a290-9ff282efce6e | exbluesbreaker/test-repo | 3rdparty/OpenCV-2.4.2/modules/stitching/src/exposure_compensate.cpp | #include "precomp.hpp"
using namespace std;
namespace cv {
namespace detail {
Ptr<ExposureCompensator> ExposureCompensator::createDefault(int type)
{
if (type == NO)
return new NoExposureCompensator();
if (type == GAIN)
return new GainCompensator();
if (type == GAIN_BLOCKS)
return... | ALGO | 0.967616 | 5.619506 |
2b8f7dd7-a101-4e49-869a-c64a1a7ea103 | EulerDanseur/MyWorks | Experiment of programming/week3/word.cpp | #include <iostream>
#include <map>
#include <vector>
#include <algorithm>
using namespace std;
bool cmp(pair<string, int> a, pair<string, int> b)
{
return a.second > b.second;
}
int main()
{
int k;
cin >> k;
map<string, int> m;
string word;
getchar();
while (cin >> word)
{
if ... | ALGO | 0.999864 | 4.179144 |
01d8315a-90f6-46b3-80fd-77cf3a9f7649 | rishabh152611/stukart | 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 |
c3ec3615-c0ac-4fc7-8016-72fd7c018b95 | tariqul-dev/DSA | LeetCode/DP/house_robber_2.cpp | #include <bits/stdc++.h>
using namespace std;
int robSpaceOptimized(int start, int end, vector<int> &nums)
{
int prev = nums[start];
int prev2 = 0;
for (int i = start + 1; i < end; i++)
{
int pick = nums[i];
if (i > start + 1)
pick += prev2;
int notPick = prev;
... | ALGO | 0.999941 | 5.224485 |
594c119c-d174-43fd-a83d-5739eb54b477 | cpvrlab/SLProject4 | externals/libigl/include/igl/slice_mask.cpp | template <typename DerivedX,typename DerivedY>
IGL_INLINE void igl::slice_mask(
const Eigen::DenseBase<DerivedX> & X,
const Eigen::Array<bool,Eigen::Dynamic,1> & R,
const Eigen::Array<bool,Eigen::Dynamic,1> & C,
Eigen::PlainObjectBase<DerivedY> & Y)
{
int xm = X.rows();
int xn = X.cols();
int ym = R.count... | TOOL | 0.870321 | 6.331387 |
888a196a-f1b6-4ded-bf26-107cb39c776f | guihunkun/LeetCode | 632.cpp | class Solution {
public:
vector<int> smallestRange(vector<vector<int>>& nums) {
int rangeLeft = 0, rangeRight = INT_MAX;
int size = nums.size();
vector<int> next(size);
auto cmp = [&](const int& u, const int& v) {
return nums[u][next[u]] > nums[v][next[v]];
... | ALGO | 0.999971 | 5.90331 |
a9720c40-3abb-4146-8489-90216c2390f0 | LDFINA01/NeuralNetwork | Eigen3/doc/examples/QuickStart_example2_fixed.cpp | #include <iostream>
#include <Eigen/Dense>
using namespace Eigen;
using namespace std;
int main()
{
Matrix3d m = Matrix3d::Random();
m = (m + Matrix3d::Constant(1.2)) * 50;
cout << "m =" << endl << m << endl;
Vector3d v(1,2,3);
cout << "m * v =" << endl << m * v << endl;
}
| ALGO | 0.997865 | 3.375595 |
2884b296-039a-46b6-ba42-ac858a90ce2c | 6767cc/baekjoon-c- | 1082/1082.cpp | // 1082.cpp : 이 파일에는 'main' 함수가 포함됩니다. 거기서 프로그램 실행이 시작되고 종료됩니다.
//
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
using namespace std;
int N, M;
int P[11];
vector<pair<int, int>> p;
string ans;
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
... | ALGO | 0.999978 | 4.963904 |
c694fb35-e313-4d27-9d0b-694c589e4bee | thalium/icebox | third_party/retdec-3.2/src/fileformat/utils/conversions.cpp | /**
* @file src/fileformat/utils/conversions.cpp
* @brief Simple string conversions.
* @copyright (c) 2017 Avast Software, licensed under the MIT license
*/
#include <algorithm>
#include "retdec/fileformat/utils/conversions.h"
namespace retdec {
namespace fileformat {
/**
* Formatter for conversions between st... | TOOL | 0.865454 | 6.649372 |
970aba26-e24a-4075-90ea-6faeffb8710f | victor-gil-sepulveda/PathPlanning-RRT | RRT/RRT.cpp | /*
* RRT.cpp
*
* Created on: May 24, 2011
* Author: vgil
*/
#include "RRT.h"
RRT::RRT( RRTMetric* metric,
SamplingAlgorithm* sampAlg,
ExpansionAlgorithm* expAlg,
NearestNeighbourAlgorithm* nnAlg,
ColisionTest* colTest,
CompletionCheck* compCheck,
RRTSerializationAlgorithm* rwAlgorithm )... | ALGO | 0.999443 | 4.22253 |
4d71c36f-9321-41f9-a536-ca0137ee24dd | GAUTHAMPANDALA/Problem-Solving | Bit Manuplation/Findrightmostdifferentbit.cpp | // Program to find right most difference between 2 elements //
// Given m and n we have to find right most diferent element in them. //
// Given m=9 and n=4 ie, 1001 and 100 the difference bit is at position 4. //
#include<bits/stdc++.h>
#include<math.h>
using namespace std;
int main()
{
int n,m;
... | ALGO | 0.999962 | 3.814502 |
57855e58-0dca-4567-b5d6-7d6980bc49d2 | RiMe-13/ps | baekjoon/5557.cpp | #include <iostream>
using namespace std;
long long dp[101][21]; // dp[i][j] i번째 수까지 j를 만들어내는 경우의 수
long long arr[101];
int n, result;
int main() {
ios::sync_with_stdio(false);
cin.tie(NULL);
cin >> n;
for (int i = 1; i <= n - 1; i++) {
cin >> arr[i];
}
cin >> result;
dp[1][arr[1]] = 1;
for (int i = 2;... | ALGO | 0.99998 | 3.899688 |
f3320bf7-1f02-442b-9286-2f319e2b2c34 | strategist614/ACM-Code | 刷题比赛/kuangbin专题/最短路/POJ2253.cpp | #include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
#include<math.h>
using namespace std;
const int N = 301;
const int INF = 0x3f3f3f3f;
double a[301][301];
double d[301];
bool v[301];
int n, m;
struct sppp
{
int x;
int y;
} Point[N];
double dis(int x1, int y1, int x2, int y2)
{
return sqrt... | ALGO | 0.999592 | 3.66448 |
9b6baede-ca80-4ac1-9042-dc71441a362e | EduardoDavilaZ/Ejercicios_Iniciales-Cpp | Iniciales4/Ejercicio48.cpp | //Leer un número entero y si es menor que 100 determinar si es primo.
#include <iostream>
using namespace std;
bool esPrimo(int);
main(){
int n;
cout << "Introduce un numero: "; cin >> n;
if (n < 100){
if (esPrimo(n)== true){
cout << "Es primo." << endl;
} else {
cout << "No es primo" << endl;
}
}
}
... | ALGO | 0.999214 | 3.225299 |
4920f638-9a25-448a-8f5f-bdd1e4f40959 | itsukis/algo | test/t1.cpp | #include <iostream>
using namespace std;
void test(char m[3][3]) {
m[0][0] = '9';
}
int main()
{
char m[3][3] = {{'0', '0' ,'0'},{'0', '0' ,'0'}, {'0', '0', '0'}};
test(m);
for (int i = 0 ; i < 3 ; i++)
for (int j = 0; j < 3 ; j++)
cout << m[i][j] << endl;
return 0;
} | ALGO | 0.982748 | 3.06265 |
e46c7f14-8ca7-45ba-b974-99c2c3bd158f | sumit-gade/DSA-Problem-Solving-Repository | SEARCHING & SORTING/NEARLY_SORTED_ARR.CPP | // C++ program to find an element
// in an almost sorted array
#include <bits/stdc++.h>
using namespace std;
// A recursive binary search based function.
// It returns index of x in given array
// arr[l..r] is present, otherwise -1
int binarySearch(int arr[], int l, int r, int x)
{
if (r >= l) {
int mid = l + (r - ... | ALGO | 0.999961 | 5.400794 |
7d779b8a-bd1c-4cf7-97d0-025792784bac | HANS-2002/5th-sem-labs | Analysis of Algorithm/DAA LAB/lab6/huffman.cpp | #include <bits/stdc++.h>
using namespace std;
struct dataNode
{
int freq;
char ch;
};
struct node
{
char ch;
int freq;
string code;
node *left, *right;
};
void dfs(node *root, string code, vector<node *> &v)
{
if (root == NULL)
return;
if (root->left == NULL && root->right ==... | ALGO | 0.999959 | 4.013504 |
2d7f4050-fcc6-4a14-a35f-aa620db3e15c | Chan531/BaekJoon_Online_Judge | 나는위대한슈퍼스타K.cpp | #include <iostream>
#include <algorithm>
#define p pair<double, int>
using namespace std;
int n, m, k;
double ans;
p arr[10000];
bool check[101];
void input()
{
cin >> n >> m >> k;
for (int i = 0; i < m; i++)
for (int j = 0; j < n; j++)
cin >> arr[i * n + j].second >> arr[i * n + j].first;
}
void solution()... | ALGO | 0.999844 | 3.49924 |
107970aa-7b57-43a0-b5bd-1e63b740098f | ultra-ACE/HDOJ2000-2100 | 2036.cpp | #include <cstdio>
#include <cmath>
int x[102] = {0};
int y[102] = {0};
int main()
{
int n;
while (scanf("%d", &n) == 1)
{
if (n == 0)
break;
for (int i = 0; i < n; i++)
{
scanf("%d%d", &x[i], &y[i]);
}
x[n] = x[0];
y[n] = y[0];
... | ALGO | 0.996879 | 3.916604 |
773c858f-992c-475f-8303-51ef0c191493 | Baileyswu/code4fun | 数据结构/T-RMQ.cpp | void init (){
int i;
for (i=1;i<=n;i++){
scanf ("%d",&a[i].x);
f[i][0]=1;
}
}
void pre (){
int i,j,l,last;
last=a[1].x;l=1;
a[n+1].x=a[n].x-1;
for (i=1;i<=n+1;i++){
if (a[i].x==last)continue;
else {
for (j=l;j<i;j++){
... | ALGO | 0.999583 | 4.012314 |
c688ed8e-7a0b-4e2f-b669-8c616f561389 | cutun/slash-sandbox | slash-sandbox/nih/mtrand/mtrand.cpp | // mtrand.cpp, see include file mtrand.h for information
#include "stdafx.h"
#include "mtrand.h"
// non-inline function definitions and static member definitions cannot
// reside in header file because of the risk of multiple declarations
// initialization of static private members
unsigned long MTRand_int32::state[... | TOOL | 0.998284 | 5.756818 |
49d1964d-66e5-49db-8b06-2f21db43cb1b | einxie/learnalgorithm | bellmanford/bellmanford.cpp | #include "bellmanford.h"
#include <iostream>
using std::cout;
using std::endl;
Bellmanford::Bellmanford(int (*m_edges)[VERTEX_LENGTH]) {
if(m_edges == 0) {
return;
}
for(int i = 0; i < VERTEX_LENGTH; i++) {
Vertex vertex;
vertex.index = i;
vertex.distance = VERTEX_KEYMAX;
... | ALGO | 0.999712 | 4.368983 |
584f6971-dd7d-41e7-b610-88edc14ecbe0 | abhisingh2244/leetcode | Palindrome with minimum sum - GFG/palindrome-with-minimum-sum.cpp | //{ Driver Code Starts
// Initial Template for C++
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
// User function Template for C++
class Solution {
public:
int minimumSum(string s) {
// code here
int low = 0, high = s.size()-1;
int sum = 0;
while(low<high){... | ALGO | 0.999499 | 5.778209 |
29301e47-4683-4ae1-af76-0d301d8cdd8d | rohannarde/configurationpuzzles | jam.cpp | // File: $Id: jam.cpp,v 1.2 2011/05/06 00:11:46 rsn5770 Exp $
// Author: Anand Rathod
// Description: Contains the main method to initiate the
// Traffic jam puzzle and take input values from user.
// Revisions:
// $Log: jam.cpp,v $
// Revision 1.2 2011/05/06 00:11:46 rsn5770... | ALGO | 0.999376 | 4.135678 |
5b0ecbbc-a10f-4926-b2e5-8edf2e55388f | im-Maryam-Mahmood/Leetcode-Solutions | 1803-average-waiting-time/average-waiting-time.cpp | class Solution {
public:
double averageWaitingTime(vector<vector<int>>& customers) {
long long totalWaitingTime = 0;
int currentTime = 0;
for (const auto& customer : customers) {
int arrivalTime = customer[0];
int cookingTime = customer[1];
if (currentTim... | ALGO | 0.999877 | 6.126781 |
e1925f85-5df5-4be9-aa22-7108e5df8d4f | war-and-peace/load_balancing_sim | daco_performance.cpp | #include <iostream>
#include <vector>
#include <random>
#include <cmath>
#include <iomanip>
#include <fmt/format.h>
// Server class
class Server {
public:
Server(int id, int capability) : id(id), capability(capability), load(0) {}
void addLoad(double taskLoad) {
load += taskLoad;
}
void reset... | ALGO | 0.999763 | 7.107426 |
74cc7263-875e-42e6-aef2-affad2928377 | huyenmi16/Language-C | phân tích thừa số nguyên tố.cpp | #include<stdio.h>
void check (int n)
{
for(int i=2;i<n;i++)
{
int dem=0;
while(n%i==0)
{
dem++;
n=n/i;
}
if(dem)
{
printf("%d^%d",i,dem);
if(n>i)
{
printf(" * ");
}
}
}
if(n>1)
{
printf("%d^1",n);
}
}
int main()
{
int t;
scanf("%d",&t);
while(t--)
{
int n;
scanf("%d",... | ALGO | 0.99954 | 4.310505 |
42f8a276-47cb-4ae0-8d95-7b4cd0505a06 | jiun0507/Interview-prep | Baekjoon/TREE]trees.cpp | //baekjoon 1991
//basic tree question implementing preorder, inorder, postorder
#include <iostream>
using namespace std;
struct Node{
int left;
int right;
};
Node a[50];
void preorder(int node){
if(node == -1) return;
cout<<(char)(node + 'A');
preorder(a[node].left);
preorder(a[node].right);
return;
}
void i... | ALGO | 0.999954 | 3.679227 |
b2dcd6eb-c184-4f5f-9bf3-34dc654c2431 | vickyguptaa7/CrackYourPlacement | 45DaysChallenge/Graph/Hard/Alien_Dictionary.cpp | class Solution
{
public:
string findOrder(string dict[], int N, int K)
{
vector<int> list[26];
for (int i = 1; i < N; i++)
{
int len = min(dict[i].size(), dict[i - 1].size());
for (int j = 0; j < len; j++)
{
if (dict[i - 1][j] == dict[... | ALGO | 0.999997 | 5.866297 |
a28337c1-3e61-4825-b845-4a8b0b153a55 | luffingluffy/cp | codeforces/round 863 (div. 3)/b.cpp | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
template <typename T>
using oset = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
typedef long long ll;
typedef long double ld;
typede... | ALGO | 0.999573 | 4.584046 |
dd6f5797-480d-4748-b8c3-8f41158c3c23 | admin333-paper/3L-Cache | libCacheSim/scripts/LightGBM/compute/example/copy_data.cpp | //[copy_data_example
#include <vector>
#include <boost/compute/algorithm/copy.hpp>
#include <boost/compute/container/vector.hpp>
namespace compute = boost::compute;
int main()
{
// get default device and setup context
compute::device device = compute::system::default_device();
compute::context context(d... | ALGO | 0.980272 | 5.542638 |
887bf5cf-1a51-47e5-a206-5cb9df77cc07 | Anirudhcodestoo/CPP | SEARCHING/lastoccur.cpp | #include <iostream>
using namespace std;
int binary(int a[],int n,int ele)
{
int i,mid, beg=0,end=n-1;
while(beg<=end)
{
mid =(beg+end)/2;
if(a[mid]==ele&&a[mid+1]!=ele)
return mid;
if(a[mid]<=ele)
beg=mid+1;
if(a[mid]>ele)
end=mid-1;
}
return -1;
}
i... | ALGO | 0.999904 | 5.41751 |
3683d059-0dc5-47cf-ae95-73c95a024338 | rabbity01234/exam2 | pracex2_1.cpp | #include<iostream>
using namespace std;
template <typename T>
int countIf(T arr[],int length,T target){
int x=0;
for(int i=0;i<length;i++){
if(arr[i] == target){
x++;
}
}
//Write your code here
return x;
}
int main(){
int a[] = {9,8,7,9,8,7,3,2,1,0,0,0};
cout << countIf(a,12,0) << "\n";
cout << countI... | ALGO | 0.998847 | 4.274054 |
5b31ba5a-2dbb-4540-bdec-3cdeed6987b9 | DKIT-STUDIO/ultra_tasks_cpp | 5/main.cpp | #include <iostream>
#include <vector>
#include <string>
#include <map>
using namespace std;
class TeamMember {
private:
string id;
string name;
string role;
public:
TeamMember(const string& id, const string& name, const string& role)
: id(id), name(name), role(role) {}
string getId() ... | TOOL | 0.892108 | 6.314821 |
ef77d3e0-4900-469d-9f48-70e703ddd86a | rrkarim/neerc | opencup/opencup-2015/gpmoscow/N.cpp | /**
*/
#include<bits/stdc++.h>
using namespace std;
struct pc{
double p;
double w;
};
pc a[222];
int dp[222];
int main() {
int n , t;
cin >> t;
while(t --) {
cin >> n;
int mx = 0;
for(int i = 0; i < n; i ++) {
cin >> a[i].p >> a[i].w;
}
for(int i ... | ALGO | 0.999863 | 3.96003 |
a6213ff5-b61d-47c5-baaf-af98252d58f9 | shoaibrayeen/Data-Structures-and-Algorithms | DATA STRUCTURES/Binary Tree/Check If Binary Tree Has Duplicate Values/code_2.cpp | #include <iostream>
#include <stack>
#include <unordered_set>
using namespace std;
struct bnode {
int data;
bnode *left;
bnode *right;
};
class btree {
public:
bnode *root;
btree();
void insert();
void display();
bnode* newNode(int);
bool checkDup(bnode*);
};
... | ALGO | 0.999667 | 4.946065 |
269c3265-70b2-484b-b08c-c1bb69b88896 | dku-boanlab/sdn-benchmark | nox/nox/boost-1.46.1/boost_1_46_1/libs/intrusive/example/doc_splay_set.cpp | using namespace boost::intrusive;
class MyClass
: public splay_set_base_hook<> //This is an splay tree base hook
, public bs_set_base_hook<> //This is a binary search tree base hook
{
int int_;
public:
//This is a member hook
splay_set_member_hook<> member_hook_;
MyClass(int i)
... | TOOL | 0.866704 | 5.233984 |
91ea3175-3289-4f42-86bf-d405a46155d5 | ishandutta2007/codeforces | wifiiii/normal/1098/C.cpp | #include <bits/stdc++.h>
typedef long long ll;
using namespace std;
#define forii for(int i=1;i<=n;++i)
#define forji for(int j=1;j<=n;++j)
#define forjj for(int j=1;j<=m;++j)
#define forij for(int i=1;i<=m;++i)
int ans[100005];
ll cal(ll n,ll k)
{
ll l=1,pl=1,ret=0;
while(n>=pl)
{
n-=pl;
r... | ALGO | 0.999949 | 3.15594 |
8ecd33ed-2796-44aa-85a4-24f70d51a982 | caibucai22/learn-pcl | 11/11-hull_2d.cpp | #include <pcl/ModelCoefficients.h>
#include <pcl/io/pcd_io.h>
#include <pcl/point_types.h>
#include <pcl/sample_consensus/method_types.h>
#include <pcl/sample_consensus/model_types.h>
#include <pcl/filters/passthrough.h>
#include <pcl/filters/project_inliers.h>
#include <pcl/segmentation/sac_segmentation.h>
#include <p... | ALGO | 0.958344 | 4.589366 |
e9afd156-2774-4da6-9cb3-a8f64550b0b0 | AchyuthReddy001/Face_Detection_Using_Haarcascades | opencv-master/modules/ml/src/svmsgd.cpp | #include "precomp.hpp"
#include "limits"
#include <iostream>
using std::cout;
using std::endl;
/****************************************************************************************\
* Stochastic Gradient Descent SVM Classifier *
\***************************************... | DATA | 0.971914 | 7.319478 |
15f8b661-e6d3-47ef-a7e5-d166f983a7d4 | Manav-Agg/Coding-Blocks-2023 | Data Structure and Algorithm/August 2023/August 16 Recursion/Multiply.cpp | #include<iostream>
using namespace std;
int multiply(int a, int b){
// base case
if(b == 0){
return 0;
}
// recursive case
return a + multiply(a, b - 1);
}
int main(){
int a, b;
cin >> a >> b;
cout << multiply(a, b);
} | ALGO | 0.999866 | 4.3929 |
dcbaba90-fcad-49b3-bcd0-fd4dd9b7073c | xandejesus/csci-15 | Labs/lab_3.cpp | // lab_3.cpp
//
// Xander de Jesus Huy Dang Lam
//
// 9 - 25 - 2019
// CSCI-15 2D array Program
// The program takes some cornersizes, and prints out arrays in spiral pattern
//
#include <iostream>
#include <fstream>
#include <cstring>
#include <iomanip>
using namespace std;
void makespiral(int a[15][20], int m, int n)... | ALGO | 0.908327 | 3.881455 |
dfe2b95f-55ef-43dd-94af-473316814aeb | sarvex/leetcode-factor | solution/1700-1799/1798.Maximum Number of Consecutive Values You Can Make/Solution.cpp | class Solution {
public:
int getMaximumConsecutive(vector<int>& coins) {
sort(coins.begin(), coins.end());
int ans = 1;
for (int& v : coins) {
if (v > ans) break;
ans += v;
}
return ans;
}
}; | ALGO | 0.999976 | 5.689985 |
294d385b-edb7-41a4-9c79-32892cea8a8c | sraihan73/Lucene- | queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/processors/MultiTermRewriteMethodProcessor.cpp | using namespace std;
#include "MultiTermRewriteMethodProcessor.h"
namespace org::apache::lucene::queryparser::flexible::standard::processors
{
using QueryNode =
org::apache::lucene::queryparser::flexible::core::nodes::QueryNode;
using QueryNodeProcessorImpl = org::apache::lucene::queryparser::flexible::
core:... | TOOL | 0.851539 | 7.225007 |
758e995c-62a0-4c04-ac6d-adae81237ad3 | ShafiqurRohman/Competitive-programming | Programming Code/cf,helpful maths.cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
vector<int>v;
int x;
string a;
cin>>a;
for(int i=0;i<a.size();i++){
if(a[i]!='+'){
x=a[i]-'0';
v.push_back(x);
}
}
sort(v.begin(),v.end());
cout<<v[0];
for(int i=1;i<v.size();i++){
... | ALGO | 0.999973 | 4.085154 |
e7d12c75-685f-4e0d-89f6-65f2849e9389 | timothygey/CPP_OOP_IBM | Administration - Multiple/Administration.cpp | #include <iostream>
using namespace std;
class RuralManagement {
protected:
int acceptedSchemes;
public:
int getAcceptedSchemes(){
return acceptedSchemes;
}
void setAcceptedSchemes(int noOfSchemes){
this->acceptedSchemes=noOfSchemes;
}
int calcNoOfSchemes(int noOfSchemes,i... | ALGO | 0.99255 | 3.947073 |
22496cdd-9bc9-473e-afcd-9c0e09173926 | misasoares/flutter-init | 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 |
4c7de8ea-a618-45fb-824d-f48fc21bc47b | atul7266/C | Bitmanipulation6.cpp | #include<iostream>
#include<string>
#include<algorithm>
using namespace std;
int setBit(int n, int pos){
return(n & (1<<pos))!=0;
}
void unique(int arr[], int n){
int xorsum=0;
for(int i=0;i<n;i++){
xorsum=xorsum^arr[i];
}
int tempxor=xorsum;
int setbit=0;
int pos=0;
while(set... | ALGO | 0.999985 | 4.057054 |
11391847-8079-4953-b40f-1b603a890ac8 | M-J-Y-21/Competetive-Programming | codeforces/1100/SerejaSuffixes.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
/**
* @brief Super speed boost
* Went from 545ms to 311ms
*/
ios::sync_with_stdio(false);
cin.tie(NULL);
int n, m, l;
cin >> n >> m;
int elements[n];
memset(elements, 0, n);
for (int i = 0; i < n; i++) {
... | ALGO | 0.999989 | 4.651222 |
b143d702-a8be-4f82-8c6c-1f6166a0fd30 | KitauraHiromi/atcoder | ARC002/b.cpp | /*
* Contents : ARC002 B問題 AC
* Author : KitauraHiromi
* LastUpdate : 20180530
* Since : 20180528
*/
#include <iostream>
#include <vector>
#include <string>
using namespace std;
vector<int> next_day(vector<int> ymd){
vector<int> ret(ymd);
// 年末
if(ymd[1] == 12 && ymd[2] == 31){
ret[0... | ALGO | 0.999099 | 4.067345 |
3c7ecb1c-8b0f-425d-a46f-2f3a4572ffd4 | coderpirate-minhajulislam/DSA-CP-with-CPP | dubly_linked_list/delete_at_any.cpp | #include <bits/stdc++.h>
using namespace std;
//? dubly linked list
class Node
{
public:
int val;
Node *next;
Node *prev;
Node(int val)
{
this->val = val;
this->next = NULL;
this->prev = NULL;
}
};
void insert_at_head(Node *&head, Node* &tail,int val)
{
Node *new_... | ALGO | 0.999752 | 4.298935 |
f9aa31ee-1665-42af-9ada-e1cb9528e493 | Wasif-Shahzad/Graphs | Graphs/adjMatrix.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define ls(i, a, b) for(int i = a; i < b; i++)
#define le(i,a , b) for(int i = a; i <= b; i++)
#define gt(i, a, b) for(int i = a; i > b; i--)
#define ge(i, a, b) for(int i = a; i >= b; i--)
const int N = 1e3+10;
int graph[N][N];
vector<int> listgrap... | ALGO | 0.999981 | 4.083676 |
b9395101-3a15-4279-9feb-cb3be97c3832 | pau-cardoso/DataStructures | BST/Yo/main.cpp | #include <iostream>
#include "Bst.hpp"
int main(){
BST<int> * arbol = new BST<int>();
arbol -> agregarNodoIterativo(50);
arbol -> agregarNodoIterativo(30);
arbol -> agregarNodoIterativo(20);
arbol -> agregarNodoIterativo(40);
arbol -> agregarNodoIterativo(50);
return 0;
} | ALGO | 0.995018 | 4.418934 |
99f2c1f1-91f4-49be-9a45-5c3f2d367f61 | file-citas/via | llvm/llvm/lib/Support/ScaledNumber.cpp | #include "llvm/Support/ScaledNumber.h"
#include "llvm/ADT/APFloat.h"
#include "llvm/ADT/ArrayRef.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/raw_ostream.h"
using namespace llvm;
using namespace llvm::ScaledNumbers;
std::pair<uint64_t, int16_t> ScaledNumbers::multiply64(uint64_t LHS,
... | TOOL | 0.901003 | 7.655499 |
cae60133-7eba-4d37-9727-e59b36f07412 | gmtiddia/structural_plasticity | simulations/simulation_no_rewiring_continuo/100000/structural_plasticity.cpp | #include <iostream>
#include <fstream>
#include <sstream>
#include <stdio.h>
#include <stdlib.h>
#include <cmath>
#include <random>
#include <cstring>
#include <algorithm>
#include <vector>
#include <cstdio>
#include <string>
#ifdef _OPENMP
#include <omp.h>
#define THREAD_MAXNUM omp_get_max_threads()
#define THREAD_ID... | ALGO | 0.952533 | 4.693918 |
6024e649-c14d-491f-8472-489ea69c4135 | Kaminyou/Competitive-Programming-Playground | solutions/1692G.cpp | #include <iostream>
#include <vector>
using namespace std;
void solve() {
int n, k;
cin >> n >> k;
vector<int> v(n, 0);
for (int i = 0; i < n; ++i) cin >> v[i];
vector<bool> relations(n - 1, false);
for (int i = 1; i < n; ++i) {
if (v[i] * 2 > v[i - 1]) relations[i - 1] = true;
}
... | ALGO | 0.999906 | 5.087369 |
5dab6e6c-984a-48cf-8492-f1348b8365b4 | Harsh14901/COP290-TrafficEstimation | assignment1/src/database_search.cpp | #include "database_search.hpp"
runtime_params get_runtime_params_from_string(string rp_str) {
runtime_params rp;
stringstream s(rp_str);
string val;
getline(s, val, ';');
rp.skip_frames = stoi(val);
getline(s, val, ';');
rp.sparse_optical_flow = stoi(val);
getline(s, val, ';');
rp.calc_dynamic_dens... | CONFIG | 0.994456 | 5.00396 |
9c8dddd4-dda2-4779-afa6-3e76e38ad84e | vladxyk/blind_signature | lab5.cpp | #include <stdlib.h>
#include <iostream>
#include <math.h>
#include <fstream>
#include <cstdlib>
#include <cstring>
#include "header.hpp"
#include "sha/SHA256.h"
using namespace std;
void client(unsigned long long int N, long long int d, string outFileName){
ofstream outf(outFileName.c_str());
srand(time(NUL... | ALGO | 0.998902 | 3.163128 |
3fd73cb5-558b-418f-b043-d7d6afec7c04 | jbyerline/PR-10-Marlin-bugfix-2.0.x-BL-Touch | buildroot/share/PlatformIO/variants/MARLIN_FYSETC_S6/variant.cpp | #include "pins_arduino.h"
#ifdef __cplusplus
extern "C" {
#endif
// Pin number
const PinName digitalPin[] = {
PA_0, //D0
PA_1, //D1
PA_2, //D2
PA_3, //D3
PA_4, //D4
PA_5, //D5
PA_6, //D6
PA_7, //D7
PA_8, //D8
PA_9, //D9
PA_10, //D10
PA_11, //D11
PA_12, //D12
PA_13, //D13
PA_14,... | CONFIG | 0.914598 | 3.876639 |
5d413eb5-60ce-4f0a-9cb5-44950f5d29c7 | SequoiaDB/SequoiaDB | thirdparty/boost/libs/graph/example/boost_web_graph.cpp | template <class Distance>
class calc_distance_visitor : public boost::bfs_visitor<>
{
public:
calc_distance_visitor(Distance d) : distance(d) { }
template <class Graph>
void tree_edge(typename boost::graph_traits<Graph>::edge_descriptor e,
Graph& g)
{
typename boost::graph_traits<Graph>::v... | ALGO | 0.99971 | 4.907742 |
4dafdf12-d6cd-416d-8aac-e6013f38926f | dyjhhh/cs225 | mp3/main.cpp | #include "list.h"
#include "blockpng.h"
#include <algorithm>
#include <iostream>
#include <string>
#include <vector>
using namespace std;
List<RGBAPixel> imageToList(PNG const & img, bool reverse = false)
{
List<RGBAPixel> list;
for (size_t i = 0; i < img.width(); i++)
{
for (size_t j = 0; j < img.height(); j++... | TEST | 0.972932 | 4.363399 |
f8a3c6c5-37d6-475c-9f8a-135881143162 | pilotcorgi/CSim | Solvers/WeakPreciseSolver.cpp | #include "WeakPreciseSolver.hpp"
#include <iostream>
using namespace std;
WeakPreciseSolver::WeakPreciseSolver() {
}
WeakPreciseSolver::~WeakPreciseSolver() {
}
int WeakPreciseSolver::UpdateValue(std::list<SimNodePtr> *node_list, std::set<SimNodePtr> &changed_list) {
int changed_node_cnt = 0;
NodeStat... | ALGO | 0.999786 | 4.901734 |
535f0b5d-e943-4fc0-9744-a55f2b28650f | aksharanigam1112/Practice | dp/house-robber-circular.cpp | // There are N houses built in a circular, each of which contains some value in it.
// A thief is going to steal the maximum value of these houses, but he can’t steal in two adjacent houses
#include<iostream>
#include<bits/stdc++.h>
using namespace std;
// TC : O(2^N) & SC : O(N)
int recursion(vector<int>&arr, in... | ALGO | 0.999987 | 5.147801 |
fc8a2c19-01a3-49aa-898f-d92b1b5c181e | ishandutta2007/codeforces | jyt/normal/1466/C.cpp | #include<iostream>
#include<cstdio>
#include<cstdlib>
#include<cmath>
#include<cstring>
#include<string>
#include<algorithm>
#include<queue>
#include<vector>
#include<set>
#include<map>
using std::cin;using std::cerr;
using std::max;using std::min;
#define N 100005
#define ll long long
#define db double
#define dbg1(x)... | ALGO | 0.999889 | 3.687345 |
5053eec8-7c2c-4730-90b1-27147eeed5b5 | NIKHILSINGH1510/Apna_college_cpp_placement | reapply3.cpp | #include<iostream>
using namespace std;
int main()
{ int n;
cin>>n;
for(int i=1;i<=n;i++){
for(int j=1;j<=i;j++)
{
cout<<"* ";
} int space=2*n-2*i;
for(int j=1;j<=space;j++)
{
cout<<" ";
}
for(int j=1;j<=i;i++){
cout<<"* ";
}
cout<<... | ALGO | 0.999948 | 3.596666 |
268c9b4d-7337-4b6f-90de-53dc29e027e3 | hannayuzefavich/stack-based-advanced-calculator | RPN.cpp | #include "RPN.h"
RPN::RPN(const ListCustomString& infix)
{
for (int i = 0; i < infix.getSize(); i++)
{
this->infix.addElement(infix.getByIndex(i));
}
}
void RPN::infixToPostfix()
{
CustomStack op_stack, args_stack;
//int nesting_counter;
for (int i = 0; i < this->infix.getSize(); i++)
{
CustomString actua... | ALGO | 0.997618 | 4.079136 |
ee309f22-d114-4945-95bb-dc7ea36d25a0 | nazibur175/C- | C_Two_Colors.cpp | #include<bits/stdc++.h>
using namespace std;
#define int long long
#define mod 1000000007
#define test int t; cin>>t; while(t--)
void solve(){
test{
int n,m;
cin>>n>>m;
vector<int> a(m);
for(int i=0;i<m;i++){
cin>>a[i];
}
sort(a.begin(),a.en... | ALGO | 0.99989 | 4.226877 |
2c44791c-9526-4d9f-8897-e779aed33cc5 | loftol/BOJ | referrence/number_theory.cpp | #define MOD 998244353
tll eeu(ll a, ll b) {
if (a == 0) return { b, 1, 0 };
else {
auto [g, x, y] = eeu(b % a, a);
return { g, y, x - b / a * y };
}
}
// MOD inverse
auto [_, __, a_inv] = eeu(a, MOD);
| ALGO | 0.999811 | 5.011136 |
83ee2b02-cfca-48ff-a8fd-5c471bc57d32 | pvastig/polyline | lib/Polyline2D.cpp | #include <cassert>
#include "Polyline2D.h"
#include "Point2D.h"
#include "Vector2D.h"
namespace pa
{
Polyline2D::Polyline2D(const std::vector<Point2D>& points)
{
assert(!points.empty());
for (auto beginPointIt = points.cbegin(), endPointIt = std::next(beginPointIt);
endPointIt != points.cend(); ++beginPointIt, ... | TOOL | 0.917135 | 5.364385 |
57e87809-0af2-451d-bf33-8230e25b3c34 | zhang-xpongz/structure_algorithm | search/binarySearch.cpp | #include <iostream>
#include <vector>
using namespace std;
int binarySearchFirstBigger(int *a, int n, int val)
{
int low = 0;
int high = n-1;
while(low <= high)
{
int mid = low + ((high-low)>>1);
if(a[mid] >= val)
{
if(a[mid-1] < val)
{
re... | ALGO | 0.999984 | 5.160896 |
f68354ba-4230-41e7-a5aa-b3c247a39ac0 | witchiman/GitDemo | LeetCode-master/algorithms/permutations/permutations.cpp | // Source : https://oj.leetcode.com/problems/permutations/
// Author : Hao Chen
// Date : 2014-06-21
/**********************************************************************************
*
* Given a collection of numbers, return all possible permutations.
*
* For example,
* [1,2,3] have the following permutations:
... | ALGO | 0.999996 | 5.309024 |
6f104db4-cb34-4602-aac9-76a142aa5e6b | HardikJhalani/cpp_dsa | switch.cpp | #include <iostream>
using namespace std;
int main()
{
int amount = 1330;
int checker = 100;
int notes = 0;
while (amount != 0)
{
switch (checker)
{
case 100:
{
notes = amount / 100;
cout << notes << " - 100 rupees notes." << endl;
... | ALGO | 0.992022 | 4.382633 |
d82047f6-8451-46e9-b4e5-d80b20564abd | baibaixue/acm | 7.5.10.cpp | #include<cstdio>
#include<iostream>
#include<cstring>
#include<algorithm>
#include<queue>
#include<vector>
#define maxn 1005
using namespace std;
string s;
int main(){
int T;
scanf("%d",&T);
getchar();
while(T--){
cin>>s;
int cnt=0;
int ans=0;
int len=s.length();
for(int i=0;i<len;i++){
int a=i;
fo... | ALGO | 0.999835 | 3.521845 |
1a6c7574-0128-4f8a-8780-a446396a9c9c | Aadesh-Magare/Competitive_Programming | codechef/majnum.cpp | #include<iostream>
#include<algorithm>
using namespace std;
int main(){
ios_base::sync_with_stdio(false);
int t, n, a[100004], i, j, sum, count;
bool flag;
cin >> t;
while(t--){
sum = 0;
cin >> n;
for(i = 0; i < n; i++)
cin >> a[i];
sort(a, a+n);
flag = false;
for(i = 0; i < n; i++){
count = 1;
... | ALGO | 0.999982 | 3.928439 |
e74bf50c-8b05-4f3a-bd36-46647cb2600c | pcbsd/NextBSD | contrib/llvm/lib/Transforms/IPO/DeadArgumentElimination.cpp | #include "llvm/Transforms/IPO.h"
#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/Statistic.h"
#include "llvm/ADT/StringExtras.h"
#include "llvm/IR/CallSite.h"
#include "llvm/IR/CallingConv.h"
#include "llvm/IR/Constant.h"
#include "llvm/IR/DIBuilder.h"
#include "llvm/IR/DebugInfo.h"
... | TOOL | 0.850945 | 7.947628 |
a043dbed-3020-449f-afaf-d162ddab44cd | sohanur-rahman0/OnlineJudge-Solution | CodeForces/CF_1352A.cpp | #include<bits/stdc++.h>
using namespace std;
#define ll long long
#define dd double
#define pb push_back
#define mp make_pair
#define endl '\n'
#define pi acos(-1.0)
#define all(v) v.begin(),v.end()
#define rall(v) v.rend(),v.rend()
#define contains(a,b) (find(a.begin(),a.end(),b!=a.end()))
#define minimum(a) *min_ele... | ALGO | 0.999533 | 4.076495 |
7eb50997-0a16-440b-9fe9-4b0d3ef5eccd | amsuffering/csce412_load_balancer | main.cpp | #include <iostream>
#include "LoadBalancer.h"
/**
* @brief Main function to simulate the load balancer and web servers.
*
* Prompts the user to input the number of servers and the amount of time (in clock cycles) for the simulation.
* Initializes the servers and generates a full queue of requests.
* Runs the simu... | ALGO | 0.874553 | 5.858363 |
3b1a22d4-0ce2-487f-8510-f73bdad87920 | chaoqun-liang/riscv-llvm | lib/Analysis/BlockFrequencyInfoImpl.cpp | #include "llvm/Analysis/BlockFrequencyInfoImpl.h"
#include "llvm/ADT/SCCIterator.h"
#include "llvm/Support/raw_ostream.h"
#include <numeric>
using namespace llvm;
using namespace llvm::bfi_detail;
#define DEBUG_TYPE "block-freq"
ScaledNumber<uint64_t> BlockMass::toScaled() const {
if (isFull())
return ScaledNu... | TOOL | 0.908886 | 7.615753 |
d1597d7d-fc76-4c46-970e-c1063ac6bd74 | shubham155217/c-programming | accept n name and sort.cpp | #include<stdio.h>
#include<string.h>
int main()
{
char s1[20][20],t[20];
int i,j,n;
printf("enter limit::");
scanf("%d",&n);
printf("enter n names::");
for(i=0;i<n;i++)
{
scanf("%s",&s1[i]);
}
for(i=0;i<n;i++)
{
for(j=0;j<n;j++)
{
if(strcmp(s1[i],s1[j])<0)
{
strcpy(t,s1[i]);
strcpy(s1[i]... | ALGO | 0.999607 | 3.141979 |
74096a20-0b56-41b8-b11b-a1083b44b20c | vishudhshah/othello | board.cpp | #include "board.hpp"
#include <iostream>
#include <format>
void initialize_board() {
board[3][3] = PLAYER2;
board[3][4] = PLAYER1;
board[4][3] = PLAYER1;
board[4][4] = PLAYER2;
}
void print_board() {
char column_labels[] = {'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H'};
std::cout << " ";
for (... | ALGO | 0.930597 | 6.047686 |
75fb77af-2596-4629-adfc-5576ba57f617 | woozway/PAT | 团体程序设计天梯赛-练习集/L1-018 大笨钟 (10分).cpp | #include <iostream>
using namespace std;
int main() {
int h, m;
scanf("%d:%d", &h, &m);
if (h < 12) {
printf("Only %02d:%02d. Too early to Dang.", h, m);
return 0;
}
if (h == 12 && m == 0) {
printf("Only %02d:%02d. Too early to Dang.", h, m);
return 0;
}
int cnt = h - 12;
if (m > 0) cnt++;
for (int i... | ALGO | 0.921735 | 4.231403 |
630a8a57-fb8b-4f4d-9e8a-3ff85a5522c9 | Judtsandy/Programacion- | ejemplo19.cpp | #include <stdio.h>
#include <stdlib.h>
int main (){
int i, j;
for (i=0; i<11; i++){
printf("%d \t", i);
for(j=0; j<11; j++){
printf("%d", i*j);
}
printf("\n");
}
return 0;
} | ALGO | 0.991381 | 3.175075 |
0b91f925-bcb5-43b6-a5be-3542f5f3b8e0 | yogibear234/progress | APR/23/main.cpp | /* Author
@ Pranjal Walia
IIIT Bangalore
*/
#include<bits/stdc++.h>
using namespace std;
void fastscan(int &x){
bool neg = false;register int c;
x = 0;c = getchar();
if(c=='-'){neg = true;c = getchar();}
for(; (c>47 && c<58); c=getchar()){x = x *10 + c - 48;}
if(neg){x *= -1;}}
#define ff first
#defi... | ALGO | 0.999902 | 3.430044 |
376ac5b3-daf3-4c19-961f-1c14907e156a | Mari-Jun/BAEKJOON-ALGORITHM | 기타/1306.cpp | #include <iostream>
#include <vector>
#include <queue>
#include <algorithm>
using namespace std;
vector<int> GetLight(int block);
void FindMaxLight(vector<int> light, int range);
int main()
{
int block, range;
cin >> block >> range;
vector<int> light = GetLight(block);
FindMaxLight(light, range);
return 0;
}
... | ALGO | 0.999989 | 3.487861 |
f87412a3-17d0-465a-8e40-fb9a4c19dd1a | code233trainee/lijiminbest | AtCoder/ABC/ABC_406/B.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main()
{
ll n, k;
cin >> n >> k;
ll ans = 1;
ll mx = pow(10, k);
mx--;
for(int i = 0; i < n; i++)
{
ll x;
cin >> x;
if(ans > (mx/x))
{
ans = 1;
}
else
{... | ALGO | 0.99997 | 3.618763 |
6def9436-2cc3-4f52-8e85-460ae77d5159 | bzz13/timus | 1167/1167.cpp | #include <iostream>
#include <stdio.h>
#include <valarray>
#include <utility>
#include <sstream>
#include <string>
#include <map>
using namespace std;
const long long maxCost = 999999999;
long long min(const long long & a, const long long & b)
{
return a < b ? a : b;
}
void print(valarray<bool> items)
{
cout << "[... | ALGO | 0.999873 | 3.932297 |
21788779-f440-4184-9421-caee599ee36d | NguyenHoangHaiD21PTIT/INT1339_NGON_NGU_LAP_TRINH_C_PLUS_PLUS_HK20221 | CÁC BÀI LUYỆN TẬP/CHỦ ĐỀ 7. CÁC BÀI TOÁN NÂNG CAO/CHỦ ĐỀ 7.1. KỸ THUẬT SINH KẾ TIẾP VÀ QUAY LUI/CPP0711 - LIET KE XAU NHI PHAN (Cach 2 - QUAY LUI).cpp | #include<bits/stdc++.h>
using namespace std;
int n, a[100];
void inkq(){
for(int i=1;i<=n;i++){
cout<<a[i];
}
cout<<" ";
}
void thu(int i){//thu gia tri cho phan tu thu i
for(int j=0;j<=1;j++){
a[i]=j;
if(i==n){//xet du gia tri cho n so trong xau
inkq();
} else {//Chua xet du gia tri cho tat ca cac so
... | ALGO | 0.999749 | 3.674622 |
3618fa38-867b-4618-9e8c-37980ab65d01 | chiragbhisikar/DSA---365-Day-Of-Code | L-32 Recursion Day-2/#3.cpp | #include <iostream>
#include <bits/stdc++.h>
using namespace std;
void sayNumber(int n)
{
if (n <= 0)
{
return;
}
sayNumber(n / 10);
string arr[10] = {"Zero", "One", "Two", "Three", "Four", "Five", "Six", "Seven", "Eight", "Nine"};
cout << arr[n % 10] << "\t";
}
int main()
{
sayNum... | ALGO | 0.994257 | 4.778815 |
25f170d0-8e28-4ab9-8b26-be038f3fd2ff | sarvex/leetcode-scala | solution/1800-1899/1855.Maximum Distance Between a Pair of Values/Solution.cpp | class Solution {
public:
int maxDistance(vector<int>& nums1, vector<int>& nums2) {
int m = nums1.size(), n = nums2.size();
int ans = 0;
for (int i = 0, j = 0; i < m; ++i) {
while (j < n && nums1[i] <= nums2[j]) {
++j;
}
ans = max(ans, j - i... | ALGO | 0.999981 | 5.797339 |
7724a679-d1c1-40e2-a72f-4e2ccb76d600 | Shreyashpatil056/Codeforces | DAY63/B_Number_of_Triplets.cpp | #pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2,fma")
#pragma GCC optimize("unroll-loops")
#include <bits/stdc++.h>
using namespace std;
typedef long double ld;
typedef long long ll;
typedef pair<int,int> p32;
typedef pair<ll,ll> p64;
typedef pair<double,d... | ALGO | 0.999952 | 4.606074 |
e5b43539-e0ec-4a19-9b5f-7fe9951864d2 | Dornsen/Laboratory-first-course | theory algorithm/alg7/7.2/main.cpp | #include <iostream>
#include <vector>
#include <string>
#include <algorithm>
using namespace std;
void print(string A, string B, vector<vector<int>> arr, vector<vector<char>> direction) {
int n = A.size();
int m = B.size();
cout << " ";
for (int j = 0; j < m; j++) cout << " " << B[j];
cout <<... | ALGO | 0.999979 | 5.769989 |
1fd0d809-afb6-4130-991b-f2778a819d1a | HustStevenZ/openMVG | src/openMVG/numeric/numeric.cpp | #include "openMVG/numeric/numeric.h"
#include <iostream>
#include <fstream>
#include <string>
namespace openMVG {
Mat3 CrossProductMatrix(const Vec3 &x) {
Mat3 X;
X << 0, -x(2), x(1),
x(2), 0, -x(0),
-x(1), x(0), 0;
return X;
}
Mat3 RotationAroundX(double angle) {
return Eigen::AngleAxisd(an... | TOOL | 0.972893 | 6.25599 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.