uuid stringlengths 36 36 | repo_name stringlengths 5 123 | relative_path stringlengths 5 4k | content stringlengths 33 2.85M | category stringclasses 6
values | algo_rel_score float64 0.85 1 | quality_score float64 3 8.76 |
|---|---|---|---|---|---|---|
d0c242f9-6926-486d-86d4-100565d3023c | cx994/diverge4 | src/gu2001/GZf2.cpp | /*This is the program for computing the coefficient of functional divergence
under the two-state model*/
#define _CRT_SECURE_NO_WARNINGS
#define WIN32
#include <vector>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include "GZf2.h"
#include "matrix.h"
/*-------------------------------... | ALGO | 0.999393 | 4.437824 |
fe09cab7-e0c5-4c00-88b0-657544451d7a | ishandutta2007/codeforces | eecs/normal/1499/G.cpp | #include <bits/stdc++.h>
using namespace std;
const int maxn = 400010, P = 998244353;
int n1, n2, m, q, ans, pw = 1, tot, d[maxn], fa[maxn], bel[maxn], s[maxn][2];
int find(int x) {
if (x == fa[x]) return x;
int y = find(fa[x]);
d[x] ^= d[fa[x]];
return fa[x] = y;
}
int main() {
ios::sync_with_st... | ALGO | 0.999902 | 5.233875 |
f4925c51-6ff4-4489-9bc2-d8c3291f0280 | Microvellum/BlenderFD2.79 | extern/carve/lib/csg_collector.cpp | #if defined(HAVE_CONFIG_H)
# include <carve_config.h>
#endif
#include <carve/csg.hpp>
#include <iostream>
#include "csg_collector.hpp"
#include "intersect_debug.hpp"
#if defined(CARVE_DEBUG_WRITE_PLY_DATA)
void writePLY(const std::string &out_file, const carve::mesh::MeshSet<3> *poly, bool ascii);
#endif
namespace ... | ALGO | 0.946377 | 5.17067 |
bd1e77b3-09cc-4d1f-84d4-01ec171af6ef | keke2014/JianzhiOffer | C++/06题目1385:重建二叉树.cpp |
#include <stdio.h>
struct BinTreeNode {
BinTreeNode(): lChild(NULL), rChild(NULL) {}
int nValue;
BinTreeNode* lChild;
BinTreeNode* rChild;
};
bool BuildTree(int len, int preOrder[], int inOrder[], BinTreeNode** root)
{
*root = new BinTreeNode;
(*root)->nValue = preOrder[0];
int pos = 0;
while (pos < len)
... | ALGO | 0.999997 | 4.12668 |
520dca14-0405-478b-87ed-4a96e2fc0c14 | sangwan14/Dynamic-Programming | MaximumPathSumMatrix.cpp | //Memoization
class Solution{
int solve(int i, int j, int n, int m, vector<vector<int>> &matrix, vector<vector<int>> &dp){
if(j<0 or j>=m) return INT_MIN;
if(i==n-1) return matrix[i][j];
if(dp[i][j]!=-1) return dp[i][j];
int down = solve(i+1,j,n,m,matrix,dp);
int leftDiag = solve(i+1,j-... | ALGO | 0.999979 | 6.228889 |
c9e400d3-3f09-403e-9301-20a38bcd0db8 | mdrion12/cps-academy-batch-4 | weekly-contest-2/B_Gleb_And_Pizza.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
int main()
{
ios::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
int r, d;
cin >> r >> d;
int t;
cin >> t;
int count = 0;
while (t--)
{
int a, b, c;
cin >> a >> b >> c;
double di... | ALGO | 0.999419 | 4.12307 |
db5f4048-3de8-4a7d-aff3-cf6e9737d4be | Bhupesh08/DSA | 0014-longest-common-prefix/0014-longest-common-prefix.cpp | class Solution {
public:
string longestCommonPrefix(vector<string>& strs) {
// if (strs.empty()) {
// return "";
// }
int n = strs.size();
string res;
for(int i=0; i<strs[0].size(); i++) {
char c = strs[0][i];
for(int j=1; j<n; j++) {
i... | ALGO | 0.999657 | 5.970728 |
ffc1b98b-b8cd-485b-87c0-816c584dc045 | mokkun2005/3DProgram | L01_Camera01/Src/Framework/Math/KdAnimation.cpp | #include "KdAnimation.h"
#include "../Direct3D/KdModel.h"
// 二分探索で、指定時間から次の配列要素のKeyIndexを求める関数
// list … キー配列
// time … 時間
// 戻り値 … 次の配列要素のIndex
template<class T>
int BinarySearchNextAnimKey(const std::vector<T>& list, float time)
{
int low = 0;
int high = (int)list.size();
while (low < high)
{
int mid = (low ... | ALGO | 0.985238 | 5.239141 |
5ea03d23-113b-4343-b108-87ed284d1fbb | Nayanmandlik1/Logic_Building | Logic_Building/program312.cpp | #include<iostream>
using namespace std;
typedef struct node
{
int data;
struct node *next;
}NODE, *PNODE, **PPNODE;
class SinglyLL
{
private:
PNODE First; // Characteristics
int iCount; // Chracteristics
public:
SinglyLL();
~SinglyLL();
void Ins... | ALGO | 0.999734 | 4.434119 |
300a4a40-0b9f-4d4f-8a26-f46c176c50f8 | r-chiba/competitive_programming | atcoder/abc/035/d2.cpp | // {{{
#include <iostream>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <complex>
#include <vector>
#include <list>
#include <set>
#include <queue>
#include <stack>
#include <map>
#include <string>
#include <algorithm>
#include <numeric>
using namespace std;
#define fi first
#defin... | ALGO | 0.999943 | 4.73479 |
51e95c10-eead-4474-be30-971e6f59e4fd | IgnaCat/codeforces | famaf-course/compe-2/E.cpp | #include <iostream>
#include <bits/stdc++.h>
#define fore(i,a,b) for(int i=a;i<b;i++)
#define pb push_back
#define fst first
#define snd second
#define FIN ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
using namespace std;
typedef long long ll;
bool check(vector<pair<ll,ll>> &v, ll n, ll p){
ll people = 1;
f... | ALGO | 0.999901 | 4.498609 |
756da5a6-7dbe-4639-8eb4-cdfefdd4f11a | shaneyuee/decorate_video | filter/fft_watermark.cpp | #include "fft_watermark.h"
#include "../3rd/log/LOGHelp.h"
#include <opencv2/imgproc/types_c.h>
#include <chrono>
using namespace cv;
#undef __MODULE__
#define __MODULE__ "FFTWaterMark"
cv::Mat FFTWaterMark::addTextWatermarkColorImage(const cv::Mat &inputImage, const std::string &text)
{
int col = inputImage.cols;
... | TOOL | 0.915597 | 5.143253 |
0df259af-1946-43e8-a856-cbcd95334baf | junqiangwu/LeetCode | 144.two_tree/main.cpp | #include <iostream>
#include "Solution.h"
int main() {
TreeNode* root;
Solution().CreatTree(root);
std::cout << "Hello, World!" << std::endl;
return 0;
} | ALGO | 0.921801 | 4.81638 |
e9d347fb-f146-4343-bc39-e14554bdd31d | Roshni-seth/Leetcode | 0145-binary-tree-postorder-traversal/0145-binary-tree-postorder-traversal.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.99994 | 6.079653 |
1dfe92d0-26bf-4f67-a945-cfd09ea6d461 | Yuriel849/WaferDefectDetection | VisionApp/thirdparty/opencv_481/sources/modules/video/src/tracking/detail/tracker_mil_state.cpp | #include "../../precomp.hpp"
#include "opencv2/video/detail/tracking.detail.hpp"
#include "tracker_mil_state.hpp"
namespace cv {
namespace detail {
inline namespace tracking {
/**
* TrackerStateEstimatorMILBoosting::TrackerMILTargetState
*/
TrackerStateEstimatorMILBoosting::TrackerMILTargetState::TrackerMILTargetSt... | ALGO | 0.967623 | 6.454565 |
8c38351e-de37-4db7-b1f3-e4bc85c61226 | yosupo06/library-checker-problems | graph/three_edge_connected_components/sol/correct.cpp | #include <algorithm>
#include <cassert>
#include <cstddef>
#include <cstdio>
#include <functional>
#include <numeric>
#include <utility>
#include <vector>
using usize = std::size_t;
class union_enumerate {
std::vector<usize> next;
public:
union_enumerate() = default;
union_enumerate(const usize size) : next(si... | ALGO | 0.999804 | 5.355813 |
6c6bb0f5-ae7a-4760-b12d-53cb3b273bf6 | xinw3/fast-code | mini1_project/18645_mini1/matrix_mul_canrun.cpp | #include <omp.h>
#include <iostream>
#include "matrix_mul.h"
#include <xmmintrin.h>
#include <string.h>
#include <x86intrin.h>
//#include <stdlib.h>
#define ROUND_UP(x, s) (((x)+((s)-1)) & -(s))
namespace omp
{
// void trans_sse(unsigned int sq_dimension, float *sq_matrix_2, float *sq_matrix_2_transpose,
// ... | ALGO | 0.99961 | 3.746547 |
fd5acda5-b5d4-4efb-ab57-a5fa2c77a427 | gratus907/Gratus_PS | AtCoder/AtCoder Regular Contest 094/E_Tozan and Gezan.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#pragma GCC optimize("O3")
#pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2,fma")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#define usecppio ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define all(x) ((x... | ALGO | 0.999985 | 3.51948 |
93686799-392b-499b-9349-6b887aa95c7e | Guna-Sekhar-Sai-Harsha/Lane-Change-Decision-Making-Using-Deep-RL | Lane Change Decision Making Using Deep RL/Lane Change Decision Making/src/Eigen-3.3/failtest/qr_int.cpp | #include "../Eigen/QR"
#ifdef EIGEN_SHOULD_FAIL_TO_BUILD
#define SCALAR int
#else
#define SCALAR float
#endif
using namespace Eigen;
int main()
{
HouseholderQR<Matrix<SCALAR,Dynamic,Dynamic> > qr(Matrix<SCALAR,Dynamic,Dynamic>::Random(10,10));
}
| TEST | 0.874762 | 3.076401 |
0e50c5d4-bdd8-40b3-8453-9bffb89558d0 | GURU1302/Problem-solving-HackerRank | taum_bday.cpp | #include <bits/stdc++.h>
using namespace std;
string ltrim(const string &);
string rtrim(const string &);
vector<string> split(const string &);
/*
* Complete the 'taumBday' function below.
*
* The function is expected to return a LONG_INTEGER.
* The function accepts following parameters:
* 1. INTEGER b
* 2. ... | ALGO | 0.991177 | 5.023644 |
350720f0-b766-49df-9e20-ee0b61166b0e | rivereh/CSS342 | HWs/HW3/temp.cpp | #include <iostream>
#include "doublylinkedlist.h"
using namespace std;
void initalizeList(DoublyLinkedList& list);
struct Nodee
{
User data;
Nodee* prev;
Nodee* next;
};
void insertFront(Nodee** start, User data)
{
Nodee* ptr1 = new Nodee;
ptr1->data = data;
ptr1->next = *start;
if (*sta... | ALGO | 0.993801 | 4.647798 |
f6563e69-33d9-4ddc-855b-a1f69182b60f | sarvex/leetcode-c-sharp | solution/0700-0799/0741.Cherry Pickup/Solution.cpp | class Solution {
public:
int cherryPickup(vector<vector<int>>& grid) {
int n = grid.size();
vector<vector<vector<int>>> dp(n << 1, vector<vector<int>>(n, vector<int>(n, -1e9)));
dp[0][0][0] = grid[0][0];
for (int k = 1; k < n * 2 - 1; ++k) {
for (int i1 = 0; i1 < n; ++i1)... | ALGO | 0.999989 | 5.735179 |
d34164c4-7253-48ee-a728-749975985836 | Priyankar96/face_recognize | opencv-master/opencv-master/samples/cpp/kmeans.cpp | #include "opencv2/highgui.hpp"
#include "opencv2/core.hpp"
#include "opencv2/imgproc.hpp"
#include <iostream>
using namespace cv;
using namespace std;
// static void help()
// {
// cout << "\nThis program demonstrates kmeans clustering.\n"
// "It generates an image with random points, then assigns a r... | ALGO | 0.997067 | 5.869509 |
015ac7b6-490c-4879-bfdb-65423f2b7ad8 | bhagvadgita/Leetcode | 525-contiguous-array/contiguous-array.cpp | class Solution {
public:
int findMaxLength(vector<int>& nums) {
unordered_map<int,int> ump;
int sum=0;
int max_len=0;
for (int i=0; i<nums.size(); i++){
if (nums[i]==0) sum-=1;
else sum+=1;
if (ump.find(sum)!=ump.end()){
max_len = m... | ALGO | 0.999841 | 6.085103 |
2340cfad-29f8-4dad-bce9-dc96b403c02e | j-c-w/DSPAcceleratorSupport | results/Github/MiBench_MiBench/accelerated_powerquad.cpp | /* Orignal skeleton is:
Pre: SKELETON:
With the array index wrappers power_quad_acc_output,Annon
And (fromvars) []
Under dimensions [power_quad_acc_n = NumSamples (=) ]
With conversion function IdentityConversion
>(new binding):
With the array index wrappers power_quad_acc_n
And (fromvars) [NumSamples]
Under dimen... | ALGO | 0.99474 | 5.813512 |
aa3d9479-4fbb-434a-a3b6-d2fc5797f97b | ishandutta2007/codeforces | aidos/normal/746/E.cpp | #include <iostream>
#include <cstdio>
#include <cstring>
#include <string>
#include <vector>
#include <cmath>
#include <algorithm>
#include <set>
#include <map>
#include <queue>
#include <ctime>
#define pb push_back
#define ll long long
#define mp make_pair
#define f first
#define s second
#define pii pair < int, int ... | ALGO | 0.999992 | 3.005318 |
84e91417-9346-4bc1-aea0-5d4a8b1924ee | mostpalon3/DSA | Striver/CodeForces.cpp/tempCodeRunnerFile.cpp | #include <bits/stdc++.h>
using namespace std;
bool falseAlarm(int doors, int buttonTime, vector<int> &arr)
{
while (doors)
{
for (int i = 0; i < arr.size(); i++)
{
if (arr[i] == 1)
{
if (buttonTime)
{
buttonTime = 0;
... | ALGO | 0.999739 | 4.857897 |
97bd1958-4b4a-449f-811e-95dcf56d5247 | ishandutta2007/codeforces | suiseiseki/normal/1023/B.cpp | #include <cstdio>
#include <iostream>
using namespace std;
int main(){
long long n,k;
cin>>n>>k;
long long left,right;
if(n<k){
left=k-n;
if(left>=n){
puts("0");
}
else{
cout<<(n-left+1)/2<<endl;
}
}
else{
right=k-1;
cout<<right/2<<endl;
}
return 0;
} | ALGO | 0.999894 | 3.056227 |
ff021a26-948b-4f67-bf97-fd1027965be7 | Capzera/Cpp | LeetCode/P0427.cpp | /*
P0427
һ n * n grid 0 1 ɡIJʾþ grid
Ҫܱʾ IJ ĸ㡣
ע⣬ isLeaf Ϊ False ʱ True False ֵڵ㣬ֵᱻ
IJݽṹУÿڲڵֻĸӽڵ㡣⣬ÿڵ㶼ԣ
valҶӽֵ1 Ӧ True0 Ӧ False
isLeaf: ڵһҶӽʱΪ True 4 ӽڵΪ False
class Node {
public boolean val;
? ? public boolean isLeaf;
? ? public Node topLeft;
? ? public Node topRight;
? ? public Node bottomLeft;
? ? publi... | ALGO | 0.999812 | 5.34569 |
c41d8157-4903-49bd-be8e-1f9d5d6abced | EloToJaa/Testing | 1. Poradnik debugowania/materiały/zbiory_struct.cpp | #include <bits/stdc++.h>
using namespace std;
struct P {
int x, y, z;
};
ostream& operator<<(ostream& out, const P& rhs) {
out << "(" << rhs.x << ", " << rhs.y << ", " << rhs.z << ")";
return out;
}
double heron(double a, double b, double c) {
double p = (a + b + c) / 2;
return sqrt(p * (p - a) *... | ALGO | 0.999289 | 4.280504 |
2618f699-aee9-4a84-abe0-7887dfefce97 | ShashiShekharSuman/DSA | LRU_cache.cpp | #include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
// design the class in the most optimal way
class LRUCache
{
private:
list<pair<int, int>> l;
unordered_map<int, list<pair<int, int>>::iterator> cache;
int capacity;
public:
// Constructor for initializing the cache capacity with the... | ALGO | 0.995253 | 5.417817 |
a2f9c372-1b32-40eb-97e2-c37dc5beaa79 | mairohanhoon/CodeForces-Files | 275_Lights_out.cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
vector<vector<int>> v(3, vector<int>(3));
vector<vector<int>> a(3, vector<int>(3));
for(int i=0; i<3; i++){
for(int j=0; j<3; j++){
cin >> v[i][j];
a[i][j] = 1;
}
}
for(int i=0; i<3; i++){
for(... | ALGO | 0.999927 | 3.625072 |
d8e6707c-db18-417c-ace4-a8541df7e3b3 | tudelft3d/PSSNet | step-1/3rd_party/CGAL/examples/Interpolation/nn_coordinates_with_info_2.cpp | #include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
#include <CGAL/Delaunay_triangulation_2.h>
#include <CGAL/natural_neighbor_coordinates_2.h>
#include <CGAL/Triangulation_vertex_base_with_info_2.h>
#include <iostream>
#include <iterator>
#include <utility>
#include <vector>
typedef CGAL::Exact_predicat... | ALGO | 0.999384 | 7.099467 |
68186f39-bca3-4fad-b2b4-b3c7eb2d26d6 | vitalykov/yandex-training | week2/d.cpp | #include <iostream>
#include <vector>
#include <limits>
#define DEFAULT std::numeric_limits<int>::min()
struct SegmentTreeNode {
int value;
int index;
};
int ClosestPower2(int a) {
--a;
a |= a >> 1;
a |= a >> 2;
a |= a >> 4;
a |= a >> 8;
a |= a >> 16;
++a;
return a;
}
void B... | ALGO | 0.999887 | 5.122446 |
aa8bf937-3662-4b4c-99c8-a5d6141b52fc | jooa7878/Algorithm | BOJ/단계별로 풀어보기/DFS와 BFS/24444 알고리즘 수업 - 너비 우선 탐색 1.cpp | #include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <queue>
using namespace std;
#define endl '\n';
int N, M, R;
vector<int> adj[100001];
int visited[100001];
int cnt = 1;
void solution(int node)
{
queue<int> q;
q.push(node);
while (!q.empty())
{
int next ... | ALGO | 0.99999 | 4.175479 |
781bbccc-36a3-4a6b-9fed-7c72a816ee81 | BackyardBrains/Spike-Recorder-IOS | source/libs/cinder_0.8.6_mac/blocks/Box2D/src/Box2D/Dynamics/Contacts/b2PolygonContact.cpp | #include <Box2D/Dynamics/Contacts/b2PolygonContact.h>
#include <Box2D/Common/b2BlockAllocator.h>
#include <Box2D/Collision/b2TimeOfImpact.h>
#include <Box2D/Dynamics/b2Body.h>
#include <Box2D/Dynamics/b2Fixture.h>
#include <Box2D/Dynamics/b2WorldCallbacks.h>
#include <new>
using namespace std;
b2Contact* b2PolygonCon... | ALGO | 0.989157 | 7.207775 |
c41ff850-c15b-40e0-827f-88ec71e4ba71 | maha123m/Leetcode- | 0206-reverse-linked-list/0206-reverse-linked-list.cpp | /**
* Definition for singly-linked list.
* 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* reverseList... | ALGO | 0.999432 | 5.622236 |
5d5506d0-e17f-455e-81f7-e21ae303f289 | ishandutta2007/codeforces | savinov/normal/197/A.cpp | #include <iostream>
#include <algorithm>
using namespace std;
int main()
{
int a,b,r;
cin >> a >> b >> r;
if (2*r<=min(a,b)) cout << "First\n"; else cout << "Second\n";
return 0;
} | ALGO | 0.999779 | 3.624549 |
29e89589-2a8c-4207-9d66-f451598e8219 | kuzznya/Algos1 | Sem1/Lab3/E.cpp | #include <iostream>
#include <fstream>
#include <vector>
#include <string>
using namespace std;
void radixsort(vector<string>& arr, int m, int k) {
for (int i = m - 1; i >= m - k; i--) {
vector<int> counters(26, 0);
for (int j = 0; j < arr.size(); j++) {
counters[arr[j][i] - 'a']++;
... | ALGO | 0.99994 | 4.317147 |
381981eb-4046-4b5f-8fd9-f9222c97d81a | aemperor/graphics_projects | project5/cg4cpp/src/upper2x3.cpp | #include <Cg/double.hpp>
#include <Cg/upper2x3.hpp>
namespace Cg {
float2x3 upper2x3(float1x1 m)
{
return upper2x3<float,1,1>(m);
}
float2x3 upper2x3(float1x2 m)
{
return upper2x3<float,1,2>(m);
}
float2x3 upper2x3(float1x3 m)
{
return upper2x3<float,1,3>(m);
}
float2x3 upper2x3(float1x4 m)
{
retur... | TOOL | 0.880284 | 5.79811 |
61c33bf3-fd6e-4c37-af85-1a617a5c600f | Arctic2333/awesome-Learning-notes | 数据结构/test/Test-8/Replace.cpp | #include "stdio.h"
#include "string.h"
const int N0 = 1000;
char *index(char *s,char *sub) //sвsubҵַַҲؿ
{
int i = 0, j = 0;
char *p = sub;
if (*sub == '\0') return NULL;
//******************************************
return strstr(s, sub);
//==========================================
}
void insStr(char *s, ... | ALGO | 0.995547 | 3.387552 |
5ecf091e-06f5-44df-bedb-d310a76213c9 | viv511/CompetitiveProgramming | AdventOfCode2024/2a_2024.cpp | #include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
#include <map>
#include <set>
#include <queue>
typedef long long ll;
typedef unsigned long long ull;
using namespace std;
typedef vector<int> vi;
typedef pair<int, int> pi;
#define all(v) v.begin(), v.end()
#define mp make_p... | ALGO | 0.998862 | 3.947087 |
2c0aafc0-5aad-4169-a710-106b2a9bee91 | Illusion0-0/LCBase | 3002-maximum-size-of-a-set-after-removals/3002-maximum-size-of-a-set-after-removals.cpp | class Solution {
public:
int maximumSetSize(vector<int>& nums1, vector<int>& nums2) {
set<int> s1, s2, s;
int n = nums1.size();
for (int x : nums1) {
s1.insert(x);
s.insert(x);
}
for (int x : nums2) {
s2.insert(x);
s.insert(x);
... | ALGO | 0.999837 | 5.413233 |
1b47852e-9afb-4161-a769-95561322b809 | liangjisheng/C-Cpp | Algorithm/Matrix and array/牛顿迭代.cpp | #include"stdio.h"
#include"math.h"
//func
double func(double x)
{return x*x*x*x-3*x*x*x+1.5*x*x-4.0;}
//dfunc
double dfunc(double x)
{return 4*x*x*x-9*x*x+3*x;}
//newton
int newton(double *x,int maxcyc,double precision)
{
double x0=*x,x1;
int i=0;
while(i<maxcyc){
if(dfunc(x0)==0.0)
{printf("迭代过程中导数为0.\n");retur... | ALGO | 0.999992 | 3.88894 |
1c73091c-b4b5-4ec5-8de9-fb76ff3ceb3a | DPChanny/workspace | PS/Baekjoon/2346.cpp | #include <cstdlib>
#include <deque>
#include <iostream>
#include <vector>
using namespace std;
int main(void) {
int n;
cin >> n;
deque<int> d;
vector<int> ns(n);
for (int _n(0); _n < n; _n++) {
cin >> ns[_n];
d.push_back(_n);
}
while (!d.empty()) {
cout << d.front() + 1 << ' ';
int i(ns... | ALGO | 0.999994 | 3.871676 |
6b2dc465-5fba-413b-bd48-1e578ae175b2 | comp0zr/Project-Euler-Solutions | 121_Disc-game-prize-fund.cpp | prev = {(0, 0): 1}
M = {}
for move in range(65):
M[move] = [0, 0]
_next = {}
for i in sorted(prev.items()):
poss = i[0]
count = i[1]
if(poss[0] > poss[1]):
M[move][0] += count
M[move][1] += count
... | ALGO | 0.999542 | 4.931149 |
626fa806-731f-470d-8693-1d2037a3bb4a | shivani26-bot/DSA-questions | 0673-number-of-longest-increasing-subsequence/0673-number-of-longest-increasing-subsequence.cpp | class Solution {
public:
// dp[i] tells length of lis including the ith index, longest increasing subsequence ending at ith indkex
// if we encounter the same length of lis for a particular index
// for more than 1 time then we increase the count[i] for dp[i]
// count[i] tells number of lis for the dp[i]
// every ind... | ALGO | 0.999997 | 6.113496 |
a136c002-ab7a-4e8b-8943-d837905c239a | Agrit-Garg/AgritGarg_PS_2A | day2_9.cpp | #include<iostream>
using namespace std;
int main()
{ int a;
cin>>a;
for(int i=1;i<=a;i++){
for(int j=i;j<=a-1;j++){
cout<<" ";
}
for(int k=1;k<=2*i-1;k++){
cout<<"*";
}
cout<<endl;
}
int n=1;
for(int i=a-1;i>=1;i--){
for(int ... | ALGO | 0.999924 | 3.454236 |
f2d2da4a-8e3d-47f1-b28f-61cc967940a2 | seongho-joo/PS_study | BOJ/1747.cpp | /**
* https://www.acmicpc.net/problem/1747
* BOJ1747 소수&팰린드롬
*/
#include <iostream>
#include <string>
using namespace std;
const int MAX = 2000000;
bool prime[MAX + 1];
void getPrimeNum() {
prime[0] = true;
prime[1] = true;
for (int i = 2; i <= MAX; i++) {
if (!prime[i])
for (int j... | ALGO | 0.999839 | 5.827045 |
3510807a-c929-4447-8a8b-a4df98af388a | nishant-Tiwari24/data-structures-algorithms | switch-functions/void-counting.cpp | #include <iostream>
using namespace std;
void counting(int n) {
int i = 0;
while(n>0) {
cout<<i<<endl;
i++;
}
}
int main() {
int n;
cout << "Enter the number of elements: ";
cin >> n;
counting(n);
return 0;
} | ALGO | 0.997596 | 4.1194 |
64dd03a2-edcb-4bcf-9aea-5d59d7e400ea | Twix19/c_university | Samostoyatelnaya_rabota_5_Func_prodvinuty_uroven/task8/ConsoleApplication1/ConsoleApplication1.cpp | #include <iostream>
int calculateDoubleFactorial(int n) {
int result = 1;
for (int i = n; i >= 1; i -= 2) {
result *= i;
}
return result;
}
int main() {
int n;
std::cout << "Введите число n: ";
std::cin >> n;
int doubleFactorial = calculateDoubleFactorial(n);
std::cout <... | ALGO | 0.999885 | 6.763228 |
0d1309ad-c75f-4c49-a723-ac048e7aa5dc | MillerJia/cpp_study_demos | gslDemos/gsl_test_gauss_pickpoints.cpp | #include <iostream>
#include <gsl/gsl_integration.h>
double f(double x, void* params) {
// double f = sin(x) * 2;
// return f;
double f = x * x + x * x * x;
return f;
}
int main()
{
gsl_integration_fixed_workspace* w;
const gsl_integration_fixed_type* T = gsl_integration_fixed_legendre;
w = gsl_integrat... | ALGO | 0.982789 | 4.812725 |
ad1c8b51-1ab6-4011-9888-4a37c9ec60de | xxMeow/Pinball | Box2D/Dynamics/b2Island.cpp | #include "Box2D/Collision/b2Distance.h"
#include "Box2D/Dynamics/b2Island.h"
#include "Box2D/Dynamics/b2Body.h"
#include "Box2D/Dynamics/b2Fixture.h"
#include "Box2D/Dynamics/b2World.h"
#include "Box2D/Dynamics/Contacts/b2Contact.h"
#include "Box2D/Dynamics/Contacts/b2ContactSolver.h"
#include "Box2D/Dynamics/Joints/b2... | ALGO | 0.999957 | 4.765239 |
2cc8bbd1-85d8-4a7a-a898-b831765b789c | Abhinow-katore/LeetCode-Hunt | 354-russian-doll-envelopes/354-russian-doll-envelopes.cpp | class Solution {
public:
static bool comp(vector<int> &a, vector<int> &b)
{
if (a[0] != b[0])
return a[0] < b[0];
return a[1] > b[1];
}
int maxEnvelopes(vector<vector<int>> &en)
{
sort(en.begin(), en.end(), comp);
vector<int> sub;
for (auto it : en)
{
if (sub.empty() || sub[sub.s... | ALGO | 0.999995 | 6.020218 |
bea08a5e-8d18-4912-b66a-d975a03918a6 | ishandutta2007/codeforces | gullesnuffs/normal/566/G.cpp | #include <bits/stdc++.h>
using namespace std;
#define rep(i, a, b) for(int i = (a); i < int(b); ++i)
#define rrep(i, a, b) for(int i = (a) - 1; i >= int(b); --i)
#define trav(it, v) for(typeof((v).begin()) it = (v).begin(); it != (v).end(); ++it)
#define all(v) (v).begin(), (v).end()
#define what_is(x) cerr << #x << ... | ALGO | 0.999979 | 3.562601 |
4717e036-b7e4-418c-99ff-a0a9766af2e0 | denis-gubar/Leetcode | Heap (Priority Queue)/2593. Find Score of an Array After Marking All Elements.cpp | class Solution {
public:
long long findScore(vector<int>& nums) {
int N = nums.size();
nums.push_back(0);
long long result = 0;
set<pair<int, int>> S;
for (int i = 0; i < N; ++i)
S.insert({ nums[i], i });
while (!S.empty())
{
pair<int, ... | ALGO | 0.999983 | 4.783795 |
7b38cdfe-3c38-463f-8c8d-c77b24ec2e21 | dhirajdarakhe/CodeForces | _Xor_Palindrome.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
#define fi first
#define se second
#define INF 2e18
#define all(x) (x).begin(), (x).end()
typedef vector<ll> v64;
typedef vector<int> v32;
#define fast_DHIraj() \
ios_base::sync_with_stdio(false); \
cin.tie(N... | ALGO | 0.999872 | 4.751546 |
6027f0ab-04f1-459a-9e3b-24a0aa49e694 | Dudam-Neeraj-Dattu/DSA_DND_CPP | 06. Arrays/23_maxminofarray.cpp | #include<iostream>
using namespace std;
int main() {
int n;
cin >> n;
int a[n] = {0};
for(int i = 0; i < n; i++) {
cin >> a[i];
}
int mini = a[0], maxi = a[0];
for(int i = 1; i < n; i++) {
mini = min(mini, a[0]);
maxi = max(maxi, a[i]);
}
cout << mini << " ... | ALGO | 0.999885 | 3.853606 |
a07b0400-6095-4978-813f-3e6b872a006d | flagflag/FlagGG | 3rd/PhysX/physx/source/geomutils/src/ccd/GuCCDSweepPrimitives.cpp | #include "Ps.h"
#include "GuVecCapsule.h"
#include "GuVecBox.h"
#include "GuVecConvexHull.h"
#include "GuVecTriangle.h"
#include "GuGJKRaycast.h"
#include "GuCCDSweepConvexMesh.h"
#include "GuGJKType.h"
namespace physx
{
namespace Gu
{
using namespace Ps::aos;
template<typename Geom> PX_FORCE_INLINE PxReal getRadiu... | ALGO | 0.989354 | 6.682393 |
e48f94ea-eff6-4ab2-803c-08ee4cb293d6 | tolgabirdal/structured_light | Galois.cpp |
#include "Galois.hpp"
void Galois::genRandomSequence(std::vector<int>& GaloisSequence)
{
const int l = (int)pow((double)q, (double)degree) - 1;
std::vector<int> seed(degree, 0);
int* primPoly1, i, j;
seed[0] = 1; // fill the first one with 1
primPoly1 = &PrimPoly[1];
GaloisSequence.resize(l);
// generate se... | ALGO | 0.994579 | 4.549568 |
281f110c-717b-485b-8c95-b28a211fb813 | jakovmitrovski/competitive-programming-algo-cpp | national/state/dumbtictactoe.cpp | #include<string>
#include <vector>
#include <queue>
#include <map>
#include <cmath>
using namespace std;
map<string, bool> visited;
int win0 = 0, winX = 0, draw = 0, cnt = 0;
bool check(string s){
if (s[0] == s[3] and s[3] == s[6] and s[0] =='x') {
winX++;
return true;
}
if (s[1] == s[4] ... | ALGO | 0.999909 | 4.388874 |
1405220f-20de-404d-9f19-2bc3fae817fe | skybarer/codeforces | A_There_Are_Two_Types_Of_Burgers.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int tc; cin >> tc;
while(tc--) {
int b, p, f; cin >> b >> p >> f;
int h, c; cin >> h >> c;
b /= 2;
int ans = 0, hb = 0, cb = 0;
if(h > c) {
hb = min(b, p);
ans += hb * h;
cb ... | ALGO | 0.998101 | 3.589098 |
a919bbb9-2413-4eba-b3c0-6e3275d2dbae | marlonwc3/cp-codes | CF/CF489C==Given Length and Sum of Digits.cpp | #include <bits/stdc++.h>
#define _ printf("\n");
#define sc1(a) scanf("%d", &a)
#define sc2(a,b) scanf("%d %d", &a, &b)
#define sc3(a,b,c) scanf("%d %d %d", &a, &b, &c)
#define sc4(a,b,c, d) scanf("%d %d %d %d", &a, &b, &c, &d)
#define iz(b) if(b==0) { break; }
#define pf(a) printf("%d ", a);
#define pfc(c,a) printf("%... | ALGO | 0.99982 | 3.103377 |
3e5ea37d-6ec9-4ae7-b1a4-279dc6d1bcd7 | chiuchiuuu/programming-and-algorithm | 3.C++程序设计/week10(final)/计算数列平方和.cpp | #include <iostream>
using namespace std;
// ڴ˴Ĵ
int sum(const int *array, int num, int(*func)(int n))
{
int sum = 0;
for (int i = 0; i < num; i++)
{
sum += func(array[i]);
}
return sum;
}
int sqr(int n)
{
return n * n;
}
int main() {
int t, n, a[0x100];
cin >> t;
for (int c = 0; c < t; ++c) {
cin >> n;
... | ALGO | 0.999425 | 4.598756 |
7354ff34-6f01-423e-a197-1697af2a4b63 | raincross7/code-similarity | codes/train_code/problem488/problem488_474.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main()
{
ll N, K;
cin >> N >> K;
ll res = 0;
for (ll i = K; i <= N + 1; i++)
{ // calculate over k.
ll pattern = i * (2 * N - i + 1) / 2 - i * (i - 1) / 2 + 1;
res = (res + pattern) % 1000000007;
}
cout ... | ALGO | 0.999917 | 4.229722 |
8fcd5a76-7a77-4120-8aaa-dec3f2390a15 | Atari007/master | src/bindings/ScriptDev2/scripts/eastern_kingdoms/loch_modan.cpp | /* ScriptData
SDName: Loch_Modan
SD%Complete: 100
SDComment: Quest support: 3181 (only to argue with pebblebitty to get to searing gorge, before quest rewarded), 309
SDCategory: Loch Modan
EndScriptData */
/* ContentData
npc_mountaineer_pebblebitty
npc_miran
EndContentData */
#include "precompiled.h"
#include "escort... | TOOL | 0.874396 | 5.736197 |
741f82e4-7ac7-4431-91e3-28edea530ffc | pralinkhaira/gfg-soln | Difficulty: Medium/Split array in three equal sum subarrays/split-array-in-three-equal-sum-subarrays.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
// User function Template for C++
// Class Solution to contain the method for solving the problem.
class Solution {
public:
// Function to determine if array arr can be split into three equal sum sets.
vector<int> fin... | ALGO | 0.987992 | 5.904362 |
37c409ec-1789-44be-be8b-232f7a00ed09 | Clarus23/algorithm-training | boj/Lv2_silver/rank3/15649.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main(void) {
int n, m;
cin >> n >> m;
vector<int> v(n);
for(int i=0; i<n; i++) v[i] = i+1;
do {
for(int i=0; i<m; i++) cout << v[i] << ' ';
cout << '\n';
reverse(v.begin()+m, v.end());
}... | ALGO | 0.999986 | 3.986716 |
02c0be23-df4f-4ea7-93ec-6186d5ad16fd | RoBorregos/entrenamiento-SWE | Fall_2020/Week_1/best-time-to-buy-and-sell-stock.cpp | /*
Problem: https://leetcode.com/problems/best-time-to-buy-and-sell-stock/
Approach: Traverse the vector once, keeping track of the minimum price, and
with that calculating each difference to track the max profit.
Time complexity: O(n)
Space complexity: O(1)
*/
#include <iostream>
#include <vector>
#inc... | ALGO | 0.997506 | 6.702257 |
86e51c05-f14b-4ccb-b558-14a618498062 | dajeonghae/DataStructure-Algorithm | Algorithm/DynamicProgramming/baekjoon/BOJ12852.cpp | #include <iostream>
#include <algorithm>
using namespace std;
int D[1000002];
int rem[1000002];
int N;
int main(void)
{
cin >> N;
rem[1] = N;
for (int i = 2; i <= N; i++)
{
D[i] = D[i - 1] + 1;
rem[i] = i - 1;
if (i % 2 == 0 && D[i] > D[i / 2] + 1)
{
D[i] = D[i / 2] + 1;
rem[i] = ... | ALGO | 0.999996 | 3.831747 |
69701753-fbcc-4b38-86ec-cd16f1102de2 | Piau3425/Code-Practice | CPE/250325/p1-uva_11461.cpp | #include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define fi first
#define se second
#define INF LONG_LONG_MAX/1000
#define WA() ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL)
#define all(x) (x).begin(), (x).end()
#define int long long
#define PII pair<int, int>
signed main() { WA();... | ALGO | 0.999678 | 4.793311 |
2e246c5b-0ef7-4460-9845-8560cf3e63a1 | geeks-hub-nith/Programming | Graphics/example_ellipse.cpp | #include <bits/stdc++.h>
#include "graphics.cpp"
using namespace std;
void midptellipse(int rx, int ry,
int xc, int yc)
{
graphics g;
float dx, dy, d1, d2, x, y;
x = 0;
y = ry;
// Initial decision parameter of region 1
d1 = (ry * ry) - (rx * rx * ry) +
(0... | ALGO | 0.99905 | 4.093608 |
b962b012-b88c-4769-96b9-565f44d65f4d | Pranav-Rustagi/Problem-Solving | 0225-implement-stack-using-queues/0225-implement-stack-using-queues.cpp | class MyStack {
public:
queue<int> q;
void push(int x) {
q.push(x);
}
int pop() {
int n = q.size();
while(--n) {
q.push(q.front());
q.pop();
}
int x = q.front();
q.pop();
return x;
}
int top() {
return... | ALGO | 0.997652 | 5.865614 |
23059595-7354-487d-90dd-82ae73a95477 | xiaohuihuigh/cpp | acm/hdu/1166.cpp | #include <iostream>
#include <sstream>
#include <ios>
#include <iomanip>
#include <functional>
#include <algorithm>
#include <vector>
#include <string>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <set>
#include <map>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cstring... | ALGO | 0.998602 | 3.713693 |
2b2849ad-2e50-4e64-9503-946059f4ec22 | daidezhi/alphaInitializerFoam | eigen3/unsupported/test/BVH.cpp | #include "main.h"
#include <Eigen/StdVector>
#include <Eigen/Geometry>
#include <unsupported/Eigen/BVH>
namespace Eigen {
template<typename Scalar, int Dim> AlignedBox<Scalar, Dim> bounding_box(const Matrix<Scalar, Dim, 1> &v) { return AlignedBox<Scalar, Dim>(v); }
}
template<int Dim>
struct Ball
{
EIGEN_MAKE_ALIGN... | TEST | 0.99419 | 6.315364 |
db432319-7d9a-43ba-ac48-f8702f8b46c5 | wiiwu959/CSIE-HW | Object_Oriented_Programming/homeworks/09-Reversal/Reversal/main.cpp | #include <iostream>
#include <string>
#include <fstream>
#include <map>
#include <algorithm>
using namespace std;
int main()
{
string input, maxWord;
fstream data;
data.open("words.txt");
if (data.fail())
{
cout << "File open failed." << endl;
return 0;
}
int id = 0, max = -1;
map<string, int> allData;... | ALGO | 0.999328 | 4.467257 |
6423637d-fadb-4b44-8d4b-331b1176ac62 | KBentley57/libnoise | src/module/terrace.cpp | #include "../interp.h"
#include <algorithm>
#include "terrace.h"
using namespace noise::module;
using namespace noise;
Terrace::Terrace ():
Module (GetSourceModuleCount ()),
m_controlPointCount (0),
m_invertTerraces (false),
m_pControlPoints (nullptr)
{
}
Terrace::~Terrace ()
{
delete[] m_pControlPoints;
... | ALGO | 0.983233 | 6.807294 |
6dffd57c-316e-446d-b6c2-6f0e6cdc2598 | dschoerk/vis2 | ext/PCL/3rdparty/eigen/bench/sparse_trisolver.cpp |
//g++ -O3 -g0 -DNDEBUG sparse_product.cpp -I.. -I/home/gael/Coding/LinearAlgebra/mtl4/ -DDENSITY=0.005 -DSIZE=10000 && ./a.out
//g++ -O3 -g0 -DNDEBUG sparse_product.cpp -I.. -I/home/gael/Coding/LinearAlgebra/mtl4/ -DDENSITY=0.05 -DSIZE=2000 && ./a.out
// -DNOGMM -DNOMTL
// -I /home/gael/Coding/LinearAlgebra/CSparse/... | ALGO | 0.997851 | 4.864765 |
f57d7521-f78c-4fd9-93b4-428e318c56ed | hjiang13/LLMs-in-IR | POJ-104/30/53.cpp | #include <iostream>
using namespace std;
void main()
{
int i,n;
long sum=0;
cin >> "%d",&n);
for (i=1; i<=n; i++)
{
if ((7*floor(i/7)!=i) && (i%10 != 7) && (i/10 !=7) )
sum=sum + i*i ;
}
cout << "%d\n",sum);
} | ALGO | 0.999496 | 3.080596 |
e36beb2c-cd88-4e7c-bc00-29cf610aed33 | caosong/minimal_scene | lib/Eigen/bench/bench_norm.cpp | #include <typeinfo>
#include <iostream>
#include <Eigen/Core>
#include "BenchTimer.h"
using namespace Eigen;
using namespace std;
template<typename T>
EIGEN_DONT_INLINE typename T::Scalar sqsumNorm(const T& v)
{
return v.norm();
}
template<typename T>
EIGEN_DONT_INLINE typename T::Scalar hypotNorm(const T& v)
{
r... | TOOL | 0.962403 | 6.558741 |
158bc126-5c73-4bbf-b8bf-50201b0e109a | AST-TheCoder/CP-Solutions | CodeForces/GNU C++14/1303D | Fill The Bag/70904483.cpp | //Bismillahir Rahmanir Rahim//
#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 fast ios_base::sync_with_stdio(false);cin.tie(NULL)
#define in1(X) scanf("%lli",&(X))
#define ins(... | ALGO | 0.999975 | 3.640069 |
7d08a055-9151-43b4-8669-a6665d4025da | trisha217/Leetcode | 0368-largest-divisible-subset/0368-largest-divisible-subset.cpp | class Solution {
public:
vector<int> largestDivisibleSubset(vector<int>& nums) {
int n = nums.size();
sort(nums.begin(),nums.end());
vector<int> dp(n,1),hash(n);
int maxi=1,last_index=0;
for(int i = 0;i<n;i++){
hash[i]=i;
for(int j = 0;j<i;j++){
... | ALGO | 0.999997 | 5.499685 |
70f6893c-da8d-497c-8618-516c85bd9cbf | 4evrinspace/testwork_1440 | 2_task/2_task_evidence.cpp | #include <iostream>
#include <vector>
#include <fstream>
#include <algorithm>
int main()
{
std::ifstream input("data_prog_contest_problem_2.txt");
int n;
input >> n;
std::vector<int> letters(n);
for (auto& letter : letters)
{
input >> letter;
}
for (int i = 1; i <= 26; i++)
... | ALGO | 0.999511 | 3.941818 |
8d5271c4-06c7-47df-9132-a7d0039417f4 | prashant-998/DSA | Finding Profession - GFG/finding-profession.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
{
char solve(int level, int pos)
{
if(level==1)
{
return 'e';
}
if(pos==0)
{
return ... | ALGO | 0.99917 | 5.402761 |
fdb1a739-ae7f-4bae-bab1-9132f1e28d27 | danny8306/Visual-LiDAR-and-Inertial-SLAM-Evaluation | lvi-sam/src/LVI-SAM/src/lidar_odometry/imuPreintegration.cpp | #include "utility.h"
#include <gtsam/geometry/Rot3.h>
#include <gtsam/geometry/Pose3.h>
#include <gtsam/slam/PriorFactor.h>
#include <gtsam/slam/BetweenFactor.h>
#include <gtsam/navigation/GPSFactor.h>
#include <gtsam/navigation/ImuFactor.h>
#include <gtsam/navigation/CombinedImuFactor.h>
#include <gtsam/nonlinear/Non... | ALGO | 0.966872 | 3.616935 |
66c735f7-22e2-4770-998d-d44011bd641c | sarvex/leetcode-beef | solution/2000-2099/2042.Check if Numbers Are Ascending in a Sentence/Solution.cpp | class Solution {
public:
bool areNumbersAscending(string s) {
int pre = 0;
istringstream is(s);
string t;
while (is >> t) {
if (isdigit(t[0])) {
int cur = stoi(t);
if (pre >= cur) {
return false;
}
... | ALGO | 0.999836 | 6.10862 |
94cbf450-3b97-4511-ad7a-59a8548167ff | 1Reek/OBS_windows_master | UI/win-update/updater/patch.cpp | #include "updater.hpp"
#include <stdint.h>
#include <vector>
#ifdef _MSC_VER
#define restrict __restrict
#include <lzma.h>
#undef restrict
#else
#include <lzma.h>
#endif
using namespace std;
#define MAX_BUF_SIZE 262144
#define READ_BUF_SIZE 32768
/* -----------------------------------------------------------------... | TOOL | 0.884905 | 5.233949 |
3c0d74bc-7be3-4016-993e-a8b0acc34cd6 | DevJrMax/Reconhece-O | Reconhece O/main.cpp | #include <iostream>
#include <random>
#include <string>
#include <stdio.h>
#include <time.h>
#include <cstdlib>
#include <ctime>
#include <cmath>
#include <math.h>
#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/imgproc/imgproc.hpp>
#define PI 3.14159265359
using namespace st... | ALGO | 0.908845 | 3.13582 |
f113e7e9-3a0c-4b81-bab0-9fd45d40a1f7 | mshirw/Optimizing-Deep-Learning-Models-for-ARM-Cortex-M-Through-Pruning | cortexm/mnist/cortexm_main.cpp | #include <stdint.h>
#include <stdio.h>
#include "arm_math.h"
#include "cortexm_weight.h"
#include "arm_nnfunctions.h"
#include "arm_nnsupportfunctions.h"
#include "cmsis_gcc.h"
#ifdef _RTE_
#include "RTE_Components.h"
#ifdef RTE_Compiler_EventRecorder
#include "EventRecorder.h"
#endif
#endif
#include "cortexm_main.h"
#... | DATA | 0.962127 | 3.274595 |
38f235f0-f337-4ab8-87a3-ec70267c46aa | PaukIsUha/optimizing_formating_code | predictions/submissions-aizu-coop-gpt35/Codenet/p02357/220301441/response_3.cpp | #include <iostream>
#include <vector>
#include <cstdint>
template <typename T>
class StaticRMQ {
std::vector<T> a;
public:
StaticRMQ(std::vector<T>& array) {
a = array;
}
T operator()(uint32_t begin, uint32_t end) {
T min_val = a[begin];
for (uint32_t i = begin + 1; i <= end; ++i) {
if (a[i... | ALGO | 0.999846 | 3.057417 |
7b9cc160-f9d5-4b7f-a2e9-34135aca013c | LeeYunSung/Algorithm | LeetCode/LeetCode_441_Arranging Coins.cpp | #include <cmath>
class Solution {
public:
int arrangeCoins(int n) {
return (int)(sqrt(2 * (long)n + 0.25) - 0.5);
}
};
| ALGO | 0.999945 | 5.929383 |
f4972a4b-0e6b-47ad-9c88-b0045488fc28 | quangloc99/CompetitiveProgramming | UVA/UVA 622.cpp | /**
* Author: Tran Quang Loc (darkkcyan)
* Notes: I changed the grammar a bit. The expression is have a pair of brackets surround it now. Doing that made the parsing easier.
*/
#include <bits/stdc++.h>
using namespace std;
#define llong long long
#define xx first
#define yy second
#define len(x) ((int)x.si... | ALGO | 0.993162 | 4.642016 |
69499d3b-2b1d-4283-9b63-363bbfe05cc6 | EslSuwen/CPP-note | contest/历届试题_Excel_地址.cpp | /*
* @Author: Suwen
* @Description:
* @LastEditors: Suwen HS\n
* @Date: 2019-03-08 19:41:02
* @LastEditTime: 2019-03-08 20:23:16
*/
#include <iostream>
using namespace std;
int main()
{
int n;
cin >> n;
char c[100];
int cnt = 0;
while (n)
{
if (n % 26 == 0)
{
c[... | ALGO | 0.99978 | 4.099401 |
b2a03ba5-850a-490a-83b9-166812e4448a | Sarthak-IET2019/DailyDsa | LeetcodeDaily/daily112.cpp | // scrambled string
class Solution {
public:
unordered_map<string,bool> mp;
bool isScramble(string s1, string s2) {
int n=s1.length();
if(s1.length()!=s2.length()) return false;
if(s1.length()==0 and s2.length()==0) return true;
if(s1.compare(s2)==0) r... | ALGO | 0.999991 | 5.801841 |
6d36f879-9373-4978-8b68-534fd38c625f | worthless443/llvm_modulation | libcxx/test/std/algorithms/alg.nonmodifying/alg.equal/ranges.equal.pass.cpp | // <algorithm>
// UNSUPPORTED: c++03, c++11, c++14, c++17
// UNSUPPORTED: libcpp-has-no-incomplete-ranges
// template<input_iterator I1, sentinel_for<I1> S1, input_iterator I2, sentinel_for<I2> S2,
// class Pred = ranges::equal_to, class Proj1 = identity, class Proj2 = identity>
// requires indirectly_comp... | TEST | 0.927196 | 7.478641 |
6c2de220-1a67-4646-875d-dfbe23689900 | Nahin-CDR/CodeForces | Rating : 1000/B1. Character Swap (Easy Version).cpp | //Author : Nahin the Coder
//Date : 13-10-2021
#include<bits/stdc++.h>
using namespace std;
int main()
{
ios::sync_with_stdio(false);
cin.tie(0);
int test;
cin>>test;
while(test--)
{
int n; cin>>n;
char arr1[n];
char arr2[n];
for(int i = 0; i < n; i++)
{
cin>>arr1[i];
}
for(int i = 0; i < n; i... | ALGO | 0.99999 | 3.959652 |
70000b30-c0a8-446d-923f-239c1ca5103d | lLupion/lab10 | lab10_1.cpp | #include<iostream>
using namespace std;
int main(){
int count[5] = {},i=1; //Declare array count for counting A,B,C,D,F and initialize all element = 0
char grade;
cout << "Please input grade of each student (A-F) or input 0 to exit.\n";
do{
cout << "Student [" << i << "]: ";
cin >> grade; //The loop must be te... | ALGO | 0.985512 | 3.593187 |
847ccb29-76a9-4828-9762-de466c6867f9 | zhangzezheng0/cpp_tinySTL | RedBlackTree/RedBlackTree.cpp | #include <iostream>
#include <sstream>
#include <string>
enum class Color { RED, BLACK };
template <typename Key, typename Value> class RedBlackTree {
class Node {
public:
Key key;
Value value;
Color color;
Node *left;
Node *right;
Node *parent;
// 构造函数... | ALGO | 0.95816 | 5.35918 |
a7c1ead7-b04d-4e8b-94e7-0929cc7fc3b9 | DanielShultz/Labs | Lab9/Lab9.cpp | #include <iostream>
#include <cstdlib>
#include <cmath>
using namespace std;
int main()
{
int n = 0;
cout << "n = ";
cin >> n;
double arr[n][n];
for (int i = 0; i < n; i++) {
for (int k = 0; k < n; k++) {
cout << "element (" << i << ',' << k << ") = ";
cin >> arr[... | ALGO | 0.999863 | 3.05641 |
4cea3f89-0b43-4095-9ff3-98d6bfc5e351 | DragonKrissash/TLE | Contests/D_Place_of_the_Olympiad.cpp | //#pragma GCC optimize("Ofast")
//#pragma GCC target("avx2")
#include <bits/stdc++.h>
using namespace std;
#define nl '\n'
#define int long long
#define vi vector<int>
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(),v.rend()
#define input(v) for(int a=0;a<v.size();a++)cin>>v[a]
#define X first
#define Y se... | ALGO | 0.99999 | 4.348835 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.