uuid stringlengths 36 36 | repo_name stringlengths 5 123 | relative_path stringlengths 5 4k | content stringlengths 33 2.85M | category stringclasses 6
values | algo_rel_score float64 0.85 1 | quality_score float64 3 8.76 |
|---|---|---|---|---|---|---|
669f9329-2abf-447d-98b6-7eb06fc2b3dc | ishandutta2007/codeforces | kpw29/normal/289/B.cpp | #include <bits/stdc++.h>
using namespace std;
#define e1 first
#define e2 second
#define pb push_back
#define mp make_pair
#define boost ios_base::sync_with_stdio(false)
#define eb emplace_back
#define OUT(x) {cout << x; exit(0); }
#define scanf(...) scanf(__VA_ARGS__)?:0
typedef long long ll;
typedef unsigned long lon... | ALGO | 0.999948 | 3.620922 |
e7c155c0-adde-4ba9-b5e9-c5c777ae1a6a | lamphanviet/competitive-programming | uva-online-judge/accepted-solutions/10300.cpp | // Problem 10300 - Ecological Premium
#include <iostream>
using namespace std;
main() {
int kase, n, x, y, z, sum;
cin >> kase;
while (kase--) {
cin >> n;
sum = 0;
while (n--) {
cin >> x >> y >> z;
sum += x*z;
}
cout << sum << endl;
}
}
| ALGO | 0.997456 | 4.269751 |
fbd9edd5-f801-4bc4-9a20-28f3fff77b1b | Shubh-am15/DAALab_4thSem | Week 6/Que1.cpp | #include<bits/stdc++.h>
using namespace std;
void DFS(int node,int destination,vector<int> &vis,vector<int> adj[],vector<int> &storedfs,int &flag)
{
storedfs.push_back(node);
vis[node]=1;
for (auto it: adj[node])
{
if (!vis[it])
{
if (it==destination) flag=1;
DFS... | ALGO | 0.999988 | 3.949511 |
64514722-2d11-48ad-90cf-7080724ce47d | yash1302/DSA | circular LL/deleteHead.cpp | #include<iostream>
using namespace std;
struct node{
int data;
node *next;
node(int x)
{
data = x;
next = NULL;
}
};
// node *delHead(node *head)
// {
// if(head==NULL)
// {
// return NULL;
// }
// if(head->next == NULL)
// {
// delete head;
// ... | ALGO | 0.999344 | 3.783557 |
76a5578c-0483-4f97-9f5a-224b290f5763 | aqshanto/Number_Theory | Long Contest/Number Theory 1.1/m.cpp | #include<bits/stdc++.h>
using namespace std;
#define int long long
#define endl "\n"
double pi= 3.141592653589793238462643383279;
int N=10;
vector<set<int>>v(N+1);
map<int,vector<int>>mp;
vector<int>ans;
void seive(){
for(int i=1;i*i<=N;i++){
for(int j=1;j<=N;j++){
if(j%i==0){
v... | ALGO | 0.999582 | 4.175937 |
11dc5ed9-7903-4cc8-9fc2-3b3ae430305e | shubhammehra4/DSA | Problems/Dynamic_Programming/Travelling_Salesman.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define pb push_back
#define INF INT_MAX
#define N 4
int cost[N][N] = {{0, 10, 15, 20},
{5, 0, 9, 10},
{6, 13, 0, 12},
{8, 8, 9, 0}};
int memo[1 << N][N];
void setup()
{
for (int i = 0; i < 1 <... | ALGO | 0.99934 | 3.437771 |
d3316d04-72ed-4c1d-be10-6b00b465716d | Vinxenzoo/LASD | exercise3/binarytree/lnk/binarytreelnk.cpp | //Vincenzo Capasso N86004259
#include "binarytreelnk.hpp"
namespace lasd
{
/* ************************************************************************** */
//Element
template <typename Data>
const Data & BinaryTreeLnk<Data>::NodeLnk::Element() const noexcept {
return info;
}
//Element (mutable)
template <type... | TOOL | 0.961415 | 3.827579 |
3f27143c-44d0-4f81-a11f-fa9765dac23e | jefferyyellow/UE4 | UnrealEngine-4.26/Engine/Source/Runtime/Experimental/Chaos/Private/Chaos/UniformGrid.cpp | #include "Chaos/ArrayFaceND.h"
#include "Chaos/ArrayND.h"
using namespace Chaos;
template<class T_SCALAR, class T>
T_SCALAR LinearlyInterpolate1D(const T_SCALAR& Prev, const T_SCALAR& Next, const T Alpha)
{
return Prev + (Next - Prev)*Alpha;
}
template<class T_SCALAR, class T, int d>
T_SCALAR LinearlyInterpolateHe... | ALGO | 0.972211 | 6.55585 |
bbf5cfe5-74c8-479e-9fb0-33b46530db55 | sheeluofficial/practice | OthersCode/LeetCode-Solutions-master/LeetCode-Solutions-master/C++/find-the-winner-of-an-array-game.cpp | // Time: O(n)
// Space: O(1)
class Solution {
public:
int getWinner(vector<int>& arr, int k) {
int result = arr[0];
for (int i = 1, count = 0; i < arr.size(); ++i) {
if (arr[i] > result) {
result = arr[i];
count = 0;
}
if (++count... | ALGO | 0.999998 | 5.639475 |
da5f508a-823a-4d75-bd33-384010e69266 | ishandutta2007/codeforces | fizzydavid/normal/477/A.cpp | //while(true)rp++;
#include<algorithm>
#include<cstdlib>
#include<cstdio>
#include<cstring>
#include<cmath>
#include<iostream>
#include<map>
#include<queue>
#include<stack>
#include<string>
#include<set>
#include<utility>
#include<vector>
using namespace std;
#define ff first
#define ss second
#define pb push_back
#de... | ALGO | 0.999923 | 3.497298 |
abc837a7-f341-494d-b172-9b74bac7ab73 | yjaiswal05/Face-recognition- | opencv/OpenCV 4.5.2.tar/opencv-opencv-39d2578/samples/cpp/image_alignment.cpp | /*
* This sample demonstrates the use of the function
* findTransformECC that implements the image alignment ECC algorithm
*
*
* The demo loads an image (defaults to fruits.jpg) and it artificially creates
* a template image based on the given motion type. When two images are given,
* the first image is the input image... | ALGO | 0.99763 | 3.982134 |
68b27cd9-33e7-475a-bf57-944a62bb6441 | shehdrbs123/Dongs-Portfolio | Algorithm/baekjoon/10845/main.cpp | #include<bits/stdc++.h>
using namespace std;
int q[10001];
int head,tail;
int main()
{
ios::sync_with_stdio(0);
cin.tie(0);
int N;
cin >> N;
for(int i=0;i<N;++i)
{
string input;
cin >> input;
if(input == "push")
{
int num;
cin ... | ALGO | 0.999551 | 4.004432 |
59507410-84d3-42ac-b9e4-579a510cabee | Phantim97/DSP-Deep-Dive | DSP/source.cpp | #include <corecrt_math_defines.h>
#include <iostream>
#include <fstream>
#include "waveforms.h"
#include "basics.h"
#include "convolutions.h"
#include "matplotlibcpp.h"
#include "dft.h"
#include "vec_util.h"
#include "filters.h"
namespace plt = matplotlibcpp;
void signal_basics()
{
std::cout << "Mean: " << signal_mea... | ALGO | 0.989412 | 5.519575 |
91c31c0e-befa-4b78-b5c3-2cb58d982b20 | tamle7422/data_structures | c++/heap_stl_vector.cpp | /*
Heap is a type of tree data structure that satisfies the heap property. Heaps are useful when one needs to
remove the item with highest or lowest value. In a max-heap, the value of each item is less than or equal to the value of its parent,
with the maximum value item at the root. In a min-heap, the value of each... | ALGO | 0.999814 | 4.739473 |
5cfe364c-7797-4627-9f79-48883d6f149a | ADITYA-0208/Leetcode-er | 0123-best-time-to-buy-and-sell-stock-iii/0123-best-time-to-buy-and-sell-stock-iii.cpp | class Solution {
public:
int fucc(int i, int buy, vector<int>& prices, int n, vector<vector<vector<int>>>& dp) {
if (i == prices.size() || n == 0) return 0;
if (dp[i][buy][n] != -1) return dp[i][buy][n];
if (buy == 1)
return dp[i][buy][n] = max(-prices[i] + fucc(i + 1, 0, prices... | ALGO | 0.999958 | 5.852969 |
8adac200-38a7-4b21-b958-4a3883ec7b33 | ThanchiraCharakhon099/LED_Flash_with_component | main/main.cpp | #include <stdio.h>
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "LED.h"
//65030099
LED led1(16);
LED led2(17);
LED led3(5);
LED led4(18);
LED led5(19);
LED led6(21);
LED led7(22);
LED led8(23);
LED leds[] = {led1, led2, led3, led4, led5, led6, led7, led8};
extern "C" void app_main(void)
... | TOOL | 0.898921 | 4.057722 |
f60306b7-553e-4616-b213-b7bcc6c5d623 | iprosenjitp/Online-Judge | Codeforces/1792A-GamingForces.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
int t;
cin >> t;
while(t--){
int n;
cin >> n;
vector<int> V;
for(int i = 0; i < n; i++){
int ni;
cin >> ni;
V.push_back(ni);
}
sort(V.begin(), V.end());
in... | ALGO | 0.999749 | 4.277318 |
d56bdfdf-b997-4fc1-b058-7d3d4456ed79 | RedNicStone/CubiCAD | src/utils/utils.cpp | //
// Created by nic on 04/12/2021.
//
#include "utils.h"
#include <string>
#include <fstream>
std::vector<char> Utils::readFile(const std::string &filename) {
std::ifstream file(filename, std::ios::ate | std::ios::binary);
if (!file.is_open()) {
throw std::runtime_error("failed to open file!");
... | TOOL | 0.959515 | 6.151118 |
709b153c-c89d-416a-b93f-d1137c6da1d1 | TAUSEEF-01/2-1_DSA_Lab_Tasks | DSA codes/Sorting/mergeSort.cpp | #include<bits/stdc++.h>
using namespace std;
int n;
void merge(int arr[], int p, int q, int r)
{
// Create L ← A[p..q] and M ← A[q+1..r]
int n1 = q - p + 1;
int n2 = r - q;
int L[n1], M[n2];
for (int i = 0; i < n1; i++)
L[i] = arr[p + i];
for (int j = 0; j < n2; j++)
M[j] = ... | ALGO | 0.999989 | 5.515011 |
3e95014a-02bc-43b8-b81d-4e85ec7945f2 | Danxfj/Cppprimerplus | C++primerplus/beforeseven/5-1.cpp | #include<iostream>
using namespace std;
int main()
{
int small, big;
cout << "Enter the small number: ";
cin >> small;
cout << "Enter the big number: ";
cin >> big;
if (small > big)
{
int temp;
temp = small;
small = big;
big = temp;
}
int total = 0;
for (int i=small; i <= big; i++)
{
total += i;
... | ALGO | 0.994448 | 3.812286 |
c555d4ed-9a8b-4e85-b461-e83f3bd4b21f | nicholas-agg/NTUAprojects | 5th_Series_2022/undir.cpp | #include <iostream>
#include <list>
#include <vector>
#include <algorithm>
#include <set>
#include <stack>
enum state{
UNVISITED,
VISITING,
VISITED
};
class Graph{
public:
Graph(int V) {
this->Vertices = V;
adj = new std::list<int>[V];
}
~Graph() { delete [] a... | ALGO | 0.999917 | 4.950684 |
01894068-a911-4868-94b3-e4915b5bc6e3 | luowanqian/LeetCode | 701-800/784_LetterCasePermutation/solution1.cpp | //
// Created by 罗万千 on 2021/3/14.
//
#include <iostream>
#include <vector>
#include <cstring>
using namespace std;
class Solution {
public:
vector<string> letterCasePermutation(string S) {
vector<string> res;
if (S.length() == 0)
return res;
char* buffer = new char[S.length(... | ALGO | 0.998206 | 5.43151 |
bf55057c-8f56-4527-927a-3419ac9de898 | d2school/da4qi4 | src/request.cpp | #include "daqi/request.hpp"
#include <iomanip>
#include <sstream>
#include <fstream>
#include <algorithm>
#include <boost/uuid/uuid_generators.hpp>
#include <boost/uuid/uuid_io.hpp>
#include "daqi/def/log_def.hpp"
#include "daqi/utilities/string_utilities.hpp"
#include "daqi/utilities/file_utilities.hpp"
#include "... | WEB | 0.954456 | 5.606327 |
a4f2cffe-5a6a-4014-aea1-a7f353312b8f | Sahilsharma-ss/LeetCode | 0223-rectangle-area/0223-rectangle-area.cpp | class Solution {
public:
int computeArea(int ax1, int ay1, int ax2, int ay2, int bx1, int by1, int bx2, int by2) {
int rec1 = (ay2 - ay1) * (ax2 - ax1), rec2 = (by2 - by1) * (bx2 - bx1);
int cx1, cy1, cx2, cy2;
cx1 = max(ax1, bx1);
cy1 = max(ay1, by1);
cx2 = min(ax2, bx2);
... | ALGO | 0.999271 | 5.69159 |
80722d27-3aa7-463b-8a0c-87e38c8979dd | ChitrakshGupta/LeetCode_Questions | 3068-find-the-maximum-sum-of-node-values/3068-find-the-maximum-sum-of-node-values.cpp | class Solution {
public:
long long help(int index, int isEven, vector<int>& nums, int k,
vector<vector<long long>>& memo) {
if (index == nums.size()) {
return isEven == 1 ? 0 : INT_MIN;
}
if (memo[index][isEven] != -1) {
return... | ALGO | 0.999977 | 5.758371 |
af579742-68a9-4c54-acfd-532648d59a05 | Hungmot/NguyenNamHung_JPN_KS24A_DEVC_SESION7 | BT3-S7.cpp | #include<stdio.h>
int main(){
int a[5];
int so=5;
for(int i=0;i<5;i++){
printf("moi nhap gia tri cua mang\n");
scanf("%d",&a[i]);
}
if (a[0] %2==0){
printf("%d la gia tri chan\n",a[0]);
}
if(a[1] %2==0){
printf("%d la gia tri chan\n",a[1]);
so--;
}
if(a[2] %2==0){
printf("%d la gia tri chan\n",... | ALGO | 0.997692 | 3.400427 |
3fbe0c0d-36fb-4650-8b3d-d2297728d641 | CathyF9600/computer-graphics-bounding-volume-hierarchy | libigl/include/igl/centroid.cpp | template <
typename DerivedV,
typename DerivedF,
typename Derivedc,
typename Derivedvol>
IGL_INLINE void igl::centroid(
const Eigen::MatrixBase<DerivedV>& V,
const Eigen::MatrixBase<DerivedF>& F,
Eigen::PlainObjectBase<Derivedc>& cen,
Derivedvol & vol)
{
using namespace Eigen;
assert(F.cols() == ... | ALGO | 0.999453 | 6.587102 |
314efbd5-1c78-4162-be4e-957cda3190fa | Capzera/Cpp | LGOJ/LGR-207-Div.4 #29/D.cpp | #include <bits/stdc++.h>
using namespace std;
int n, a[1001], ans, mx;
int main() {
cin >> n;
for (int i = 1; i <= n; i++) cin >> a[i];
for (int i = n; i > 0; i--) {
if (a[i] > mx) {
mx = a[i];
ans++;
}
}
cout << ans;
return 0;
}
/*
求有多少数大于它 后面的 最大值
a[i] > 后面的最大值 ans++;
a[i]
*/
| ALGO | 0.999936 | 3.681406 |
47554d54-a29c-4c11-8f90-bb824ece0495 | SusmoyNath/leetcode-codes | 3750-closest-equal-element-queries/3750-closest-equal-element-queries.cpp | #include <vector>
#include <unordered_map>
#include <algorithm>
using namespace std;
class Solution {
public:
vector<int> solveQueries(vector<int>& nums, vector<int>& queries) {
int n = nums.size();
unordered_map<int, vector<int>> positions;
for (int i = 0; i < n; i++) {
... | ALGO | 0.999923 | 6.054507 |
dc133f65-3697-4999-9d41-474b8e4a917b | Prateek1337/Coding | Data_Structures/sparse_table.cpp | /*
* Sparse table. Solves static RMQ problem (without element changes).
* O(NlogN) on precomputation, O(1) on minimum query.(Can be used for any idempotent functions ,Eg: MAX .. etc)
* For sum like queries it will take Log(n) time(better use segment tree).
* Based on the problem RMQSQ from SPOJ.com:
* https://www.spoj.... | ALGO | 0.999984 | 5.372261 |
926645e2-8252-4c6e-abda-0b9090c844f2 | FAKERINHEART/CODE | ACM/1015Beta.cpp | #include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
int p[200];
int d[200];
int pd[200];
int sum[21][801];
vector<int> path[21][801];
int main()
{
int n, m;
int num = 0;
while(cin >> n >> m)
{
if(!n && !m) break;
num++;
for(int i = 0; i <= m; i++)
{
for(int j = 0; j <= m ... | ALGO | 0.999763 | 3.650206 |
bde397fb-0883-4681-9195-8fae90ce0ae1 | manjeetdeveloper/Leetcode-DSA-150-Days-Challenge | DSA 150 Days Challenges In 150 Days Problem Solving/20. Valid Parentheses.cpp | class Solution {
public:
bool isValid(string s) {
stack<char> stk;
unordered_map<char, char> closing = {{')', '('}, {']', '['}, {'}', '{'}};
for (char c : s) {
if (closing.count(c)) {
if (stk.empty() || stk.top() != closing[c])
return false;
... | ALGO | 0.999408 | 6.556877 |
c2be7ca5-53dc-40ed-8b62-bc86dd832ae9 | anksank/SPOJ-Solutions | Classical/NINJA4 - Help Sheldon.cpp | #include <iostream>
using namespace std;
int main() {
int t;
cin>>t;
while(t--){
int position;
cin>>position;
int x,y;
if(position % 2 == 0){
x = position/2;
if(x % 2 == 0)
x = -1*x;
if((position + 2) % 4 == 0) y = (position+2)/2;
else y = (-1*(position/2));
}
else {
x = (position + 1... | ALGO | 0.999566 | 3.574425 |
ec874767-2e36-4b87-8bc7-54a51d555091 | bgodala/gem5_ARM_FDIP | src/systemc/tests/systemc/misc/user_guide/chpt11.7/mean.cpp | /*****************************************************************************
mean.cpp --
Original Author: Martin Janssen, Synopsys, Inc., 2002-02-15
*****************************************************************************/
/*****************************************************************************
... | ALGO | 0.999551 | 4.457939 |
3c2248ae-163e-4e9a-a60e-0e0fe6bd6b4c | Prithvirajbilla/AlgorithmCoding | codechef/nov14/RBTREE.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long int
int stage = 0;
char a,b;
ll x,y;
//initially red root and black nodes.
void get_balls()
{
vector<ll> px,py;
ll tx = x,ty=y;
while(tx > 0)
{
px.push_back(tx);
tx/=2;
}
while(ty > 0)
{
py.push_back(ty);
ty/=2;
}
// for (int i = 0; i <... | ALGO | 0.999897 | 3.752702 |
a1e0bd97-a484-440d-a0b2-9acaee6a4794 | Bossixd/competitive-programming | codeforces/contests/2037/C.cpp | #include <iostream>
#include <unordered_set>
using namespace std;
void test_case() {
int N;
cin >> N;
if (N == 2 || N == 3 || N == 4)
cout << "-1\n";
if (N < 7) {
if (N == 5)
cout << "2 4 5 1 3\n";
else if (N == 6)
cout << "2 4 5 1 3 6\n";
} else {
... | ALGO | 0.999773 | 4.219953 |
c69a9812-2cf3-434b-b7f1-987a554b2823 | CarlsonZhuo/primal_dual_frank_wolfe | ell_1/Eigen/doc/examples/Tutorial_BlockOperations_corner.cpp | #include <Eigen/Dense>
#include <iostream>
using namespace std;
int main()
{
Eigen::Matrix4f m;
m << 1, 2, 3, 4,
5, 6, 7, 8,
9, 10,11,12,
13,14,15,16;
cout << "m.leftCols(2) =" << endl << m.leftCols(2) << endl << endl;
cout << "m.bottomRows<2>() =" << endl << m.bottomRows<2>() << endl << ... | ALGO | 0.99793 | 4.092313 |
c915b713-05af-4df9-8948-1ef86397bd88 | ishandutta2007/codeforces | aryanc403/normal/1208/B.cpp | /*
Warn - Don't change next line else you will get WA verdict. Online Judge is configured to give WA if next line is not present.
"An ideal problem has no test data."
Author - Aryan Choudhary (@aryanc403)
*/
#pragma warning(disable:4996)
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize ("Ofast")
... | ALGO | 0.999905 | 4.345761 |
cf2e1767-1868-4bf5-8f5b-888ab6915d4d | yifanpeng96/leetcodeRep | 038_countAndSay.cpp | //38. 外观数列
//
//给定一个正整数 n ,输出外观数列的第 n 项。
//
//「外观数列」是一个整数序列,从数字 1 开始,序列中的每一项都是对前一项的描述。
//
//你可以将其视作是由递归公式定义的数字字符串序列:
//
//countAndSay(1) = "1"
//countAndSay(n) 是对 countAndSay(n - 1) 的描述,然后转换成另一个数字字符串。
//
//前五项如下:
//
//1. 1
//2. 11
//3. 21
//4. 1211
//5. 111221
//第一项是数字 1
//描述前一项,这个数是 1 即 “ 一 个 1 ”,记... | ALGO | 0.999556 | 5.679078 |
4f9b2874-41fa-4901-b5b8-2cbd48052e89 | meharavi/LeetCodeSolutions | Pattern 7 - GFG/pattern-7.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution {
public:
void printTriangle(int n) {
for(int i=0;i<n;i++){
for(int j=1;j<n-i;j++){
cout<<" ";
}
for(int k=0;k<(i*2+1);k++){
cout<... | ALGO | 0.999945 | 5.823617 |
ba210d2d-8f6d-4598-b00d-8897fdb74fc7 | hyp3rflow/ProblemSolving | Baekjoon/14867.cpp | #include <iostream>
#include <algorithm>
#include <utility>
#include <stack>
#include <queue>
#include <map>
using namespace std;
typedef pair<int, int> p;
map<p, int> r;
queue<p> q;
int m, n, rm, rn, cnt = 1;
int main(){
cin >> m >> n >> rm >> rn;
p curr = {0, 0};
q.push(curr);
r[curr] = cnt++;
... | ALGO | 0.999936 | 3.155692 |
2a1cc03b-7fb5-4e86-8bb9-3204e02ee6e0 | Sean0628/competitive_programming | misc/kako100/43.cpp | #include <bits/stdc++.h>
using namespace std;
#include <atcoder/all>
using namespace atcoder;
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define out(arg) cout << (arg) << endl
using ll = long long;
using P = pair<int, int>;
using mint = modint1000000007;
void chmax(ll& a, ll b) { a = max(a, b); }
void chmax(int& a... | ALGO | 0.999608 | 4.569118 |
96d13692-6783-46e4-98bc-4a9aba5d829f | Md-Noman-Biswas/Codeforces_problems | D_Candy_Box_easy_version.cpp | #include<bits/stdc++.h>
using namespace std;
#define ll long long
#define nl "\n"
#define YES cout << "YES\n"
#define NO cout << "NO\n"
#define pb push_back
#define llmx LONG_LONG_MAX
#define llmn LONG_LONG_MIN
#define mod 1000000007
const int N = 1e5 + 7;
const int INF = 1e9 + 10;
bool cmp(pair<ll, ll> p1, pair<ll, l... | ALGO | 0.999866 | 4.800034 |
8622538d-0167-415c-8b71-5962dd736ba3 | anand887723-stack/coding_305 | 2289.steps-to-make-array-non-decreasing.cpp | /*
* @lc app=leetcode id=2289 lang=cpp
*
* [2289] Steps to Make Array Non-decreasing
*/
// @lc code=start
#define deb(x) cout << #x << "= " << x << endl;
class Solution
{
public:
int totalSteps(vector<int> &nums)
{
// first of all make the decreasing sequences collpased
// then find the n... | ALGO | 0.999967 | 5.946037 |
573a6e65-7966-4c30-8b6b-991880502f57 | MuhammadAbuBakarQureshi/Cpp-Learning-Journey | Pointers And References/Concepts/Refrence/Refrence.cpp | #include <iostream>
using namespace std;
int main()
{
int value = 10;
int &ref = value;
ref = 20; // now value of "value" is changed to 20
cout << "value = " << value << endl;
value = 30; // now value of ref is changed to 30
cout << "ref = " << ref << endl;
return 0;
} | TOOL | 0.968629 | 3.836646 |
412ff7ba-baed-48be-9060-d1b28fd38002 | yogesh19aggarwal/Dsa | dsa harry/45_heap.cpp | #include <bits/stdc++.h>
using namespace std;
class maxHeap{
public:
int arr[101];
int size;
maxHeap(){
arr[0] = -1;
size = 0;
}
void insert(int val){
size = size + 1;
int index = size;
arr[index] = val;
while(index > ... | ALGO | 0.999954 | 4.19155 |
c8b20f49-6333-46b0-8b0c-459bfd0e9c48 | ymd45921/HUST-ACM-training | nowcoder/2020寒假算法基础集训营/contest3004/J.cpp | /**
*
*/
#include <iostream>
#include <cstring>
using namespace std;
typedef long long longs;
typedef long double longd;
struct edge{int to,next;};
struct poke{longs t,p,val;};
int n,m,k,p,u,v;
int head[250];
edge edges[10086];
int tot;
poke pokemon[100010];
longs ans,t,val;
inline void init()
{
memset(head,-... | ALGO | 0.999445 | 3.796043 |
72c8b970-ed5d-4cae-91ad-bb34c4fca604 | Raajzz/leetcode-dsa | 0070-climbing-stairs/0070-climbing-stairs.cpp | class Solution {
public:
unordered_map<int,int> map;
int climbStairsSolver(int n){
if(n == 0){
return 1;
}
if(n < 0){
return 0;
}
if(!map[n]){
map[n] = climbStairs(n-1) + climbStairs(n-2);
}
return map[n];
}
... | ALGO | 0.999996 | 6.170794 |
0974a1cc-2d83-4203-a8d6-5ad22f2591ac | fede-fernandez/AlgoritmosUTNTP2 | Ejercicio3/Ejercicio3.cpp | #include <cstdlib>
#include <iostream>
#include <conio.h>
using namespace std;
int length(string s)
{
int i = 0;
while(s[i] != '\0')
{
i++;
}
return i;
}
int indexOf(string s, char c)
{
for(int i = 0; i < length(s)+1; i++)
{
if(s[i] == c)
{
... | TOOL | 0.959298 | 3.671024 |
27b1b3f0-4bb7-4de0-80b1-c3c9de7abf79 | monikapatidar27/DSA_learning | codechef/CONN.cpp | #include<bits/stdc++.h>
using namespace std;
#define loop(i,l,n) for(int i=0;i<n;i++)
#define loop1(i,l,n) for(int i=1;i<=n;i++)
#define endl "\n"
typedef long long int ll;
#define sp " "
int main(){
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
int testcase=1;
cin>>testcase;
... | ALGO | 0.999933 | 4.507604 |
ce6644ba-c85d-4d7c-b197-931cec40e3ff | esther-araujo/CompetitiveProgramming | UVA/UVA11466.cpp | //Largest Prime Divisor
#include <bits/stdc++.h>
using namespace std;
// function to calculate all the prime factors and
// count of every prime factor
long long factorize(long long n)
{
int count = 0;
long long largest=0, x = n, c=0;
// count the number of times 2 divides
while (!(n % 2)) {
n >>= 1; /... | ALGO | 0.99998 | 4.371355 |
94a8b966-7912-4beb-bfe9-3b8e39a471f0 | qkrdmstn/codetree-TILs | 240131/방향에 맞춰 이동/move-in-direction.cpp | #include <iostream>
using namespace std;
int main() {
int n;
int nx = 0, ny = 0;
cin >> n;
for(int i=0; i<n; i++)
{
char dir;
int dist;
cin >> dir >> dist;
if(dir == 'W')
nx -= dist;
else if(dir == 'S')
ny -= dist;
else if(dir... | ALGO | 0.999766 | 3.519156 |
4dd691fb-71c2-40f8-b0cd-e35320a7621b | gyubeomim/lockdpwn | cpp/1books/brain_STL/book_codes/08/ex08-76.cpp | #include <iostream>
#include <vector>
#include <numeric>
using namespace std;
void main( )
{
vector<int> v;
v.push_back(10);
v.push_back(20);
v.push_back(30);
v.push_back(40);
v.push_back(50);
cout << "v: ";
for(vector<int>::size_type i = 0; i < v.size(); ++i)
cout << v[i] ... | ALGO | 0.987162 | 4.266122 |
b1f7eab1-f477-4b5f-8af0-852a9658eb1f | mvaloriani/InformaticaA | PreparazionePrimaProva/Ese1-TDE01022008.cpp | /*
Dato il tipo
typedef struct { int V[20]; int C; } STR;
Scrivere una funzione con un parametro formale X di
tipo STR e un parametro formale MATR
di tipo matrice 20x20 interi.
La funzione considera i primi C elementi contenuti
nel campo V di X e restituisce
la somma di quelli tra loro che sono multipli di
al... | ALGO | 0.999871 | 3.280376 |
2ea9a3af-06d2-4856-8f76-713aeffbbe9e | mooleetzi/ICPC | pat/ladder/l2004.cpp | #include<iostream>
using namespace std;
const int maxn =1e3+10;
inline int read(){
char ch;
int tmp=0;
int f=1;
ch=getchar();
if (ch=='-'){
f=-1;
ch=getchar();
}
while(ch>='0'&&ch<='9'){
tmp=tmp*10+ch-'0';
ch=getchar();
}
tmp*=f;
return tmp;
}
int ... | ALGO | 0.999552 | 3.227176 |
ced71c22-a864-42e9-a5e4-e8e31d659b9f | Manish-Kumar12345/Loops2 | countDigits.cpp | #include<iostream>
using namespace std;
int main(){
int n;
cout<<"Enter any number : ";
cin>>n;
int count = 0;
int a = n;
while( n > 0){
n = n/10;
count++;
}
if(a == 0) cout<<1;
else cout<<"Number of digits in "<<a<<" is "<<count;
} | ALGO | 0.999221 | 4.091568 |
78e2b19d-697b-4655-b645-e72d310fd9ab | Vivekqc123/CPP-PRACTICALS | Practical 7(1).cpp | #include <iostream>
using namespace std;
int gcd(int a,int b)
{
if(a == 0 || b == 0)
return 0;
if (a>b)
return gcd(a-b,b);
return gcd(a,b-a);
}
int main()
{
int a,b;
cout<<"Enter two numbers: ";
cin>>a>>b;
cout<<"GCD of "<<a<<" and "<<b<<" is: "<<gcd(a,b);
return 0;
}
| ALGO | 0.996202 | 5.08315 |
e9df7b08-3808-4598-a3b9-0ef7fcbc48ef | tayfundaldik/PythonProjects | Python/opencv/3rdparty/carotene/src/separable_filter.cpp | #include "common.hpp"
#include "separable_filter.hpp"
namespace CAROTENE_NS {
bool isSeparableFilter3x3Supported(const Size2D &size, BORDER_MODE border, s32 dx, s32 dy, Margin borderMargin)
{
return isSupportedConfiguration() &&
size.width >= 9 && size.height >= 1 &&
(size.height + borderMargin.t... | TOOL | 0.873411 | 6.659892 |
2111a5cd-fddc-4b69-a3a4-feda4f54396b | hprasad99/CodeChef | CHN15A.cpp | #include<iostream>
using namespace std;
int main(){
int T;
cin>>T;
while(T--){
int N,K,ans=0;
cin>>N>>K;
while(N--){
int a;
cin>>a;
if((a+K)%7==0){ans++;}
}
cout<<ans<<endl;
}
return 0;
} | ALGO | 0.999633 | 3.234214 |
88985858-b979-4989-8272-5b566b91fbad | jboyer4/leetcode-submissions | problems/valid_palindrome/solution.cpp | class Solution {
public:
bool isPalindrome(string s) {
int pos = 0;
int endpos = s.length()-1;
while(pos < endpos){
while(!isalnum(s[pos]) && pos < endpos){
++pos;
}
while(!isalnum(s[endpos]) && pos < endpos){
--endpos;
... | ALGO | 0.999194 | 6.275053 |
2655cd7e-7e98-4d82-a6f5-86fbfe7977f4 | urvashiparashar/Cpp_prep | Celebrityproblembystack.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:
//function to find if every one knows everyone or not
bool knows(vector<vector<int> >& M,int a,int b,int n)
{
... | ALGO | 0.999905 | 6.07266 |
9a6dfcf0-48bc-4bb1-a247-b883b337de01 | tongji-TTT/tongji-data-structure-homework-2020 | 02/项目02 .cpp |
#include <iostream>
using namespace std;
template<class T>
class date
{
public:
T number;
date* link;
};
template <class T>
class list
{
private:
date<T>* head;
date<T>* current;
int nowsetnumber = 0;
public:
list(int a);
list();
void output();
void relist();
template<class T>
friend bool change(list<T> ... | ALGO | 0.999898 | 3.644833 |
3d1c06bc-e9ba-4368-8a57-192a81469918 | HIROSN/CodingInterviews | src/tailtohead.cpp | // {"category": "List", "notes": "Print a list from tail to head"}
#include <SDKDDKVer.h>
#include <stdio.h>
#include <tchar.h>
#include <iostream>
#include <memory>
#include <stack>
using namespace std;
//------------------------------------------------------------------------------
//
// Please implement a functio... | ALGO | 0.994047 | 5.617537 |
d5343da5-2ec2-4ef2-ad16-a4b5b3892e6c | Akashkumar888/cpp_programming | stack-4/prefix_to_posrfix.cpp |
#include<iostream>
#include<stack>
using namespace std;
string solve(string n1,string n2,char ch){
string s="";
s+=n1;
s+=n2;
s.push_back(ch);
return s;
}
int main(){
stack<string>st;
string s="-/*+79483";
int n=s.size();
for(int i=n-1;i>=0;i--){
if(s[i]>=48 &&s[i]<=57) st.... | ALGO | 0.999982 | 4.570683 |
3c569253-dbfc-4697-ae37-76ec524fe818 | incluit/OpenVino-Driver-Behaviour | third-party/dlib/tools/python/src/rectangles.cpp | #include <dlib/python.h>
#include <dlib/geometry.h>
#include <pybind11/stl_bind.h>
#include "indexing.h"
#include "opaque_types.h"
#include <dlib/filtering.h>
using namespace dlib;
using namespace std;
namespace py = pybind11;
// ---------------------------------------------------------------------------------------... | TOOL | 0.956673 | 6.01633 |
676e5bf7-428f-4a20-9d90-1e2c98efd978 | singhbir/DS_Cpp | DS/Sorting/Merge Sort.cpp | #include<iostream>
using namespace std;
void merge(int arr[], int l, int m, int r)
{
int i, j, k;
int n1 = m - l + 1;
int n2 = r - m;
int L[n1], R[n2];
for (i = 0; i < n1; i++)
L[i] = arr[l + i];
for (j = 0; j < n2; j++)
R[j] = arr[m + 1+ j];
i = 0;
j = 0;
k = ... | ALGO | 0.999932 | 4.661592 |
efd3a591-b895-4600-9db5-595c1f6f69b3 | Sandern/aswscratch | src/game/server/ai_movesolver.cpp | #include "cbase.h"
#include "ai_movesolver.h"
#include "ndebugoverlay.h"
// memdbgon must be the last include file in a .cpp file!!!
#include "tier0/memdbgon.h"
//-----------------------------------------------------------------------------
inline float round( float f )
{
return (float)( (int)( f + 0.5 ) );
}
//-... | ALGO | 0.997459 | 7.366933 |
1ccb2061-7d38-4983-8b58-ca1fe8da26a1 | artfin/co2_ar_fixed_r | matrix_euler.cpp | #include "matrix_euler.hpp"
const double mu1 = 14579.0;
const double mu2 = 38183.0;
const double l = 4.398;
void inertia_tensor_dR( Eigen::Matrix3d & i_dr, const double R, const double Theta)
{
i_dr(0, 0) = i_dr(1, 1) = 2 * mu2 * R;
i_dr(1, 0) = i_dr(2, 0) = 0;
i_dr(0, 2) = i_dr(1, 2) = i_dr(2, ... | ALGO | 0.999873 | 4.637109 |
9585db89-09d1-4568-800b-f0f0af06e6dc | sun1599026/hxy | 最长不下降子序列(线性动规).cpp | #include<iostream>
using namespace std;
//定义一个变量:n:表示数据的个数
int n;
int main(){
//读入数据的个数
//之后设立两个数组:a数组:存n个数据,dp[i]数组:表示以a[i]这个数据为子序列的结尾能得到的最长的不下降子序列的长度
cin>>n;
int a[n],dp[n];
//读入n个数据存入a数组中,之后注意不要忘记进行初始化(因为对于每一个以a[i]数值结尾的不下降子序列的最大值中的最小值一定可以是1
//因为对于一个以a[i]这个数值结尾的子序列一定包含a[i]这个元素,因此以该元素结尾的最长的不下降子序列的最小值也有1
//而之所以要... | ALGO | 0.999697 | 4.220142 |
39f0aa5e-1f3a-4c3b-8866-bf654c006e31 | CyanogenMod/android_external_aac | libSBRdec/src/arm/env_calc_arm.cpp |
/* -----------------------------------------------------------------------------------------------------------
Software License for The Fraunhofer FDK AAC Codec Library for Android
Copyright 1995 - 2013 Fraunhofer-Gesellschaft zur Frderung der angewandten Forschung e.V.
All rights reserved.
1. INTRODUCTION
T... | ALGO | 0.998587 | 5.983925 |
a920b04a-5314-460c-94e5-b2b57e4afbcb | Max-Ratcliff/Classes | 25winter/cse101/pa5/Shuffle.cpp | /***
* Max Ratcliff
* mwratcli
* 2025 Winter CSE101 PA5
* Shuffle.cpp
* client function simulates shuffling a deck of cards,
* and counting how many shuffles are needed to bring a list back in order
***/
#include "List.h"
#include <iostream>
#include <string>
#include <stdexcept>
#include <iomanip>
using namespace ... | ALGO | 0.996258 | 5.255475 |
7fe59173-4448-4e87-a004-eb58d9b5ed04 | Haadi-Awan/Data_Structures | Linked List/List ADT.cpp | #include<iostream>
#include<stack>
using namespace std;
class node{
public:
int data;
node* next;
node()
{
int d=0;
next=NULL;
}
node(int d):data(d),next(NULL){}
};
class LList{
public:
node* head;
node* tail;
LList()
{
head=NULL;
tail=NULL;
}
void insert_at_head(int d)
... | ALGO | 0.99791 | 3.739357 |
dc4070a9-fc4f-4852-9376-654ed1060b4a | rclouse/phoenix-realm | src/track.cpp | #include "mud.h"
#include "fight.h"
#include "roomindex.h"
const int BFS_ERROR = -1;
const int BFS_ALREADY_THERE = -2;
const int BFS_NO_PATH = -3;
const int BFS_MARK = ROOM_TRACK;
#define TRACK_THROUGH_DOORS
void start_hunting( char_data *, char_data * );
void set_fighting( char_data *, char_data * );
bool mob_fire(... | ALGO | 0.997122 | 3.730259 |
c20b02d8-15b2-4a8f-97bf-a5cd973024fe | enjoyfrozen/opencv | samples/cpp/tutorial_code/core/how_to_use_OpenCV_parallel_for_/how_to_use_OpenCV_parallel_for_new.cpp | #include <iostream>
#include <opencv2/core.hpp>
#include <opencv2/imgcodecs.hpp>
#include <opencv2/imgproc.hpp>
#include <opencv2/highgui.hpp>
#define PARALLEL_FOR_LAMBDA
using namespace std;
using namespace cv;
namespace
{
//! [convolution-sequential]
void conv_seq(Mat src, Mat &dst, Mat kernel)
{
//![convoluti... | ALGO | 0.998551 | 7.002152 |
dc01f44f-7fee-4cf7-8341-20215af2336d | rishabh27goel/Daily-Coding-Practice | DSA_Sheet/Backtracking/Word_Break_Problem.cpp | #include <iostream>
#include <vector>
#include <unordered_map>
using namespace std;
// Method : Backtracking
// Time Complexity : O(2^n) Space Complexity : O(n^2)
unordered_map <string, bool> words;
void wordBreakHelper(string &input, int index, string word, string sent, vector<string> &output){
if(index > inp... | ALGO | 0.999788 | 5.621943 |
b16029a8-cb5c-4b9a-a6ec-80c64b97c6ae | iamkaniska/DSA | pattern/second.cpp | /*
12345
12345
12345
12345
12345
*/
#include<iostream>
using namespace std;
int main(){
int n,m;
cout<< "Enter Number: ";
cin>>n;
for (int i = 1; i <=n; i++)
{
for (int j = 1; j <= n; j++)
{
cout<<j;
}
cout<<endl;
}
}
| ALGO | 0.997967 | 3.42 |
9a9163bf-6df4-45df-b2e6-4ce505babcf1 | TranAnhQuoc23521313/We-Code | Problem4/Problem408.cpp | #include <iostream>
using namespace std;
int reverse(int n)
{
int daonguoc = 0;
int temp = n;
while (temp!=0)
{
daonguoc = daonguoc*10+temp%10;
temp /= 10;
}
return daonguoc;
}
int main() {
int n;
cin >> n;
cout << reverse(n);
}
| ALGO | 0.99985 | 5.08244 |
34e35e1f-35fd-47b5-beb2-6addf3e8c27f | lazy-chess-player/codestudy_cpp | study_230816_3/源.cpp | #include <iostream>
#include <vector>
using namespace std;
typedef long long ll;
int main()
{
int t; cin >> t;
while (t--)
{
ll n, k;
cin >> n >> k;
ll temp = (ll)pow(2, k);
if (n % temp == 0)
cout << n / temp << endl;
else
cout << n / temp + 1 << endl;;
}
return 0;
} | ALGO | 0.999678 | 4.283342 |
f747cab6-2e63-4322-931f-482be488d8a4 | imovishek/coding-practice | UVa_Online_Judge_Problem_Solutions/10180 - Rope Crisis in Ropeland!.cpp | #include<bits/stdc++.h>
using namespace std;
#define EPS 1e-9
#define pi acos(-1.0)
int cmp(double x)
{
if(fabs(x) < EPS) return 0;
return x < 0 ? -1 : 1;
}
struct PT{
double x, y;
PT(){x = y = 0; }
PT(double _x, double _y) {x = _x, y = _y; }
PT operator-(const PT &a) const{
return PT(x ... | ALGO | 0.99973 | 3.898952 |
98ae8379-bb07-4776-96c4-6af82e817c94 | eggag32/Competitive-Programming | Baekjoon/11722.cpp | #pragma GCC optimize ("O3")
#pragma GCC target ("sse4")
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef vector<int> vi;
typedef pair<int, int> pi;
#define debug(x) cerr << #x << ": " << x << endl;
#define debug2(x, y) debug(x) debug(y);
#define repn(i, a, b) for(int i... | ALGO | 0.999932 | 4.229971 |
18ce5a32-fc0e-4112-9cd9-7ece7efbaefc | xide-projext/simple_ui_app2_maiti | 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 |
7fdede2f-9d91-4402-8ecf-44954fbf728f | tachyon83/code-rhino | DAY300~399/DAY361-LEET215-Kth LargestElementInAnArray/joohyuk.cpp | class Solution {
public:
int findKthLargest(vector<int>& nums, int k) {
sort(nums.begin(),nums.end());
return nums[(int)nums.size()-k];
}
};
| ALGO | 0.999885 | 5.000204 |
b45e9dc5-60c3-4962-9504-a0b5c1714d0a | niharika987/dev | merge and inversion.cpp | #include<iostream>
using namespace std;
int mergesort(int a[],int l,int m,int r)
{ int inv=0;
int n=m-l+1;
int n2=r-m;
int t1[n],t2[n2];
for(int i=l;i<m;i++)
t1[i]=a[l+i];
for(int i=m;i<r;i++)
t2[i]=a[m+1+i];
int i=0;
int j=0;
int k=l;
while(i<n && j<n2)
{
if(t1[i]<=t2[j])
{
a[k]=t1[i];
i++;}
... | ALGO | 0.999896 | 3.9182 |
1b2e092b-a402-4202-84ec-dd4c4f118200 | DungNguyenCoder/LeetCode | Array_String/12.IntegertoRoman.cpp | #include <bits/stdc++.h>
using namespace std;
// https://leetcode.com/problems/integer-to-roman/description/?envType=problem-list-v2&envId=string
void convert(string &ans, int digit, char small, char medium, char large) {
if(digit == 5-1) {
ans += small;
ans += medium;
}
else if(digit ==... | ALGO | 0.999541 | 5.950879 |
8239ea10-b3c2-4219-b656-b5c38a0a66fd | Neel-07/DSA | Max Area of Island.cpp | #include <vector>
using namespace std;
class Solution {
public:
int maxAreaOfIsland(vector<vector<int>>& grid) {
int maxArea = 0;
int rows = grid.size(), cols = grid[0].size();
for (int i = 0; i < rows; ++i) {
for (int j = 0; j < cols; ++j) {
if (grid[i]... | ALGO | 0.999932 | 6.936262 |
21d440c7-3b37-40f9-a13b-87b82c824629 | ghanisol/lums | cs200_intro_to_programming/assignments/assignment0/task4.cpp | #include <iostream>
using namespace std;
int main()
{
/*Initialization*/
char type = 0, initial_1 = 0, final_1 = 0;
int initial_2 = 0, final_2 = 0;
cout << "Welcome to Chess Mania!!!!\n\n";
//Taking input from the user
cout << "Enter the type of your piece\n"
<< "Enter P for Pawn, K for King, Q for Queen,... | ALGO | 0.964942 | 3.819793 |
a3620ff9-0006-4130-b01e-6f8014f825c5 | JolenLi/leetcode_train | 数组/633. Sum of Square Numbers.cpp | //
// Created by Jolen on 2022/3/31.
//
//
// Created by Jolen on 2022/3/11.
//
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <stack>
#include <queue>
#include <unordered_map>
#include <unordered_set>
using namespace std;
bool judgeSquareSum(int c) {
int lo = 0, hi = sqrt... | ALGO | 0.999911 | 3.618859 |
1fc79c22-15d1-4b6e-a267-31df696a511f | taniaban2712/dsaRepo | Codechef problems/1000* to 2000*/prg1.cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
int q{0};
cin>>q;
while(q--){
string s="", srev="";
cin>>s;
for(int i=s.length()-1;i>=0;i--){
srev+=s[i];
}
int flag{1};
for(int i=0;i<s.length()-1;i++){
int diff=int(s[i+1])-int(... | ALGO | 0.99902 | 4.782799 |
b0cd4fad-ce8d-498c-8909-d9c1c4d65327 | Hamsik2rang/SA24-Algorithm-Study | Problems/Week_6/5.10_손익분기점(1712)/서봉성/1712.cpp | #include<iostream>
using namespace std;
int main()
{
long a, b, c;
cin >> a >> b >> c;
if (b >= c)
{
cout << -1;
return 0;
}
else
cout << a / (c - b) + 1;
return 0;
} | ALGO | 0.999749 | 3.53512 |
d876e063-0591-4faf-9169-11a1876b7ba2 | abdelaleem024/competitive-programming | Solutions/Battle of The Brains/Contest #1/L - Make it Palindrome .cpp | #include <bits/stdc++.h>
using namespace std;
#define int long long
int32_t main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
int n;
cin >> n;
int res = 0;
map<int, vector<int>> mp;
vector<int> calc(n + 1);
for (int i = 1; i <= n; ++i) {
calc[i] = i / 2;
}
partial_sum(calc.begin(), calc.... | ALGO | 0.999801 | 3.766305 |
0580d967-11f8-4dbf-ace4-741dc3ff9f33 | leafaber/bioinf | src/LDCF.cpp | /***************************************************************************************************
* A file containing LDCF implementation *
***************************************************************************************************/
#include "LDCF.... | ALGO | 0.985826 | 4.536018 |
34539f83-d6e1-41f2-ac32-95da16d424ba | AlbertoEstirado/c-Engine_All_Versions-Unstable- | C++ Engine/v3.0/alberto-estirado-engine-c++/libraries/windows/bullet-3.17/src/BulletCollision/CollisionDispatch/btBox2dBox2dCollisionAlgorithm.cpp | ///btBox2dBox2dCollisionAlgorithm, with modified b2CollidePolygons routines from the Box2D library.
///The modifications include: switching from b2Vec to btVector3, redefinition of b2Dot, b2Cross
#include "btBox2dBox2dCollisionAlgorithm.h"
#include "BulletCollision/CollisionDispatch/btCollisionDispatcher.h"
#include "... | ALGO | 0.999561 | 6.993068 |
566a0d17-ce33-48bb-b748-417f38930c5a | hiter-joe/pflotran | src/pflotran/.deprecated/mdt/MidIFC.cpp | #include "MidIFC.h"
#ifndef MAX
#define MAX(X,Y) ((X) > (Y) ? (X) : (Y))
#endif
#ifndef MIN
#define MIN(X,Y) ((X) < (Y) ? (X) : (Y))
#endif
MidIFC::MidIFC(Grid **grid_) {
boundary_polygon = NULL;
ifc_polygon = NULL;
ascii_grids = NULL;
PetscReal mx = 1.;
PetscReal my = 1.;
PetscReal mz = 1.;
PetscInt... | ALGO | 0.9185 | 6.775867 |
5ce12feb-b7c6-40c2-abc7-eb9398427590 | johnnyoh555/Baekjoon | 24.02/2447_별 찍기 - 10.cpp | // https://www.acmicpc.net/problem/2447
#include <iostream>
using namespace std;
bool s[2188][2188];
void recursion(short x, short y, short N) {
short tmp = N / 3;
short tmp2 = tmp * 2;
for (short i = y + tmp; i < y + tmp2; i++) {
for (short j = x + tmp; j < x + tmp2; j++) {
s[i][j] = 1;
}
}
if (N == 3)... | ALGO | 0.999974 | 3.696039 |
ad718098-d268-4f2b-b83c-b14816567cca | varshneyanushka/codeforces | searching.cpp | #include<bits/stdc++.h>
#include <iostream>
#define ll long long
#define speed ios_base::sync_with_stdio(0),cin.tie(0), cout.tie(0);
// #define ff(i,x,y) for(ll i=x;i<y;i++)
//#define fb(i,x,y) for(ll i=x;i=+y;i--)
using namespace std;
int main()
{
ll n;
cin>>n;
... | ALGO | 0.999928 | 5.179681 |
ad0b0a99-07c4-4104-9475-cc25fe48a97e | Hifzu04/DynamicProgramming | class4/frogJumpWithKdist.cpp | #include <bits/stdc++.h>
using namespace std;
// recursion
/*
int frogMemo(int n, int k, int arr[])
{
if (n == 0)
return 0;
int minmJmp = INT_MAX;
for (int i = 1; i <= k && i <= n; i++)
{
int jump = frogMemo(n - i, k, arr) + abs(arr[n] - arr[n - i]);
minmJmp = min(minmJmp, jump... | ALGO | 0.999979 | 4.926157 |
06d11551-1fb0-483c-bd41-e084c8de76c9 | keijak/comp-pub | atcoder/abc234/B/main_B.cpp | #include <bits/stdc++.h>
#define REP_(i, a_, b_, a, b, ...) for (int i = (a), END_##i = (b); i < END_##i; ++i)
#define REP(i, ...) REP_(i, __VA_ARGS__, __VA_ARGS__, 0, __VA_ARGS__)
#define ALL(x) std::begin(x), std::end(x)
using Int = long long;
using Uint = unsigned long long;
using Real = long double;
template<typen... | ALGO | 0.999702 | 4.385101 |
0e60e45a-8f40-4952-8585-df54d693ddf4 | facebookarchive/BOLT | llvm/lib/Transforms/Utils/FlattenCFG.cpp | #include "llvm/ADT/SmallPtrSet.h"
#include "llvm/Analysis/AliasAnalysis.h"
#include "llvm/Transforms/Utils/Local.h"
#include "llvm/Analysis/ValueTracking.h"
#include "llvm/IR/BasicBlock.h"
#include "llvm/IR/IRBuilder.h"
#include "llvm/IR/InstrTypes.h"
#include "llvm/IR/Instruction.h"
#include "llvm/IR/Instructions.h"
#... | ALGO | 0.997784 | 7.550511 |
e533b6f4-af45-480e-82c3-4048ae65a46c | chenshuting/Algorithm | split_2NAarray.cpp | /*
* =====================================================================================
*
* Filename: split_2NAarray.cpp
*
* Description: To split a 2N array into two N array which the sum of each array is
* the most closely to SUM/2
*
* Version: 1.0
* Created: 08/14/2013 02:1... | ALGO | 0.999989 | 4.895714 |
beaae3c8-87e8-4a42-8b55-5183720e5180 | Rohan3011/DSA | Random Problems/B_Fence.cpp | #include "iostream"
using namespace std ;
int main() {
ios::sync_with_stdio(0) ; cin.tie(0);
int n , k ;
cin >> n >> k ;
int arr[n] ;
for (auto &i : arr) cin >> i ;
int window = 0 ;
for (int i = 0 ; i < k ; i++)
window += arr[i] ;
int ans = window , idx = 0 ;
for (int i = 0 ; i + k < n ; i++) {
window = w... | ALGO | 0.999982 | 4.612523 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.