uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
f48f8a86-9619-4aa8-b7d9-e42f8d1c4f85 | jvujcic/cp | cpp/hackerrank/booking-com-back-end-code-sprint/reviews.cpp | #include <iostream>
#include <algorithm>
#include <vector>
#include <map>
#include <string>
using namespace std;
using ll = long long;
const ll june_15 = 1465948800LL;
const ll july_15 = 1468540800LL;
int main() {
freopen("input.txt", "r", stdin);
int n, m;
cin >> n >> m;
vector<string> passions(n)... | ALGO | 0.999244 | 4.560915 |
75c83afe-cd72-402e-9736-dcc80159cbfb | murillocas/flutter_testes | api_demo/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.998243 | 6.76073 |
ec9a1874-5f85-4dc0-be2d-831b078c543d | WhiteCells/code | algo/daily/23/11/10.cpp | #include "../../head_file.h"
/*
problme:
url:
*/
// time complexity: O()
// spatial complexity: O()
class Solution {
public:
vector<int> successfulPairs(vector<int>& spells, vector<int>& potions, long long success) {
vector<int> pairs;
sort(potions.begin(), potions.end());
for (const a... | ALGO | 0.999318 | 5.341341 |
304d24c4-3c19-4c8c-baaa-086082cc2268 | hansitha2001/Hansitha | addingtwonumber.cpp | #include <iostream>
using namespace std;
int main()
{
int x,y;
char op;
cout<<"enter two number:"<<"\n";
cin>>x>>y;
cout<<"enter the one operator:"<<"\n";
cin>>op;
if(op=='+'){
cout<<"Adding two numbers"<<x+y<<"\n";
}
else if(op=='-'){
cout<<"subtraction two numbers"... | ALGO | 0.947585 | 3.32809 |
8cbc5119-4ae4-4c8b-92b6-d9f1c4714650 | muskankumari11/Dsa-Assignment | Assignment 9.cpp/Insertion of two linkedlist.cpp | class Solution {
public:
ListNode *getIntersectionNode(ListNode *headA, ListNode *headB) {
// ListNode *getIntersectionNode(ListNode *headA, ListNode *headB) {
ListNode *ptr1 = headA;
ListNode *ptr2 = headB;
while(ptr1!=ptr2){
if(ptr1==NULL){
ptr1=headB;
}
else{
ptr1=ptr1->next;
... | ALGO | 0.999811 | 5.283175 |
3c7609d0-f37a-4ac7-82bc-555832271383 | helenjw/CSC317 | lab5/libigl/tutorial/406_FastAutomaticSkinningTransformations/main.cpp | #include <igl/colon.h>
#include <igl/directed_edge_orientations.h>
#include <igl/directed_edge_parents.h>
#include <igl/forward_kinematics.h>
#include <igl/PI.h>
#include <igl/partition.h>
#include <igl/mat_max.h>
#include <igl/lbs_matrix.h>
#include <igl/slice.h>
#include <igl/deform_skeleton.h>
#include <igl/dqs.h>
#... | ALGO | 0.996548 | 5.22098 |
caad66d4-faf3-42c0-8482-8daa4f73d2a3 | AkashSingh3031/LeetCode__GeeksforGeeks-Solution | 307-range-sum-query-mutable/307-range-sum-query-mutable.cpp | class BIT { // One-based indexing
vector<int> bit;
public:
BIT(int size=0) {
bit.assign(size + 1, 0);
}
int getSum(int idx) { // Get sum in range [1..idx]
int sum = 0;
for (; idx > 0; idx -= idx & (-idx))
sum += bit[idx];
return sum;
}
void addValue(in... | ALGO | 0.99998 | 6.458075 |
1154b24b-a103-4da6-b02f-5fe154a223e2 | brenimcode/desafio-estagio | 4.cpp | #include <iostream>
#include <iomanip>
using namespace std;
int main() {
// Valores em reais
double sp = 67836.43;
double rj = 36678.66;
double mg = 29229.88;
double es = 27165.48;
double outros = 19849.53;
// Calcula o total
double total = sp + rj + mg + es + outros;
// Calcula ... | TOOL | 0.964752 | 4.167992 |
a68bdcea-ea21-48f3-bc20-5ba2ddc1d113 | DongWooE/CodingTest | PG/[PG]자릿수더하기.cpp | #include <iostream>
#include<string>
using namespace std;
int solution(int n)
{
string temp = to_string(n);
int answer = 0;
for(auto i : temp){
answer += i-'0';
}
return answer;
} | ALGO | 0.999541 | 4.712163 |
13b7dab9-a91a-408a-b1c9-e088b14a6e91 | K0nnyaku/Code | Data/CSP-JS2021二轮提高组数据/SD-00598/airport/airport.cpp | #include<cstdio>
#include<iostream>
#include<algorithm>
#include<string>
#include<cstring>
#include<queue>
#include<stack>
#include<vector>
#define max(a, b) (((a) > (b)) ? (a) : (b))
using namespace std;
struct pl {
int k, a, b;
};
pl a[10002];
int p[2][10002];
int n, m1, m2, m;
bool cmp(pl x, pl y) {
return x.... | ALGO | 0.999824 | 3.639657 |
5b0087a6-7063-410e-bd8b-576953cd54eb | MinJuTur/cpp | Day3/Practice3.cpp | #include <iostream>
using namespace std;
int main() {
int t;
cin >> t;
for (int i = 0; i < t; i++) {
unsigned int n;
cin >> n;
unsigned int result = 1;
while (true) {
if (n % 10 != 0) {
result *= n % 10;
}
n /= 10;
if (n == 0) { //각 자리수 곱하기가 끝났을 때
if (... | ALGO | 0.999935 | 5.595773 |
c986b7fc-ebe2-426f-ad89-c7880c298aa1 | yashbhanu/Data-Structure-and-Algorithms | Problem Solving/Backtracking/sudoku_solver_3.cpp | #include <iostream>
#include <bits/stdc++.h>
using namespace std;
//Problem => You are given a sudoku to solve (i.e 9*9 matrix) // in a soduko , there are a lot on empty spaces , you need to fill it (ie solve it)
// I/P 3 0 6 5 0 8 4 0 0
// 5 2 0 0 0 0 0 0 0
// 0 8 7 0 0 0 0 3 1
// 0 0 3 0 1 0 0 8 0
/... | ALGO | 0.999463 | 5.8113 |
e647ad61-c01f-4dc4-bbe2-5886c4a52420 | Saifur-Rahman03/Codes | Codes/1-2/CSE 1204/1703018/Lab 6 (7B)/Herbert Schildt/virtual base class.cpp | #include <iostream>
using namespace std;
class base{
public:
int i;
};
class derived1 : virtual public base{
public:
int j;
};
class derived2 : virtual public base{
public:
int k;
};
class derived3 : public derived1, public derived2{
public:
int product(){return i * j * k;}
};
int main( )
{
der... | TOOL | 0.985602 | 4.553648 |
d66a9e1d-a4d6-4d9b-aab5-c511c26d738a | Fiza-Kalam/try_new | All p in one/sum_Of_NaturalNO.cpp | #include<iostream>
using namespace std;
int main()
{
int start_number=1;
int sum=0;
int n;
cout<<"Enter the number at limit :";
cin>>n;
for(int i=0;i<=n; i++)
{
sum +=i;
}
cout<<"The sum of natural number from 1 to n :"<<sum;
return 0;
} | ALGO | 0.995124 | 3.416555 |
2440fb3d-9243-4c2c-affb-d5d44b82dde1 | forzenheart/ACM | ACM_10/d.cpp | //仔细理会如何通过 2进制度优化的,这里不懂
#include <iostream>
#include <cstring>
using namespace std;
int n, c;
int v[1001];
int m[1001];
int f[100001];
int main()
{
while(cin>>c>>n)
{
for(int i = 1; i <= n; i++)
cin>>m[i]>>v[i];
memset(f, 0, sizeof(f));
for(int i = 1; i <= n; i++)
{
if(m[i] * v[i] > c)//当可拿物品的件数乘上它的... | ALGO | 0.999965 | 3.499419 |
45e18fbb-ed6e-4205-97c0-d6e923fc8c7b | geometryprocessing/penner-optimization | src/holonomy/core/homology_basis.cpp | #include "holonomy/core/homology_basis.h"
#include "util/vector.h"
#include "holonomy/core/dual_lengths.h"
#include <random>
#include "util/embedding.h"
namespace Penner {
namespace Holonomy {
// Construct a clockwise sequence of dual segments around a vertex in the mesh
std::vector<DualSegment> build_clockwise_ver... | ALGO | 0.997366 | 6.867994 |
66170506-0025-49b4-809d-ce0e966014c4 | 539077har/CSA0488-Operating-system- | Q18.cpp | #include<stdio.h>
#include<stdlib.h>
int mutex=1,full=0,empty=3,x=0;
int main()
{
int n;
void producer();
void consumer();
int wait(int);
int signal(int);
printf("\n1.Producer\n2.Consumer\n3.Exit");
while(1)
{
printf("\nEnter your choice:");
scanf("%d",&n);
switc... | ALGO | 0.995582 | 4.194493 |
47cb4933-61b8-4242-9d25-db10fc1406f8 | ThunderMJ2003/DSA | DSA_Striver/A2Z/A2Z_6_1_2_2.cpp | #include <bits/stdc++.h>
using namespace std;
// class Node{
// public:
// int data;
// Node* next;
// public:
// Node (int data1, Node* next1){
// data = data1;
// next = next1;
// }
// public:
// Node (int data1){
// data = data1;
// next = nullptr;
/... | ALGO | 0.999341 | 5.112798 |
2d0e7145-05a6-4240-afc5-5c1f305bce2c | haishand/work | CP/atcoder/medium100/23C.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int MOD = 1e9+7;
const int M = 5;
int n, m;
vector<int> ans(M, -1);
vector<int> digit(M, -1);
void dfs(int k) {
if(k > m) {
if(ans[0] != -1) {
for(int i=0; i<m; i++) {
cout << ans[i];
}
}else {
cout << -1 << endl;
}
exit(... | ALGO | 0.999969 | 4.062297 |
5c4ed249-d291-4ce3-812b-0f5d0427f880 | GomHyeok/Algorithm_Study | 프로그래머스/미로탈출명령어.cpp | #include <string>
#include <vector>
#include <iostream>
using namespace std;
string answer;
bool finish;
vector<int> value;
int dx[4] = {1, 0, 0, -1};
int dy[4] = {0, -1, 1, 0};
string ds[4] = {"d", "l", "r", "u"};
void dfs(int depth, string st, int x, int y);
string solution(int n, int m, int x, int y, int r, int ... | ALGO | 0.999782 | 4.197283 |
2e6914eb-6655-4ce0-a470-c0db19d15606 | Kiran-Chaitu/LeetCode | 378-kth-smallest-element-in-a-sorted-matrix/kth-smallest-element-in-a-sorted-matrix.cpp | class Solution {
public:
int kthSmallest(vector<vector<int>>& matrix, int k) {
ios_base::sync_with_stdio(0);
priority_queue<int> pq;
int n=matrix.size(),i=1;;
for(int i=0;i<n;i++){
for(int j=0;j<n;j++){
pq.push(-(matrix[i][j]));
}
}
... | ALGO | 0.999997 | 5.189156 |
7a139986-65a0-49b3-b83a-0754c5fecd71 | Harashporiya/Strivers_Sheet_A2Z | Strivers_A_to_Z_DSA_COURSE/oops/operatorOverloading/DistanceCalculator.cpp | #include<iostream>
#include<cstdio>
#include<cmath>
using namespace std;
class Distance
{
private:
double feet, inch;
public:
void readDistance(){
cin>>feet>>inch;
}
Distance operator +(Distance D3){
Distance res;
res.feet = feet + D3.feet;
res.inch = inch + D3.inch;
if(res.inch >=12){
... | ALGO | 0.996826 | 3.250573 |
16bafba3-ed9b-4832-bf91-e0c8eeba59ed | ivanj26/Algorithm-DataStructures-DesignPattern | Algorithm/LeetCode Practices/reverseInKGroup.cpp | #include <vector>
#include <iostream>
using namespace std;
template <class T>
struct ListNode {
int val;
ListNode<T> *next;
ListNode(int v): val(v) {}
};
int length(ListNode<int> *l) {
if (!l) {
return 0;
}
return 1 + length(l->next);
}
ListNode<int>* reverseInKGroup(ListNode<int> *l, int k)
{
if (!l) {
... | ALGO | 0.999908 | 4.821229 |
3b498a01-2302-47ad-b192-d11b1758461f | sarvex/leetcode-malbolge | solution/0600-0699/0654.Maximum Binary Tree/Solution.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.999997 | 6.931108 |
8da67d2e-9238-4e1f-bd9b-30c0b1fd52c7 | dongdongdong111/acm-template | Others/SOS.cpp | #include<bits/stdc++.h>
#define MAXN 100005
#define INF 1000000000
#define MOD 1000000007
#define F first
#define S second
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
int n,a[MAXN],f[MAXN];
int main()
{
scanf("%d",&n);
for(int i=0;i<(1<<n);i++)
scanf("%d",&a[i]);
for(int i=0;i<(1<<n);i++)
... | ALGO | 0.999783 | 3.257181 |
8e537f9c-b4f5-4c1e-9f0a-9af149e3b01e | anci123/sophomore01 | 資料結構/40947019S_HW10/hw10_function.cpp | #include"hw10_function.h"
char stack_1[100];
node stack_2[100];
int index_1 = 0;
int index_2 = 0;
void print_choise() {
cout << "-------------------------------------------------------\n";
cout << "(1) 輸入一串 infix 運算式,並輸出其 postfix 運算式\n";
cout << "(2) 輸出對應 prefix 運算式\n";
cout << "(3) 輸出對應二元運算樹之 level ord... | ALGO | 0.999028 | 3.185609 |
353fbc7c-fb44-45ec-ab00-7500f682effd | arthurvtrr/AA-Problems-Solved | UVa/11456 - Trainsorting.cpp | #include <stdio.h>
#include <algorithm>
#include <vector>
using namespace std;
int t, n, nums[2200], used[2200];
vector < int > aux;
int find_pos(int x, bool inverted) {
int ini = 0, fim = aux.size();
while (ini < fim) {
int meio = (ini + fim) / 2;
if (aux[meio] == x) return meio;
el... | ALGO | 0.999913 | 4.134417 |
edc120dd-48a8-4e5c-869d-9925c36d2234 | RikihisaRyota/GE3 | Externals/DirectXTex/DirectXTexNormalMaps.cpp | #include "DirectXTexP.h"
using namespace DirectX;
using namespace DirectX::Internal;
namespace
{
#pragma prefast(suppress : 25000, "FXMVECTOR is 16 bytes")
inline float EvaluateColor(_In_ FXMVECTOR val, _In_ CNMAP_FLAGS flags) noexcept
{
XMFLOAT4A f;
static XMVECTORF32 lScale = { { { 0.2125f... | ALGO | 0.991711 | 7.582268 |
dcb61e53-6251-41db-8a0c-0f5736c8fbee | readable-ko/ProblemSolving | 프로그래머스/lv1/42840. 모의고사/모의고사.cpp | #include <bits/stdc++.h>
using namespace std;
vector<int> solution(vector<int> answers) {
vector<int> answer ;
int chck[3] = {0,};
int p1[] = {1,2,3,4,5};
int p2[] = {2,1,2,3,2,4,2,5};
int p3[] = {3,3,1,1,2,2,4,4,5,5};
for(int i = 0 ; i < answers.size() ; i++)
{
if(p1[i%5] == a... | ALGO | 0.999967 | 5.186213 |
d143d629-7add-454a-b7ac-6d6426dccfc4 | Saty248/dsa-sheet | algorithms2_leetcode/rbsmin.cpp | #include <bits/stdc++.h>
#define fastio \
ios_base::sync_with_stdio(false); \
cin.tie(NULL)
#define endl "\n"
using namespace std;
int main()
{
fastio;
vector<int> nums={3,1,2};
int n=nums.size();
int l,e,k;
l=0;
e=n-1;
while(l<=e){... | ALGO | 0.999992 | 4.378762 |
cb151070-b8b9-44c5-91d4-e1681318db7d | User-zwj/cplusplus | test/basicoperation.cpp | #include <stdio.h>
int add(int x, int y){
return x+y;
}
int mi(int x, int y){
return x-y;
}
| TOOL | 0.903581 | 4.395321 |
871eca48-7a98-4f24-92a9-9bdf627a9987 | nxp-imx/opencv-imx | samples/cpp/fitellipse.cpp | /********************************************************************************
*
*
* This program is demonstration for ellipse fitting. Program finds
* contours and approximate it by ellipses using three methods.
* 1: OpenCV's original method fitEllipse which implements Fitzgibbon 1995 method.
* 2: The App... | ALGO | 0.998181 | 6.140951 |
3094ae70-4832-4cd9-9931-1c78ea19123f | nzjrs/opencv_old_libdc1394 | cv/src/cvcanny.cpp | #include "_cv.h"
icvCannyGetSize_t icvCannyGetSize_p = 0;
icvCanny_16s8u_C1R_t icvCanny_16s8u_C1R_p = 0;
CV_IMPL void
cvCanny( const void* srcarr, void* dstarr,
double low_thresh, double high_thresh, int aperture_size )
{
CvMat *dx = 0, *dy = 0;
void *buffer = 0;
uchar **stack_top, **stack_bottom... | TOOL | 0.973754 | 6.172721 |
3d69c4c3-0868-4fad-80df-cc46f0d60bf1 | junke365/ros2-deb-boost | boost_1_73_0/libs/graph/test/transitive_closure_test.cpp | #include <iostream>
#include <cstdlib>
#include <ctime>
#include <boost/graph/vector_as_graph.hpp>
#include <boost/graph/adjacency_list.hpp>
#include <boost/graph/adjacency_list_io.hpp>
#include <boost/graph/graph_utility.hpp>
#include <boost/graph/transitive_closure.hpp>
#include <boost/timer/timer.hpp>
using namesp... | ALGO | 0.987784 | 6.858603 |
59446a5d-5b32-4fd1-9963-906f5534fa42 | tic40/atcoder | abc/abc395/a/main.cpp | #include <bits/stdc++.h>
using namespace std;
#define REP(i,n) for(int i=0;i<n;i++)
#define endl '\n'
int main() {
int n; cin >> n;
vector<int> a(n);
REP(i,n) cin >> a[i];
REP(i,n-1) if (a[i] >= a[i+1]) { cout << "No" << endl; return 0; }
cout << "Yes" << endl;
return 0;
}
| ALGO | 0.999975 | 3.733086 |
6ddc4e6d-f7f0-4da7-af7d-11e8568f155f | LChen-99/drone | src/realflight_modules/VINS-Fusion/vins_estimator/src/initial/initial_aligment.cpp | #include "initial_alignment.h"
void solveGyroscopeBias(map<double, ImageFrame> &all_image_frame, Vector3d* Bgs)
{
Matrix3d A;
Vector3d b;
Vector3d delta_bg;
A.setZero();
b.setZero();
map<double, ImageFrame>::iterator frame_i;
map<double, ImageFrame>::iterator frame_j;
for (frame_i = all... | ALGO | 0.942946 | 3.176352 |
626a5f54-ff57-4df0-b85f-98b565238784 | frozenca/CLRS3 | 25/25.3_johnson's_algorithm_for_sparse_graphs.cpp | #include <array>
#include <algorithm>
#include <cassert>
#include <chrono>
#include <cstddef>
#include <concepts>
#include <functional>
#include <iostream>
#include <iterator>
#include <limits>
#include <list>
#include <memory>
#include <queue>
#include <random>
#include <ranges>
#include <tuple>
#include <type_traits>... | ALGO | 0.997702 | 3.183464 |
329bf265-416a-4da8-bad9-95fc946c171f | nayeem003/CrackYourPlacement | 122_ Invert Binary Tree.cpp | class Solution {
public:
TreeNode* invertTree(TreeNode* root) {
if (root == nullptr) {
return nullptr;
}
TreeNode* temp = root->left;
root->left = root->right;
root->right = temp;
invertTree(root->left);
invertTree(root->right);
... | ALGO | 0.999976 | 6.679804 |
1a95f7f7-4d3f-4b41-9e03-ceee7d39724e | XJTU-IMISS-test1/DP-DICE-test | Sketches/gene_sketch.cpp | #include<iostream>
#include<fstream>
#include<iterator>
#include<string>
#include<vector>
#include<fstream>
#include<iomanip>
#include<math.h>
#include<cstdlib>
#include<thread>
#include<mutex>
#include<time.h>
#include<chrono>
#include"MurmurHash3.h"
using namespace std;
using namespace chrono;
// output file naming... | DATA | 0.973886 | 3.346292 |
66b11fd7-66c4-483e-b90c-aa882019894f | AdityaDhangar/Problem-Solving | 0113-path-sum-ii/0113-path-sum-ii.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.99997 | 5.942167 |
c178ceaf-63ce-4e10-8938-0bb87d53b961 | zz44xmd/gem5_ece511 | ext/systemc/src/sysc/utils/sc_pq.cpp | /*****************************************************************************
sc_pq.cpp - Simple heap implementation of priority queue.
Original Author: Stan Y. Liao, Synopsys, Inc.
CHANGE LOG AT END OF FILE
*****************************************************************************/
// $Log: sc_pq.cpp,v ... | ALGO | 0.999159 | 6.188192 |
0b1ad1a0-cf6f-4441-b02d-e14c57946069 | ishandutta2007/codeforces | duality/normal/1477/B.cpp | #define DEBUG 0
#include <bits/stdc++.h>
using namespace std;
#if DEBUG
// basic debugging macros
int __i__,__j__;
#define printLine(l) for(__i__=0;__i__<l;__i__++){cout<<"-";}cout<<endl
#define printLine2(l,c) for(__i__=0;__i__<l;__i__++){cout<<c;}cout<<endl
#define printVar(n) cout<<#n<<": "<<n<<endl
#define printA... | ALGO | 0.99994 | 3.51885 |
54a5683b-1c0c-409e-bbe1-627939096c5c | sarvex/leetcode-skip | solution/2000-2099/2087.Minimum Cost Homecoming of a Robot in a Grid/Solution.cpp | class Solution {
public:
int minCost(vector<int>& startPos, vector<int>& homePos, vector<int>& rowCosts, vector<int>& colCosts) {
int i = startPos[0], j = startPos[1];
int x = homePos[0], y = homePos[1];
int ans = 0;
if (i < x) {
ans += accumulate(rowCosts.begin() + i + 1... | ALGO | 0.999954 | 5.254621 |
e7562f8c-88a7-4bf4-b176-7ba541f8b3df | sinhu-jung/Coding_Test | 프로그래머스/0/181894. 2의 영역/2의 영역.cpp | #include <string>
#include <vector>
using namespace std;
vector<int> solution(vector<int> arr) {
vector<int> answer;
int first = -1;
int last = -1;
for (int i = 0; i < arr.size(); i++) {
if (arr[i] == 2) {
if (first == -1) {
first = i;
}
las... | ALGO | 0.998955 | 5.53098 |
4e4c7d4a-d9bd-494a-8dfe-66dad798b3bf | dannguyenmessi1705/Cpp | SCTDL082_DaoNguocNganXep.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
int test;
cin >> test;
while (test--)
{
int N, t;
stack<int> st;
cin >> N;
for (int i = 0; i < N; i++)
{
cin >> t;
... | ALGO | 0.999776 | 4.90845 |
87bcc621-d7af-48f9-99b2-dd9bcb937966 | ablk/OptimizeHW | Eigen/doc/snippets/JacobiSVD_basic.cpp | MatrixXf m = MatrixXf::Random(3,2);
cout << "Here is the matrix m:" << endl << m << endl;
JacobiSVD<MatrixXf> svd(m, ComputeThinU | ComputeThinV);
cout << "Its singular values are:" << endl << svd.singularValues() << endl;
cout << "Its left singular vectors are the columns of the thin U matrix:" << endl << svd.matrixU(... | ALGO | 0.999838 | 3.50246 |
316b2bba-f16e-49c6-be32-7e0981365f05 | Vishnubansal51/C_Programming | BASIC/tut33multiplicationtable.cpp | #include<iostream>
using namespace std;
int main()
{
int n,i;
cout<<"enter the number"<<endl;
cin>>n;
for(i=1;i<11;i++){
cout<<n<<"x"<<i<<"="<< i*n;
cout<<endl;
}
return 0;
} | ALGO | 0.971254 | 3.427123 |
afaa0d84-b98e-4380-9854-3c64d95f7f2f | kartik-chauhan1/Programs | Untitled6.cpp | #include<iostream>
using namespace std;
int main()
{
int i,n,f=1;
cout<<"Enter the number ";
cin>>n;
for (i = 1; i<=n; i++)
{
f=f*i;
}
cout<<f;
}
| ALGO | 0.999787 | 3.958516 |
8b00e6d3-31e4-4efb-94ed-b29577f29dc7 | ishandutta2007/codeforces | potassium/normal/1709/B.cpp | #pragma GCC optimize ("O3", "unroll-loops")
// #pragma GCC target ("avx2")
// #pragma comment(linker, "/stack:200000000")
// #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#include "bits/stdc++.h"
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define disti... | ALGO | 0.99985 | 4.501483 |
7ca5e9f4-ab02-44d5-8bbc-45dfcc965bd8 | jikongabc/test-jikong | CFround966bu_E.cpp | #include <iostream>
#include <algorithm>
#include <cstring>
#include <string>
#include <vector>
#include <queue>
#include <deque>
#include <map>
#include <set>
#include <unordered_map>
#define inf 0x3f3f3f3f
using namespace std;
using LL = long long;
using ULL = unsigned long long;
typedef pair<int, int> PII;
const int... | ALGO | 0.999957 | 3.879011 |
b4bc0965-cd9a-4ab4-bdf6-c65fa585666e | raincross7/code-similarity | codes/train_code/problem355/problem355_4.cpp | #include <iostream>
#include <vector>
using namespace std;
bool isW(char c){
return c=='W';
}
bool isX(char c){
return c=='x';
}
int main(){//D問題
int n;
string s;
cin >> n >> s;
vector<char> t(n);
char assum[4][2] = {{'S', 'S'}, {'S', 'W'}, {'W', 'S'}, {'W', 'W'}};
for(int i=0;i<4;++i){... | ALGO | 0.999985 | 3.685163 |
a499db84-a112-4ef3-96cf-f930343945a2 | ishandutta2007/codeforces | anta/normal/526/A.cpp | #include <string>
#include <vector>
#include <algorithm>
#include <numeric>
#include <set>
#include <map>
#include <queue>
#include <iostream>
#include <sstream>
#include <cstdio>
#include <cmath>
#include <ctime>
#include <cstring>
#include <cctype>
#include <cassert>
#include <limits>
#include <functional>
#define re... | ALGO | 0.999873 | 3.672124 |
f76d6df8-3324-4ec0-b521-e70915b3c1bd | ishandutta2007/codeforces | kotamanegi/normal/1111/B.cpp | #define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <algorithm>
#include <utility>
#include <functional>
#include <cstring>
#include <queue>
#include <stack>
#include <math.h>
#include <iterator>
#include <vector>
#include <string>
#include <set>
#include <math.h>
#include <iostream>
#include <random>
#include... | ALGO | 0.999958 | 3.475567 |
649f65a4-dcc3-4946-9a7f-4bb9845e81d4 | jaymody/leetcode | c++/11 - Container With Most Water.cpp | // 11
// Container With Most Water
// https://leetcode.com/problems/container-with-most-water/
// c++
// medium
// O(n)
// O(1)
// array two_pointers
class Solution {
public:
int maxArea(vector<int>& height) {
int max = 0;
int left = 0;
int right = height.size()-1;
int ma... | ALGO | 0.999949 | 6.612834 |
889efbcc-4bc3-4bfb-b5f3-a4b57b7c547f | pooria159/Programming-competitions | Contests/Contest1669/D/Code_D.cpp | #include <bits/stdc++.h>
using namespace std;
#define int long long
#define endl "\n"
// #define file_io freopen("input.txt","red",stdin);freopen("output.txt","w",stdout)
#define fastio ios::sync_with_stdio(false);cin.tie(nullptr);cout.tie(nullptr)
bool State(int red, int blue , bool flag = true){
if ((red > 0 and... | ALGO | 0.999874 | 5.401401 |
dd654711-0da4-40fa-80ae-0412182bcb93 | ishandutta2007/codeforces | danya090699/normal/799/E.cpp | #include <bits/stdc++.h>
#define int long long
using namespace std;
struct el
{
int va, ty;
};
el nel;
bool comp(el a, el b){return(a.va<b.va);}
vector <el> ar;
struct el2
{
int q=0, va=0;
};
el2 *dot;
int lg, lef, cu;
void recalc(int nu)
{
dot[nu].q=dot[nu*2].q+dot[nu*2+1].q;
dot[nu].va=dot[nu*2].va+do... | ALGO | 0.999942 | 3.543364 |
f6879280-7bf4-4f74-ae32-7a75441d417c | nishatfatima25/LeetCode-Problem-Solving | Easy/867_Transpose_Matrix.cpp | // LeetCode Problem : 867. Transpose Matrix
// Link : https://leetcode.com/problems/transpose-matrix/description/
class Solution {
public:
vector<vector<int>> transpose(vector<vector<int>>& matrix) {
int row = matrix.size();
int col = matrix[0].size();
vector<vector<int>> result(c... | ALGO | 0.99997 | 7.025886 |
7ff6f7b4-70d9-450e-9605-56ffd064995b | devloic/vAmigaNet | cpp/emulator/Utilities/IOUtils.cpp | #include "config.h"
#include "IOUtils.h"
#include <assert.h>
#include <vector>
#include <fstream>
#include <algorithm>
#include <iomanip>
namespace util {
string
extractPath(const string &s)
{
auto idx = s.rfind('/');
auto pos = 0;
auto len = idx != string::npos ? idx + 1 : 0;
return s.substr(pos, len... | TOOL | 0.934242 | 5.706457 |
ca164091-3422-4ca6-ae7a-c272114c0d90 | Storkeus/parallel-computing | pr2/pr2.cpp | #define _CRT_SECURE_NO_DEPRECATE
#include <stdio.h>
#include <omp.h>
#include <math.h>
#include <time.h>
#include <iostream>
#include <fstream>
#include <clocale>
#include <cstdio>
#define MIN 100
#define MAX 2000000000
#define NUMBER_OF_NUMBERS MAX-MIN //Optymalizacja rozmiaru tablicy liczb
#define SHOW_RESULTS 1
st... | ALGO | 0.999748 | 3.535164 |
7c578d40-f8e7-4033-8a50-8a5d72169394 | RobinSchmidt/RS-MET | Libraries/RobsJuceModules/rosic/filters/rosic_TeeBeeFilter.cpp | //#include "rosic_TeeBeeFilter.h"
//using namespace rosic;
//-------------------------------------------------------------------------------------------------
// construction/destruction:
TeeBeeFilter::TeeBeeFilter()
{
cutoff = 1000.0;
drive = 0.0;
driveFactor = 1.0;... | TOOL | 0.910955 | 4.429151 |
c2adf6ac-7b94-4cb9-ad97-16c7bc1c80a5 | mystic-01/LeetCode | 399-evaluate-division/399-evaluate-division.cpp | class Solution {
public:
void dfs(string start,string end,map<string,double>& mp,map<string,vector<string>>& graph,double& val,map<string,int>& visited,bool& found){
visited[start]=1;
if(found==true)
return ;
for(auto child:graph[start]){
if(visited[child]!=1){
... | ALGO | 0.999984 | 6.016113 |
fe19f884-a76e-4d65-b6db-368c687b227f | ishandutta2007/codeforces | danya090699/normal/841/A.cpp | //Come on, make Togliatti great again!
#include <bits/stdc++.h>
using namespace std;
int main()
{
int n, k, q[26], ok=1;
cin>>n>>k;
for(int a=0; a<26; a++) q[a]=0;
for(int a=0; a<n; a++)
{
char x;
cin>>x;
q[x-'a']++;
}
for(int a=0; a<26; a++) if(q[a]>k) ok=0;
if(o... | ALGO | 0.99999 | 4.189931 |
8baa79b9-6179-4296-aaa3-0b2db5207d93 | morix1500/atcoder | atcoder/ABC040/A/main.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int n, x;
cin >> n >> x;
cout << min(x - 1, (n - x)) << endl;
} | ALGO | 0.999776 | 4.000134 |
5e1fc71b-a66a-44f6-ad53-eb90c9fbb7bf | woohyunjng/Coding-Practice | CP/Codeforce/Round 962/E.cpp | #include <bits/stdc++.h>
#define int long long
#define MAX 200100
#define MOD 1000000007
using namespace std;
typedef pair<int, int> pr;
typedef array<int, 3> tp;
int arr[MAX], cnt[MAX * 2 + 1];
signed main() {
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
cout.tie(nullptr);
int T, N, res = 0;... | ALGO | 0.999966 | 4.989786 |
34604feb-7d07-4fe8-9bca-571ea82041fe | JuJangGwon/algorithm | back_2587.cpp | #include <iostream>
#include <algorithm>
using namespace std;
int main()
{
int arr[5]; int sum = 0;
for (int i = 0; i < 5; ++i)
{
cin >> arr[i];
sum += arr[i];
}
sort(arr, arr + 5);
cout << sum / 5 << endl;
cout << arr[2];
} | ALGO | 0.999729 | 3.138035 |
b64ccbb5-c88a-4ac0-86d5-26d32e299d4c | javierdelapuente/eigen | doc/examples/tut_arithmetic_scalar_mul_div.cpp | #include <iostream>
#include <Eigen/Dense>
using namespace Eigen;
int main()
{
Matrix2d a;
a << 1, 2,
3, 4;
Vector3d v(1,2,3);
std::cout << "a * 2.5 =\n" << a * 2.5 << std::endl;
std::cout << "0.1 * v =\n" << 0.1 * v << std::endl;
std::cout << "Doing v *= 2;" << std::endl;
v *= 2;
std::cout << ... | ALGO | 0.993714 | 3.666278 |
d2f71c76-5779-499a-97f9-bda667cacdb8 | SysCall97/all-uva-codes | 12918 Lucky Thief.cpp | #include<bits/stdc++.h>
using namespace std;
#define ll long long
int main()
{
ll t;
cin>>t;
while(t--) {
ll n,m,res=0;
cin>>n>>m;
--m;
while(n--) {
res+=m;
--m;
}
cout<<res<<'\n';
}
return 0;
}
| ALGO | 0.999887 | 3.863259 |
217cdf30-ad7a-4a34-bf35-516df7dc1be2 | masalehh/Algorithms | fibonacci_series.cpp | /**
fibonacci_series.cpp
Purpose: practice data structure and algorithm implementation
@author MA Saleh
*/
#include<iostream>
using namespace std;
void fibonacciSeries(int nthTerm); //a function to findout nth term of fibonacci series
int main() ... | ALGO | 0.998932 | 4.052083 |
7f1c0308-3089-4f93-a345-e9935f2e3d0e | elmerjani/competitive-programming | D_Knapsack_1.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(){
ll n,W;cin>>n>>W;
ll w[n],v[n];
for(int i=0;i<n;i++){
cin>>w[i]>>v[i];
}
vector<vector<bool>> used(W+1,vector<bool>(n,false));
vector<ll> dp(W+1,0);
for(ll x=1;x<=W;x++){
for(int i=0;i<n;i++){
... | ALGO | 0.999989 | 4.46691 |
50a8d6e0-aa3e-4319-b73d-1625011122aa | utec-computer-science/cs1103-integer-yumilr | Integer.cpp | #include "Integer.h"
using namespace std;
Integer::Integer(){}//cout<<value<<" sin parametro"<<endl;}
Integer::Integer (int value){
this->value=value;
// cout<<value<<" int parametro;
}
Integer::Integer(const Integer& other){
this->value=other.value;
// cout<<value<<" other parametro"<<endl;
}
Integer... | TOOL | 0.960389 | 4.070974 |
57a0b025-0e77-42df-8b0b-cf57a9fca871 | hanjjong/Algorithm | BAEKJOON/문자열/10808-알파벳.cpp | #include <iostream>
int arr[26];
int main()
{
std::string s;
std::cin >> s;
for (auto c : s){
arr[c - 'a']++;
}
for (auto c : arr){
std::cout << c << " ";
}
} | ALGO | 0.999418 | 4.137759 |
2c1b541b-ccdf-4ad1-9373-a654044fd6ed | ishandutta2007/codeforces | dorost/normal/1504/C.cpp | /* * In the name of GOD
* Thanks God */
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
#define F first
#define S second
bool ok (string s) {
int x = 0;
for (int i = 0; i < s.size(); i++) {
if (s[i] == '(')
x++;
else
x--;
if (x < 0)
return false;
}
re... | ALGO | 0.999974 | 4.084597 |
367c982b-7d6f-4ce3-a1a7-9ce7c0c459e0 | willkill07/AdventOfCode2021 | tests/Day10.cpp | #include <catch2/catch_all.hpp>
#include "AdventTest.hpp"
#include "AdventDay.hpp"
#include "Day10.hpp"
using namespace day10;
namespace {
char const* input = R"MULTILINE([({(<(())[]>[[{[]{<()<>>
[(()[<>])]({[<{<<[]>>(
{([(<{}[<>[]}>{[]{[(<()>
(((({<>}<{<{<>}{[]{[]{}
[[<[([]))<([[{}[[()]]]
[{[{({}]{}}([{[{{{}}([]
{... | TEST | 0.858514 | 6.715872 |
afc47b50-5158-43bd-b670-88875499dec4 | Shahzadahasnat/mycodes | Practical 16/Write a C++ program that uses pointer variable..cpp | #include <iostream>
using namespace std;
int main (){
int a = 3;
int *ptr = &a;
cout << "Value stored in a: " << a << endl;
cout << "Address of a: " << &a<< endl;
cout << "Address of a stored in ptr: " << ptr << endl;
cout << "Value pointed towards ptr: " << *ptr << endl;
*ptr = 40;
cout << "Modified val... | ALGO | 0.977536 | 3.145323 |
ea07512e-be21-4d7e-ac84-058910f7a024 | SkiddieAhn/Study-Problem-Solving | 4. 부분배열 삭감/decrease.cpp | #include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#pragma warning(disable:4996)
#define max 100002
typedef struct {
int key;
int list_idx;
}helement;
typedef struct {
helement heap[max];
int heap_size;
}HeapType;
typedef HeapType* HeapType_ptr;
// Լ
HeapType_ptr hcreate() {
return (HeapType*)malloc(... | ALGO | 0.999957 | 3.877158 |
410c3f7b-b1e2-4d00-ba3d-9a337adc4e26 | dhan-02/mpc_turtlesim | src/Bicycle/mpc_bicycle.cpp | # include <ros/ros.h>
# include <math.h>
# include <turtlesim/Pose.h>
# include <geometry_msgs/Twist.h>
# include "ipopt_solver.hpp"
extern int N;
extern float dt;
extern int L;
extern float goal_x,goal_y;
extern float v_limit,sa_limit;
extern float msg_linear,msg_angular;
extern float obs_x,obs_y;
extern float x_now,y... | ALGO | 0.999342 | 5.115384 |
639a2302-6e94-45ed-bcb2-975b9746e826 | rainwl/GeometryKit | include/igl/octree.cpp | #include "octree.h"
#include <vector>
namespace igl {
template <typename DerivedP, typename IndexType, typename DerivedCH,
typename DerivedCN, typename DerivedW>
IGL_INLINE void octree(const Eigen::MatrixBase<DerivedP>& P,
std::vector<std::vector<IndexType> > & point_indices,
... | ALGO | 0.998345 | 7.545612 |
fef998bf-7446-44e4-83aa-c61690c12c6b | ishandutta2007/codeforces | bbatti93/normal/1029/D.cpp | #include <bits/stdc++.h>
using namespace std;
int dg(int a) {
int out=0;
for(;a>0;a/=10) out++;
return out;
}
int a[200001], n, k;
long long ki, t[11];
unordered_map<int,int> m[11];
int main()
{
scanf("%d%d", &n, &k);
t[0]=1;
for(int i=1;i<=10;i++) t[i]=10*t[i-1];
for(int i=0;i<n;i++) sc... | ALGO | 0.999799 | 3.654954 |
f8b0a472-80ac-4a3c-b7c6-d727767afcc7 | part-of-the-crew/DSA | sprint8/FinB_Crib/main.cpp | //https://contest.yandex.ru/contest/26133/run-report/131093388/
/*
-- WORKING PRINCIPLE --
First, I insert the words to be found in the long given word in the Trie structure
based on the list of the hashmaps.
Second, I look for the possibility of assembling the long word with small ones
using Trie and storing... | ALGO | 0.999918 | 6.134426 |
dce69d44-3d9f-4738-89a6-4f18695e4734 | ishandutta2007/codeforces | rosed/normal/1579/A.cpp | #include<bits/stdc++.h>
using namespace std;
namespace red{
#define int long long
#define ls(p) (p<<1)
#define rs(p) (p<<1|1)
#define mid ((l+r)>>1)
#define lowbit(i) ((i)&(-i))
inline int read()
{
int x=0;char f=0,ch;
for(ch=getchar();(ch<'0'||ch>'9')&&ch!='-';ch=getchar());
if(ch=='-') f=1,ch=getchar();
whi... | ALGO | 0.999795 | 4.489186 |
20c59db6-7215-4e01-b595-aeca28c0b72d | singhalshubham89/CompetitiveCoding | KickstartD2020/D.cpp | #include<bits/stdc++.h>
using namespace std;
void solve(){
}
int main(){
int t;
cin>>t;
for(int i = 1; i <= t;i++){
cout<<"Case #"<<i<<": "<<solve();
}
} | ALGO | 0.917912 | 3.635617 |
7dc3f426-3a4a-4e26-8674-03ce16426079 | sarvex/leetcode-ksh | solution/1400-1499/1434.Number of Ways to Wear Different Hats to Each Other/Solution.cpp | using ll = long long;
class Solution {
public:
int numberWays(vector<vector<int>>& hats) {
vector<vector<int>> d(41);
int n = hats.size();
int mx = 0;
for (int i = 0; i < n; ++i) {
for (int& h : hats[i]) {
d[h].push_back(i);
mx = max(mx, h... | ALGO | 0.999982 | 5.579082 |
c3226d18-a6f1-45aa-a147-7c4b0a39fbaa | WangWilly/MyLeetCode | No2364/solution.cpp | #include <iostream>
#include <vector>
#include <map>
#include <queue>
#include <unordered_set>
using namespace std;
////////////////////////////////////////////////////////////////////////////////
class Solution {
public:
long long countBadPairs(vector<int>& nums) {
map<int, unordered_set<int>> numIdxs;
... | ALGO | 0.999963 | 5.427263 |
92cbd434-88a7-4cdb-9d04-1616891a4fc5 | AbdusSamadAli/DSA- | 1046-max-consecutive-ones-iii/1046-max-consecutive-ones-iii.cpp | class Solution {
public:
int longestOnes(vector<int>& nums, int k) {
int left=0, right=0, maxlen=0;
for(right=0; right<nums.size();right++){
if(nums[right]==0) k--;
while(k<0){
if(nums[left]==0) k++;
left++;
}
maxlen = m... | ALGO | 0.999967 | 6.150155 |
d17ddfeb-75e1-43cc-9995-da4dc3eed6fd | starswap/CompetitiveProgramming | UVa/11456MtSM.cpp | //USing the method in "Methods to Solve"
#include <bits/stdc++.h>
using namespace std;
int n;
vector<int> weights;
vector<int> memoLIS;
vector<int> memoLDS;
const int INF = 10001;
int LIS(int i) {
if (i == 0) return 1;
if (memoLIS[i] != -1) return memoLIS[i];
int maxi = 1;
for (int j=0;j<i;++j) {
if (we... | ALGO | 0.999876 | 4.134854 |
29a92731-9db2-4dd7-99f6-197215909fa8 | dwshin-dev/Baekjoon-Algorithm | 400 - 다이나믹 프로그래밍1/15988.cpp | #include <iostream>
#include <algorithm>
#define MAX 1000001
#define MODULER 1000000009
using namespace std;
long long dp[MAX] = { 0, };
int main(int argc, char* argv[])
{
int test_case;
cin >> test_case;
dp[1] = 1;
dp[2] = 2;
dp[3] = 4;
dp[4] = 7;
for (int i = 5;i < MAX;i++) {
dp... | ALGO | 0.999917 | 4.061505 |
eb4533ba-f4ee-4ae0-af6b-51abcad01d6b | jiangyinzuo/algorithm | src/exercise/leetcode/lc1293.cpp | //
// Created by Jiang Yinzuo on 2021/4/21.
//
#include <vector>
using namespace std;
class Solution {
public:
int shortestPath(vector<vector<int>> &grid, int k) {
vector<vector<vector<int>>> dp(grid.size(), vector<int>(grid[0].size(), vector<int>(k, 0)));
}
}; | ALGO | 0.999954 | 5.999964 |
28e47c8f-de88-4dc9-876f-4495e22963a6 | yonghaason/HElib_new | olds/old/src/polyEval.cpp | #include "polyEval.h"
// Returns the e'th power of X, computing it as needed
Ctxt& DynamicCtxtPowers::getPower(long e)
{
if (v.at(e-1).isEmpty()) { // Not computed yet, compute it now
long k = 1L<<(NextPowerOfTwo(e)-1); // largest power of two smaller than e
v[e-1] = getPower(e-k); // comput... | ALGO | 0.999706 | 4.686391 |
2d129b0e-304c-4aaf-8289-c90a8011f5c4 | deepak-ky/cpp-codes | cpp-codes/Linked_list_insertion_sort.cpp | #include<iostream>
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define w111 cout<<1
class node
{
public:
int data;
node* next;
node(int d)
{
data = d;
next = NULL;
}
};
void insertathead(node*&head, int d)
{
node* n = new node(d);
n->next = head;
head = n;
}
void insertattail(node*&h... | ALGO | 0.999962 | 3.923644 |
fd9038be-fb33-43e5-ae4d-9783a7ff95be | ishandutta2007/codeforces | rns_cus/normal/39/G.cpp | #include<bits/stdc++.h>
using namespace std;
#define mod 32768
char temp;
string s[110], tp;
int cnt, f[32780], tot, pos, n, ans, answer;
int calc();
int getnum(){
int rlt = 0;
if(tp[pos] == 'n') return pos ++, n;
if(tp[pos] == 'f') return pos +=2, rlt = f[calc()], pos++, rlt;
while(tp[pos] > 47 and tp[po... | ALGO | 0.999831 | 3.595723 |
c201c3b7-e651-4220-bdae-cb23bde6cd46 | prash-goel/Cpp-ConcurrencyTopics | 9. Using_locks_to_avoid_deadlocks/3. unique_lock.cpp | /**
* [Description]
* In this version of the code, std::lock_guard has been replaced with std::unique_lock. As before, the lock object lck will unlock
* the mutex in its destructor, i.e. when the function divideByNumber returns and lck gets out of scope. In addition to this automatic unlocking,
* std::unique_lock... | ALGO | 0.966599 | 7.18948 |
eed106bd-d386-413e-b8f7-b32d8082fdd2 | skrewbar/algo-kit | boj/C++/silver/13305.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
int n;
cin >> n;
vector<ll> len(n);
for (int i = 1; i < n; i++)
cin >> len[i];
vector<ll> price(n);
for (int i = 0; i < n; i++)
cin >> price... | ALGO | 0.999938 | 3.759784 |
d725a33a-d9a4-4cc0-8313-efacec4f4d2b | jurajsic/DQBDD | libs/hqspre/formula_unit_pure.cpp | #include <vector>
#include <easylogging++.hpp>
#include "auxil.hpp"
#include "clause.hpp"
#include "exceptions.hpp"
#include "formula.hpp"
#include "gate.hpp"
#include "literal.hpp"
/**
* \file formula_unit_pure.cpp
* \brief Implementation of unit propagation and pure literal detection
* \author Ralf Wimmer
* \d... | ALGO | 0.997728 | 7.391593 |
eae42cda-0fbd-4c9a-b538-976999ad54ec | kennent/for_scsc_code_save | contest/icpc/2018prac/c.cpp | #include <bits/stdc++.h>
#define MAX 1000000007
using namespace std;
using ll = long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
namespace atcoder {
namespace internal {
#if __cplusplus >= 202002L
using std::bit_ceil;
#else
// @return same with std::bit::bit_ceil
unsigned int bit_ceil(unsigned int ... | ALGO | 0.999982 | 4.308166 |
8e15c248-5738-4b46-a453-6892c03f52fa | fortyyearslater/My-Codes | 2022洛谷月赛/3月普及/T1.cpp | #include <bits/stdc++.h>
using namespace std;
long long MakeGenius(long long k)
{
int sum,i,t=0;
for(i=1;i<=k;i++)
{
t=t+9*pow(10,i-1);
}
return t;
}
bool GetGenius(long long k,long long n)
{
int i,t=MakeGenius(k);
while(n>=0)
{
n=n-t;
if(n==0)return true;
}
return false;
}
int k,n,i,t;
bool ans;
int ma... | ALGO | 0.999259 | 4.130522 |
30c728b1-01f4-467b-bf8b-e1f486f9316d | Nahom51/DSA-Lab | rottingoranges.cpp | class Solution {
public:
int orangesRotting(vector<vector<int>>& grid) {
int m = grid.size(), n = grid[0].size();
int cnt = 0;
typedef pair<int, int> pii;
queue<pii> q;
for (int i = 0; i < m; ++i) {
for (int j = 0; j < n; ++j) {
if (grid[i][j] == 2... | ALGO | 0.999918 | 6.118773 |
c7ed2cae-ca78-4945-8c20-d028a9c1ee7b | ritishBhatoye/dsa | DAY 99/ARRAYS/reverseAnArray.cpp | #include<iostream>
using namespace std;
void inputArr(int *arr,int size){
for(int i=0;i<size;i++){
cin>>arr[i];
}
}
void printArr(int *arr,int size){
for(int i=0;i<size;i++){
cout<<arr[i]<<" ";
}
}
void reverseAnArray(int *arr,int size)
{
int s=0;
int e=size-1;
while(s<e){
sw... | ALGO | 0.998898 | 4.116084 |
12570aa0-4340-46af-a3ff-b56c5b3c38bb | johnwlambert/argoverse-centerpoint-simplified | iou3d_nms/src/iou3d_nms.cpp | #include <torch/serialize/tensor.h>
#include <torch/extension.h>
#include <vector>
#include <cuda.h>
#include <cuda_runtime_api.h>
#define CHECK_CUDA(x) TORCH_CHECK(x.type().is_cuda(), #x, " must be a CUDAtensor ")
#define CHECK_CONTIGUOUS(x) TORCH_CHECK(x.is_contiguous(), #x, " must be contiguous ")
#define CHECK_INP... | TOOL | 0.9115 | 5.909549 |
47da0c66-bef3-4c23-891a-13c67dcd1993 | pikapi2030/CPP2nd | DP/1DProblems/fibonacci.cpp | #include <bits/stdc++.h>
using namespace std;
/*
nth fibonacci number using dp
T.C O(N) S.C O(N)+O(N) //array + recursion stack space
*/
int fib(int n,vector<int>&dp)
{
if(n<=1){return n;}
if(dp[n]!=-1)
{
return dp[n];
}
return dp[n]=fib(n-1,dp)+fib(n-2,dp);//returns the ans and stores it in dp as well
}
//b... | ALGO | 0.999995 | 5.416265 |
56cc3f01-32f9-4179-b634-be71d092656f | nbelouni/n_puzzle | src/Algo.cpp | #include "Algo.hpp"
#include <vector>
#include <algorithm>
#include <unistd.h>
#include <stdlib.h>
Algo::Algo(void)
{
board = NULL;
heuristic = &Algo::ManhattanDist;
numeric.path = NULL;
blank.path = NULL;
tmp_path = NULL;
}
Algo::~Algo(void)
{
}
void
Algo::setBoard(Board *b)
{
if (numeric.path)
delete [] nu... | ALGO | 0.999768 | 4.055779 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.