uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
cd6567f8-6202-4753-838a-1b364a8472e5 | VishalSingh1703/Placement | Matrix/Medium/2373. Largest Local Values in a Matrix.cpp | https://leetcode.com/problems/largest-local-values-in-a-matrix/?envType=daily-question&envId=2024-05-12
class Solution {
public:
int solve(vector<vector<int>> &grid, int m, int n)
{
int mx = 0;
for(int i = m; i < m + 3; i++)
{
for(int j = n; j < n + 3; j++) mx = max(mx, gri... | ALGO | 0.999928 | 6.313164 |
74f0aec8-d494-4e89-9ec5-db6d1b10f764 | Shaileshdhoundiyal/leetcodepractice | Find Nth root of M - GFG/find-nth-root-of-m.cpp | //{ Driver Code Starts
#include<bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution{
public:
int NthRoot(int n, int m)
{
// Code here.
if(n ==1)
return m;
if(m ==1)
return 1;
for(int i = 2 ; pow(i,n) <= m ; i++){
if(pow(i,n) == m)
retu... | ALGO | 0.999984 | 6.233798 |
bc042ecf-83cb-4050-b577-0ac9f866e4ef | FernandoCaudillo10/programmingTeamChallenges | progteam/kattis2/nineknights.cpp | #include <iostream>
#include <vector>
using namespace std;
int main(){
vector<string> grid(5);
for(auto &r : grid){
cin >> r;
}
int count = 0;
bool isValid = true;
for(int i=0; i<grid.size() && isValid; i++){
for(int j=0; j<grid[i].size() && isValid; j++){
if(grid[i][j] == 'k'){
count++;
if(i-... | ALGO | 0.999579 | 4.754821 |
d5c7cd32-9650-4052-a95d-ee24a539d0d3 | AryanK1511/cpp-practice-snippets | 004-Basics/015-functors.cpp | #include <iostream>
using namespace std;
class Add {
public:
int operator()(int a, int b) {
return a + b;
}
};
int main() {
Add a;
int sum = a(2, 3);
cout << sum << endl;
return 0;
} | TOOL | 0.865632 | 5.755515 |
0b0a1904-24ce-4fa6-8250-acdf1ed23e42 | ProbablyButter/aoc | 2023/day19/part2.re.cpp | /*!re2c re2c:flags:utf-8 = 1;*/
/*!max:re2c*/
/*!re2c
re2c:define:YYCTYPE = char;
re2c:yyfill:enable = 0;
re2c:flags:tags = 1;
re2c:yyfill:check = 1;
*/
#include "aoc.hpp"
#include "geometry_tools.hpp"
#include "graph_tools.hpp"
#include "string_tools.hpp"
#include <algorithm>
#include <charconv>
#include <cmath>
#in... | ALGO | 0.993243 | 5.826262 |
767f4bd4-be53-4162-ba40-7365b9fb1194 | ishandutta2007/codeforces | a_g/normal/611/D.cpp | #include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9+7;
const int N = 5005;
int dp[N][N], dps[N][N];
void add(int& x, int y) {
x += y;
if (x >= MOD) x -= MOD;
}
int main () {
ios_base::sync_with_stdio(0); cin.tie(0);
int n;
string s;
cin >> n >> s;
vector<vector<int>> lcp(n, vector<int>(n)... | ALGO | 0.999994 | 4.861067 |
58781430-04d9-4d12-bdcb-a42ee2849064 | WendellReis/Competitive-Programming | Maratonas/UFU/contest_05/l.cpp | #include <bits/stdc++.h>
using namespace std;
string binary(int n, int tam);
int main(){
int n, eventos = 0;
while(cin >> n){
int tot = pow(2,n);
string s;
for(int i = 0; i < tot; i++){
s = binary(i,n);
for(int j = 0; j < n - 1; j++)
if(s[j] == ... | ALGO | 0.999688 | 4.588185 |
b07f264e-e112-4a08-a0ac-e7174a203d3b | yash-1104github/DSA-Leetcode | 46. Permutations.cpp | class Solution {
public:
vector<vector<int>>ans;
unordered_set<int>st;//O(1)
void solve(vector<int>& temp, vector<int>& nums ){
int n = nums.size();
if(temp.size() == n ){
ans.push_back(temp);
return;
}
for(int i = 0 ;i < n;i++){
... | ALGO | 0.999996 | 6.157684 |
29bfdcf7-1f2e-49c3-ac99-93ea7bb23ee1 | virtyaluk/leetcode | problems/830/solution.cpp | class Solution {
public:
vector<vector<int>> largeGroupPositions(string s) {
vector<vector<int>> ans;
int start = 0;
for (int i = 0; i < s.size(); i++) {
if (i == s.size() - 1 || s[i] != s[i + 1]) {
if (i - start + 1 >= 3) {
vector<int... | ALGO | 0.999631 | 6.214427 |
ec8dc755-f8c7-4f2f-b4a3-ee4ecdef4979 | galloska/ManiAC | RPC29Abril2017/J.cpp | #include <bits/stdc++.h>
#define endl '\n'
#define forn(i, n) for(int i=0;i<n;i++)
#define lli long long int
#define pii pair<int,int>
#define fi first
#define se second
#define pb push_back
#define MOD 1000000007
using namespace std;
const int MAXN = 1000006;
lli vis[MAXN];
lli pot[MAXN];
vector<lli> primes;
void ... | ALGO | 0.999879 | 3.972833 |
292e4cc3-39ca-4295-9bdc-ad69ac388a19 | DyedBamboo/LeetcodeCpp | StackAndQueue/7.cpp | /***
* @Author: RanZhuJun
* @Date: 2023-08-03 23:42:16
* @LastEditTime: 2023-08-03 23:42:17
* @Description: leetcode 239 滑动窗口最大值
* @FilePath: \LeetcodeCpp\StackAndQueue\7.cpp
* @版权声明 RanZhuJun
*/
#include <iostream>
#include <stack>
#include <vector>
using namespace std;
vector<int> maxSlidingWindow(vector<int... | ALGO | 0.999994 | 6.079699 |
5a739248-aad9-4f5b-90e6-1e367b39a787 | ishandutta2007/codeforces | peti1234/normal/1107/E.cpp | #include <bits/stdc++.h>
using namespace std;
int n;
string q;
long long t[101];
long long dp[101][101][101];
long long solve(int s, int f, int p)
{
if (s>f) {
return 0;
}
if (s==f) {
return t[p];
}
long long ans=dp[s][f][p];
if (ans!=0) {
return ans;
}
ans=t[p]+... | ALGO | 0.999969 | 3.915556 |
07558112-4b7c-45bb-88e9-d812dd137d19 | HoangCuongCat162006/C_SS9 | btvn 1.cpp | #include<stdio.h>
#define max 100
int main(){
int n;
int arr[max];
int value,position;
printf("Nhap so phan tu : ");
scanf("%d",&n);
if (n<=0 || n > max){
printf("So phan tu khong hop le ");
return 1;
}
printf("Nhap %d phan tu : ");
for (int i=0;1<n;i++){
printf("Phan tu thu %d : ",i+1);
scan... | ALGO | 0.999687 | 3.117017 |
a70882f1-f3ff-4ed8-be9b-3f8d825eeb4e | biggies-desu/datastructure | Week3/LL_Expain.cpp | #include<bits/stdc++.h>
using namespace std;
class Node
{
public:
Node *next;
int data;
public:
Node(int data)
{
this->data = data;
}
};
class LinkList
{
public:
Node *head; //create node for first times
int size;
public:
LinkList()
{
size = 0;
}
void Print()
{
for(Node *h = head ; h !... | ALGO | 0.998098 | 3.687453 |
2ea7eb67-1fd4-4717-89ba-f41bc4f2cd37 | qauzal/first-repo | stackcpp.cpp | #include <iostream>
using namespace std;
class Node{
public:
int data;
Node *next;
};
class Stack{
private:
Node *top;
public:
Stack(){top=NULL;}//non parameterized constructor
void push(int x);
int pop();
void Display();
};
void Stack::push(int x){
Node *t=new Node;
if(t){
... | ALGO | 0.995221 | 3.977573 |
f2b122c5-7032-4991-a0b6-6ae012eeab0a | xfali/dmengine | dmengine/graphics/dmpoint.cpp | #include "dmpoint.h"
DM_USING_NAMESPACE;
Point Point::bezier(const Point &p1, const Point &p2, const Point &p3, dreal t )
{
Point target = (1-t)*(1-t)*p1 + 2*t*(1-t)*p2 + t*t*p3;
return target;
}
| ALGO | 0.995966 | 6.062898 |
8f576f4a-0e0b-4d8b-9eef-b6d3b59c1631 | Tanya401/StriversSDESheetChallenge | bst from preorder.cpp | #include <bits/stdc++.h>
/*************************************************************
Following is the Binary Tree node structure
template <typename T>
class TreeNode{
public:
T data;
TreeNode<T> *left;
TreeNode<T> *right;
TreeNode(T data) {
this->data ... | ALGO | 0.999887 | 5.480334 |
415884a5-31bc-43e9-8485-590b4050be5b | jzx-bitdb/LBSC | FPDB/normal-cache/src/LearningCachingPolicy.cpp | //
// on 9/22/20.
//
#include <sstream>
#include <fmt/format.h>
#include <cstdlib>
#include <utility>
#include <chrono>
#include "normal/cache/LearningCachingPolicy.h"
#include "normal/connector/MiniCatalogue.h"
#include <iostream>
std::shared_ptr<normal::connector::MiniCatalogue> normal::cache::beladyLearningMiniCa... | DATA | 0.992702 | 6.831816 |
07d95546-8824-4914-9da7-93541fd655a9 | gatoxtest/cccl | libcudacxx/test/libcudacxx/std/algorithms/alg.sorting/alg.sort/is.sorted/is_sorted_until.pass.cpp | // <algorithm>
// template<ForwardIterator Iter>
// requires LessThanComparable<Iter::value_type>
// Iter
// is_sorted_until(Iter first, Iter last);
#include <cuda/std/__algorithm_>
#include <cuda/std/cassert>
#include "test_iterators.h"
#include "test_macros.h"
template <class Iter>
__host__ __device__ TEST_... | TEST | 0.936138 | 7.502405 |
373b8d1b-e5d7-4686-8eb5-899eaf19e03a | rjk13637110731/Cplusplus-Language-Learn-Note | 21Days_C++/cerr_1.cpp | # include <iostream>
# include <stdlib.h>
using namespace std;
double func(double x,double y) {
if (y == 0) {
throw y;
}
return x / y;
}
int main() {
double res;
try {
res = func(2, 3);
cout << "The result of x/y is : " << res << endl;
res = func(4, 0);
}
catch(double){
cerr << "error of dividing ... | TOOL | 0.9268 | 5.138379 |
b1e309d5-8c60-4f74-b348-b6e9a4804120 | zubair954/todo | 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 |
9314e7b0-48c7-4400-9faa-19b4cf515502 | alepnm/bldc | software/F103/Drivers/CMSIS/NN/Examples/ARM/arm_nn_examples/gru/arm_nnexamples_gru.cpp | /**
* @ingroup groupExamples
*/
/**
* @defgroup GRUExample Gated Recurrent Unit Example
*
* \par Description:
* \par
* Demonstrates a gated recurrent unit (GRU) example with the use of fully-connected,
* Tanh/Sigmoid activation functions.
*
* \par Model definition:
* \par
* GRU is a type of recurrent neura... | ALGO | 0.929553 | 7.464193 |
f1977c1d-7761-4b83-b858-0136980cccd4 | napul205/leetcode- | factorial-trailing-zeroes/factorial-trailing-zeroes.cpp | class Solution {
public:
int trailingZeroes(int n) {
int count = 0;
while (n >= 5) {
n /= 5;
count += n;
}
return count;
}
}; | ALGO | 0.999788 | 6.448688 |
3fb74eda-7876-4037-b3aa-df35264be178 | Once1meetu/COPP_cpp | 1F.cpp | #include <iostream>
using namespace std;
int main()
{
int t;cin>>t;
int *answer=new int[t];
for (int j=0;j<t;j++)
{
int n,k;cin>>n>>k;
int *a=new int[k];
for (int i=0;i<k;i++)
{
cin>>a[i];
}
int max=0;
for (int i=1;i<k;i++)
{
if(a[i]-a[i-1]>max)max=a[i]-a[i-1];
}
if(a[0]-1>max) max=a[0]-1;... | ALGO | 0.999822 | 3.159026 |
f5e3a390-f874-44d1-99c8-2d4e54ad6aa4 | allenchou/CMU-15618-Final-Project | src/utils/disjoint_set.cpp | //
// Created by Xuren Zhou on 11/12/19.
//
#include <cassert>
#include "disjoint_set.h"
DisjointSet::DisjointSet(const int n): num_nodes(n), ranks(n, 1) {
parents.reserve(n);
for (int i = 0; i < num_nodes; ++i) {
parents.push_back(i);
}
}
int DisjointSet::findSet(const int node) {
if (parent... | ALGO | 0.965109 | 6.891504 |
a93d1158-3004-4a02-a835-74e4e9363155 | TingHui-Luo/Pat | 字符串模拟/1140.cpp |
#include <iostream>
#include <map>
#include <set>
#include <vector>
#include <math.h>
#include <queue>
#include <algorithm>
#include <unordered_map>
using namespace std;
inline int read(){
int x = 0,y = 1;char c = getchar();
while(c>'9'||c<'0') {if(c == '-') y = -1; c= getchar();}
while(c>='0'&&c<='9') {... | ALGO | 0.999929 | 3.54775 |
d6372d88-be70-4c86-a83e-74eee54562a2 | AtharvaAnbhule/Leetcode-Solved-Problems | CountNumberOfIncremovableArrays.cpp | class Solution {
public:
long long incremovableSubarrayCount(vector<int>& nums) {
int sz = nums.size(), j = sz - 1;
while (j > 1 && nums[j - 1] < nums[j])
--j; //j is traversing
if (j == 0)
return sz * (sz + 1) / 2; //return all
long long res = 1 + sz - j; // after j comes
... | ALGO | 0.999957 | 5.477433 |
7cc20838-3fd8-4226-acca-dc8df3c7a725 | OPM/ResInsight | ApplicationLibCode/UserInterface/RiuPickItemInfo.cpp | #include "RiuPickItemInfo.h"
#include "cvfDrawableGeo.h"
#include "cvfEffect.h"
#include "cvfHitItem.h"
#include "cvfHitItemCollection.h"
#include "cvfPart.h"
#include "cvfRenderState.h"
#include "cvfRenderStatePolygonOffset.h"
#include "cvfTransform.h"
#include <cmath>
double RiuPickItemInfo::sm_rayDistanceToleranc... | TOOL | 0.861725 | 7.168131 |
036be1b7-4419-4532-80d8-c39ee10dc49d | ledizia/Programacao-Competitiva | dijkstra/ilhas.cpp | #include<bits/stdc++.h>
using namespace std;
#define N 1002
#define INF 1000000009
int n, m, u, v, w, s, dist[N], vis[N];
vector<pair<int, int> > adj[N];
int dijkstra() {
for (int i = 1; i <= n; i++) {
dist[i] = INF;
vis[i] = 0;
}
dist[s] = 0;
priority_queue<pair<int, int>> pq;
pq... | ALGO | 0.999893 | 4.228565 |
1932676f-17ec-4d6f-962b-553290a61377 | shareef35/Amber | src/hotspot/share/opto/output.cpp | #include "precompiled.hpp"
#include "asm/assembler.inline.hpp"
#include "asm/macroAssembler.inline.hpp"
#include "code/compiledIC.hpp"
#include "code/debugInfo.hpp"
#include "code/debugInfoRec.hpp"
#include "compiler/compileBroker.hpp"
#include "compiler/compilerDirectives.hpp"
#include "compiler/oopMap.hpp"
#include "... | TOOL | 0.879836 | 6.904185 |
877ad2d3-8c84-40a8-970a-d81cc65a595c | http-rixhi/COB-APP_DEVELOPMENT_INTERN | Image_Gallery/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.998187 | 6.76073 |
c1bebe5a-a876-4655-8d77-82f810cd175d | nataliaellem/aeds | PDS II/VPL 05 - PDS2/BST.cpp | #include "BST.hpp"
Node* cria_node(Aluno a){
Node *aux = new Node;
aux->aluno.set_nome(a.get_nome());
aux->aluno.set_matricula(a.get_matricula());
aux->left = nullptr;
aux->right = nullptr;
return aux;
}
BST::BST(){
this->root = nullptr;
}
void BST::inserir_aluno_helper(Node *node, Aluno... | ALGO | 0.995132 | 4.388278 |
2c3c9d97-671d-43e1-9ca4-ac5a1e4aa4a8 | aryanrahul1313/Data-Structure-and-Algorithm-DSA- | Binary Tree/K Sum Paths.cpp | /*
struct Node
{
int data;
Node *left;
Node *right;
Node(int val) {
data = val;
left = right = NULL;
}
};
*/
class Solution {
public:
void check(Node *root, int k, int &count, int sum, unordered_map<int, int> &mp) {
if(root == NULL)
return;
... | ALGO | 0.999987 | 5.709912 |
6174aa27-1e6a-4327-ba3d-9c0169c66e01 | Duonghbtt/CODEPTIT | PTIT-Source-main/PTIT-Source-main/CodePTIT - CPP/CPP0224.cpp | // https://code.ptit.edu.vn/student/question/CPP0224
// ĐẾM SỐ MIỀN MA TRẬN
#include <bits/stdc++.h>
using namespace std;
int n, m;
int a[100][100];
const int X[8] = {-1, -1, -1, 0, 1, 1, 1, 0};
const int Y[8] = {-1, 0, 1, 1, 1, 0, -1, -1};
void BFS(int r, int c) {
for (int i = 0; i < 8; ++i) {
int x = r... | ALGO | 0.999269 | 4.517379 |
ff3e020f-c19c-4130-b8c5-1afe39870c67 | techqc/siztest | src/Rpc/RpcServer.cpp | #include "RpcServer.h"
#include <future>
#include <unordered_map>
// CryptoNote
#include "Common/StringTools.h"
#include "CryptoNoteCore/CryptoNoteTools.h"
#include "CryptoNoteCore/Core.h"
#include "CryptoNoteCore/IBlock.h"
#include "CryptoNoteCore/Miner.h"
#include "CryptoNoteCore/TransactionExtra.h"
#include "Cryp... | WEB | 0.874871 | 7.460457 |
5af064c7-033b-4c41-a5c4-c048c15bf020 | GyosunShin/ProblemSolving | 백준 유형별 문제풀이/BFS/11559Puyo Puyo.cpp | // OUTPUT
// ־ Ȳ Ⱑ Ǵ ϶. (ϳ ʴ´ٸ 0 ϸ ȴ.)
// (. : )
// R , G ʷ, B Ķ, P , Y ̴.( 빮ڷ ־.)
#include <cstdio>
#include <cstring>
#include <queue>
#include <algorithm>
using namespace std;
char pan[12][6];
bool visited[12][6];
const int dr[] = {-1,1,0,0};
const int dc[] = {0,0,-1,1};
queue<pair<int, int> > q;
vector<pa... | ALGO | 0.999543 | 3.27182 |
44533987-fb8d-4446-8e26-ba42f3e1243b | Shelfcol/ASD-SLAM | src/3rd_party/eigen_catkin/eigen-eigen-b9cd8366d4e8/doc/snippets/EigenSolver_EigenSolver_MatrixType.cpp | MatrixXd A = MatrixXd::Random(6,6);
cout << "Here is a random 6x6 matrix, A:" << endl << A << endl << endl;
EigenSolver<MatrixXd> es(A);
cout << "The eigenvalues of A are:" << endl << es.eigenvalues() << endl;
cout << "The matrix of eigenvectors, V, is:" << endl << es.eigenvectors() << endl << endl;
complex<double> l... | ALGO | 0.999129 | 3.093769 |
7214c782-825d-40cc-9fb8-df90cf9b3728 | kunj-bhuva/Codeforces | December-2024/26-Thursday/B_Effects_of_Anti_Pimples.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<long long int> vii;
typedef vector<int> vi;
#define int int64_t
// Macro definitions
#define pb(x) push_back(x)
#define ppb(x) pop_back(x)
#define fi(i, a, b) for (ll i = a; i < b; i++)
#define Na cout << "NO" << endl
#define Ha cout <<... | ALGO | 0.99999 | 4.628283 |
c9f03333-cdfe-424b-a055-8abced3f3edf | saurabhkurve/Daily-CPP-Practice | Arrays (Week 5)/Vectors/Leetcode Problems/move+veright-veleft.cpp | #include<bits/stdc++.h>
#include<iostream>
using namespace std;
void placeNegPov(vector<int>&v){
int n=v.size();
int i=0;
int j=v.size()-1;
while(i<=j){
if(v[j]>0){
j--;
}else if(v[i]<0){
i++;
}else if(v[i]>0 && v[j]<0){
int temp = v[i];
... | ALGO | 0.99999 | 4.52901 |
441076e7-f7ef-4b4e-ad2e-c91ce6d09fac | muit/RiftEngine | Source/Engine/ThirdParty/Box2D/Dynamics/Joints/b2FrictionJoint.cpp | #include "Box2D/Dynamics/Joints/b2FrictionJoint.h"
#include "Box2D/Dynamics/b2Body.h"
#include "Box2D/Dynamics/b2TimeStep.h"
// Point-to-point constraint
// Cdot = v2 - v1
// = v2 + cross(w2, r2) - v1 - cross(w1, r1)
// J = [-I -r1_skew I r2_skew ]
// Identity used:
// w k % (rx i + ry j) = w * (-ry i + rx j)
//... | ALGO | 0.991192 | 7.574437 |
076e0ad4-0901-4f82-a4e4-901fb6b76237 | dominhquangklhd/BT01 | LeapYear/main.cpp | #include <iostream>
using namespace std;
int main()
{
int year;
cin >> year;
if ((year % 100 == 0 && year % 400 != 0) || (year % 4 == 0 && year % 100 != 0))
cout << "true";
else cout << "false";
return 0;
}
| ALGO | 0.999835 | 4.174869 |
84ca5c1b-bc55-4c48-aef2-e86b17d0dee1 | pranatsharma1/Competitve-Programming | Number-Theory/Modular_Inverse_using_Fermat_Little_Theorem.cpp | #pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,avx,avx2")
#include<bits/stdc++.h>
#include <ext/pb_ds/detail/standard_policies.hpp>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace ... | ALGO | 0.999967 | 4.678489 |
4aff9fbb-6ebe-4e09-853a-3a118e0b1487 | Megg01/CSII201-C-Language | Lab12/3.cpp | #include<stdio.h>
#include<stdio.h>
typedef struct {
int d,m,y;
} Date;
Date read(){
Date date;
printf("On: ");
scanf("%d", &date.y);
printf("Sar: ");
scanf("%d", &date.m);
printf("Odor: ");
scanf("%d", &date.d);
return date;
}
void print(Date dt){
if(dt.m<10 && dt.d<10){
printf("%d/0%d/0%d\n", dt.y, dt.m, ... | ALGO | 0.998534 | 3.811694 |
27074958-632f-40b1-b502-04e16f9e43f4 | FzArnob/problem_solving | beecrowd/Mean Median Problem - 1379/Main.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
long long a, b;
while (cin >> a >> b && (a + b)) {
cout << a - (b - a) << endl;
}
return 0;
} | ALGO | 0.999583 | 3.637169 |
2fdcff97-1111-4b72-a3e7-fce087f40d1d | mightbxg/CameraCalibration | samples/calibrate_camera.cpp | #include "estimator/camera_calibrator.h"
#include <iostream>
#include <opencv2/core.hpp>
using namespace std;
namespace cv {
template <typename _Scalar, int _Dim>
class DataType<Eigen::Matrix<_Scalar, _Dim, 1>> {
public:
typedef Eigen::Matrix<_Scalar, _Dim, 1> value_type;
typedef Eigen::Matrix<typename DataT... | ALGO | 0.978395 | 5.878409 |
6a30442d-9c94-451f-a3e1-d9fe34e077e7 | DCPRHeart/ComputerSciencePortfolio | C++/CS111-Richmand-Project-6/CS111-Richmand-Project-6/board.cpp | #include "board.h"
Board::Board(){
for (int i = 0; i < BOARD_SIZE; i++)
for (int j = 0; j < BOARD_SIZE; j++)
theBoard[i][j] = EMPTY_MARKER;
}
void Board::printBoard() {
for (int i = 0; i < BOARD_SIZE; i++) {
for (int j = 0; j < BOARD_SIZE; j++)
std::cout << theBoard[i][j] << " ";
std::cout << std::endl;... | ALGO | 0.95567 | 5.226905 |
3cec16dc-8631-4046-a897-672fe2b0bb19 | Bossixd/competitive-programming | codeforces/contests/2133/A.cpp | #include <iostream>
#include <list>
#include <vector>
#include <stack>
#include <queue>
#include <cmath>
#include <algorithm>
#include <map>
#include <unordered_map>
#include <set>
#include <unordered_set>
#include <numeric>
using namespace std;
#define int long long
int MOD = 998244353;
// Layers and adds ranges i... | ALGO | 0.999951 | 4.51586 |
5dc77bbc-4d51-4b68-820b-5760795c30ae | TimothyHorscroft/competitive-programming | codeforces/1288/e.cpp | #include <bits/stdc++.h>
using namespace std;
#define int long long
#define REP(i, l, r) for (int i=(l); i<(r); ++i)
#define RREP(i, r, l) for (int i=(r); i>(l); --i)
#define CASET int _T; cin >> _T; REP(caset, 0, _T)
#define print(x) cout << to_string(x) << '\n'
#define vi vector<int>
#define vb vector<bool>
#define... | ALGO | 0.99997 | 3.921529 |
b3e7a5fc-f068-463d-929c-793277358998 | dreamsxin/example | algorithm/算法的乐趣代码/code23/othello/WzEvaluator.cpp | #include "StdAfx.h"
#include "WzEvaluator.h"
#include "GameState.h"
#include "Support.h"
WzEvaluator::WzEvaluator(void)
{
}
WzEvaluator::~WzEvaluator(void)
{
}
int WzEvaluator::Evaluate(GameState& state, int max_player_id)
{
int min = GetPeerPlayer(max_player_id);
int empty = state.CountEmptyCells();
... | ALGO | 0.999561 | 3.870402 |
5855e4ab-6235-4d4e-9784-fa31fe5d6604 | MusicMan241504/project-euler-cpp | src/P023.cpp | #include <algorithm>
#include <iostream>
#include <vector>
bool isAbundantNum(int num) {
int total {1}; // include 1
for (int i{2}; i*i <= num; i++) { // start at 2 to avoid including num itself
if (num % i == 0) { // if factor
if (i == num/i) { // if both factor... | ALGO | 0.999814 | 6.655532 |
01067973-7bf7-47a5-a5cd-54ccd5cc6e9b | Nicholas1126/osmo-limesdr | osmo-trx/Transceiver52M/Resampler.cpp | #include <stdlib.h>
#include <math.h>
#include <string.h>
#include <malloc.h>
#include <iostream>
#include <algorithm>
#include "Resampler.h"
extern "C" {
#include "convolve.h"
}
#ifndef M_PI
#define M_PI 3.14159265358979323846264338327f
#endif
#define MAX_OUTPUT_LEN 4096
using namespace std;
static float sinc... | ALGO | 0.992786 | 5.014285 |
114049b6-a718-459f-942c-0efaaa0f4772 | Ravix-3/CPP--Program | Program/P4.cpp | #include <iostream>
int calculate(int num1, int num2, int op) {
switch(op) {
case '+': return num1 + num2; // Addition
case '-': return num1 - num2; // Subtraction
case '*': return num1 * num2; // Multiplication
case '/': return num2 != 0 ? num1 / num2 : 0; // Division with zero check
default: ret... | ALGO | 0.956558 | 5.719353 |
5fcf08e9-0897-4118-9913-53ccb9cdd4cf | sakshieng/DSA-Sheet | Binary Search/8.cpp | #include<bits/stdc++.h>
/* Sakshi */
using namespace std;
int main()
{
class Solution {
public:
int search(vector<int>& nums, int target) {
int lo=0,hi=nums.size()-1;
int mid;
if(nums[mid]==target) return mid;
if(nums.size()==0) return -1;
while(hi-lo>1)
{
int mid... | ALGO | 0.999935 | 5.658592 |
08408242-a973-4949-a9aa-26effb1caa61 | pratham182/dsa_practice | recursion/basics-2/10.given_integer_stored_vector.cpp | //input integers [1,2,1];
#include<iostream>
#include<vector>
#include<math.h>
using namespace std;
int convert(vector<int>arr,int size,int index,int ans,int power){
//base case
if(size<=index){
return ans;
}
ans=ans+arr[index]*pow(10,power);
return convert(arr,size,index+1,ans,power-1)... | ALGO | 0.99966 | 3.739959 |
a7e1f55c-6af2-4c1b-9ab0-c850a6bb0ff5 | JackyLu0520/cpp | 2022-3-BM-2.cpp | #include<bits/stdc++.h>
using namespace std;
int n,t;
int a[510],b[510],Min[510];
int main(){
cin>>t;
for(int l=1;l<=t;l++){
cin>>n;
for(int i=1;i<=n;i++)
cin>>a[i];
for(int i=1;i<=n;i++)
Min[i]=600;
for(int i=1;i<=n;i++)
for(int j=i;j<=n;j++){
for(int k=1;k<=n;k++)
b[k]=a[k];
reverse(b+... | ALGO | 0.999894 | 3.223832 |
26c276b0-46c3-4ac6-bc16-dcfec3f76f5c | okaryo/CompetitiveProgramming | AtCoder/ABC/001~100/061~070/063/D.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long LL;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(),(x).end()
int main() {
int n; cin >> n;
LL a, b; cin >> a >> b;
vector<LL> h(n);
rep(i, n) cin >> h[i];
LL ans = 1e9;
LL left = 1, right = 1e9;
LL mid, sum;... | ALGO | 0.99957 | 3.475857 |
4e3fa987-d05c-4e59-bfab-c5db0d5b2c75 | Jolyeh/payfast | 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.998809 | 6.763549 |
b36d2ded-a1a6-4ec2-a324-07815a925051 | ta1qo/ADS2024 | lab9/B.cpp | #include <iostream>
#include <vector>
using namespace std;
void LPS(string &pat, vector<int> &lps) {
int len = 0;
int i = 1;
while (i < pat.length()) {
if (pat[i] == pat[len]) {
lps[i] = len + 1;
len++;
i++;
} else if (len != 0) {
len = lps[le... | ALGO | 0.999998 | 5.157232 |
3e76d4c4-ce1c-4f9b-b226-9d17c7d6cb55 | victoriavllso/UFSC | Estrutura de dados/exercicios/LinkedList2.cpp | #include <cstdint> // std::size_t
#include <stdexcept> // C++ exceptions
namespace structures {
//! Classe Lista Encadeada
template<typename T>
class LinkedList {
public:
LinkedList(); // construtor padrão
~LinkedList(); // destrutor
void clear(); // limpar lista
void push_back(const T& data); ... | ALGO | 0.97537 | 5.361132 |
859f9474-34c0-47e3-8c89-2beec97aa554 | Shubham0920/Daily-Leetcode-question | String Subsequence - GFG/string-subsequence.cpp | //{ Driver Code Starts
// Initial Template for C++
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
// User function Template for C++
class Solution{
public:
int solve(int i,int j,string s,string t,vector<vector<int>> &dp){
if(i<0 && j<0) return 1;
if(j<0) return 1;
if(... | ALGO | 0.999983 | 6.343853 |
300500b4-8f80-432c-b443-87715f056f7d | kvtys/AlgorithmVisualizer | AntAlg/sortJect.cpp | #include "sortJect.h"
#include <chrono> //chrono is being stubborn
using namespace std;
sortJect::sortJect(int capacity){
this->capacity = capacity;
this->arr = new int[capacity];
}
sortJect::sortJect(){
this->capacity = 10;
this->arr = new int[capacity];
}
sortJect::~sortJect(){
delete [] arr;
}... | ALGO | 0.995973 | 4.806111 |
e7a1d2fe-6809-4984-910a-9421ee1034c4 | delwar03/CF | A_Entertainment_in_MAC.cpp | #include <bits/stdc++.h>
#define int long long
#define endl '\n'
using namespace std;
const int M = 1e9 + 7;
const int N = 2e5 + 10;
const int INF = 1e15 + 10;
void solve() {
int n; cin>>n;
string s; cin>>s;
string p = s;
reverse(p.begin(), p.end());
// cout<<s<<" "<<p<<endl;
if(s == p) {
... | ALGO | 0.999999 | 4.731288 |
b6f3e848-3862-4ddb-af7d-b0a6669701b5 | hhu1506010220/ACM_Repository | 蓝桥杯模拟赛1/7.cpp | #include <bits/stdc++.h>
using namespace std;
int main(){
int n;
double c,a0,an1;
scanf("%d",&n);
scanf("%lf %lf",&a0,&an1);
double ans=0;
double t = 0;
ans=an1+n*a0;
for(int i=1;i<=n;i++){
scanf("%lf",&c);
t+=c*(n-i+1)*2;
}
ans-=t;
ans/=(n+1);
printf("%.2... | ALGO | 0.999612 | 3.179367 |
6042fea5-52d9-4c12-a0cd-c163481790bb | Ahmad-AlDeeb/Problem-Solving | Codeforces/Polycarp and the Day of Pi.cpp | #include<iostream>
#include<string>
#include<sstream>
#include<algorithm>
#include<cmath>
#include<iomanip>
#include<vector>
#include<stack>
#include<queue>
#include<deque>
#include<set>
#include<unordered_set>
#include<map>
#include<bitset>
using namespace std;
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie... | ALGO | 0.999847 | 4.251999 |
d4e808e4-1431-483d-a148-fc2c2cef29ba | kvm2116/vmtorrent | p2pfs/boost/libs/bimap/example/user_defined_names.cpp | // VC++ 8.0 warns on usage of certain Standard Library and API functions that
// can be cause buffer overruns or other possible security issues if misused.
// See http://msdn.microsoft.com/msdnmag/issues/05/05/SafeCandC/default.aspx
// But the wording of the warning is misleading and unsettling, there are no
// po... | TOOL | 0.913769 | 4.976112 |
642caed9-d380-43db-98d2-44adee91463a | Visiator/Visiator_Windows | V26/cryptopp/panama.cpp | // panama.cpp - originally written and placed in the public domain by Wei Dai
// use "cl /EP /P /DCRYPTOPP_GENERATE_X64_MASM panama.cpp" to generate MASM code
#include "pch.h"
#ifndef CRYPTOPP_GENERATE_X64_MASM
#include "panama.h"
#include "secblock.h"
#include "misc.h"
#include "cpu.h"
NAMESPACE_BEGIN(CryptoPP)
... | ALGO | 0.984417 | 6.875381 |
7cfa1311-14c9-41d0-bdf7-78b8317e2e3d | rupesh-dharme/LeetCode | 162-find-peak-element/162-find-peak-element.cpp | class Solution {
public:
int findPeakElement(vector<int>& nums) {
int n = nums.size();
if (n == 1) return 0;
if (nums[0] > nums[1]) return 0;
if (nums[n-1] > nums[n-2]) return n-1;
int l = 1, r = n-2, mid;
while (l <= r) {
mid = l + (r-l)/2;
if... | ALGO | 0.999913 | 5.632116 |
2109829a-6277-4988-923f-3204e42fd19b | dmitriy-0297/5130904_3000_7_1 | golikov.valentin/T3/figure.cpp | #include "figure.h"
double golikov::Point::getDistance(const Point& point) const
{
return std::hypot(x - point.x, y - point.y);
}
bool golikov::Point::operator != (const Point& other) const
{
return x != other.x || y != other.y;
}
double golikov::getTriangleArea(const Point& pointFirst, const Point& pointSecond,... | ALGO | 0.985108 | 5.345187 |
82b01ade-1dc0-41cb-b741-86951b7f5000 | ishaankumar108/DSA | Lecture-097/1_Disjoint_Set.cpp | #include <bits/stdc++.h>
using namespace std;
vector< pair<pair<int,int>, int> > calculatePrimsMST(vector< vector<int> > &edges, int n, int m) {}
int findParent(vector<int> &parent, int node) {
// Reached topmost point of hierarchy
if(parent[node] == node) {
return node;
}
// Going upwards in... | ALGO | 0.999967 | 4.980401 |
4a3c2022-9149-4af4-b9a7-2fc70f44699e | Notgard/galaxy_simulator | src/SimulationSDL.cpp | #include "SimulationSDL.h"
void simulation::SimulationSDL::draw_quadtree(const TREE_TYPE::Node *node, const quadtree::Box<double> &box, int depth)
{
if (!node)
return;
SDL_Color color = {0, 0, 255};
draw_box(box, color);
// Recursively draw child nodes
for (int i = 0; i < QUADTREE_MAX_VA... | TOOL | 0.946948 | 5.055196 |
b2292877-35e6-4aa7-a8ab-6333754d7c33 | krishna146/DSASheetAndSolution | 18Stack/Homework/9binaryTreeInorder.cpp | // Problem Link - https://leetcode.com/problems/binary-tree-inorder-traversal/
/* By Krishna Kumar */
#include <bits/stdc++.h>
#include <iostream>
using namespace std;
struct TreeNode
{
int val;
TreeNode *left;
TreeNode *right;
TreeNode() : val(0), left(nullptr), right(nullptr) {}
TreeNode(int x) : ... | ALGO | 0.999996 | 6.781025 |
d42498d7-648b-4558-b337-58ee47fa580f | anmolgulati10/Algo | Sorting/sort game.cpp | #include<bits/stdc++.h>
using namespace std;
class emp
{
public:
int salary;
string name;
emp()
{
salary=0;
name="";
}
};
bool mycompare(emp e1,emp e2)
{
if(e1.salary==e2.salary)
{
return e1.name<e2.name;
}
return e1.salary>e2.salary;
}
int main(int argc, char const *argv[])
{
int min;
cin>>min;
in... | ALGO | 0.999721 | 3.781594 |
6a8636eb-70e6-43b5-92ad-8f516c186417 | WeiguoMa/PurityFromRandomMeasurement | extern/eigen/bench/sparse_transpose.cpp |
// g++ -O3 -g0 -DNDEBUG sparse_transpose.cpp -I.. -I/home/gael/Coding/LinearAlgebra/mtl4/ -DDENSITY=0.005 -DSIZE=10000
// && ./a.out
// -DNOGMM -DNOMTL
// -DCSPARSE -I /home/gael/Coding/LinearAlgebra/CSparse/Include/
// /home/gael/Coding/LinearAlgebra/CSparse/Lib/libcsparse.a
#ifndef SIZE
#define SIZE 10000
#endi... | ALGO | 0.99184 | 5.171746 |
07ec9834-faf8-41ba-a0a0-4717c58b52b5 | Macasten/EveryDayCode | src/challenges/leetcode/876-Middle-of-the-Linked-List.cpp | ////////////////////////////////////////////////////////////////////////////////
// c++ libraries
////////////////////////////////////////////////////////////////////////////////
#include <bits/stdc++.h>
////////////////////////////////////////////////////////////////////////////////
// Personal Helpers
/////////////... | ALGO | 0.999849 | 6.439768 |
95a59ab0-d917-4692-b98f-b8043a385afd | dmehrab06/Time_wasters | toph/summerspur/XORMASTER.cpp | /*-------property of the half blood prince-----*/
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/detail/standard_policies.hpp>
#define MIN(X,Y) X<Y?X:Y
#define MAX(X,Y) X>Y?X:Y
#define ISNUM(a) ('0'<=(a) && (a)<='9')
#define ISCAP(a) ('A'<=(a)... | ALGO | 0.999851 | 3.319654 |
44d3080a-b9a1-4589-83ee-fcc217cb2186 | johanvdw/saga-debian | src/modules/shapes/shapes_points/remove_duplicates.cpp | /**********************************************************
* Version $Id: remove_duplicates.cpp 1921 2014-01-09 10:24:11Z oconrad $
*********************************************************/
///////////////////////////////////////////////////////////
// //
// //
// //
/////... | TOOL | 0.982862 | 7.043173 |
e23ccb70-2b4f-4755-8c43-c2549946f1ff | akashghadge/competitive-programming | Company Test/TCS Codevita Rj/A.cpp | #include <bits/stdc++.h>
using namespace std;
vector<string> tokenize(string s, string del = " ")
{
vector<string> ans;
int start, end = -1 * del.size();
do
{
start = end + del.size();
end = s.find(del, start);
ans.push_back(s.substr(start, end - start));
} while (end != -1)... | ALGO | 0.99803 | 5.115119 |
ae005756-507e-4995-8548-42d0281aa479 | time-hxh/My-ACM-Template | 01_Math/05_Combinatorics/01_Combination.cpp | // ---
// $0 \leq m \leq n \leq 1000$
// ---
const int maxn = 1010;
ll C[maxn][maxn];
void CalComb()
{
C[0][0] = 1;
for (int i = 1; i < maxn; i++)
{
C[i][0] = 1;
for (int j = 1; j <= i; j++) C[i][j] = (C[i - 1][j - 1] + C[i - 1][j]) % mod;
}
}
// ---
// $0 \leq m \leq n \leq 10^5$, 模p为素... | ALGO | 0.999351 | 4.306197 |
adaac31f-4970-4e06-aea3-41e66d70b221 | albertogg023/GraphProblemsAlgorithms | code/equivalancy-relations-to-find-people-that-know-each-other.cpp | #include <stdlib.h> // Funcion exit
#include <iostream> // Funciones cin y cout
using namespace std;
//////////////////////////////////////////////////////////////
//////////// FUNCIONES DEL PROGRAMA ////////////////
//////////////////////////////////////////////////////////////
// ENCONTRAMOS EL ELEMENTO... | ALGO | 0.999856 | 4.527508 |
22008554-6fdf-4288-ac22-777ee41d870f | ZwFink/hpacml | libc/src/stdlib/qsort.cpp | #include "src/stdlib/qsort.h"
#include "src/__support/common.h"
#include "src/stdlib/qsort_util.h"
#include <stdint.h>
namespace __llvm_libc {
LLVM_LIBC_FUNCTION(void, qsort,
(void *array, size_t array_size, size_t elem_size,
int (*compare)(const void *, const void *))) {
if ... | ALGO | 0.998202 | 6.469637 |
6d2efd41-8c19-45e2-9639-5b2310434e63 | ishandutta2007/codeforces | fqw/normal/672/B.cpp | #include <set>
#include <cassert>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <string>
#include <vector>
using namespace std;
#define sz(a) static_cast<int>(a.size())
#define all(a) a.begin(), a.end()
#define rep(i, a, b) for(int i=int(a); i<=int(b); ++i)
#defi... | ALGO | 0.999963 | 3.475472 |
4da5e155-bf59-4655-88b4-0c5ae97f9f1a | martinmaxk/ESPP-Master-Thesis | Optimal Subdivision EHL/boost_1_64_0/libs/program_options/src/value_semantic.cpp | #define BOOST_PROGRAM_OPTIONS_SOURCE
#include <boost/program_options/config.hpp>
#include <boost/program_options/value_semantic.hpp>
#include <boost/program_options/detail/convert.hpp>
#include <boost/program_options/detail/cmdline.hpp>
#include <set>
#include <cctype>
namespace boost { namespace program_options {
... | TOOL | 0.983953 | 7.622782 |
b79412ac-d183-476e-a8f9-0ec955b0ef42 | ixray-team/xray-vss-archive | net.ssa/CSG_2D/segment.cpp | #include "line.h"
#include "psolid2.h"
#include "rpoint2.h"
#include "segment.h"
#include "segedge.h"
int Segmentation::m_klein4[4][4] =
{
{ 0, 1, 2, 3 },
{ 1, 0, 3, 2 },
{ 2, 3, 0, 1 },
{ 3, 2, 1, 0 }
};
//---------------------------------------------------------------------------
Segmentation::Segme... | ALGO | 0.999219 | 4.723454 |
55a33de6-fd9e-4759-bf3d-41025da7980d | Vssmmrr/mipt_cpp_tasks | geometry/London.cpp | #include <iostream>
#include <cstdlib>
#include <math.h>
#include <vector>
#include <algorithm>
#include <iomanip>
template <class T>
bool SameSign(const T& lhs, const T& rhs) {
return (lhs >= 0 && rhs >= 0) || (lhs <= 0 && rhs <= 0);
}
template <class T>
bool DifferentSign(const T& lhs, const T& rhs) {
retur... | ALGO | 0.999821 | 4.451047 |
0c8b5703-caa2-4af2-8ac7-2bdf4ad72305 | Mittal854/III | Object Oriented Programming/functionptr.cpp | #include <iostream>
using namespace std;
int add(int a, int b) {
return a+b;
}
float add(float a, float b) {
return a+b;
}
int main() {
int n1=10, n2=20;
float a=4.5, b=6.89;
int(*fun)(int, int);
fun = &add;
cout<< fun(n1,n2)<< endl;
cout<< "Address of add: "<< fun<< endl;
cout<< ... | TOOL | 0.914704 | 5.11581 |
2bd86b7a-7699-4289-8696-b71800abcbad | Sumit4509/leetcode | 1773-count-items-matching-a-rule/1773-count-items-matching-a-rule.cpp | class Solution {
public:
int countMatches(vector<vector<string>>& items, string ruleKey, string ruleValue) {
int counter=0;
for(int i=0;i<items.size();i++){
if(ruleKey=="type"){
if((items[i][0])==ruleValue){
counter++;
}
}
... | ALGO | 0.995022 | 6.029654 |
7c195d59-085a-4688-829a-0543c3976bda | jawoznia/Grafy | src/Disjoint_Union.cpp | #include "Disjoint_Union.h"
Disjoint_Union::Disjoint_Union(int n)
{
z = new Wierzcholek[n];
}
Disjoint_Union::~Disjoint_Union()
{
delete[] z;
}
void Disjoint_Union::makeSet(int n)
{
z[n].up = n;
z[n].wRank = 0;
}
int Disjoint_Union::findSet(int v)
{
if(z[v].up != v)
z[v].up = findSet(z[v... | ALGO | 0.991298 | 4.219351 |
3b20b839-9d08-4c2f-baed-b72528f655f4 | Ange1uchi/LabAlgos2 | Semana1/Codef1.cpp | #include <iostream>
#include <vector>
using namespace std;
int main() {
int count=0;
int casos=0;
int n=0;
int k=0;
bool rep=false;
vector<int> cartas;
cin >> casos;
for (int i=0; i<casos; i++){
cin >> n;
cin >> k;
cartas.resize(n);
for(int i=0; i<n; i++)... | ALGO | 0.999853 | 3.699779 |
5395f401-4ce3-4185-8cd7-f6bec5eb3c79 | LKomaryanskiy/University | Numerical analysis/Taylor series/MyCos.cpp | #include "MyCos.h"
void MyCos::CalculateExpressions(double x){
//Limit x between 0 and Pi
//Since cos is even function, we can take absolute x value
//This guarantees less iterations
double limitedX = [x]() -> double{ double tmp = (fabs(x) - 2 * M_PI * floor(fabs(x) / (M_PI * 2)));
return (tmp >= M_PI) ... | ALGO | 0.999313 | 4.42154 |
50cd7371-ce52-4d80-9d35-c655c2a859e3 | sebaMejia/CSCI-211 | Assignment12/nqueen.cpp | /**
* @file nqueen.cpp
* @author Sebastian Mejia
* N Queens Problem
*/
#include <iostream>
#include <cmath>
using namespace std;
/***
* Same checker as before for the position checking.
*/
bool ok(int q[], int c){
for(int i = 0; i < c; i++){
if(q[c]==q[i] || (c - i) == abs(q[c]-q[i])){
retu... | ALGO | 0.99964 | 5.078668 |
d9265845-d226-4a80-8a67-e64c9eed346d | ishandutta2007/codeforces | aghaseyed/normal/1329/B.cpp | #include <bits/stdc++.h>
#pragma GCC optimize ("O2")
#pragma GCC optimize ("unroll-loops")
//#pragma GCC optimize("no-stack-protector,fast-math")
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;
typedef pair<pii, int> piii;
typedef pair<ll, ll> pll;
#define debug(x) cerr<<... | ALGO | 0.999979 | 4.869947 |
2825c334-229c-4e2d-9bc3-6f9c81b72f99 | vancegroup-mirrors/sofa-framework | Sofa/modules/sofa/component/collision/DiscreteIntersection.cpp | #include <sofa/helper/system/config.h>
#include <sofa/helper/FnDispatcher.inl>
#include <sofa/component/collision/DiscreteIntersection.h>
#include <sofa/core/ObjectFactory.h>
#include <sofa/core/collision/Intersection.inl>
#include <sofa/helper/proximity.h>
#include <iostream>
#include <algorithm>
namespace sofa
{
na... | TOOL | 0.964647 | 6.67162 |
f016063a-a9f6-4aa1-9baf-d4cb10e7374e | Ninja-OS/frameworks_av | media/libstagefright/codecs/m4v_h263/dec/src/get_pred_outside.cpp | /*
------------------------------------------------------------------------------
INPUT AND OUTPUT DEFINITIONS
Inputs:
xpos = x half-pixel of (x,y) coordinates within a VOP; motion
compensated coordinates; native data type
ypos = y half-pixel of (x,y) coordinates within a VOP; motion
co... | ALGO | 0.999719 | 6.728376 |
f4e940b9-2dd0-4c99-bde0-fc177c5f1b96 | yzcmf/Lintcode_Classify | DFS/127_topological-sorting/topological-sorting.cpp | /*
@Copyright:LintCode
@Author: yzcmf
@Problem: http://www.lintcode.com/problem/topological-sorting
@Language: C++
@Datetime: 16-08-29 04:30
*/
/**
* Definition for Directed graph.
* struct DirectedGraphNode {
* int label;
* vector<DirectedGraphNode *> neighbors;
* DirectedGraphNode(int x) : label(... | ALGO | 0.999984 | 6.147795 |
b4ae9c6a-36f0-4c9b-bdc6-03680890874f | dittoo8/algorithm_cpp | programmers_level_3/go_school.cpp | #include <iostream>
#include <string>
#include <vector>
#define MOD 1000000007
using namespace std;
int d[101][101];
int solution(int m, int n, vector<vector<int> > puddles) {
for(int i=1;i<=n;i++){
for(int j=1;j<=m;j++){
d[i][j] = 1;
}
}
for(int i=0;i<puddles.size();i++){
... | ALGO | 0.99985 | 4.539605 |
6a85854a-3cf8-4422-a6fb-023c8aa301b6 | colinyoyo26/mlir-standalone-toy | llvm/tools/llvm-rc/ResourceScriptCppFilter.cpp | #include "ResourceScriptCppFilter.h"
#include "llvm/ADT/StringExtras.h"
#include <vector>
using namespace llvm;
namespace {
class Filter {
public:
explicit Filter(StringRef Input) : Data(Input), DataLength(Input.size()) {}
std::string run();
private:
// Parse the line, returning whether the line should be i... | TOOL | 0.916646 | 6.95629 |
c9c0e0cd-a0ad-40fd-be85-b843d0f25c69 | saif-islam-rayhan/code-backup | Recursion_sum.cpp | #include<bits/stdc++.h>
using namespace std;
int sum(int n){
if(n==1)
return 1;
return sum(n-1)+n;
}
int main()
{
int n;
cin>>n;
cout<<sum(n)<<endl;
return 0;
} | ALGO | 0.999954 | 4.191771 |
3a24cfcc-50f2-49a9-92b6-0c4f78dc5b2d | lvaldivia/Fundamentos201902 | depts/include/Box2D/Dynamics/Joints/b2PrismaticJoint.cpp | #include "Box2D/Dynamics/Joints/b2PrismaticJoint.h"
#include "Box2D/Dynamics/b2Body.h"
#include "Box2D/Dynamics/b2TimeStep.h"
// Linear constraint (point-to-line)
// d = p2 - p1 = x2 + r2 - x1 - r1
// C = dot(perp, d)
// Cdot = dot(d, cross(w1, perp)) + dot(perp, v2 + cross(w2, r2) - v1 - cross(w1, r1))
// = -dot... | ALGO | 0.999702 | 7.679602 |
621bbeef-b295-4c7a-a407-5019ca7fe7a8 | a446187673/Cpp-LeetCode | 953. Verification of alien language dictionary.cpp | #include<iostream>
#include<vector>
#include<string>
#include<unordered_map>
#include<algorithm>
using namespace std;
//953. 验证外星语词典 https://leetcode.cn/problems/verifying-an-alien-dictionary/
class Solution {
public:
bool isAlienSorted(vector<string>& words, string order) {
unordered_map<char, int> mappi... | ALGO | 0.999935 | 5.723525 |
c9a10d4d-dec5-49dc-a682-c5d968c104c8 | KingSadik1/CSE-3150 | in-class-assignments/in_class_6/vector_main.cpp | #include "vector.h"
int main() {
ifstream in_file;
in_file.open("vector_2D.txt");
vector<int_vector> vect = read_vectors(in_file);
sort_vectors(vect);
print_vectors(vect);
in_file.close();
return 0;
} | ALGO | 0.983346 | 4.275823 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.