uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
a7e826f7-c58c-4472-9ee0-1d8c04401b60 | Soumik77777/cs141_2018 | cslab9-master/q13.cpp | #include<iostream>
using namespace std;
//main
int main(){
//Declaring the array
int arr[10];
//Taking input of the elements of array
for(int i=0;i<10;i++){
int x;
cout<<"enter "<<i+1<<"th element : ";
cin>>x;
arr[i]=x;
}
cout<<endl<<"Display by index method "<<endl<<endl;
//Display by index method
... | ALGO | 0.976413 | 3.823648 |
38fcb7fd-36de-48e5-b6fd-1a5b0cdde28e | neuroconductor-devel/eegUtils | src/ica_test.cpp | #include <RcppArmadillo.h>
using namespace Rcpp;
// [[Rcpp::export]]
arma::mat do_iter(arma::cube amps, int k, int N){
int n_epochs = amps.n_slices;
arma::mat Rxp(amps.n_rows, amps.n_rows, arma::fill::zeros);
k += 1;
for (int i = 0; i < n_epochs; i ++) {
Rxp += amps.slice(i).cols(k, N - 1) * amps.slice(i... | ALGO | 0.997111 | 5.664962 |
17941bfc-f6d4-4019-a47a-509dfa6de9ef | Amisha328/Recursion-in-CPP | CountConsonantsInString.cpp | // letters other than vowels are called consonents.
// Examples of constants are b, c, d, f, g, ..
#include<bits/stdc++.h>
using namespace std;
#define eff ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
bool isConsonent(char ch)
{
ch = tolower(ch);
return (!(ch=='a' || ch=='e' || ch=='i' || ch=='o' || ch==... | ALGO | 0.999673 | 4.448873 |
51e17cf9-fc53-45b4-9b1b-9c1fc83845ab | Zielon/3DScanning | Exercises/Exercise3/libs/Eigen/doc/examples/tut_arithmetic_matrix_mul.cpp | #include <iostream>
#include <Eigen/Dense>
using namespace Eigen;
int main()
{
Matrix2d mat;
mat << 1, 2,
3, 4;
Vector2d u(-1,1), v(2,0);
std::cout << "Here is mat*mat:\n" << mat*mat << std::endl;
std::cout << "Here is mat*u:\n" << mat*u << std::endl;
std::cout << "Here is u^T*mat:\n" << u.transpo... | ALGO | 0.998899 | 3.818773 |
63c66a29-9254-4ffd-8b60-c1caac5c0704 | Laxmikant3/Dsa_cpp | 02. Mathematics/ModularMultiplicativeInverse.cpp | // { Driver Code Starts
//Initial Template for C++
#include<iostream>
using namespace std;
// } Driver Code Ends
//User function Template for C++
class Solution{
public:
//Complete this function
int modInverse(int a, int m)
{
//Your code here
for(int i=1;i<=m;i++){
if((i*... | ALGO | 0.999947 | 6.054995 |
ec069c82-071a-485f-a451-7a44bcb6a6a5 | vbonnici/grafe-sim | analysis/data/p02271/s816426825.cpp | #include <iostream>
#include <string>
#include <vector>
#include <utility>
#include <algorithm>
#include <set>
#include <map>
#include <stack>
#include <cassert>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cstring>
using namespace std;
typedef unsigned long long ull;
typedef long long ll;
templat... | ALGO | 0.999867 | 4.126353 |
48aa87ae-80a9-4ff7-a759-581ce35130dc | Dharamvirmuz/C-Cpp-DSA-Assignments | Assignment 24/Q9.cpp | // Write functions using function overloading to find a maximum of two numbers and both the numbers can be integer or real.
#include <iostream>
using namespace std;
class Maximum
{
public:
double x, y;
void Check();
Maximum(double a, double b)
{
x = a;
y = b;
}
};
void Maximum:... | ALGO | 0.994789 | 5.437486 |
149e623b-51f4-47bc-8b21-2d09a4eca0ba | Kishii/Dev | dep/src/g3dlite/MeshAlgAdjacency.cpp | #include "G3D/Table.h"
#include "G3D/MeshAlg.h"
#include "G3D/Set.h"
#include "G3D/Stopwatch.h"
#include "G3D/SmallArray.h"
namespace G3D {
/** Two-level table mapping index 0 -> index 1 -> list of face indices */
class MeshEdgeTable {
public:
/** We expect 2 faces per edge. */
typedef SmallArray<int, 2> Fa... | ALGO | 0.999034 | 7.755578 |
3e678048-3757-4577-9ab0-709f9ea114dd | ishandutta2007/codeforces | peterr/normal/1215/E.cpp | #include <bits/stdc++.h>
using namespace std;
const long long INF = 2E11;
const int MAXN = 4E5;
const int MAXA = 20;
vector<int> pos[MAXA + 1];
long long cost[MAXA + 1][MAXA + 1];
long long dp[1 << MAXA];
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int n;
cin >> n;
for (int i = ... | ALGO | 0.999914 | 3.721965 |
58ff99cc-af0f-4147-b2e6-2528b2435848 | 2h1082/Coding-Test-Repo | 프로그래머스/1/12928. 약수의 합/약수의 합.cpp | #include <string>
#include <vector>
using namespace std;
int solution(int n) {
int answer = 0;
for(int i=1;i<=n;i++){
if(!(n%i)){
answer+=i;
}
}
return answer;
} | ALGO | 0.999971 | 5.392304 |
c881be80-aca5-416b-8336-f16f68dab92e | thalium/icebox | third_party/virtualbox/src/VBox/VMM/VMMAll/PDMAllNetShaper.cpp | /* $Id: PDMAllNetShaper.cpp $ */
/** @file
* PDM Network Shaper - Limit network traffic according to bandwidth group settings.
*/
/*********************************************************************************************************************************
* Header Files ... | TOOL | 0.882342 | 6.795729 |
f9b016d9-c741-4947-999a-f750d02fdc16 | competitiveprogrammingpietro/competitiveprogramming | alice_bob.cpp | /*
* Competitive programming Universita' degli studi di Pisa.
* Source http://codeforces.com/problemset/problem/6/C?locale=en
* Complexity O(n)
*/
#include <iostream>
#include <vector>
#include <utility>
using namespace std;
pair<int, int> chocolate_bars(vector<int>& times) {
int SUM[times.size() + 1], i, alic... | ALGO | 0.999921 | 4.439903 |
3382ca1e-d6db-481e-ba33-0066f35cef68 | Hee-won/LLVM-JSRfuzz | mlir/lib/Dialect/Affine/Transforms/SuperVectorize.cpp | #include "mlir/Dialect/Affine/Passes.h"
#include "mlir/Analysis/SliceAnalysis.h"
#include "mlir/Dialect/Affine/Analysis/AffineAnalysis.h"
#include "mlir/Dialect/Affine/Analysis/LoopAnalysis.h"
#include "mlir/Dialect/Affine/Analysis/NestedMatcher.h"
#include "mlir/Dialect/Affine/IR/AffineOps.h"
#include "mlir/Dialect/A... | TOOL | 0.942247 | 6.626846 |
2ef526f6-0ee9-4eab-befb-7156113b3bac | frblazquez/Acepta-el-reto | 329.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main()
{
int numEdificios, ini, fin;
cin >> numEdificios;
while(numEdificios)
{
vector<pair<int,int>> edificios;
for(int i = 0; i < numEdificios; i++)
{cin >> ini >> fin; edificios.push_back({ini, fin});}
sor... | ALGO | 0.999487 | 4.427153 |
d94c3fe8-4cce-4afb-a06f-7aa9e610b637 | hameem008/Competitive_Programming | Codeforces_and_others/Card_Game.cpp | #include <bits/stdc++.h>
using namespace std;
#define endl '\n'
#define gap ' '
typedef long long ll;
typedef long double lld;
const ll infinite = INT64_MAX;
ll MOD = 998244353;
ll binExp(ll a, ll b, ll mod)
{
if (b == 0)
return 1;
ll rec = binExp(a, b / 2, mod);
if (b % 2 != 0)
return ((a ... | ALGO | 0.999702 | 4.284463 |
6b17b6a8-aff0-4a94-a8a8-0d5d19fa9f41 | shaan2610/Leetcode-solution | 239-sliding-window-maximum/239-sliding-window-maximum.cpp | class Solution {
public:
vector<int> maxSlidingWindow(vector<int>& nums, int k) {
int n=nums.size();
vector<int> ans;
deque<int> q;
for(int i=0;i<n;i++) {
if(q.empty()) {
q.push_back(i);
}
else {
while(not q.empty() ... | ALGO | 0.999989 | 6.211867 |
2b49b2c5-cc19-4cfd-be04-cd1525565968 | Nhannguyen993/Programming-projects | stackdouble.cpp | #include <iostream>
template <class Type>
class Stack
{
private:
Type* A; // array for storage
int capacity = 1; // capacity of A
int length = 0;
public:
Stack():A(nullptr),capacity(1),length(0){
}
Stack(int nums):A(nullptr),capacity(1),length(0) {
capacity = nums;
length=0;
A=... | TOOL | 0.938321 | 4.354805 |
0cf118d8-7f7d-402c-9f1e-524115b2b3f4 | Dmitriy282/BI-118 | Пластун Руслан/Chapter 3/cpa_lab_3_6_3_(1)-A.cpp | #include <iostream>
using namespace std;
void increment(int &ref, int increase_expr = 1)
{
ref += increase_expr;
}
int main(void)
{
while (true)
{
int var = 0;
for (int i = 0; i < 10; i++)
if (i % 2)
increment(var);
else
increment(var, i);
cout << var << endl;
int test;
cin.ignore();
... | ALGO | 0.946322 | 3.54135 |
6a29cbdf-9684-466a-a2a1-a98253c7b590 | chopinic/MIT-6.836-assignment | assn2/starter2/3rd_party/nanogui/ext/eigen/doc/examples/Tutorial_ReductionsVisitorsBroadcasting_reductions_norm.cpp | #include <Eigen/Dense>
#include <iostream>
using namespace std;
using namespace Eigen;
int main()
{
VectorXf v(2);
MatrixXf m(2,2), n(2,2);
v << -1,
2;
m << 1,-2,
-3,4;
cout << "v.squaredNorm() = " << v.squaredNorm() << endl;
cout << "v.norm() = " << v.norm() << endl;
cout << "v.lpN... | ALGO | 0.996656 | 4.034037 |
4639ed15-4e83-4cc7-b3b3-f280613951e3 | seate/algorithm | baekjoon/단계 별로 풀어보기/1차원 배열/2577_숫자의_개수.cpp | #include <iostream>
#include <vector>
#include <string>
using namespace std;
int main()
{
int command;
int result = 1;
int counter[10] = {0,};
for (int i = 0; i < 3; i++)
{
scanf("%d", &command);
result *= command;
}
while (result != 0)
{
counter[result % 10]++;
result /= 10;
}
for ... | ALGO | 0.99971 | 3.406007 |
3a5c78ec-2fa6-44f3-ad1f-09434d51465f | tommyvtran123/First-rep | module 2/2-2 Assignment.cpp | #include <iostream>
using namespace std;
void printarray(double const * , int);
int main()
{
double num[10] = {5.3,10.5,15.23,20.2,25.3,30.6,35.2,40.7,45.8,50.3};
printarray(num,10);
}
void printarray(double const *ptr , int)
{
for(int i = 0;i<10;i++)
cout << *(ptr + i) << "\t";
cout << endl;
}
| ALGO | 0.983655 | 3.792642 |
507c7928-75b4-416b-a7d2-d654ed60aa48 | Vishesh-web-dev/Standard-DSA-Problems | Binary Search/TLE/pointsOnLine.cpp | #include <bits/stdc++.h>
using namespace std;
//macros
#define ll long long
#define pii pair<int, int>
#define pll pair<long long, long long>
#define vi vector<int>
#define vll vector<ll>
#define vpii vector<pair<int, int>>
#define vb vector<bool>
#define vs vector<string>
#define forn(n) for (int i = 0; i < int(n); i+... | ALGO | 0.999923 | 4.003551 |
e5aad960-75ce-4bd2-8fa8-47de43106a48 | 113bommy/deepmind_codecontests_refine | cpp_gold_filter_file/cpp_train_8053_10.cpp | #include <bits/stdc++.h>
using namespace std;
const int N = 100005;
using ll = long long;
struct Point {
ll x, y;
} p[N];
int n, a, b, c, d, idx, top;
ll dp[N];
int main() {
ios::sync_with_stdio(false);
scanf("%d%d/%d%d/%d", &n, &a, &b, &c, &d);
for (int i = 1; i <= n; i++) {
ll t1, t2;
scanf("%lld%lld"... | ALGO | 0.999851 | 4.038511 |
29b55f83-c638-47df-8ecf-ed93bf500671 | DarrenSandhu/Sudoku-Solver | BreadthFSSudoku.cpp | #include "Sudoku.h"
#include "BreadthFirstSearch.h"
#include <vector>
#include <string>
using std::vector;
using std::string;
#include <iostream>
using std::cout;
using std::endl;
bool fillBoard(Sudoku * board, const vector<string> & fillWith) {
for (size_t row = 0; row < fillWith.size(); ++row) {
... | ALGO | 0.967967 | 6.107307 |
bf9b6cb2-72eb-454f-9b75-24caab2e219a | BinomialSheep/CompetitiveC-- | AtcoderProblems/BootCampMedium/043_GoHome.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
//#include <atcoder/all>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define MAX 10000
#define INFTY (1 << 29)
// 浮動小数点の誤差を考慮した等式
#define EPS (1e-10)
#define equal(a, b) (fabs((a) - (b)) < EPS)
ll llMax(ll x, ll y) { return (x >= y) ? x : y; }... | ALGO | 0.999935 | 3.90321 |
99c44f98-1b6d-4269-ae11-7b37147c28f2 | mnmary/Netology_CPP_HW | Algo HW7/AlgoHW7-3/AlgoHW7-3.cpp | // AlgoHW7-3.cpp : Этот файл содержит функцию "main". Здесь начинается и заканчивается выполнение программы.
//
#include <iostream>
#include <fstream>
int** createArray(int vCount)
{
//создаем динамический двумерный массив по заданным размерам
//возвращаем указатель на него
int** arr;
arr = new int* ... | ALGO | 0.99896 | 3.941347 |
58f3e06c-84f8-48a0-8737-df495fe90f7f | matthewachan/fluid-simulator | include/eigen/doc/snippets/Tutorial_AdvancedInitialization_LinSpaced.cpp | ArrayXXf table(10, 4);
table.col(0) = ArrayXf::LinSpaced(10, 0, 90);
table.col(1) = M_PI / 180 * table.col(0);
table.col(2) = table.col(1).sin();
table.col(3) = table.col(1).cos();
std::cout << " Degrees Radians Sine Cosine\n";
std::cout << table << std::endl;
| ALGO | 0.945948 | 3.543272 |
6770292c-9171-4c51-93b5-e81464d99657 | saeid721/OstadFlutterProject | module_twelve_task_manager/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.998746 | 6.76073 |
e7d5dc14-5c0c-479d-ae63-9e4847a5b186 | renatacpolicarpo/KyberCoprocessorHLS | polyvec.cpp | #include <stdint.h>
#include "params.hpp"
#include "poly.hpp"
#include "polyvec.hpp"
/*************************************************
* Name: polyvec_compress
*
* Description: Compress and serialize vector of polynomials
*
* Arguments: - uint8_t *r: pointer to output byte array
* ... | ALGO | 0.99244 | 4.983508 |
6e5e874f-a67c-44ab-9e15-72759d336c55 | AnshKetchum/programming-for-glory | Stanford ProCo/2014 Novice/Problem B: Prime Evil/novB.cpp | #include <bits/stdc++.h>
using namespace std;
#define STOP_VAL 150000
int n,cnt;
bool is_prime(int v)
{
if(v == 1)
return false;
for(int i = 2; i <= sqrt(v); i++)
if(v % i == 0)
return false;
return true;
}
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(0);
... | ALGO | 0.999951 | 4.141119 |
99a7c4e9-01e0-45e3-a119-563a692a2468 | Kirsart/Task | Task programming/4Cycles/Solution/Task5.cpp | #include <stdio.h>
int main()
{
int n, min = 10, number = 0, a, z;
scanf("%d", &n);
z = n;
do
{
if (n % 10 < min) min = n % 10;
n /= 10;
number++;
} while (n > 0);
while ((z % 10) > min)
{
number--;
z /= 10;
}
printf("%d", number);
} | ALGO | 0.999811 | 3.640724 |
da3c368a-276d-4931-9df9-22dc998ec1db | gengzhenfei/LeetCode | c++/L047Permutations2.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
class L047Permutations2
{
private:
/* data */
public:
L047Permutations2(/* args */);
~L047Permutations2();
vector<vector<int>> permuteUnique(vector<int> &nums)
{
vector<vector<int>> result;
sort(nums.be... | ALGO | 0.999952 | 5.149321 |
3bb1e54d-4f3f-40de-a913-f5b37fbee5d0 | ezhumalai91/Class_Note | C_and_C++/C++/Programs/Practice-programs/sum_natur.cpp | #include <iostream>
using namespace std;
int main()
{
int n,i,add=0;
cout << "Enter the number of elements: ";
cin >> n;
for(i=n;i>=1;i--)
{
add=add+i;
}
cout<<add;
} | ALGO | 0.999139 | 3.487285 |
904a3685-c7c9-4afd-a8d3-b3d2cf393171 | ishandutta2007/codeforces | izban/normal/353/C.cpp | #include <iostream>
#include <string>
#include <map>
#include <math.h>
#include <vector>
#include <algorithm>
#include <cstdio>
#include <set>
#include <queue>
#include <sstream>
#include <deque>
#include <memory.h>
#include <cassert>
#include <ctime>
using namespace std;
#define ll long long
#pragma comment(linker,... | ALGO | 0.999812 | 3.759721 |
5a41284c-9d0a-47a6-8283-c118d57a7391 | junho1004/algorithm | programmers/lev2/올바른 괄호.cpp | #include<string>
#include<stack>
#include <iostream>
using namespace std;
stack<char> st;
bool solution(string s)
{
cin.tie(0); cout.tie(0);
ios::sync_with_stdio(0);
bool answer = true;
for(int i = 0; i < s.size(); i++){
if(s[i] == ')'){
if(st.empty()) return false;
el... | ALGO | 0.998826 | 5.098423 |
0570c665-836b-46b7-a123-ab5110e39d65 | nougat-hammerhead/hardware_qcom_display | msm8996/sdm/libs/utils/rect.cpp | #include <math.h>
#include <utils/rect.h>
#include <utils/constants.h>
#define __CLASS__ "RectUtils"
namespace sdm {
bool IsValid(const LayerRect &rect) {
return ((rect.bottom > rect.top) && (rect.right > rect.left));
}
bool IsCongruent(const LayerRect &rect1, const LayerRect &rect2) {
return ((rect1.left == re... | TOOL | 0.939839 | 6.825529 |
b230e6cf-c366-4a0b-be79-2220df9f9912 | CodeMacrocosm/Algo-a-Thon | Algos/C++/balance paranthesis.cpp | //balanced parantheseis
#include <bits/stdc++.h>
using namespace std;
void balance(string s)
{
stack<char> st;
int l=s.length();
int i,flag=0;
for(i=0;i<l;i++)
{
if((s[i]=='(')||(s[i]=='{')||(s[i]=='['))
st.push(s[i]);
else if(s[i]==')')
{
if((!st.emp... | ALGO | 0.99966 | 4.724606 |
5d8c40ca-a7de-411b-ad37-34bc6fd41675 | allenbrookes/HexSim | Hex Map Generator/HexScore.cpp | // HexScore.cpp : implementation file
//
// implementation of hexagon scoring algorithm
#ifdef _DEBUG
//#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
#include "StdAfx.h"
#include "hex_map_generator.h"
#include "HexScore.h"
#include "ThrowMsg.h"
#include "assert.h"
#include <cmath... | ALGO | 0.99266 | 6.485854 |
46625bb1-c1ce-4820-8415-5e5b958e9c3e | Ayush01015/My-Own-STL-C-Plus-Plus | Array/DynamicArray_Vector/DynamicArray.cpp | #include <bits/stdc++.h>
#include <iostream>
using namespace std;
class _Vector{
private:
int capacity;
int lastIndex;
int *ptr;
public:
_Vector(){}
_Vector(int size){
this->capacity = size;
this->lastIndex = -1;
this->ptr = new int[size];
}
~_Vector(){
delete... | ALGO | 0.996999 | 4.128792 |
8123a9fe-1d6b-4a1d-85b9-460090673000 | mlofduybor/ahnu-DataStructure-project | 停车场管理/E/src/LinkQueue.cpp | #include<iostream>
#include<string>
#include "LinkQueue.h"
typedef char Message;
typedef int License;
typedef int time;
void LinkQueue::InitQueue(){
front = new QNode();
rear = new QNode();
front = rear;
front->next = NULL;
}
int LinkQueue::EnQueue(car e){
QNode* p = new QNode();
p->data = ... | TOOL | 0.870511 | 3.801214 |
0f614a59-65e8-4e12-a223-b1b0b10ea981 | zhouxs1023/WildMagic | LibMathematics/Intersection/Wm5IntrPlane3Triangle3.cpp | #include "Wm5MathematicsPCH.h"
#include "Wm5IntrPlane3Triangle3.h"
namespace Wm5
{
//----------------------------------------------------------------------------
template <typename Real>
IntrPlane3Triangle3<Real>::IntrPlane3Triangle3 (const Plane3<Real>& plane,
const Triangle3<Real>& triangle, Real epsilon)
:
... | ALGO | 0.937814 | 7.535893 |
a0082145-138b-4edd-a5d2-dc13427eecf7 | Amandiktiya/AMANDIKTIYA | C++/Prac1/switch.cpp | // Programming exercises on control flow statements in C++
#include <iostream>
using namespace std;
int main() {
int month;
cout << "Enter a number (1-12): ";
cin >> month ;
switch (month) {
case 1:
cout << "January" << endl;
break;
case 2:
cout << ... | ALGO | 0.98738 | 3.254481 |
050b6309-18c7-4121-ac18-078d3378153a | KULeuven-COSIC/SCALE-MAMBA | src/Offline/DABitMachine.cpp | /*
* DABitMachine.cpp
*
* Created on: Mar 5, 2019
* Author: drotaru
*/
#include "DABitMachine.h"
#include "LSSS/Share2.h"
#include "OT/aBit.h"
#include "config.h"
DABitMachineBase::DABitMachineBase() : nBitsPerLoop(kdaBitsPerLoop), sec(daBits_stat_sec), cnc_param(0),
... | ALGO | 0.97994 | 5.304664 |
dc1f62c0-db1c-45b5-a7c8-6fe14f18ed31 | chuuuuu/algorithm | cses/dynamic-programming/2181/sol.cpp | // reference / algorithm explanation: https://codeforces.com/blog/entry/90841
// #include <ext/pb_ds/assoc_container.hpp>
#include <bits/stdc++.h>
using namespace std;
// using namespace __gnu_pbds;
using ll = long long;
// template<class T> using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_stat... | ALGO | 0.999985 | 5.12906 |
65328c15-f39f-4e56-a6f4-aa8beaee68df | sarvex/leetcode-nativescript | solution/2400-2499/2462.Total Cost to Hire K Workers/Solution.cpp | using pii = pair<int, int>;
class Solution {
public:
long long totalCost(vector<int>& costs, int k, int candidates) {
priority_queue<pii, vector<pii>, greater<pii>> q;
int n = costs.size();
int i = candidates - 1, j = n - candidates;
for (int h = 0; h < candidates; ++h) q.push({cost... | ALGO | 0.999952 | 5.167552 |
69b979ce-7a7d-472b-9072-32e43906558b | mgharbi/mit_png2dng | dng_sdk/source/dng_xy_coord.cpp | /*****************************************************************************/
/*****************************************************************************/
/* $Id: //mondo/dng_sdk_1_3/dng_sdk/source/dng_xy_coord.cpp#1 $ */
/* $DateTime: 2009/06/22 05:04:49 $ */
/* $Change: 578634 $ */
/* $Author: tknoll $ */
/**... | TOOL | 0.91956 | 6.168729 |
2781d227-341d-49bb-8391-b56208945520 | kavin23923/Leetcode | contest/161/2.cpp | class Solution {
public:
int numberOfSubarrays(vector<int>& nums, int k) {
int size = nums.size();
vector<int> count(size);
for (int i = 0; i < size; i++) {
if (i == 0 && nums[i] % 2 == 1) {
count[i] = 1;
} else if (i == 0) {
count[i] = 0;
} else {
count[i] = coun... | ALGO | 0.99999 | 6.01371 |
8342161f-bc9b-4517-b2c4-3d3bbc543144 | SantiagoVilla09/Tareas-Estructuras-de-Datos | quicksort.cpp | #include <iostream>
#include <vector>
#include <chrono>
// Quicksort(Data: values[], Integer: start, Integer: end)
void quicksort(std::vector<int>& data, int start,int end){
if(start>=end) return;
// <Pick a dividing item from the array. Call it divider.>
int divider = data.at(start);
int blank = sta... | ALGO | 0.999807 | 5.535164 |
d33feb6c-06d1-4527-8e93-ea8fdf402935 | tamofplease/atcoder_abc | abc102/b/main.cpp | #include <bits/stdc++.h>
using namespace std;
#include <atcoder/all>
using namespace atcoder;
typedef long long ll;
#define rep(i,n) for(int i=0;i<n;i++)
#define Rep(i,n) for(int i=1;i<=n;i++)
#define ALL(v) v.begin(), v.end()
const ll MOD = 1000000007;
int main(){
int n; cin >> n;
vector<ll> a(n);
rep(i, ... | ALGO | 0.999932 | 4.430792 |
ef3deb59-8fc0-4ca4-be9d-31c7b98fc8b9 | lht06/openGauss-server | src/gausskernel/dbmind/db4ai/executor/algorithms/svm.cpp | #include "db4ai/gd.h"
#include "db4ai/kernel.h"
static void svmc_gradients(GradientsConfig *cfg)
{
Assert(cfg->features->rows > 0);
GradientsConfigGD *cfg_gd = (GradientsConfigGD *)cfg;
// distances = 1 - y * (x * w)
Matrix distance;
matrix_init(&distance, cfg->features->rows);
matrix_mult_ve... | TEST | 0.879466 | 6.903909 |
5926165b-0410-499a-973e-ea862286892e | Codemigod-666/CodingNinjasDSA-CPP | Searching And Sortiing/secondLargestInArray.cpp | // find the second largest element in the array:::::::::::::::::::::
// first approach is to find the largest in the array and the find the second largest
// for this we have to traverse the array two times to get the answer:
// so we will go to another approach for which we have to use some complex form of nested ... | ALGO | 0.999926 | 5.00446 |
54576409-da15-4146-93c6-322e497b182c | Omkarpatil108/Coding-PractiseProblem | Easy/Non Repeating Character/non-repeating-character.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution
{
public:
//Function to find the first non-repeating character in a string.
char nonrepeatingCharacter(string S)
{
//Your code here
vector<int> freq(26, 0);
for (char ch... | ALGO | 0.999792 | 4.971931 |
215a30d5-de02-4330-95f0-e167585105a8 | JoaoPedroPPS/PrimeiraLista30 | Exercicio 05- lista 01 - potencia e raiz quadrada de numero.cpp | /*
Faa um programa que leia um nmero e, caso ele seja positivo, calcule e mostre:
O nmero digitado ao quadrado
A raiz quadrada do nmero digitado
*/
#include<stdio.h>
#include<locale.h>
#include<math.h>
int main(){
setlocale(LC_ALL,"Portuguese");
float num, quad, raiz;
printf("\nDigite um nmero posi... | TOOL | 0.985491 | 3.285345 |
06b862de-0bbd-473c-9bdc-73f898b43dcf | odanado/Procon | AtCoder/ARC050/A.cpp | #include <iostream>
#include <string>
#include <vector>
#include <sstream>
#include <map>
#include <set>
#include <queue>
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
using namespace std;
using ll = long long;
#define all(c) (c).begin(), (c).end()
#define rep(i,n) for(... | ALGO | 0.99995 | 3.405295 |
b64a0a8d-89a0-489b-b719-5b32a584f00e | likeabhityagi0700/PLACEMENT-PREPRATION-MODULE- | DAY 19 VALIDSUDOKU.CPP | valid sudoku-class Solution {
public:
bool valid(int i,int j,vector<vector<char>>& board){
unordered_set<char> temp;
for(int x=i;x<i+3;x++){
for(int y=j;y<j+3;y++){
if(board[x][y]!='.' and temp.count(board[x][y]))
return false;
temp.ins... | ALGO | 0.999597 | 4.872898 |
e6a71d23-69b9-4d0e-a8a6-88a96e0f1f8f | abirdas12/DS_Assignments | DS_Assignment_4.cpp | #include <iostream>
using namespace std;
#include <string>
template <class T> //template classes
class addelements {
T element;
public:
addelements(T arg) {
element = arg;
}
T add(T arg) {
return element+arg;
}
};
template <>
class addelements <string> {
string element;
public:
addelements (string arg) {
... | ALGO | 0.903858 | 4.281957 |
182a0bc4-88d4-4a00-878e-d7c5814ea9f2 | mmmhj2/code-competitive | HDU/1398/14261618_AC_31ms_1788kB.cpp | #include <iostream>
#include <cstring>
using namespace std;
const int MAXN = 300 + 10;
class GeneratingFunc
{
typedef int *pint;
int n;
pint co1, co2;
pint v, minco, maxco;
public:
/**
@p N 预期空间最大值
@p value 价值数组
@p _maxco 起始系数数组
@p_ minco 终止系数数组
**/
GeneratingFunc(... | ALGO | 0.999866 | 3.560492 |
b223c7ec-2fe5-4154-a2e9-14182300670e | Raghavgarg12/Leetcode | 121-best-time-to-buy-and-sell-stock/best-time-to-buy-and-sell-stock.cpp | class Solution {
public:
int maxProfit(vector<int>& prices) {
int n=prices.size();
int mini=INT_MAX,i,profit=0;
for(i=0;i<n;i++)
{
mini=min(prices[i],mini);
profit=max(profit,prices[i]-mini);
}
return profit;
}
}; | ALGO | 0.999805 | 6.090607 |
748b4a4a-5587-4cd2-8a34-1d985cca8a99 | TasnimAnas/Class_Assignments | 2nd Sem/C++ Codes/Part 9/2.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
int n;
cout << "Enter a number: ";
cin >> n;
int m = n;
int rev = 0;
while(n!=0)
{
rev = rev*10 + (n % 10);
n /= 10;
}
cout << "Reverse number is: " << rev << endl;
return 0;
} | ALGO | 0.999705 | 4.783971 |
e3d47f76-ffdf-412b-b53f-d44957d6a49f | devbenitez08/cKernighanRitchie | chapter 1/03 temperature - celcius to farenheit.cpp | #include <stdio.h>
// ºF = (ºC * 9/5) + 32
/* print celcius to farenheit from 0 to 300 into 20 steps */
int main()
{
float step = 20;
float celcius = 0;
float maximumC = 300;
float farenheit = 0;
printf(" ====== Celcius to Farenheit Calculator Accurate =====\n\n");
printf("Celcius \tFarenheit\n");
while... | ALGO | 0.970962 | 3.113609 |
1ac1e7ef-57cb-49c9-874a-023bd2aec749 | BigTree777/AtCoder | submissions/abc261/abc261_a.cpp | #include<bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
int main(){
int L1, R1, L2, R2;
cin >> L1 >> R1 >> L2 >> R2;
int ans = 0;
for(int i = 0; i <= 100; i++){
if((i > R1) && (i > R2)) break;
if((L1 <= i) && (i <= R1)){
if((L2 <= ... | ALGO | 0.999595 | 3.126416 |
1dd7983d-3583-4fd1-b020-77bb1bf679fe | benkoehlL/Magnonic_Thermal_Transport_Code | Selfenergy/uvtest.cpp | #include <iostream>
#include <fstream>
#include <sstream>
#include <cmath>
#define step 0.02
using namespace std;
double u(double, double, double);
double v(double, double, double);
double gamma(double,double);
double omega(double,double,double);
double A(double,double,double);
double B(double,double,double);
int m... | ALGO | 0.985221 | 3.40327 |
6fd06a81-ccab-4456-9182-c757222649ac | ambak/CSES-solutions | Sorting and Searching/Apartments.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long LL;
int a[1000009];
int b[1000009];
int main() {
ios_base::sync_with_stdio(false);
int n, m, k;
cin >> n >> m >> k;
for (int i = 0; i < n; i++) {
cin >> a[i];
}
for (int i = 0; i < m; i++) {
cin >> b[i];
}
sort(a, a + n);
sort(b, b + m);
in... | ALGO | 0.999892 | 3.546781 |
b3fcf5fd-983b-4418-ab4b-73a417fa7772 | catstrike/algorithms_cpp | graph/graph.cpp | #include "graph.h"
auto getMaxIndex(const std::vector<Edge>& edges) -> decltype(Edge::start)
{
auto maxIt = std::max_element(
std::begin(edges),
std::end(edges),
[](const Edge& a, const Edge& b) {
return std::max(a.start, a.end) < std::max(b.start, b.end);
}
);
... | ALGO | 0.999298 | 6.705311 |
b0dfcf0c-b748-496c-bd36-49a15dd9fe5e | kalpesshh/DAA | mergesort.cpp | #include <iostream>
#include <vector>
// Merge two subarrays of the original array
void merge(std::vector<int>& arr, int left, int middle, int right) {
int n1 = middle - left + 1;
int n2 = right - middle;
std::vector<int> leftArray(n1);
std::vector<int> rightArray(n2);
for (int i = 0; i < n1; i++... | ALGO | 0.999998 | 6.36569 |
f75c0d5c-f111-4459-8664-bcd9b22c6bf0 | sheyua/LAMMPS-QTB | src/USER-OMP/pair_peri_pmb_omp.cpp | /* ----------------------------------------------------------------------
Contributing author: Axel Kohlmeyer (Temple U)
------------------------------------------------------------------------- */
#include "math.h"
#include "float.h"
#include "pair_peri_pmb_omp.h"
#include "fix.h"
#include "fix_peri_neigh.h"
#incl... | ALGO | 0.999761 | 5.919119 |
6bf4bfd0-491f-4e68-bc45-c2c408adabe5 | Shahriar-Seam/Programming | Codeforces/Contests/2131_B.cpp | #include <bits/stdc++.h>
using namespace std;
void solve()
{
int n, i;
cin >> n;
for (i = 1; i < n; i++) {
if (i & 1) {
cout << -1 << " ";
}
else {
cout << 3 << " ";
}
}
if (n % 2 == 0) {
cout << 2 << "\n";
}
else {
... | ALGO | 0.999915 | 4.398141 |
aff63f13-3247-432e-b683-d9534643072e | RajThakur777/Leetcode-POTD | 0692-top-k-frequent-words/0692-top-k-frequent-words.cpp | // class myComparator {
// public:
// bool operator() (const pair<int , string> &p1, const pair<int , string> &p2) {
// if(p1.first == p2.first) return p1.second < p2.second;
// return p1.first > p2.first;
// }
// };
// class Solution {
// public:
// vector<string> topKFrequent(vecto... | ALGO | 0.999993 | 6.136217 |
d3c4b587-9d0f-4e81-a3f2-9c543eab00dc | sungeun05/PPS- | veryEasy/A017_박성은_20250706.cpp | #include <iostream>
#include <string>
using namespace std;
int main(){
int n;
cin >> n;
string s = to_string(n);
int sum = 0;
int number[10] = {};
int a[10] = {0,1,2,3,4,5,6,7,8,9};
for(int i=0; i<10; ++i)
number[s[i] - '0']++;
for(int i=0; i<10; ++i)
if(i != 9 ... | ALGO | 0.999593 | 4.623725 |
90150f2b-6c60-4e6c-a925-ce2cbccd0467 | zhm/node-spatialite | src/spatialite/deps/geos/geos/src/operation/overlay/PolygonBuilder.cpp | #include <geos/operation/overlay/PolygonBuilder.h>
#include <geos/operation/overlay/OverlayOp.h>
#include <geos/operation/overlay/MaximalEdgeRing.h>
#include <geos/operation/overlay/MinimalEdgeRing.h>
#include <geos/geomgraph/Node.h>
#include <geos/geomgraph/NodeMap.h>
#include <geos/geomgraph/DirectedEdgeStar.h>
#incl... | ALGO | 0.960791 | 7.378424 |
2dab0881-5dd0-43c4-98d2-6a14eb3bb0b3 | elikkozak/-EngineForAnimationCourseASS3 | igl/octree.cpp | #include "octree.h"
#include <vector>
#include <queue>
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_i... | ALGO | 0.997741 | 7.508667 |
51a068f2-a5e4-4114-96c5-83c14d24afb1 | Adampultz/pultzLib | Filters/Adaptive_Comb.cpp | //
// adaptiveComb.hpp
// Bela Mirror
//
// Created by Adam Pultz Melbye on 04.07.22.
//
#include "Adaptive_Comb.h"
using namespace pultzLib;
Adaptive_Comb::Adaptive_Comb(float initFreq, float ampDiffThresh, float schmittLow, float schmittHigh, float valSmoothing){
init(initFreq, ampDiffThresh, schmittLow, s... | ALGO | 0.998726 | 4.387125 |
30932204-502a-47f0-b78b-961c0d2299dd | arturJan4/University | 5_Semester/ZCPP/Lista05/weighted_graph.cpp | #include "weighted_graph.hpp"
bool Weighted_graph::has_edge(const std::list<edge> &edges, int dest_idx)
{
for (const edge& e : edges)
{
if (e.destination_idx == dest_idx)
return true;
}
return false;
}
bool Weighted_graph::exists_edge(int idx_s, int idx_d)
{
if (!idx_set.contai... | ALGO | 0.986214 | 5.008466 |
edef23fd-61ca-442e-b935-0f3715ac845a | Lucky19112002/Impact-Training | Self_Pratice/Appna Collage classes/4 Pattern Questions/4-1-1.cpp | #include <bits/stdc++.h>
using namespace std;
int32_t main(){
cout<<"Pattern \n";
int row,col;
cin>>row>>col;
for (int i = 0; i < row; i++)
{
for (int j = 0; j < col; j++)
{
cout<<"* ";
}
cout<<endl;
}
} | ALGO | 0.999436 | 4.235844 |
c31f436e-2fe9-4f35-961e-4e22907a5695 | sebas095/Competitive-Programming | URI/Close the Doors!.cpp | #include <bits/stdc++.h>
#define fast ios_base::sync_with_stdio(false);cin.tie(NULL)
#define endl '\n'
using namespace std;
vector<int> ans;
void calc() {
for (int i = 0; i <= 5000; i++) {
ans.push_back(i * i);
}
}
int main() {
fast;
int n;
calc();
while (cin >> n and n) {
for (int i = 1; i <= s... | ALGO | 0.99878 | 4.297221 |
75a13a30-4d76-45e5-8311-f6bf1f244837 | Ainemed/Algorithm-and-Data-Structures | Exams/Tree/BST/12_06_2024/mergeBST.cpp | #include <iostream>
#include <vector>
using namespace std;
struct Node{
Node* p;
Node* left;
Node* right;
int key;
Node(int key): key(key), p(nullptr), left(nullptr), right(nullptr){}
Node(int key, Node* p, Node* left, Node* right): key(key), p(p), left(left), right(right){}
Node(): key(-... | ALGO | 0.999957 | 4.522314 |
7018565b-af50-4268-819a-1ab42d88b47f | Sravani-Sravani/B.-Tech-Files | c programming/assignment/big.cpp | #include<stdio.h>
int main()
{
int a,b,c;
scanf("%d %d %d",&a,&b,&c);
if(a>b&&a>c)
printf("%d is the biggest number",a);
else if(b>a&&b>c)
printf("%d is the biggest number",b);
else
printf("%d is the biggest number",c);
return 0;
}
| ALGO | 0.99935 | 3.86604 |
e04ca946-64ef-45e3-9697-c59d81745451 | m04j00/class2-coding-study | BaekJoon/Project/Project/no5.cpp | #include <iostream>
using namespace std;
int main() {
int a, b;
cin >> a >> b;
cout << a + b << endl;
return 0;
} | ALGO | 0.997333 | 3.553062 |
59c530dd-52d8-4a73-8df7-3d2ff0603a6d | NITEESHTHROVAGUNTA/c-programming-108123136 | triangle.cpp | #include<stdio.h>
#include<math.h>
int main()
{
float a,b,c;
printf("enter the sides of the triangle ");
scanf("%f%f%f",&a,&b,&c);
if(a==b&&b==c&&c==a)
printf("the triangle is EQULIATERAL");
else if (a!=b&&a!=c&&b!=c)
printf("the triangle is SCALENE");
else
printf("the triangle is isosceles");
return 0;
}
| ALGO | 0.999598 | 3.669552 |
8f4a3ad0-3497-4f4f-9079-6c4a64e9e611 | swimmingturtle165/Codeforces-Submissions--Ordered | codeforces/1475/E.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;
typedef unsigned long long int ull;
typedef long long int ll;
typedef long double ld;
typedef pair<ll,ll> pll;
#define FOR(i,a,b) ... | ALGO | 0.999934 | 4.226416 |
e212e57a-1484-4175-b83e-d4286ddfe36d | algoamigoo/Leetcode | 684-redundant-connection/redundant-connection.cpp | class Solution {
public:
vector<int> parent;
vector<int> rank;
int find(int x) {
if(parent[x] == x)
return x;
return parent[x] = find(parent[x]);
}
void Union(int x, int y) {
int x_parent = find(x);
int y_parent = find(y);
if(ra... | ALGO | 0.999602 | 5.380827 |
7e0ca19e-9be4-49d5-8c2c-9a3f5142e8da | minkimgyu/TIL | CodingTest/1700/1700/main.cpp | #include <iostream>
#include <queue>
#include <list>
#include <functional>
#include <algorithm>
using namespace std;
int n, k;
int items[101];
int frequency[101];
list<int> inputOrder[101];
bool plugIn[101];
int plugInSize = 0;
int result = 0;
struct Item
{
public:
int name;
int frequency;
int nextInputIndex;
... | ALGO | 0.999729 | 3.975306 |
17c50634-0289-464b-8a70-e8d907de3692 | DraSoGo/Competitive_Programming | CSES/CSES_Problem_Set/Sorting&Searching/Josephus_Problem_I.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
int n;
cin >> n;
set <int> S;
for (int i = 1; i <= n; i++)
{
S.insert(i);
}
auto idx = S.begin();
idx++;
while (!S.empty())
{
if (idx == S.end())
... | ALGO | 0.999896 | 3.394672 |
555792fe-da2c-4e41-9b21-28b6e0538ba1 | Chaek2/pahomov | 7/flutter_7/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.997706 | 6.76073 |
511f9bf6-ff8a-4784-b5b4-4c3b35069283 | alexandraback/datacollection | solutions_2449486_0/C++/avv/Lawnmower.cpp | // Lawnmower.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include "vector"
#include "string"
#include "set"
#include "sstream"
#include "algorithm"
#include "cmath"
#include "cassert"
#include "iostream"
#include <fstream>
using namespace std;
int _tmain(int argc, _TCHAR* argv[]... | ALGO | 0.999627 | 4.354446 |
205303b3-73ee-4f00-9adf-8d2d8de431ec | dhuamanilu/programacion | 1409/1409D.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int, int> pi;
typedef vector<int> vi;
typedef vector<ll> vll;
#define FOR(i, a, b) for (int i=a; i<(b); i++)
#define mp make_pair
#define pb push_back
#define f first
#define se second
#define lb lower_bound
#define... | ALGO | 0.99979 | 4.401414 |
b6edbe01-7c12-450f-a225-f13722d0df36 | andrewaarestad/ode-system-fitting-with-boost-and-nlopt | boost_1_77_0/libs/spirit/example/x3/roman.cpp | ///////////////////////////////////////////////////////////////////////////////
//
// A Roman Numerals Parser (demonstrating the symbol table). This is
// discussed in the "Symbols" chapter in the Spirit User's Guide.
//
// [ JDG August 22, 2002 ] spirit1
// [ JDG March 13, 2007 ] spirit2
// [ JDG May 13, 2015 ] ... | TOOL | 0.96828 | 7.688988 |
4c30e0f9-897f-40c2-b886-0aae179a3708 | caotoanbk/CP_contest_template | ACMICPC.NET/8972/brute_force.cpp | #include <bits/stdc++.h>
using namespace std;
#ifdef ON_PC
#include "../shared/lib/debug2.h"
#else
#define dbg(...)
#define dbgArr(...)
#endif
typedef pair<int,int> pii;
#define ll long long
#define ld long double
#define ar array
#define vt vector
#define pb push_back
#define mp make_pair
#define fi firs... | ALGO | 0.999919 | 3.509094 |
5081476f-1800-428d-a4dd-fbd662ee35c5 | leakingmemory/buildmanager | bm.cpp | #include <iostream>
#include <vector>
#include <map>
#include "Ports.h"
#include "PortGroup.h"
#include "Port.h"
#include "Build.h"
#include "Unpack.h"
#include "Chroot.h"
#include "Exec.h"
#include "Db.h"
#include "Installed.h"
#include "App.h"
#include "basiccmd.h"
enum class Command {
NONE,
LIST_GROUPS,
... | TOOL | 0.933873 | 5.429028 |
a62c016d-7f9c-485b-8309-2ddae96d1812 | razbareli/Operating-Systems-67808 | ex4/original_ex4_files/PhysicalMemory.cpp | #include "PhysicalMemory.h"
#include <vector>
#include <unordered_map>
#include <cassert>
#include <bitset>
#include <cstdio>
#include <iostream>
typedef std::vector<word_t> page_t;
std::vector<page_t> RAM;
std::unordered_map<uint64_t, page_t> swapFile;
void initialize() {
RAM.resize(NUM_FRAMES, page_t(PAGE_SIZE... | TOOL | 0.870153 | 4.744518 |
751c58e5-dd71-4af2-95f2-cef66861e39d | nasturas/LSTM | PrezicerePretActiuni/LogaritmNormalisation.cpp | #include "LogaritmNormalisation.h"
#include <cmath>
vector<double> LogaritmNormalisation::Normalise(vector<double> data_set) const
{
vector<double> rtn(data_set.size(), 0.0);
for (int i = 1; i < data_set.size(); i++)
{
rtn[i] = log(data_set[i] / data_set[i - 1]);
if (rtn[i] < -1.0)
rtn[i] = -1.0;
if (rtn[... | ALGO | 0.996321 | 3.593021 |
ce556fe5-8b58-4429-a6dd-2d86ec330652 | longsll/algorithm-practises | codeforce/oth/E_Porcelain.cpp | #include<bits/stdc++.h>
using namespace std;
int dp[10001],dp1[101][101],n,m,v[101],sum[101][101],q[101];
int main()
{
cin>>n>>m;
for(int i=1;i<=n;i++)
{
int k;
cin>>k;
for(int j=1;j<=k;j++)
cin>>v[j],sum[i][j]=sum[i][j-1]+v[j];
for(int j=1;j<=k;j++)
for(int l=0;l<=j;l++)
{
int r=k-(j-l);
dp... | ALGO | 0.999929 | 3.237445 |
c18bd80d-6559-4334-97b8-5b85f4418d4e | Shahriar-Seam/Programming | CPP/Other CF Problems/1814_A.cpp | #include <bits/stdc++.h>
using namespace std;
#define int long long
void solve()
{
int n, k;
cin >> n >> k;
cout << ((n % gcd(2, k) == 0) ? "YES" : "NO") << "\n";
}
int32_t main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int32_t t, i;
cin >> t;
for (i = 1; i <= t; i++)... | ALGO | 0.999688 | 4.720351 |
97742e76-e704-45ef-8c19-44a3639a3d38 | ahmedryasser/Cplusplus_OOP | numEven/numEven.cpp | #include <iostream>
using namespace std;
int numEven( int v[], int numItems){
int n = v[numItems-1] ;
if (numItems == 0){
return 0;
}
else if (n%2 == 0) {
return numEven(v,numItems - 1)+1 ;
}
else {
return numEven(v,numItems - 1) ;
}
}
int main() {
int v[10] = {1... | ALGO | 0.998331 | 5.082357 |
e8885205-7276-4252-ae60-225f1ebc6cb7 | Shrestha005/DSA_cpp | 7.1.Recursion/5.allSubsequence.cpp | #include <iostream>
#include <vector>
using namespace std;
void backtrack(vector<int>& nums, int start, vector<int>& subset, vector<vector<int>>& result) {
int n = nums.size();
result.push_back(subset);
for (int i = start; i < n; i++) {
subset.push_back(nums[i]);
backtrack(nums, i + 1, sub... | ALGO | 0.999955 | 6.874693 |
4cdbaacf-bdd5-42a1-9a33-5eb8fffa7855 | ttycp3/Classdesign | 航班管理系统/航班信息管理.cpp | #include <stdio.h>
#include<string.h>
#include<stdlib.h>
#include <malloc.h>
const int MAXN = 1e6 + 10;
char n[128];
int planenum, passengernum;
typedef struct planemessage {
char number[16];//
int maxbear;//ؿ
char beginplace[64];//ɵص
char endplace[64];//ص
char begintime[16];//ʱ
char endtime[16];//ʱ
double price... | TOOL | 0.85806 | 3.292059 |
2ba60d3d-d532-4c15-a3ea-6c29316afec8 | Rudovich1/openMP | task_3/main.cpp | #include "../benchmark.hpp"
#include "../function_wrapper.hpp"
#include <vector>
#include <random>
#include <string>
#include <iostream>
#include <iomanip>
#include <fstream>
using Matrix = std::vector<std::vector<double>>;
class MatrixException: public std::exception
{
std::string msg_;
static inline const s... | ALGO | 0.986297 | 5.327665 |
024acf88-e05b-4052-b357-3644040b32c8 | Divyamkholia16/DAA_2022_2017324_DivyamKholia_Practicals | Practical/Week10/ques1.cpp | #include<bits/stdc++.h>
using namespace std;
int main() {
int n;
cin>>n;
multiset<pair<int,int>> s;
vector<int> v1(n);
vector<int> v2(n);
vector<int> ans;
for(int i = 0; i < n; i++) {
cin>>v1[i];
}
for(int i = 0; i < n; i++) {
cin>>v2[i];
}
for(int i = 0; i <... | ALGO | 0.999996 | 3.687091 |
fce36c7a-ee8e-46a1-9211-f96bcb1cf2f8 | munna516/Online-Judge | Codeforces/1399A.cpp | #include <bits/stdc++.h>
#include <vector>
using namespace std;
int main()
{
int t;
cin >> t;
while (t--)
{
int x;
cin >> x;
vector<int> ary(x);
for (int i = 0; i < x; i++)
{
cin >> ary[i];
}
bool count = true;
sort(ary.begin(),... | ALGO | 0.999924 | 4.306545 |
a9ac5556-086d-4e97-b430-db633d16e64e | atharvkore20/Data-Structure-And-Algorithm | program297.cpp | #include<iostream>
using namespace std;
void DisplayFactors(int iNo)
{
static int i = 1;
if(i <= (iNo/2))
{
if((iNo % i) == 0)
{
cout<<i<<endl;
}
i++;
DisplayFactors(iNo);
}
}
int main()
{
int iValue = 0, iRet = 0;
cout<<"Enter number : "<<... | ALGO | 0.999277 | 3.9103 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.