uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
c54c1528-952d-424d-bbfa-acac89fcea21 | rei-hoshinomori/banana | GameTemplate/k2EngineLow/ExEngine/bulletPhysics/src/BulletSoftBody/btSoftSoftCollisionAlgorithm.cpp | #include "btSoftSoftCollisionAlgorithm.h"
#include "BulletCollision/CollisionDispatch/btCollisionDispatcher.h"
#include "BulletCollision/CollisionShapes/btBoxShape.h"
#include "BulletCollision/CollisionDispatch/btCollisionObject.h"
#include "BulletSoftBody/btSoftBodySolvers.h"
#include "btSoftBody.h"
#include "BulletCo... | ALGO | 0.986586 | 3.784431 |
bc732e94-6ae5-467a-8110-9ee103d1fead | NinnOgTonic/PMPH | 3_NaiveCuda/ProjectMain.cpp | #include "ParseInput.h"
#include "ProjHelperFun.h"
int main()
{
unsigned int OUTER_LOOP_COUNT, NUM_X, NUM_Y, NUM_T;
const REAL s0 = 0.03, t = 5.0, alpha = 0.2, nu = 0.6, beta = 0.5;
readDataSet( OUTER_LOOP_COUNT, NUM_X, NUM_Y, NUM_T );
REAL* res = (REAL*)malloc(OUTER_LOOP_COUNT*sizeof(REAL));
{ // Orig... | ALGO | 0.978167 | 4.197328 |
9ffa514e-8faa-46ca-8655-41815e0229bd | ishandutta2007/codeforces | oierwanhong/normal/1060/B.cpp | #include<iostream>
#include<cstdio>
#include<cstring>
#include<cmath>
using namespace std;
long long ans,k,n;
long long s(long long a){
long long p=0;
while(a>0){
p+=a%10;
a/=10;
}
return p;
}
long long f(long long n){
if(n<10)return 0;
long long p=0;
while(n>=10){
p=p*10+9;
n/=10;
}
return p;
}
int ma... | ALGO | 0.999809 | 4.060038 |
726719b9-0aad-448f-9fd2-538f7d66b2df | kirteeprajapati/Competitive-Coding | CodeChef Cpp/BURGERS.cpp | #include <iostream>
using namespace std;
int main()
{
int T;
cin >> T;
while (T--)
{
int A, B;
cin >> A >> B;
cout << min(A, B) << endl;
}
return 0;
} | ALGO | 0.999625 | 5.069122 |
73357b37-183c-4159-bd25-fb7980a286bd | jalexp/c345 | boost_1_71_0/libs/spirit/example/karma/num_matrix.cpp | ///////////////////////////////////////////////////////////////////////////////
//
// This sample demonstrates a generator formatting and printing a matrix
// of integers taken from a simple vector of vectors. The size and the
// contents of the printed matrix is generated randomly.
//
////////////////////////////... | TOOL | 0.871672 | 5.799753 |
822619be-8b3a-4cdf-b29c-737176ec2ffc | itohdak/AtCoder | AGC/025/B.cpp | #include <bits/stdc++.h>
#include "/home/itohdak/AtCoder/000/print.hpp"
using namespace std;
#define ll long long
#define REP(i,m,n) for(int i=(int)(m); i<(int)(n); i++)
#define rep(i,n) REP(i,0,n)
#define RREP(i,m,n) for(int i=(int)(m); i>=(int)(n); i--)
#define rrep(i,n) RREP(i,n-1,0)
#define REPL(i,m,n) for(ll i=(ll... | ALGO | 0.999938 | 4.5532 |
52557f8e-b341-4147-9812-e64f5cf30234 | colinyoyo26/mlir-standalone-toy | llvm/utils/benchmark/cmake/std_regex.cpp | #include <regex>
#include <string>
int main() {
const std::string str = "test0159";
std::regex re;
re = std::regex("^[a-z]+[0-9]+$",
std::regex_constants::extended | std::regex_constants::nosubs);
return std::regex_search(str, re) ? 0 : -1;
}
| ALGO | 0.907517 | 5.855292 |
618bd349-8ba8-452c-8f81-ce2b232d4714 | fscorrea1984/CPP | INF01056/marathon1/09 - Shopping in FdI/fdi.cpp | #include <iostream>
using namespace std;
void buildmin(int stmin[], int a[], int pos, int b, int e,) {
if(b == e)
stmin[pos] = a[e];
else {
int h = (b+e)/2;
buildmin(a, 2*pos+1, b, h);
buildmin(a, 2*pos+2, h+1, e);
stmax[pos] = max(stmax[2*pos+1],stmax[2*pos+2]);
}
}
void buildmax(int stmax... | ALGO | 0.999799 | 4.114929 |
22bfb98f-b078-4525-a147-f5e289915a72 | ishandutta2007/codeforces | eliden/normal/NA/115.cpp | #include <bits/stdc++.h>
using namespace std;
#define rep(i,a,b) for(int i=a;i<b;++i)
#define debug(x) cerr<<#x<<": "<<x<<endl
#define sz(x) (int)(x).size()
using ll = long long;
using vi = vector<int>;
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
int MAXA=102;
vi count(MAXA,-1);
int... | ALGO | 0.999999 | 3.549607 |
7ace6cca-9750-4610-8261-96cdf0ff3ea1 | Mishalfatima/RawDet-7 | mmcv/mmcv/ops/csrc/parrots/iou3d.cpp | // Modified from
// https://github.com/open-mmlab/OpenPCDet/blob/master/pcdet/ops/iou3d_nms/src/iou3d_nms.cpp
#include "pytorch_cpp_helper.hpp"
#include "pytorch_device_registry.hpp"
const int THREADS_PER_BLOCK_NMS = sizeof(unsigned long long) * 8;
void iou3d_boxes_overlap_bev_forward_impl(const int num_a, const Ten... | ALGO | 0.998866 | 6.422254 |
f1045f7b-a059-474c-8634-e70fcdacc081 | mechiragjain/Data-Structure-Algorithms | Array/13 - Maximum occured integer.cpp | /*Given N integer ranges, the task is to find the maximum occurring integer in these ranges. If more than one such integer exits, print the smallest one. The ranges are given as two arrays L[] and R[]. L[i] consists of starting point of range and R[i] consists of corresponding end point of the range.*/
#include <bits... | ALGO | 0.999981 | 4.835576 |
f36f5628-bea2-4b53-9148-2ef334005f25 | alexandraback/datacollection | solutions_1674486_0/C++/Zubie7a/jama.cpp | /*Santiago Zubieta*/
#include <iostream>
#include <numeric>
#include <fstream>
#include <climits>
#include <cstring>
#include <cstdio>
#include <cmath>
#include <queue>
#include <list>
#include <map>
#include <set>
#include <stack>
#include <deque>
#include <vector>
#include <string>
#include <cstdlib>
#include <casser... | ALGO | 0.999907 | 4.198844 |
1ac52c12-6a1a-41fb-b05f-9418ed2a9813 | Mrhuangyi/leetcode-Solutions | Cpp/Easy/485. 最大连续1的个数.cpp | 给定一个二进制数组, 计算其中最大连续1的个数。
示例 1:
输入: [1,1,0,1,1,1]
输出: 3
解释: 开头的两位和最后的三位都是连续1,所以最大连续1的个数是 3.
注意:
输入的数组只包含 0 和1。
输入数组的长度是正整数,且不超过 10,000。
class Solution {
public:
int findMaxConsecutiveOnes(vector<int>& nums) {
int res = 0;
if(nums.size() == 0) {
return res;
}
int temp =... | ALGO | 0.999984 | 6.253153 |
3de4cfc4-3fe6-4f4c-9803-9782eb7496ce | Mistcase/chess-engine | ParsingFunctional.cpp | #include "ParsingFunctional.h"
int SubString(std::string str, std::string subString)
{
for (unsigned int i = 0; i < str.size(); i++)
{
bool flag = true;
for (unsigned int j = 0; j < subString.size(); j++)
{
if (i + j < str.size() && str[i + j] != subString[j])
{
flag = false;
break;
}
}
i... | TOOL | 0.887099 | 4.310815 |
f9a3fc3e-912d-4aa6-8626-60059196d08f | dhiraj-02/Competetive-Programming | alice-potter-and-dumbledore-codechef.cpp | //https://www.codechef.com/COOK144C/problems/DUMBLEDORE
#include <iostream>
#include<map>
#include<vector>
using namespace std;
int main() {
// your code goes here
ios_base::sync_with_stdio(false);
cin.tie(NULL);
long long n,m;
cin>>n>>m;
vector<long long int> a(n+1,0);
long long ans=0;
//vector<long> v... | ALGO | 0.999819 | 3.505701 |
0b7dc584-6cb3-42ff-b096-c184cc5c07bb | bugph0bia/DeZeroCpp | DeZeroCpp/steps/step29.cpp | #include "pch.h"
#include "../dezero/dezero.hpp"
using namespace dz;
namespace step29 {
VariablePtr f(const VariablePtr& x)
{
auto y = power(x, 4) - 2 * power(x, 2);
return y;
}
NdArrayPtr gx2(const NdArrayPtr& x)
{
auto y = 12.0 * nc::power(*x, 2) - 4.0;
return as_array(y);
}
void step29()
{
auto x = as_var... | ALGO | 0.998383 | 3.701263 |
dfe89876-2d74-4e05-8958-59d10f3895db | nv-0203/Data-Structures | Linked List/07_remove_duplicate.cpp | #include <iostream>
using namespace std;
struct Node{
int data;
Node *next;
Node (int x)
{
data=x;
next=NULL;
}
};
void remove_duplicate(Node *head)
{
Node *curr;
Node *temp;
curr=head;
while (curr->next != NULL && curr != NULL)
{
if (curr->data == ... | ALGO | 0.998668 | 4.324616 |
3375bc04-d324-4a2c-8e04-0754dafecd0c | nmp9981/coding_daily_2022 | 20221015_prog12902.cpp | #include <string>
#include <vector>
typedef long long ll;
using namespace std;
const int maxi = 5001;
const ll mod = 1000000007;
ll dp[maxi];//타일 채우는 경우의 수
//타일 채우기
void tile(){
dp[2] = 3;dp[0] = 1;
for(int i=4;i<maxi;i++){
dp[i] = 3*dp[i-2];
for(int j=i-4;j>=0;j-=2) dp[i]+=(2*dp[j]);
d... | ALGO | 0.999976 | 4.563602 |
728b3d01-2e7e-4a3d-a138-9b0ee1d65792 | vmware001/cpp | findfactor_new.cpp | #include <iostream>
#include <vector>
#include <chrono>
using namespace std;
void findFactor(vector<long long>& factorArray, long long num) {
long long i = 2;
long long fixedNum = num;
while (i * i <= fixedNum && num != 1) {
if (num % i == 0) {
factorArray.push_back(i);
num = num / i;
}
else {
i++;
... | ALGO | 0.99819 | 4.554193 |
f1458722-f7fd-48cf-8ecc-01757a5fa3b3 | okuraofvegetable/PKU | 2154.cpp | #include <cstdio>
using namespace std;
typedef long long ll;
int MOD;
int mod_pow(ll a,int x)
{
ll res=1;
while(x>0)
{
if(x&1)res = (res*a)%MOD;
a = (a*a)%MOD;
x >>= 1;
}
return (int)res;
}
int euler(int x)
{
int res = x;
for(int i=2;i*i<=x;i++)
{
if(x%i==0)
{
while(x%i==0)x/=i;
res /= i;
res... | ALGO | 0.99992 | 4.419468 |
e36e81b4-30e0-400e-bcbb-c2def2deb345 | hungnt61h/PTIT-Algorithms | Contest_28072017/A.cpp | #include <iostream>
using namespace std;
long long len[10000];
void init() {
len[1] = 1;
len[2] = 1;
for (int i = 3; i <= 100; i++)
len[i] = len[i-1] + len[i-2];
}
char find(const char *a, const char *b, long long n, long long i) {
while (n > 2) {
if (i <= len[n-2]) {
n -= 2;
} else {
i -= len[n-2];... | ALGO | 0.999825 | 3.468822 |
f68d09f2-4f63-4ca1-a244-d108a9e479f9 | ly-ntc/PTIT_CODE | dsa samsung/seq1.cpp | // #include<bits/stdc++.h>
// using namespace std;
// int n;
// long a[1000005];
// long long b[1000005];
// long long cal(long l, long r)
// {
// if(l==r) return a[l];
// if(l>r) return -1e9;
// long mid=(l+r)/2;
// long long res1=cal(l,mid);
// long long res2=cal(mid+1,r);
// long long minb=1... | ALGO | 0.999809 | 4.135928 |
aaf04f50-bf7f-4047-a67a-658c1a70ee9f | Duck4705/Algorithm | Thuat_toan_to_hop.cpp | #include <bits/stdc++.h>
using namespace std;
long long NcR(int n, int r)
{
long long p = 1, k = 1;
// C(n, r) == C(n, n-r),
// choosing the smaller value
if (n - r < r)
r = n - r;
if (r != 0) {
while (r) {
p *= n;
k *= r;
// gcd of p, k
... | ALGO | 0.999163 | 4.222215 |
4d81d677-abad-4324-b1f1-e722148492a3 | gagandeepahuja09/Trees | LeetCode/Maximum Product Of Splitted Binary Tree.cpp | /**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode(int x) : val(x), left(NULL), right(NULL) {}
* };
*/
class Solution {
public:
vector<int> pre, suff;
int sum, total, ans;
void normal(TreeNode* root) {
... | ALGO | 0.999964 | 6.189476 |
debdd2f2-bbd0-47d8-b07d-79142a22b253 | WangSimiao2000/GAMES101-Assignments | opencv/sources/modules/video/src/ecc.cpp | #include "precomp.hpp"
/****************************************************************************************\
* Image Alignment (ECC algorithm) *
\****************************************************************************************/
using namespace cv;
s... | ALGO | 0.999908 | 4.293699 |
9b787b2f-f9e5-47d2-bf01-f3b3ed700daf | Usofl/Programmers_practice | Programmers_practice/TriangulSnail/TriangulSnail.cpp | #include <string>
#include <vector>
using namespace std;
vector<int> solution(int n) {
vector<int> answer;
vector<int> snail;
snail.reserve(n * n);
int row = 0;
int col = 0;
int cross = 0;
int num = 1;
for (int i = 0; i < (n / 2) + 1; ++i)
{
for (int j = col; j < n - col - row; ++j)
{
snail[(n * (j ... | ALGO | 0.999945 | 5.076701 |
2dcb1f22-2e33-4669-856a-52f9f18e0ca6 | madhav-bits/Coding_Practice | leetNumPairsStrsConcatEqlTarget.cpp | /*
*
//****************************************2023. Number of Pairs of Strings With Concatenation Equal to Target.****************************************
https://leetcode.com/problems/number-of-pairs-of-strings-with-concatenation-equal-to-target/
*******************************************************************TE... | ALGO | 0.999694 | 6.766114 |
da9d2792-95f8-491a-ab2a-cbaee43ca55d | SourabhYelluru131/just-lockdown-problems | Day17-02.05.2020/Queue_Implementation/Queue_Implementation_with_Linked_List.cpp | // Implementation of Queue with Linked Lists
#include <iostream>
using namespace std;
// enqueue() -> pushes an element into the end of the queue
// dequeue() -> pops the first element of the queue (LIFO)
// empty() -> returns true if queue is empty, else returns false
... | ALGO | 0.998869 | 4.651378 |
125c1766-1613-4b44-a929-176e9c60ded3 | antimodular/ofxPolyFit-scattered | ofxPolyFit_Scattered_4rd_order/src/ofApp.cpp | #include "ofApp.h"
//float panList[] = {957.714,58.2857,86.4847,656,89.1429,1.6609,563.429,68.5714,-40.5663,320,61.7143,-87.9866,316.572,267.429,-55.5973,313.143,442.286,-38.9867,344,668.571,-25.7325,553.143,630.857,-9.0661,693.714,620.571,5.02,957.714,675.429,26.7333,786.286,538.286,13.9715,580.572,435.429,-7.6081};
... | ALGO | 0.965161 | 4.121616 |
2b062ad9-e655-4456-a72e-7e4debf15938 | hritiktambe/DSA | LinkedList/RemoveNthNode.cpp |
struct ListNode
{
int val;
ListNode *next;
ListNode(int val) : val(val), next(nullptr) {}
};
class Solution
{
public:
ListNode *removeNthFromEnd(ListNode *head, int n)
{
ListNode *t = head;
while (n > 0 and t)
{
n--;
t = t->next;
}
... | ALGO | 0.999966 | 5.995628 |
688dbd6b-1dd8-41c4-a685-89f23beea609 | ryan-jonesford/Path-Planning | src/Eigen-3.3/doc/examples/TutorialLinAlgComputeTwice.cpp | #include <iostream>
#include <Eigen/Dense>
using namespace std;
using namespace Eigen;
int main()
{
Matrix2f A, b;
LLT<Matrix2f> llt;
A << 2, -1, -1, 3;
b << 1, 2, 3, 1;
cout << "Here is the matrix A:\n" << A << endl;
cout << "Here is the right hand side b:\n" << b << endl;
cout << "Computing LLT... | ALGO | 0.999903 | 3.145425 |
cf36bcca-0c48-4634-81b9-f19c7e9706f3 | SRkuma/cpp | ABC/073/b-theater/main.cpp | #include<iostream>
typedef long long ll;
#define FOR(i,a,b) for(ll i = (a);i < (b);++i)
#define REP(i,n) FOR(i,0,n)
#define debug(x) cout << #x << "=" << x << endl;
using namespace std;
int main(void){
int N;
cin >> N;
int l , r;
int ans = 0;
REP(i,N){
cin >> l >> r;
ans += r - l + 1;
}
... | ALGO | 0.998586 | 3.579433 |
d670c074-29f2-4617-bc76-110f6a7177f4 | HumsterZOO/Home-work | 5)Расчёт суммы всех,чётных,нечётных чисел диапозона.cpp | #include <iostream>
using namespace std;
void main()
{
setlocale(LC_ALL, "ru");
int var,summ = 0,from, to;
cout << "Введите начало диапозона :" << endl;
cin >> from;
cout << "Введите конец диапозона :" << endl;
cin >> to;
cout << "\tВыберети действие\n1 - Сумма всех чисел\n2 - Сумма всех чётных чисел\n3 - сумма... | ALGO | 0.997946 | 3.249829 |
3516baf2-358b-4c58-bd59-91945563a506 | NIrmalpat3l/codeforces | fafacomp.cpp | #include<bits/stdc++.h>
using namespace std;
void code(){
long long int n,cnt=0;
cin>>n;
for(int i=1;i<=n/2;i++){
if(n%i==0){
cnt++;
}
}
cout<<cnt;
}
int main(){
code();
return 0;
} | ALGO | 0.999794 | 4.696874 |
61566f21-8fc4-4db1-845f-d1f55a69f347 | Dangonizer/ADS | ADS_P2_2_Hashtable/hashtable.cpp | #include "hashtable.h"
#include <iostream>
using namespace std;
HashTable::HashTable(int size, double threshold, int methode) : size(size), threshold_rehashing(threshold), m_sondierMethode(methode), elements(0), collisionCount(0)
{
hashTable = new vector<int>(size);
for (int i = 0; i < size; i++)
{
hashTable->at... | ALGO | 0.998766 | 4.706561 |
429ab35d-804c-4e6c-81ca-6dcd6928744f | Hima0X2/UVA | 374 - Big Mod.cpp | /// BISMILLAHIR RAHMANIR RAHIM
#include<bits/stdc++.h>
using namespace std;
#define endl '\n'
#define optimize() ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define fraction() cout.unsetf(ios::floatfield); cout.precision(10); cout.setf(ios::fixed,ios::floatfield);
long long int lcm(long long int a,long long b)... | ALGO | 0.999995 | 3.880707 |
111e3c14-b752-44f6-a6c4-acb3a2ef7b29 | Mohammad-debug/FWI_CUDA | src/h_preproc_PSV.cpp | //h_preproc_PSV.hpp
/*
* Created by: Min Basnet
* 2020.December.09
* Kathmandu, Nepal
*/
// preprocessing in host
// staggering material & PML coefficients computation
#include "h_preproc_PSV.hpp"
#include <math.h>
#include <iostream>
#include <fstream>
void alloc_varpre_PSV( real *&hc, int *&isurf, int *&npml, // ... | ALGO | 0.98884 | 3.735221 |
e5ac5eb3-977b-492e-bd4f-abede854ce0f | KylerM-23/Univeristy-Lectures | ECE1310-C-Programming/Exercises 81-100/Exercise 99/Exercise 99/Exercise 99.cpp | // Exercise 99.cpp : This file contains the 'main' function. Program execution begins and ends there.
//
#include <iostream>
using namespace std;
void cube(int* number)
{
*number = *number * *number * *number;
}
int main()
{
int n;
cout << "Enter an integer\n";
cin >> n;
cout << "\nThe cube of " <... | TOOL | 0.99124 | 4.27541 |
57414c17-e5fe-4723-bdbc-39b8d700179c | luuvus/Udacity-SelfDrivingCar-T2-P5-ModelPredictiveControl | src/Eigen-3.3/failtest/colpivqr_int.cpp | #include "../Eigen/QR"
#ifdef EIGEN_SHOULD_FAIL_TO_BUILD
#define SCALAR int
#else
#define SCALAR float
#endif
using namespace Eigen;
int main()
{
ColPivHouseholderQR<Matrix<SCALAR,Dynamic,Dynamic> > qr(Matrix<SCALAR,Dynamic,Dynamic>::Random(10,10));
}
| TEST | 0.909831 | 3.159166 |
95bbf93e-3d23-4fed-9044-f68986db4c99 | longpth/RoLabsSlam | ThirdParty/eigen/unsupported/doc/examples/FFT.cpp | // To use the simple FFT implementation
// g++ -o demofft -I.. -Wall -O3 FFT.cpp
// To use the FFTW implementation
// g++ -o demofft -I.. -DUSE_FFTW -Wall -O3 FFT.cpp -lfftw3 -lfftw3f -lfftw3l
#ifdef USE_FFTW
#include <fftw3.h>
#endif
#include <vector>
#include <complex>
#include <algorithm>
#include <iterator>
... | ALGO | 0.995464 | 6.39609 |
f3223981-0382-4d8e-a240-bda2e056c77a | Devika03/Leetcode_Daily_progress | 0107-binary-tree-level-order-traversal-ii/0107-binary-tree-level-order-traversal-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.999974 | 6.180278 |
cf048506-99aa-48bb-ad1d-4adb1086ad04 | ParasBhardava/LeetCode | 1530-number-of-good-leaf-nodes-pairs/1530-number-of-good-leaf-nodes-pairs.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.999982 | 6.024076 |
d7372f92-1502-4694-949a-0088eaa3d43a | docclaus/Programacion-UD2 | Pro evolution/pro.cpp | //ejercicio pro evolution soccer, haciendo que el usuario introduzca las coordenadas de la esquina superior izquierda y la de abajo superior derecha
#include <iostream>
using namespace std;
int main(){
int tx, ty, bx, by, dx, dy; //los que introducirá el usuario
int cx, cy, ax, ay; //los de las igualdades
cout <... | ALGO | 0.999516 | 3.202357 |
2d92807a-9430-423b-92e9-3fef86a10882 | Aadarsh04/DSA-Practice | Day-25/4DefaultArguments.cpp | #include<iostream>
using namespace std;
void print(int arr[], int n, int start=0){
for(int i=start;i<n;i++){
cout<<arr[i]<<endl;
}
}
int main(){
int arr[5]={1,4,7,8,9};
int size=5;
print(arr, size);
cout<<endl;
print(arr, size, 2);
return 0;
} | ALGO | 0.995544 | 4.726791 |
131dacbe-9697-45c5-9ffd-03fddb654a69 | erlonL/EstruturaDeDados | teste.cpp | #include <iostream>
#include <chrono>
#include <thread>
int main() {
std::cout << "Contagem regressiva: " << std::endl;
for (int i = 0; i < 5; ++i) {
std::cout << 5 - i << std::endl;
std::this_thread::sleep_for(std::chrono::seconds(1)); // Espera por 1 segundo
}
std::cout << "Fim da co... | TOOL | 0.871585 | 4.717043 |
d71c1741-f3f3-4de7-a5f6-12449328d85b | hidog/http_server | boost_1_63_0_source/libs/type_traits/examples/copy_example.cpp | #include <iostream>
#include <typeinfo>
#include <algorithm>
#include <iterator>
#include <memory>
#include <boost/test/included/prg_exec_monitor.hpp>
#include <boost/timer.hpp>
#include <boost/type_traits.hpp>
using std::cout;
using std::endl;
using std::cin;
namespace opt{
//
// opt::copy
// same semantics as std... | ALGO | 0.960338 | 5.917429 |
de348ea6-d616-4be5-8c46-7984131b8373 | oxygen-hunter/Flashboom | data/big-vul-100/add_attention_code/Phi/top0-100/minimum-time-takes-to-reach-destination-without-drowning-Solution2.minimumSeconds/177927_nan.cpp | PHP_FUNCTION(openssl_seal)
{
zval *pubkeys, *pubkey, *sealdata, *ekeys, *iv = NULL;
HashTable *pubkeysht;
EVP_PKEY **pkeys;
zend_resource ** key_resources; /* so we know what to cleanup */
int i, len1, len2, *eksl, nkeys, iv_len;
unsigned char iv_buf[EVP_MAX_IV_LENGTH + 1], *buf = NULL, **eks;
char * data;
size... | ALGO | 0.999108 | 5.561951 |
3e79957c-5665-4758-afc4-70f4be587c4c | Ankur02Sarkar/Striver-s-A-Z-DSA | 1.2 Patterns/4-triangle-with-num-2.cpp | #include<iostream>
using namespace std;
int main(){
int row = 5;
for(int i = 0 ; i < row ; i++){
for(int j = 0 ; j <= i ; j++){
cout<<i+1;
}
cout<<"\n";
}
return 0;
} | ALGO | 0.999706 | 3.522912 |
b5d87836-022d-4604-aa45-fc3a218ca66d | moondemon68/cp | Codeforces/PastContests/987/987C.cpp | #include <bits/stdc++.h>
#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define MOD 1000000007
#define pii pair<int,int>
#define LL long long
using namespace std;
int main () {
//clock_t start = clock();
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
... | ALGO | 0.999959 | 3.2838 |
dbf8ae42-6fd5-41ed-9238-beb86793ee34 | SaurabhMaurya9695/cpp-questions- | CPP course/B. T-primes.cpp | #include<bits/stdc++.h>
using namespace std;
#define ll long long
#define ff first
#define ss second
#define sort(a) sort(a.begin() , a.end())
#define rev(a) reverse(a.begin() , a.end())
#define fast \
ios_base::sync_with_stdio(0); \
cin.tie(0); \
cout.tie(0);
#define... | ALGO | 0.999941 | 4.2651 |
4d72127d-026f-4139-aa33-54c28e328163 | ParticulateFlow/LIGGGHTS-PFM | src/GPU/pair_mie_cut_gpu.cpp | /* ----------------------------------------------------------------------
Contributing author: Trung Dac Nguyen (ORNL)
------------------------------------------------------------------------- */
#include "lmptype.h"
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include "pair_mie_cut_gpu.h"
#include "at... | ALGO | 0.997684 | 4.859046 |
caeeda15-f5dd-4ffa-ac94-91f4b8754bdf | Hasan-Saju/Competitive-Programming | Codeforces/1525B.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
int t;
cin>>t;
for(int i=0;i<t;i++)
{
int n;
cin>>n;
vector<int>v;
bool zero =true;
for(int j=1;j<=n;j++)
{
int x;
cin>>x;
v.push_back(x);
if(j!=x... | ALGO | 0.999766 | 3.445196 |
f8d7703f-3bdb-49fe-aec0-532baa32e3cc | javagovindsharma/leetscode | lcci/01.04.Palindrome Permutation/Solution2.cpp | class Solution {
public:
bool canPermutePalindrome(string s) {
unordered_set<char> vis;
for (auto& c : s) {
if (vis.count(c)) {
vis.erase(c);
} else {
vis.insert(c);
}
}
return vis.size() < 2;
}
}; | ALGO | 0.999601 | 6.334505 |
324414a5-e154-4d4f-ad82-3a22aad947d3 | Scholasticpal/DSA_Practice | GFG/Trees/LeftViewofBinaryTree2.cpp | // Solution 2: Iterative- Level order Traversal and print only val at i = 0
// TC: Theta(n)
// SC: Theta(w) or O(n)
#include<iostream>
#include <queue>
using namespace std;
struct Node{
Node *left;
Node *right;
int key;
Node(int k){
key = k;
left = right = NULL;
}
};
void LeftView2... | ALGO | 0.999956 | 4.417412 |
490653a4-f75f-48c6-948a-bc73c45f5815 | cksharma/coding | cpp/topcoder/Past SRMs/EnlargeTheCave.cpp | #include <bits/stdc++.h>
using namespace std;
array<int, 4> dx = {-1, 0, 1, 0};
array<int, 4> dy = {0, -1, 0, 1};
class EnlargeTheCave {
public:
void fill(int x, int y, int& cnt, int& desiredArea,
vector<string>& ans, vector<string>& cave, vector<vector<bool>>& can_go) {
if (cnt >= desiredArea) return;
fo... | ALGO | 0.99937 | 5.310216 |
833d23f6-4427-484f-aa4c-59b343bf566b | CraftOldWang/data_structure | hw_sol/hw4/2delete_all.cpp | #include <forward_list>
#include <fstream>
#include <iostream>
using namespace std;
template <class T>
class Stack {
private:
forward_list<T> fl;
int size;
public:
Stack()
: size(0)
{
}
~Stack()
{
}
void push(T data)
{
fl.push_front(data);
size += 1;
... | ALGO | 0.999235 | 4.236331 |
6b715de9-87df-45e2-ad3a-755c089fe9af | harish3110/SDCND-P10-Model_Predictive_Control | src/Eigen-3.3/doc/examples/tut_arithmetic_redux_basic.cpp | #include <iostream>
#include <Eigen/Dense>
using namespace std;
int main()
{
Eigen::Matrix2d mat;
mat << 1, 2,
3, 4;
cout << "Here is mat.sum(): " << mat.sum() << endl;
cout << "Here is mat.prod(): " << mat.prod() << endl;
cout << "Here is mat.mean(): " << mat.mean() ... | ALGO | 0.997667 | 3.872858 |
cc9ab1ad-07cb-42a6-b1e1-d81c21a0f519 | P76ers/cpp | vorlesung/17.11/2.cpp | #include <iostream>
/*
Lassen Sie vom Benutzer Größe und Gewicht eingeben und berechnen Sie dazu den Bodymaßindex (BMI).
Bewerten Sie den BMI der Benutzer, indem Sie ausgeben
- "Untergewicht",
- bmi < 25
- "Normalgewicht",
- bmi >= 25
- "Übergewicht 1 (Untergroß)",
- bmi >= 30
- "Übergewicht 2, Arzt konsultiere... | TOOL | 0.959674 | 4.839928 |
55fba553-fe1b-4b60-8e9b-cb37c09fe1b6 | ishandutta2007/codeforces | qyhamster/normal/1404/C.cpp | #ifdef LOCAL
#include <iostream>
#include <vector>
#include <queue>
#else
#include <bits/stdc++.h>
#endif
using namespace std;
const int maxn = 3e5 + 5;
#define pii pair<int,int>
int bit[maxn],bit2[maxn],a[maxn],res[maxn];
pair<pii,int> q[maxn];
vector<int> tim[maxn];
int sgn[maxn];
void add(int* arr, int x, int val)
{... | ALGO | 0.999958 | 3.436009 |
88c00e8d-5257-4f62-9071-9602897be0d8 | iagozag/competitive_programming | contests/cf/group/trem/527273/a/a.cpp | #include <bits/stdc++.h>
using namespace std;
#define _ ios_base::sync_with_stdio(0);cin.tie(0);
#define rep(i,x,n) for(auto i=x;i<n;i++)
#define repr(i,n,x) for(auto i=n;i>=x;i--)
#define forr(x, v) for(auto& x: v)
#define all(a) (a).begin(), (a).end()
#define sz(a) (int)(a.size())
#define endl '\n'
#define ff first
... | ALGO | 0.999988 | 5.012319 |
16f0e7b2-2aae-4874-868b-6112d2489b88 | saurabhsrivastava2001/Data_Streucture_Algorithms_full | g-stack_queue/queue/implementation_of_queue_using_array_structural_programming.cpp | // this is the implementation of the queue using array , structural programming
#include <iostream>
using namespace std;
void push(int* & arr,int & rear,int d){
arr[rear]=d;
rear++;
}
void pop(int * & arr, int &front,int &rear){
if (front==rear){
cout<<"empty queue";
}
else {
arr[... | ALGO | 0.999122 | 4.494651 |
fa294ac7-aff6-4068-b8ce-33983ecb503d | HaiAu2501/Data-Structures-and-Algorithms-using-C | A3 - Backtracking/09_SolutionCount_1.cpp | #include <iostream>
#include <vector>
using namespace std;
typedef long long ll;
// ĐỀ BÀI: Đếm số nghiệm nguyên dương x[1..n] của phương trình a[1]x[1] + a[2]x[2] + ... + a[n]x[n] = M (*)
/* ĐẦU VÀO:
| - Dòng thứ nhất là 2 số nguyên dương n và M.
| - Dòng thứ hai là n số nguyên dương a[1..n].
*/
// ĐẦU RA: Số ... | ALGO | 0.999988 | 4.106955 |
56283739-222b-4370-946d-0eefbb55b3a1 | iamhemantgauhai/HiveDB_EditingApp | 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.998859 | 6.785645 |
e7f037f3-5be7-4a98-a95b-8b3f7a06a88e | raincross7/code-similarity | codes/train_code/problem278/problem278_254.cpp | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
using namespace std;
using ll = long long;
using P = pair<int, int>;
const long long MOD = 1000000007;
const long long INF = 1LL << 60;
int main()
{
string s1, s2;
cin >> s1 >> s2;
int dp[s1.size() + 10][s2.size() + 10];
for (int i = 0; ... | ALGO | 0.999992 | 4.342311 |
37b4130a-a590-4481-89c4-0306399bf82e | ishandutta2007/codeforces | kostka/normal/1054/D.cpp | //Bartek Kostka
// You are not prepared!
#include "bits/stdc++.h"
using namespace std;
#define x first
#define y second
#define SZ(x) int(x.size())
#define ll long long
#define pii pair <int, int>
#define vi vector <int>
#define ALL(x) x.begin(), x.end()
#ifdef LOCAL
template<class TH> void _dbg(const char *sdbg, ... | ALGO | 0.99999 | 4.174361 |
b225f104-2d36-40fc-a75a-1b7cb9d85100 | timniku/rust-opencv | OpenCV/opencv-4.5.1/modules/flann/src/flann.cpp | #include "precomp.hpp"
#include "opencv2/flann.hpp"
namespace cvflann
{
/** Global variable indicating the distance metric to be used.
* \deprecated Provided for backward compatibility
*/
flann_distance_t flann_distance_type_ = FLANN_DIST_L2;
flann_distance_t flann_distance_type() { return flann_d... | CONFIG | 0.881152 | 3.668378 |
e5c73160-fd8d-4e4b-a343-0a0235cd186e | hiro1729/atcoder | ABC/ABC301-400/ABC351/C/C.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int N;
cin >> N;
vector<int> A(N);
for (int i = 0; i < N; i++) {
cin >> A[i];
}
vector<int> B;
for (int i: A) {
while (B.size() >= 1 && B.back() == i) {
B.pop_back();
i++;
}
B.push_back(i);
}
cout << B.size() << '\n';
} | ALGO | 0.999906 | 4.45232 |
7df2add0-b2a1-4cc1-99c8-ec2a62966677 | nullist0/ProblemSolving | Baekjoon Problems/1987.cpp | #include <cstdio>
#include <iostream>
#include <string>
#include <algorithm>
using namespace std;
int R, C;
char map[21][21];
int route[26];
int dir[4][2] = {{1, 0}, {-1, 0}, {0, 1}, {0, -1}};
int res = 0;
void move(int y, int x, int ret){
res = max(ret, res);
if(route[map[y][x] - 'A'] == 0){
route[map[y][x] - ... | ALGO | 0.998806 | 3.740188 |
faba25f7-2291-4819-9a5d-3f436eec19e4 | SuchitanKulkarni/Programming_Practice | DS Practice/q2.cpp | #include<iostream>
#define MAX 50
using namespace std;
class node
{
public:
int data;
node*next;
node()
{
data = 0;
next = NULL;
}
node(int a)
{
data = a;
next = NULL;
}
~node()
{
cout<<"\nnode deleted"<<endl;
}
};
class Queue
{
int data[MAX];
node* front;
node* rear;
public:
... | ALGO | 0.998743 | 4.114406 |
05716219-52bb-4155-b501-b4eab9ba9a0c | ishandutta2007/codeforces | khuepr123/normal/1725/C.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;
#define endl '\n'
#define fi first
#define se second
#define For(i, l, r) for (auto i = (l); i < (r); i++)
#define ForE(i, l, r) for (auto i = (l); i <= (r); i++)
#def... | ALGO | 0.999829 | 3.611427 |
4052a231-3b7c-4b91-bfd3-f4e9d91d2ac4 | hmtrung2305/usaco_guide | usaco/gold/graphs/disjoint_set_union/moocast.cpp | #include <bits/stdc++.h>
struct Edge {
int u, v, distance;
};
struct DisjointSetUnion {
int numNode;
std::vector<int> parrentNode;
std::vector<int> rankNode;
DisjointSetUnion(int inputNode) : numNode(inputNode) {
parrentNode.resize(numNode);
iota(parrentNode.begin(), parrentNode.end(), 0);
rankNode.assign... | ALGO | 0.999934 | 4.803486 |
d87568ed-2953-4680-9053-e23cb32b8f97 | Oriburger/problem_solving_1w3solve | BOJ/1744_수묶기.cpp | #include <bits/stdc++.h>
using namespace std;
int n, ans=0;
int neg = 0, pos = 0, zero = 0;
deque<int> arr;
int GetAndPop(bool bIsFront) //deque의 앞과 뒤에서 데이터를 뽑아옴
{
int ret = (bIsFront ? arr.front() : arr.back());
if(bIsFront) arr.pop_front();
else arr.pop_back();
return ret;
}
int main()
{
ios::sync_with_stdi... | ALGO | 0.999994 | 4.607835 |
9fcbe505-c6e8-4fe0-a203-01bf20923e65 | Bossppp/Comprog | midtermPrep/midterm_P2.cpp | #include <cmath>
#include <iostream>
#include <math.h>
using namespace std;
int main(){
double h,t,u,g,r,theta;
g = 10;
cin >> u >> theta >> t;
double rad = theta * (M_PI/180);
double rad2 = theta * (180/M_PI);
h = (t - ((u*sin(rad))/g)) * ( (u*sin(rad)) + (0.5*g)*(t-(3*((u*sin(rad))/g))) );
... | ALGO | 0.998079 | 3.296413 |
dc1937c3-a4e5-436a-a195-31958641f0a5 | adityapotdar23/Leetcode-Daily-Challenge | October 2023 Challenge/D21 - Constrained Subsequence Sum.cpp | class Solution {
public:
int constrainedSubsetSum(vector<int>& nums, int k) {
deque<int> dq;
for(int i=0;i<nums.size();i++)
{
if(!dq.empty())
{
nums[i] += nums[dq.front()];
}
while(!dq.empty() && (i-dq.front()>=k || nums[i]>=num... | ALGO | 0.999993 | 5.671399 |
ed9020a9-3078-4b61-8240-b8a1e2dbacf6 | DISASTER-RUMBLING/CODE | 算法/排序算法/Leetcode 219 存在重复元素Ⅱ.cpp | #define _CRT_SECURE_NO_WARNINGS
#include<vector>;
#include<algorithm>;
using namespace std;
class Solution {
public:
bool containsNearbyDuplicate(vector<int>& nums, int k) {
int a = nums.size();
vector<int> n(a);
for (int i = 0; i < a; i++) {
n[i] = i;
}
sort(n.b... | ALGO | 0.999985 | 5.489791 |
3b517bfe-0ccf-4116-b8be-fb7b67ca1552 | AnuragMacOS/DSA | LinkedList_Leetcode/Delete the Middle Node of a Linked List.cpp |
class Solution {
public:
ListNode* deleteMiddle(ListNode* head) {
if(head == NULL || head->next == NULL) return NULL;
ListNode* slow = head;
ListNode* fast = head;
ListNode* prev = NULL;
while(fast!= NULL && fast->next != NULL){
prev = slow;
slow = slow->next;
... | ALGO | 0.999729 | 6.015779 |
fb279ef8-df6c-48e8-a463-32c13a45bf27 | viren-joshi/DSASubmissions | problems/trapping_rain_water/solution.cpp | class Solution {
public:
int trap(vector<int>& height) {
int l = 0, r = height.size() - 1, sum = 0;
int leftMax = height[l], rightMax = height[r];
while(l < r) {
if(leftMax < rightMax) {
l++;
leftMax = max(leftMax, height[l]);
sum +... | ALGO | 0.999979 | 6.868612 |
a8fd5a8f-db35-406d-b4c8-63b6fc4e3d80 | flash1230/leetcode_solutions | solutions/1501-2000/1502_can_make_ap_from_sequence.cpp | /* https://leetcode.com/problems/can-make-arithmetic-progression-from-sequence/
1502. Can Make Arithmetic Progression From Sequence
Easy
Sorting
*/
class Solution
{
public:
bool canMakeArithmeticProgression(vector<int> &arr)
{
sort(arr.begin(), arr.end());
int diff = arr[1] - arr[0];
for... | ALGO | 0.999919 | 5.90015 |
308b6473-8605-469a-9cc3-c26d2546ff8d | ishandutta2007/codeforces | shapo/normal/321/B.cpp | #include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cassert>
#include <cmath>
#include <algorithm>
#include <vector>
using namespace std;
#define maxn 150
int n, m;
vector < int > atk, def;
int ciel[maxn];
char buf[maxn];
int maxHarm[maxn][maxn];
int main()
{
scanf("%d%d", &n, &m);
for (int i = 0; i... | ALGO | 0.999826 | 3.479808 |
32005cc2-af8c-4891-ad26-49418a8d8448 | 113bommy/deepmind_codecontests_refine | cpp_gold_filter_file/cpp_train_7923_17.cpp | #include <bits/stdc++.h>
int u[20], v[20], seat[20];
long long num[(1 << 16)];
int n, m;
long long y;
void input() {
int i, a, b;
memset(seat, 0, sizeof(seat));
for (i = 1; i <= m; i++) {
scanf("%d%d", &a, &b);
seat[a - 1] |= 1 << (b - 1);
}
}
void init() {
int i;
m = (1 << n) - 1;
for (i = 0; i <... | ALGO | 0.999946 | 3.213128 |
3056cd49-22a0-4c5e-8592-887c7830b366 | Blacksuan19/CPP-Lang | watermelon.cpp | // #! bashism!!
#include <iostream>
#include <iomanip>
using namespace std;
int main()
{
int weight;
cin >> weight;
if (weight > 2 && weight % 2 == 0)
{
cout << "YES" << endl;
}
else
{
cout << "NO" << endl;
}
return 0;
} | ALGO | 0.99945 | 3.33294 |
d3d4bf31-519b-4890-b745-bd0cde9d7b83 | Lavashick/181_351_Smetanina | Laboratory_12/opencv/sources/modules/core/src/kmeans.cpp | #include "precomp.hpp"
#include <opencv2/core/utils/configuration.private.hpp>
#include <opencv2/core/hal/hal.hpp>
////////////////////////////////////////// kmeans ////////////////////////////////////////////
namespace cv
{
static int CV_KMEANS_PARALLEL_GRANULARITY = (int)utils::getConfigurationParameterSizeT("OPEN... | ALGO | 0.999781 | 7.032552 |
25f03369-c43b-483e-94f7-849b8db4530f | IvanRenison/ProgrammingProblems | Training camps, courses and books/Training Camp Argentina - 2024/#3/G.cpp | // https://codeforces.com/group/5GNF7zti59/contest/535420/problem/G
#include <bits/stdc++.h>
#define fst first
#define snd second
#define pb push_back
#define SZ(x) ((ll)x.size())
#define ALL(x) x.begin(),x.end()
#define fore(i,a,b) for(ll i=a,gmat=b;i<gmat;++i)
using namespace std;
typedef long long ll;
typedef vector... | ALGO | 0.999928 | 3.568626 |
96185f8a-70c3-4694-9740-b87268d1b953 | NYU-ZYJCS/Leetcode | 1778-shortest-path-in-a-hidden-grid/1778-shortest-path-in-a-hidden-grid.cpp | /**
* // This is the GridMaster's API interface.
* // You should not implement it, or speculate about its implementation
* class GridMaster {
* public:
* bool canMove(char direction);
* void move(char direction);
* boolean isTarget();
* };
*/
class Solution {
public:
int findShortestPath(Gri... | ALGO | 0.999907 | 6.142464 |
1926419a-81ad-4bbe-90c8-fb0d72db96d8 | ches51311/leetcode | 19/remove_Nth_node_from_end_of_list.cpp |
#include <iostream>
struct ListNode {
int val;
ListNode *next;
ListNode() : val(0), next(nullptr) {}
ListNode(int x) : val(x), next(nullptr) {}
ListNode(int x, ListNode *next) : val(x), next(next) {}
};
class Solution {
public:
ListNode* removeNthFromEnd(ListNode* head, int n) {
ListN... | ALGO | 0.99985 | 5.851576 |
5636c26c-700b-4302-af4e-76cd04e49ca4 | kiiimiiin/Algorithm | 프로그래머스/2/12953. N개의 최소공배수/N개의 최소공배수.cpp | #include <string>
#include <vector>
using namespace std;
int getGCD(int n, int m){
if(n % m == 0) return m;
return getGCD(m, n % m);
}
int getLCM(int n, int m){
return n * m / getGCD(n, m);
}
int solution(vector<int> arr) {
int answer = arr[0];
for(int i = 1; i < arr.size(); i++)
ans... | ALGO | 0.999968 | 5.211491 |
3e931906-f730-43cd-93ca-1743f85fd94c | ksiminski/neuro-fuzzy-library | source/partitions/fcm-conditional.cpp | /** @file */
#include <cmath>
#include <vector>
#include <list>
#include <algorithm>
#include <random>
#include <chrono>
#include "../common/dataset.h"
#include "../descriptors/descriptor-gaussian.h"
#include "partitioner.h"
#include "partition.h"
#include "fcm.h"
#include "fcm-conditional.h"
#include "../service/deb... | ALGO | 0.998103 | 5.875298 |
160eda2c-6e4c-4e92-b88b-727d5b132e24 | shrsu/code | C++/Dojo/asteroids.cpp | #include <iostream>
#include <vector>
#include <stack>
#include <cmath>
#include <algorithm>
using namespace std;
vector<int> findAsteroids(vector<int> asteroids)
{
int n = asteroids.size();
if (n < 1)
{
return {};
}
stack<int> ans;
for (int i = 0; i < n; i++)
{
ans.push(... | ALGO | 0.999995 | 5.182975 |
89bbae57-2e2e-4c1d-9acc-bd59f3ed9c98 | f2rkan/intro-to-Programming-w-c-plus-plus | part-3/04082020/49.cpp | #include<iostream>
int y_to_m(int);
int main(void)
{
using namespace std;
int dizi[3];
cout << "sureleri gir: ";
for(int i = 0; i < 3; i++)
{
cin >> dizi[i];
}
cout << "cevrilmis halleri:\n";
for(int i = 0; i < 3; i++)
cout << y_to_m(dizi[i]) << endl;
cout << "Done.... | ALGO | 0.997671 | 3.651015 |
051efc63-296d-41cf-91e1-6e46e8aa90aa | denosg/data-structures-and-alg-an2-sem1 | lab 2 sdda/lab 2 sdda.cpp | #include <iomanip>
#include <iostream>
#include <conio.h>
#define nrMaxN 20
using namespace std;
typedef struct _nod {
int cheie;
int parinte;
}nod;
nod A[nrMaxN];
int nrEl;
void AdaugFii(int idxParinte, int cheie, int niv) {
int i, j, idx, nrFii;
//adaugarea nodului
idx = nrEl; //retinem indicele noului nod
A... | ALGO | 0.998941 | 3.674432 |
53cb08d6-d6c4-491a-86ae-04a46c5e7be7 | ishandutta2007/codeforces | mangooste/normal/1086/A.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
#define vec vector
#define ar array
#define all(a) begin(a), end(a)
#define rall(a) rbegin(a), rend(a)
#define len(a) ((int)((a).size()))
template<typename A, typename B>
ostream& operator<<(ostream &out, pair<A, B> p) { ret... | ALGO | 0.99999 | 4.345862 |
516bdfc2-6a7b-4b0e-8695-6146382c9252 | chenbowen/Competitive-Programming | apoc/chapter5/examples/5-1 uva10474.cpp | #include <cstdlib>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <algorithm>
#include <cctype>
#include <map>
using namespace std;
#define LOCAL
#define maxn 10000 + 10
int a[maxn], n, q, t;
int main() {
#ifdef LOCAL
freopen("in.txt", "r", stdin);
//freopen("out.txt", "w", stdout);
#endif... | ALGO | 0.999682 | 3.639221 |
b7233a2f-0a90-449d-8422-2119fa3a92bb | ayushnagar123/Leetcode | 153-find-minimum-in-rotated-sorted-array/153-find-minimum-in-rotated-sorted-array.cpp | class Solution {
public:
int findMin(vector<int>& nums) {
int l = 0; int r = nums.size() -1;
int mid;
int ans = nums[0];
while(l<=r){
if(nums[l] < nums[r]){
ans = min(ans, nums[l]);
break;
}
mid = l + (r - l)/2;
... | ALGO | 0.999985 | 6.010382 |
9edea9da-ddc4-4c8c-b2ec-f250a2d1e432 | Mohammad-Sabbir-Ahmed/Competitive-Programming-1 | All Online Judge Problem/Codeforces/Codeforces Round #615 (Div. 3)/C - Product of Three Numbers__.cpp | # include <bits/stdc++.h>
using namespace std;
void primeFactors(int n)
{
vector<int>v;
set<int>st;
set<int>s;
while (n%2 == 0) {
v.push_back(2);
n = n/2;
}
for (int i = 3; i <= sqrt(n); i = i+2) {
while (n%i == 0) {
v.push_back(i);
n = n/i;
}
}
if (n > 2)
v.push_... | ALGO | 0.998751 | 4.25485 |
1fc22db9-d88f-40b9-a6a1-0cd7fe9b503f | biswajitmaharana2016/CppCode | svn_code_peter/chapter_1/async_is_prime.cpp | #include <iostream>
#include <vector>
#include <string>
#include <thread>
#include <functional>
#include <future>
#include <chrono>
using namespace std;
namespace mv {
struct trivial {};
bool is_prime(long i)
{
if (i % 10 == 5 && i != 5)
throw trivial{};
if (i == 1)
return false;
if (i... | ALGO | 0.986102 | 4.547392 |
34e2b732-c24c-420f-ac9d-b80689a138e1 | plumonito/dtslam | 3rdparty/suitesparse-metis-for-windows-1.2.1/SuiteSparse/SPQR/MATLAB/spqr_solve.cpp | // =============================================================================
// === spqr_solve mexFunction ==================================================
// =============================================================================
#include "spqr_mx.hpp"
/* x = A\b using a sparse QR factorization.
x ... | ALGO | 0.999862 | 3.73301 |
86d44693-371d-49fd-944d-f1a289ee79b3 | seunghyukcho/algorithm-problems-solved | baekjoon/previous/10815/main.cpp | #include<iostream>
#include<set>
using namespace std;
int main(){
int n, m;
set<int> card;
cin >> n;
for(int i = 0; i < n; i++){
int num;
cin >> num;
card.insert(num);
}
cin >> m;
for(int i = 0; i < m; i++){
int num;
cin >> num;
cout << card... | ALGO | 0.999884 | 3.789855 |
784c9e0f-117e-4a26-8553-0d73b66c1a15 | beamuu/Solve-2020 | maxlate.cpp | #include <iostream>
#include <list>
using namespace std;
struct work {
int duration;
int due_date;
bool operator<( const work & o) const {
if (due_date != o.due_date) return due_date < o.due_date;
}
};
list <work> l;
int main() {
int n;
int duration , due_date , date=0 , max=0;
... | ALGO | 0.998852 | 4.721992 |
5fff4e69-c4d9-4fad-828a-88133b1929ce | showmanlee/HowCanISolveThisQuestion | BOJ/17000/17245.cpp | // 서버실
// https://www.acmicpc.net/problem/17245
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main(void) {
cin.tie(NULL);
ios_base::sync_with_stdio(false);
int n;
cin >> n;
int left = 0, right = 0;
long long sum = 0;
vector<vector<int>> board(n, vector<int>(n));
for (int... | ALGO | 0.99998 | 5.142837 |
819f4b9e-177e-4943-9c99-039f42396ae4 | sshjj/note | leetcode/剑指offer/51数组中的逆序对.cpp | 在数组中的两个数字,如果前面一个数字大于后面的数字,则这两个数字组成一个逆序对。输入一个数组,求出这个数组中的逆序对的总数。
示例 1:
输入: [7,5,6,4]
输出: 5
// 归并排序
class Solution {
public:
vector<int>tmp;
int reversePairs(vector<int>& nums) {
tmp = vector<int>(nums.size());
return merge(nums,0,nums.size()-1);
}
int merge(vector<int>&nums,int l,int r){... | ALGO | 0.999968 | 5.046243 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.