uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
dbf90c7e-c791-4383-aed0-74558dff4bd8 | kartik0920/DSA-2.0 | Lec 61/interleaveque.cpp | #include <bits/stdc++.h>
#include <iostream>
using namespace std;
vector<int> rearrangeQueue(queue<int> &q)
{
queue<int> nq;
int size = q.size();
for (int i = 0; i < (size / 2); i++)
{
nq.push(q.front());
q.pop();
}
while (!nq.empty())
{
int v = nq.front();
q... | ALGO | 0.989804 | 3.418574 |
54b3357e-da33-4d89-8392-b01f7e94c5df | ritikaradh/learnDSA | DSA/Hashing/UnionIntersect.cpp | #include <iostream>
#include <vector>
#include <unordered_set>
using namespace std;
void unionVec(vector<int> &vec1, vector<int> &vec2){
unordered_set<int> unionOfVec(vec1.begin(), vec1.end());
for(int ele: vec2){
unionOfVec.insert(ele);
}
for(int ele: unionOfVec){
cout<<ele<<" ";
... | ALGO | 0.999599 | 4.936692 |
573b0909-d1f5-4d55-9630-cc040701fd8a | maparham/flow_update | boost_1_65_1/libs/graph/example/implicit_graph.cpp | #include <boost/concept/assert.hpp>
#include <boost/graph/adjacency_iterator.hpp>
#include <boost/graph/dijkstra_shortest_paths.hpp>
#include <boost/graph/graph_concepts.hpp>
#include <boost/graph/properties.hpp>
#include <boost/iterator/counting_iterator.hpp>
#include <boost/iterator/iterator_facade.hpp>
#include <boo... | ALGO | 0.999747 | 5.329942 |
91db4f2e-2b50-4782-9a66-56904ff6a847 | haofengsiji/Depth-Estimation-From-Stereo-and-Video | GCMex/graph.cpp | /* graph.cpp */
#include <stdio.h>
#include "graph.h"
Graph::Graph(void (*err_function)(char *))
{
error_function = err_function;
node_block = new Block<node>(NODE_BLOCK_SIZE, error_function);
arc_block = new Block<arc>(NODE_BLOCK_SIZE, error_function);
flow = 0;
}
Graph::~Graph()
{
delete node_block;
delete ... | ALGO | 0.896208 | 5.617796 |
1e44f231-6d44-44d5-b172-9efa6a83a513 | iamAbhi1992/SCALER_JULY_2024 | 08 Hashing/03 DSA: Hashing 3: Internal Implementation & Problems/Count Subarrays.cpp | // https://www.scaler.com/academy/mentee-dashboard/class/297885/homework/problems/1226?navref=cl_tt_nv_dd
// Problem Description
// Misha likes finding all Subarrays of an Array. Now she gives you an array A of N elements and told you to find the number of subarrays of A, that have unique elements.
// Since the numb... | ALGO | 0.999923 | 6.157439 |
790fe765-b0b4-4029-aae0-0e5a56fb651e | bjd20/IoT-based-Solar-Tracking-Monitoring-System | managed_components/espressif__esp-dsp/applications/azure_board_apps/graphics/3d_matrix/3d_matrix_src/graphics_support.cpp | #include <malloc.h>
#include <math.h>
#include "graphics_support.h"
void init_perspective_matrix(dspm::Mat &P_m)
{
const float fov = 90; // field of view in degrees
const float near = 0.0001;
const float far = 1;
const float S = 1 / (tan((fov / 2) * DEG_TO_RAD));
// Init... | ALGO | 0.978807 | 5.801321 |
322a988c-95b8-49bd-ac38-82d681fc5fc0 | utkarsh4033/Data-Structures-and-Algo | 0048-rotate-image/0048-rotate-image.cpp | class Solution {
public:
void rotate(vector<vector<int>>& matrix) {
int row = matrix.size();
for(int i = 0; i<row;i++)
{
for(int j = 0;j<i;j++)
{
swap(matrix[i][j],matrix[j][i]);
}
}
for(int i = 0;i<row;i++)
{
... | ALGO | 0.999982 | 6.274521 |
10b164ee-0bc0-4ef4-868e-47d6fb50eac9 | magizebi/Basic1 | Basic1.cpp | #include <iostream>
#include <string>
#include <regex>
#include <array>
using namespace std;
double check_pattern(string text); // ๋ฐฐ์ด์ ๋ค์ด๊ฐ ์ซ์๊ฐ ์ฌ๋ฐ๋ฅธ์ง ํ์ธ
template <size_t T>
void input(array<double, T>& arr); // ๋ฐฐ์ด์ ์ซ์ ๋ฃ๊ธฐ
template <size_t T>
double sum(array<double, T>& arr); // ๋ฐฐ์ด ํฉ
template <size_t T>
double averag... | TOOL | 0.937772 | 4.295336 |
03b4771b-580e-4a43-a1e8-2c1e36a4f713 | Flash3225/CPP_Journey | functions.cpp | #include<iostream>
using namespace std;
//0-->not prime
//1-->prime
bool Prime(int n){
for(int i=2; i<n; i++){
if(n%i==0){
return 0;
}
}
return 1;
}
int main(){
int x;
cin>>x;
if(Prime(x)){
cout<<"It is a prime number.";
}
else{
cout<<"It is... | ALGO | 0.999919 | 4.219367 |
11ac33c7-2c68-4d41-b30f-70b347603318 | HustStevenZ/mvg_dist_match | src/openMVG/sfm/pipelines/localization/SfM_Localizer_Single_3DTrackObservation_Database.cpp | #include "openMVG/sfm/pipelines/localization/SfM_Localizer_Single_3DTrackObservation_Database.hpp"
#include "openMVG/matching/indMatch.hpp"
#include "openMVG/matching/regions_matcher.hpp"
namespace openMVG {
namespace sfm {
SfM_Localization_Single_3DTrackObservation_Database::
SfM_Localization_Single_3DTrackObser... | ALGO | 0.972775 | 6.186355 |
51483fbb-2095-497b-b086-81283652c24c | TechieDheeraj/algorithms | dp/1_nthFibElement.cpp | /**
* file : 1_fibSeries.cpp
* author : techiedheeraj
* created : 2020 Dec 10 17:54:39
* lastMod : Thu Dec 10 17:54:39 2020
**/
#include <bits/stdc++.h>
using namespace std;
class FibElement {
public:
int elem = 0;
vector<int>mem;
FibElement(int n) {
elem = n;
... | ALGO | 0.999979 | 5.303942 |
f39603e4-7406-4c41-a6f7-5271b823de4c | ishandutta2007/codeforces | gmusya/normal/1059/C.cpp | #include <iostream>
using namespace std;
void solve(int n, int k) {
if (n == 1)
cout << k << ' ';
if (n == 2)
cout << k << ' ' << 2 * k << ' ';
if (n == 3)
cout << k << ' ' << k << ' ' << 3 * k << ' ';
if (n > 3) {
for (int i = 0; i < (n + 1) / 2; i++)
cout << k << ' ';
solve(n / 2, ... | ALGO | 0.999961 | 3.574927 |
556e42ca-1387-4473-b6d0-8fb4547712d4 | kkpan11/apple-llvm-project | libcxx/test/std/numerics/rand/rand.dist/rand.dist.bern/rand.dist.bern.negbin/eval_param.pass.cpp | // <random>
// template<class IntType = int>
// class negative_binomial_distribution
// template<class _URNG> result_type operator()(_URNG& g, const param_type& parm);
#include <random>
#include <numeric>
#include <vector>
#include <cassert>
#include "test_macros.h"
template <class T>
inline
T
sqr(T x)
{
retur... | TEST | 0.961576 | 5.627142 |
585380ca-92a3-4ef0-93f6-c777af77b65f | ahmadmughal96/Data-Structure-and-Algorithms-C- | How_pointers_work_on_memory.cpp | //Ahmad Amjad mughal
//Regg No:121672
//Class:BSCS-6C
//Task2
#include<iostream> //including library
using namespace std;
int sum(int *a, int size) //function sum that uses pointer and size as a variable
{
int res = 0;
for (int i = 0; i<size; i++) //loop that continues ti... | ALGO | 0.997585 | 4.166062 |
a35b34a5-92ed-4b03-bf86-6ed7e8a5f486 | nahda-aqila/nahda_city_tour | 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.9988 | 6.76073 |
c733bc27-601b-4ab9-bfeb-3dc4fdef3f09 | chinoxyz/guiafuentes | algorithms/FFT.cpp |
struct cpx{
cpx(){}
cpx(double aa):a(aa){ b = 0;}
cpx(double aa, double bb):a(aa),b(bb){}
double a;
double b;
double modsq(void) const {
return a * a + b * b;
}
cpx bar(void) const{
return cpx(a, -b);
}
};
cpx operator +(cpx a, cpx b){
return cpx(a.a + b.a, a.b + b.b);
}
cpx operator *(cp... | ALGO | 0.999992 | 3.956753 |
4645f08e-5dde-444a-826b-59c9f9a05594 | philipjfredholm/FYSC23-ProgrammingProject | main.cpp | #include <iostream>
#include <string>
#include <vector>
#include <cmath>
#include <complex>
#include <algorithm>
#include <Eigen/Dense>
#include <Eigen/Eigenvalues>
#include<unistd.h> //Replace with #include <windows.h> if not running Linux.
using namespace Eigen;
//ROOT headers
#include <TRint.h>
#include <TCanvas.h... | ALGO | 0.999499 | 4.549262 |
97961af9-aa96-498a-abd3-89e5fa327a8a | PriyaTK03/product_app | frontend/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.998303 | 6.76775 |
1f66b3e3-0e44-4389-ad66-2049f939d825 | Altu-Bitu-6/Altu-Bitu-KimEunsom | 12_ํธ๋ฆฌ/156881.cpp | #include <iostream>
#include <vector>
using namespace std;
vector<vector<int>> list, tree; // ๊ฐ ๋
ธ๋์ ์ฐ๊ฒฐ ์ ๋ณด ๋ฐ ํธ๋ฆฌ ๊ตฌ์กฐ๋ฅผ ๋ด์ ๋ฒกํฐ
vector<int> parent, subtree_size; // ๋ถ๋ชจ ๋
ธ๋ ์ ๋ณด ๋ฐ ๊ฐ ๋
ธ๋์ ์๋ธํธ๋ฆฌ ํฌ๊ธฐ๋ฅผ ๋ด์ ๋ฒกํฐ
void makeTree(int curNode, int p) {
for (int node : list[curNode]) {
if (node != p) {
tree[curNode].push... | ALGO | 0.999944 | 5.543014 |
aceae6fa-bdda-40b2-bced-e3e428ffcd79 | igor-pavkov/honours-2024 | Code Examples/DiverseVul Filtered/Secure/c1cf54ebf251fdbad1e971679614e81649f1c032-29.cpp | char **lxc_string_split_and_trim(const char *string, char _sep)
{
char *token, *str;
char sep[2] = { _sep, '\0' };
char **result = NULL;
size_t result_capacity = 0;
size_t result_count = 0;
int r, saved_errno;
size_t i = 0;
size_t len;
if (!string)
return calloc(1, sizeof(char *));
len = strlen(string);
... | TOOL | 0.980186 | 5.795238 |
9c45ffec-b0de-43ea-a6c5-612d137f7b94 | thealchemistguild/Box2DC | Box2D/Common/b2Math.cpp | #include <Box2D/Common/b2Math.h>
const b2Vec2 b2Vec2_zero(0.0f, 0.0f);
/// Solve A * x = b, where b is a column vector. This is more efficient
/// than computing the inverse in one-shot cases.
b2Vec3 b2Mat33::Solve33(const b2Vec3& b) const
{
float32 det = b2Dot(ex, b2Cross(ey, ez));
if (det != 0.0f)
{
det = 1.0f... | ALGO | 0.998463 | 6.95739 |
e787e56f-0a26-470d-86ce-6aa140548d55 | anaceciliabmota/Branch-and-Cut | mainteste.cpp | #include <ilcplex/ilocplex.h>
#include <vector>
#include <iostream>
#include "separation.h"
#include <cstdlib> // For rand() and srand()
#include <ctime> // For seeding rand()
#include <iomanip> // For setting precision
ILOSTLBEGIN
double** generateSymmetricGraph(int n, double min_weight , double max_weight ) ;
... | ALGO | 0.99995 | 6.452238 |
56b2d203-72ce-4af7-a1d9-81053eb51990 | YoungJooYoo/For_Coding_Test | leetcode/2782. Number of Unique Categories.cpp | /**
* Definition for a category handler.
* class CategoryHandler {
* public:
* CategoryHandler(vector<int> categories);
* bool haveSameCategory(int a, int b);
* };
*/
class Solution
{
public:
int numberOfCategories(const int n, CategoryHandler* const categoryHandler)
{
vector<int> categ... | ALGO | 0.999209 | 6.375936 |
8dd8a9ea-ff87-49af-9cdf-f1f764f8a057 | xq25478/Master_Job | PyTorchๆกๆถ/pytorch-master/torch/csrc/jit/passes/canonicalize.cpp | #include <torch/csrc/jit/passes/canonicalize.h>
#include <c10/util/irange.h>
#include <torch/csrc/jit/ir/ir_views.h>
namespace torch {
namespace jit {
// Canonicalize a graph, renumbering it so that all structurally equivalent
// graphs have same numbers.
// keep_unique_names: If false, canonicalizes unique names by... | ALGO | 0.974824 | 7.948206 |
641d1cf4-d0a3-4e63-b619-0d755e340f56 | ishandutta2007/codeforces | 6aren/normal/498/C.cpp | #include <bits/stdc++.h>
using namespace std;
#define all(s) s.begin(), s.end()
#define pb push_back
#define ii pair<int, int>
#define x first
#define y second
#define bit(x, y) ((x >> y) & 1)
#define vi vector<int>
#define oo 1000000000
struct Matching {
int m, n;
vector<vi> adj;
vi match;
vi dist;
... | ALGO | 0.999877 | 4.259364 |
506ca2e9-825f-42db-9f84-8a8139294378 | arsh608/DSA-fall24 | lab8/q03.cpp | #include <iostream>
using namespace std;
struct TreeNode {
int val;
TreeNode* left;
TreeNode* right;
TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}
};
int max(int a, int b) {
return (a > b) ? a : b;
}
int maxProfit(TreeNode* root, int& maxSum) {
if (!root) return 0;
int left ... | ALGO | 0.999977 | 6.321518 |
0bd1c185-00cb-4485-9ffb-4287dbc9ce97 | jtiger0303/BaekJoonAlgo | DP/BOJ2482.cpp | #include <iostream>
using namespace std;
int n, k;
const int mod = 1000000003;
int dp[1004][1004];
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
cin >> n >> k;
for (int i = 0; i < n; i++) {
dp[i][0] = 1; //i๊ฐ ์ค 0๊ฐ ์ ํ
dp[i][1] = i; //i๊ฐ ์ค 1๊ฐ ์ ํ
}
... | ALGO | 0.999987 | 4.390675 |
1ecfe908-aef8-43fb-9fc2-9b225ed508e0 | fura2/competitive-programming-library | verify/tree/Cartesian_tree.test.cpp | #define PROBLEM "https://judge.yosupo.jp/problem/cartesian_tree"
#include "../../library/template.hpp"
#include "../../library/tree/Cartesian_tree.hpp"
int main(){
int n; scanf("%d",&n);
vector<int> a(n);
rep(i,n) scanf("%d",&a[i]);
Cartesian_tree CT(a);
rep(u,n) printf("%d%c",CT.parent(u)!=-1?CT.parent(u):u,u<... | ALGO | 0.999928 | 3.84253 |
ba5f6834-d627-408c-b8c1-50724f9060e0 | DusteDdk/unfinishedsidescrollerfrom2013 | terrain.cpp | #include "terrain.hpp"
extern struct sceneInfo_t sceneInfo;
static bool lineCompFunc(line a, line b)
{
int ax, bx;
// First, decide which end of the lines are the first.
if(a.a.x > a.b.x)
ax=a.b.x;
else
ax=a.a.x;
if(b.a.x > b.b.x)
bx=b.b.x;
else
bx=b.a.x;
return( ax < bx );
}
terrainC... | ALGO | 0.933011 | 3.077256 |
18506537-0921-420e-81a5-efa122d33e39 | Luckily777/C- | Likou042403.cpp | 226. ืช
/**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* struct TreeNode *left;
* struct TreeNode *right;
* };
*/
void _invert(struct TreeNode* root)
{
if (root)
{
//ืชาบ
struct TreeNode* tmp = root->left;
root->left = root->right;
root-... | ALGO | 0.999917 | 5.537745 |
bf3f9e9e-d0ac-490a-b68e-56c0300996ad | Codeon0101/Data-Structures-And-Algorithms | Bubble_Sort_Algorithm/Bubble_sort_Algorithm.cpp | #include<iostream>
using namespace std;
void bubble_sort(int arr[],int n){
bool swapped = false;
int temp = 0;
for(int i=n-2;i>=0;i--){
for(int j=0;j<=i;j++){
if(arr[j] > arr[j+1]){
// swap(arr[j],arr[j+1]); --> Also use Built-in function for swapping the elements in the... | ALGO | 0.999936 | 4.898419 |
1e16fbac-bb6f-4938-a610-39513dc3dbd9 | NatsuDrag9/starting-out-with-cplusplus-solutions | Chapter-3/pc_15.cpp | #include <iostream>
// #include <string>
using namespace std;
/* For senior citizens */
int main(void)
{
float propertyTaxFraction = 0.6,senCitizenExemption = 5000, currTaxRateForEvery100USD, actualValue;
cout << "Enter actual value of property: ";
cin >> actualValue;
cout << "Enter current year tax r... | TOOL | 0.963407 | 3.559688 |
4662663d-4bf2-46ee-bb03-2d07aeda11ad | Farazulhaque/CPlusPlus_Coding | Q8/bondsGame.cpp | #include <iostream>
#include <ctime>
using namespace std;
int main()
{
srand(time(0));
for (int i = 0; i < 5; i++)
{
int x, y, product;
x = (rand() % 12) + 1;
y = (rand() % 12) + 1;
cout << x << " x " << y << " = ";
cin >> product;
if (x * y == product)
... | TOOL | 0.98271 | 3.188715 |
b83852ce-dcef-4301-9577-674041aa7a03 | BielMandelli/maratona-unioeste | codeforces/1360/e.cpp | #include <bits/stdc++.h>
#define int long long
using namespace std;
bool valid, iT, jT;
int n;
bool solve(int i, int j, vector<vector<char>> &grid, vector<vector<int>> &dp){
if(!valid) return false;
if(i == n && grid[i][j] == '1' or j == n && grid[i][j] == '1') return true;
if(i < n) iT = dp[i+1][j];
... | ALGO | 0.999892 | 5.466417 |
c3f8cff8-28d7-4549-9623-eb5d072e3457 | AmiiThinks/benchmarks | chinese_checkers/players/UCB.cpp | #include <math.h>
#include "UCB.h"
#include "DistEval.h"
#include "Timer.h"
CCMove *UCB::GetRandomAction(CCheckers *cc, CCState &s)
{
CCMove *m = cc->getMovesForward(s);
int count = m->length();
int which = random()%count;
while (which != 0)
{
which--;
CCMove *tmp = m;
m = m->next;
tmp->next = 0;
cc->fr... | ALGO | 0.999741 | 4.376259 |
45f8dd8e-a2e7-4332-b37b-02e1f6a6ae7f | NorbertSzydlik/WebForge | lib/boost_1_60_0/libs/msm/doc/PDF/examples/iPodEuml.cpp | #include <vector>
#include <set>
#include <string>
#include <iostream>
// we need more than the default 20 states
#define FUSION_MAX_VECTOR_SIZE 20
// we need more than the default 20 transitions
#include "boost/mpl/vector/vector50.hpp"
#include <boost/msm/back/state_machine.hpp>
#include <boost/msm/front/euml/euml.hpp... | TOOL | 0.900966 | 5.738094 |
fbda3763-2684-4411-9e74-a4612ee586cd | HenrikSamuelsson/code-forces-solutions | c-plus-plus/p-00XX/p-006X/p-0061/a/ultra-fast-mathematician.cpp | #include <iostream>
int main()
{
using namespace std;
string number1, number2;
cin >> number1 >> number2;
for (int i = 0; i < number1.size(); i++)
{
if (number1[i] == number2[i])
{
cout << 0;
}
else
{
cout << 1;
}
}
ret... | ALGO | 0.999992 | 3.678574 |
31a311de-db82-4cc7-8c0a-14035327353a | ZhongZeng/Leetcode | lc1056confNum.cpp | /*
1056. Confusing Number
Companies Google
Related Topics Math
Similar Questions Strobogrammatic Number
Test Cases:
6
89
11
25
Next challenges: Fraction to Recurring Decimal,
Three Equal Parts, Least Operators to Express Number
Runtime: 0 ms
Memory Usage: 8.1 MB
*/
class Solution {
public:
bool confusingNumbe... | ALGO | 0.998388 | 6.213023 |
7e48e499-bbf9-48c3-9862-8fa95445f93b | karna3813/Funpart2 | CountSort.cpp | #include <bits/stdc++.h>
using namespace std;
void c_p_c(){
ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#ifndef ONLINE_JUDGE
freopen("input.txt", "r", stdin);
freopen("output.txt", "w", stdout);
#endif
}
void countSort(int snehu[],int n){
int k = *max_element(snehu,snehu+n);
int shiv... | ALGO | 0.999976 | 4.878366 |
37d2183d-3168-4db2-9d5a-f2cdf7c36153 | enochjung/acmicpc_net | 01/1699.cpp | #include <stdio.h>
#include <math.h>
int n;
int d[100010];
int f(int x)
{
if(x == 0)
return 0;
if(d[x] == 0)
{
int min = 999999;
for(int i=(int)sqrt(x); i>=1; i--)
{
int res = f(x-i*i);
if(min > res)
min = res;
}
d[x] = min+1;
}
return d[x];
}
int main()
{
scanf("%d", &n);
printf("%d",... | ALGO | 0.999838 | 3.548757 |
b20cf66b-191f-4fb6-b226-693ed7dd3c3f | muhammadhasan01/cp | Online Judge/CodeChef/Practice/REVERSE.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
int n, m;
cin >> n >> m;
vector<vector<int>> adj(n + 1);
vector<vector<int>> radj(n + 1);
for (int i = 0; i < m; i++) {
int u, v;
cin >> u >> v;
... | ALGO | 0.999936 | 4.642497 |
e9250a33-0be6-4d9e-9c84-c7b5a219dd3b | EltonPajaziti/Detyrat-LC-2 | detyra14.cpp | #include <iostream>
#include <algorithm>
using namespace std;
// Definition for a binary tree node
struct TreeNode {
int val;
TreeNode* left;
TreeNode* right;
TreeNode(int x) : val(x), left(NULL), right(NULL) {}
};
int maxDepth(TreeNode* root) {
if (root == NULL) {
return 0;
}
i... | ALGO | 0.999938 | 7.102242 |
0584b357-0614-4981-832d-13083ceaf640 | checkoutb/LeetCodeCCpp | ge1500/LT1503_Last_Moment_Before_All_Ants_Fall_Out_of_a_Plank.cpp |
#include "../header/myheader.h"
class LT1503
{
public:
// D D
// ไธ็งๅญฆ๏ผ๏ผ ้ฝๅทฎไธๅค็ไปฃ็ ๏ผ ๅซไบบๅฐฑ30-40ใใใ
//Runtime: 72 ms, faster than 11.41% of C++ online submissions for Last Moment Before All Ants Fall Out of a Plank.
//Memory Usage: 23.1 MB, less than 47.91% of C++ online submissions for Last Moment Before All Ants Fall Out... | ALGO | 0.99964 | 4.641678 |
d49292d1-e3f6-4ee7-9536-3afcb09dc11b | zipengzhaojingzi/OpenGLExperiment | 4.cpp | //#include <GL/glut.h>
//#include <vector>
//
//struct Point {
// float x, y;
//
//};
//
//std::vector<Point> controlPoints; // ๆดขฦต
//bool bDraw = false;
//
//// Bezierฯตฤต
//void calcBezierCurve(std::vector<Point>& curvePoints, const std::vector<Point>& controlPoints) {
// int numPoints = 100; // ฯต
// curvePo... | ALGO | 0.99395 | 6.53369 |
69d4bbd4-2ff4-4868-b7f4-ef179a9a19d1 | yangjl2022/cp | problems/atcoder/G_XOR_Neighbors.cpp | /**
* author: yangjl
* created: 2024.10.08 21:10:07
**/
#include <bits/stdc++.h>
#ifdef YJL
#include "debug.h"
#else
#define debug(...)0
#endif
#define ALL(a) a.begin(),a.end()
using namespace std;
using ll = long long;
template<class T>
istream& operator>>(istream& is, vector<T>& v) {
for(auto& x : v) {
... | ALGO | 0.999947 | 4.789246 |
66c582fa-1236-4bfd-90f7-13fb684e362c | zzxxm451/cryptology | ๆฑๆจก้.cpp | #include <iostream>
using namespace std;
void exgcd(int a,int b, int &x, int &y, int &d)
{
if (!b)
{
d = a;
x = 1;
y = 0;
return;
}
exgcd(b, a % b, x, y, d);
int temp = x;
x = y;
y = temp - (a / b) * y;
}
int main()
{
while(1){
int a, b, x, y, d;
cin >> a >> b;
exgcd(a, b, x, y, d);
x = (x % b +... | ALGO | 0.999897 | 4.063901 |
08d963bf-428b-4b64-b7d3-7cfc3c4d2c48 | theroyalcoder/HF-ICT-1-2-SEM-CPP | 14.3_Zinsberechnung/main.cpp | #include <iostream>
using namespace std;
double zinsberechnung(double *betrag, double *zins, double *rueckzahlung, double *zinsbetrag, double *zinstot, int *anzJahre){
for (int i = 0; i < *anzJahre; i++) {
*zinsbetrag = *betrag / 100 * *zins; //Jahreszins
*betrag -= *rueckzahlung;
*zinsto... | ALGO | 0.939668 | 4.105567 |
7b572578-04ac-413e-bf7f-dbc5fbd3e14a | piDack/magma | src/zgetrs_nopiv_batched.cpp | /*
-- MAGMA (version 2.7.1) --
Univ. of Tennessee, Knoxville
Univ. of California, Berkeley
Univ. of Colorado, Denver
@date February 2023
@author Azzam Haidar
@precisions normal z -> s d c
*/
#include "magma_internal.h"
#include "batched_kernel_param.h"
/**********... | ALGO | 0.997718 | 6.57317 |
b3709044-0408-4c73-880b-315498f46b3a | PlatONnetwork/libcsnark | src/gadget2.cpp | /** @file
*****************************************************************************
Declarations of the interfaces and junzhen gadgets for R1P (Rank 1 prime characteristic)
constraint systems.
See details in gadget.hpp .
*****************************************************************************
* @author ... | TOOL | 0.997469 | 7.480374 |
d8605255-cd69-4777-9927-9ade4792c2dd | f3nr1rs3c/AlgorithmAndProgramming | C++/isimler_dizini.cpp | #include <iostream>
using namespace std;
int main()
{
string isimler[3];
cout << "Lรผtfen 3 adet isim giriniz: ";
cin >> isimler[0];
cin >> isimler[1];
cin >> isimler[2];
cout << "Yazdฤฑgฤฑnฤฑz isimler = " << isimler[0] << endl;
cout << "Yazdฤฑgฤฑnฤฑz isimler = " << isimler[1] << endl;
cout <... | TOOL | 0.934564 | 3.350465 |
0072a7fb-364c-4aae-9c8b-495f11d444b6 | JimYang1999/data-structure | Insertion Sort/Source.cpp | #include<stdio.h>
#include<stdlib.h>
#include <time.h>
void InsertionSort(int[], int);
void printarray(int[], int);
int main()
{
srand(time(NULL));
int array[6];
int size = 6;
for (int i = 0; i < 6; i++)
{
int x = rand() % (10 - 0 + 1); //รผ0~10
array[i] = x;
printf("%d ",array[i]);
}
InsertionSort(array, s... | ALGO | 0.999616 | 3.809633 |
ebfe720c-ae96-42dc-bbc2-111d2df06c36 | liuawen/Play-Leetcode | Play-Leetcode-master/0198-House-Robber/cpp-0198/main3.cpp | /// Source : https://leetcode.com/problems/house-robber/description/
/// Author : liuyubobobo
/// Time : 2017-11-19
#include <iostream>
#include <vector>
using namespace std;
/// Dynamic Programming, with O(1) space
/// Time Complexity: O(n)
/// Space Complexity: O(1)
class Solution {
public:
int rob(vector<in... | ALGO | 0.999796 | 5.582831 |
d5dfe4e8-95cb-4276-9357-5e0101b31f3f | gwynbleidd415/LeetCode | 0151-reverse-words-in-a-string/0151-reverse-words-in-a-string.cpp | class Solution {
private:
string solution1(string &s) {
istringstream iss(s);
string ans{""}, temp;
while(getline(iss, ans, ' ') && ans == "") {};
while(getline(iss, temp, ' ')) {
if(temp == "") continue;
ans = temp + " " + ans;
}
return ans;
... | ALGO | 0.999979 | 6.093244 |
8b355c10-b5d6-4f0b-a770-7d8bf7c0b5fb | Yannliu59/NetworkProgramming | semaphore/sem.cpp | //
// Created by chengzi on 2022/7/22.
//
// p30 System Vไฟกๅท้๏ผไธ๏ผ
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <sys/mman.h>
#include <sys/ipc.h>
#include <sys/shm.h>
#include <sys/sem.h>
#include <cstdlib>
#include <cstdio>
#include <cerrno>
#include <cstring>
#define ER... | TOOL | 0.911413 | 3.756909 |
3714c7a0-f02b-4a96-bd5c-1c524d5e7106 | ewaty/Model-Predictive-Control | Ipopt-3.12.7/Ipopt/src/Algorithm/IpAdaptiveMuUpdate.cpp | #include "IpAdaptiveMuUpdate.hpp"
#include "IpJournalist.hpp"
#ifdef HAVE_CMATH
# include <cmath>
#else
# ifdef HAVE_MATH_H
# include <math.h>
# else
# error "don't have header file for math"
# endif
#endif
namespace Ipopt
{
#if COIN_IPOPT_VERBOSITY > 0
static const Index dbg_verbosity = 0;
#endif
AdaptiveMuUp... | ALGO | 0.998157 | 7.075138 |
1990e157-f077-4531-bcd3-ea6e60e3b5f5 | MichaelSedrak/Interactive-ARAP | ARAP/libs/libigl-2.2.0/include/igl/cotmatrix_entries.cpp | #include "verbose.h"
template <typename DerivedV, typename DerivedF, typename DerivedC>
IGL_INLINE void igl::cotmatrix_entries(
const Eigen::MatrixBase<DerivedV>& V,
const Eigen::MatrixBase<DerivedF>& F,
Eigen::PlainObjectBase<DerivedC>& C)
{
using namespace std;
using namespace Eigen;
// simplex size (3: ... | ALGO | 0.99875 | 5.757307 |
4a19f3b2-9ca6-4865-9b31-702b797cb8c1 | Krishna-mudgal/LeetCode | lc_1800_maximum_ascending_subarray_sum.cpp | #include <bits/stdc++.h>
using namespace std;
// https://leetcode.com/problems/maximum-ascending-subarray-sum/?envType=daily-question&envId=2025-02-04
class Solution {
public:
int maxAscendingSum(vector<int>& nums) {
int n = nums.size();
int ans = 0;
int i = 1;
int sum = nums[0];
... | ALGO | 0.999939 | 6.125422 |
691750ea-2c58-4561-8d41-3534674d454d | sdm660/external_skia | src/core/SkStrokerPriv.cpp | #include "SkStrokerPriv.h"
#include "SkGeometry.h"
#include "SkPath.h"
#include "SkPointPriv.h"
#include <utility>
static void ButtCapper(SkPath* path, const SkPoint& pivot, const SkVector& normal,
const SkPoint& stop, SkPath*) {
path->lineTo(stop.fX, stop.fY);
}
static void RoundCapper(Sk... | TOOL | 0.985419 | 6.938398 |
9b926204-3f97-4e2f-95de-6c67904913fc | SebastianCastilloDev/algoritmos-y-estructuras-de-datos | seccion2-algoritmos/division.cpp | # include <iostream>
using namespace std;
// build a program that divide two integers numbers without using "/" operator.
int division(int a, int b){
int value = 0;
while (a >= b) {
value++;
a -= b;
}
return value;
// the remains value of a corresponds at the rest of division
}
in... | ALGO | 0.994496 | 3.857184 |
fb6f296e-c59d-49ba-b5ff-9093bbe927ad | yinyanghu/OI | OJ/usaco/cpp/shopping.cpp | /*
ID:oifox20071
LANG:C++
PROG:shopping
*/
#include <iostream>
#include <fstream>
using namespace std;
const int maxn = 5;
const int maxs = 99;
ifstream fin("shopping.in");
ofstream fout("shopping.out");
int s, cheap[maxs][maxn], map[maxn],total = -1, lowprice[maxs];
int f[maxn + 1][maxn + 1][maxn + 1][maxn + 1][maxn +... | ALGO | 0.999222 | 3.027562 |
0476ddf8-dd5a-419d-8bd1-f3db3a36630f | Mayank887/IPMP | Week_1/arrays_10.cpp | #include <iostream>
#include <vector>
#include <algorithm>
#include <set>
#include <unordered_set>
using namespace std;
bool find3Numbers(int A[], int n, int X)
{
//Your Code Here
sort(A,A+n);
for(int i=0;i<n;i++){
int f=A[i];
int x=i+1;
int y=n-1;
... | ALGO | 0.995465 | 4.270892 |
b6fde39f-fd37-4df1-a91a-0afeb2e73fea | 99396ankitraj/Leetcode_Questions | 646-maximum-length-of-pair-chain/maximum-length-of-pair-chain.cpp | class Solution {
public:
static bool cmp(const vector<int>& a, const vector<int>& b) {
return a[1] < b[1];
}
int findLongestChain(vector<vector<int>>& pairs) {
ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
sort(pairs.begin(), pairs.end(), cmp);
int currentEnd = pairs[0][1... | ALGO | 0.999965 | 5.581572 |
7b9bc2ab-11ce-4ea9-9408-162f38fc7a39 | RPerobeli/Type-2-FLS-Simulation | src/vant/include/fuzzylite/src/defuzzifier/LargestOfMaximum.cpp | #include "fl/defuzzifier/LargestOfMaximum.h"
#include "fl/Exception.h"
#include "fl/term/Term.h"
namespace fl {
LargestOfMaximum::LargestOfMaximum(int resolution)
: IntegralDefuzzifier(resolution) { }
LargestOfMaximum::~LargestOfMaximum() { }
std::string LargestOfMaximum::className() const {
... | ALGO | 0.999349 | 6.194715 |
059bf548-b13e-420f-89ed-eca7d9be1d09 | Jarvis-bot/DIVYANSHU-LEETCODE | leetcode/543-DiameterofBinaryTree.cpp | class Solution {
int res = 0;
public:
int diameterOfBinaryTree(TreeNode* root) {
dfs(root);
return res;
}
private:
int dfs(TreeNode* root) {
if (!root) {
return 0;
}
int l = dfs(root->left);
int r = dfs(root->right);
res = s... | ALGO | 0.999948 | 6.746989 |
66447cc9-3fc7-43b2-ac80-b7bcde2ba595 | yuyilei/Pat_Advanced_Level | Advanced_Pat/1024.cpp | #include<iostream>
#include<string>
#include<algorithm>
using namespace std ; // ่ถ
ๅคงๆดๆฐๅ ๆณไธ่ฝ็จlong long ไผๆบขๅบ๏ผ็ดๆฅ็จๅญ็ฌฆไธฒๅ ๆณ๏ผ๏ผ๏ผ
string change( string a ){
int flag = 0 ;
string res = a ;
reverse(a.begin(),a.end()) ;
for ( int i = 0 ; i < a.length() ; i++ ){
res[i] = res[i] + a[i] + flag -'0' ;
fla... | ALGO | 0.999969 | 3.665084 |
aa98fe29-e705-4a4f-a4cc-3f8f2e650d93 | rasmul2/Data_Structures | Labs/Lab13/performance.cpp | #include <ctime>
#include <cassert>
#include <cstdlib>
#include <algorithm>
#include <iostream>
#include <fstream>
#include <string>
#include <vector>
#include <list>
#include <set>
#include <map>
#include <queue>
#include <unordered_set>
#include <unordered_map>
using namespace std;
// ===============================... | ALGO | 0.912951 | 5.706048 |
1f682c64-20af-4428-8e94-146db7c53f34 | Ashvani-Gurjar/Some_new_Question_in_data_structures | bit_To_generatea_all_possible_subsets_ofset.cpp | #include<bits/stdc++.h>
using namespace std;
void subsets(int arr[], int n){
for(int i=0;i<(1<<n);i++){
for(int j=0;j<n;j++){
if(i & (1<<j)){
cout<<arr[j]<<" ";
}
}
cout<<endl;
}
}
int main(){
int arr[3] = {1, 2, 3};
... | ALGO | 0.999562 | 4.453167 |
541ed1d4-a07d-4614-a2f2-bb42850b0a18 | tmwilliamlin168/CompetitiveProgramming | CodeChef/ADITREE.cpp | #include <bits/stdc++.h>
using namespace std;
const int mxN=2.5e5;
int n, m, ai, bi, p[mxN], d[mxN], hv[mxN], prt[mxN], ap[mxN], st[1<<19];
vector<int> adj[mxN];
bool lz[1<<19];
int dfs(int u) {
int s=1, mcs=0;
for(int v : adj[u]) {
if(v==p[u])
continue;
p[v]=u;
d[v]=d[u]+1;
int cs=dfs(v);
if(cs>mcs) {... | ALGO | 0.999943 | 4.167319 |
2a12cea6-7aa3-4860-835c-0e0cfd47cd03 | alexandraback/datacollection | solutions_5690574640250880_1/C++/DBZX/C.cpp | // C.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <map>
#include <set>
#include <list>
#include <string>
#include <iostream>
#include <fstream>
#include <algorithm>
#include <vector>
#include <cassert>
#include <cassert>
#include <math.h>
using namespace std;
ifstream i... | ALGO | 0.999704 | 3.692782 |
242c33ec-d749-428a-a3c2-beb0e1689acc | ME-JAHED/Data-structures | Practic2/duplicate_valu_in_link_list.cpp | #include<bits/stdc++.h>
using namespace std;
class Node
{
public:
int val;
Node* next;
Node(int val)
{
this->val=val;
this->next=NULL;
}
};
void Insert_tail(Node* &head,Node* &tail,int val)//o(1)
{
Node* newNode=new Node(val);
if(head==NULL)
{
head=newNode;
... | ALGO | 0.999893 | 3.84924 |
e5c4c5b9-7e3a-4314-b20a-99c9ce64f2b1 | Blanks-Brain/Competitive-Programming | Recursion(adi)/print n to 1.cpp | #include<bits/stdc++.h>
using namespace std;
void print(int n)
{
if(n==1)
{
cout<<n<<" ";
return ;
}
cout<<n<<" ";
print(n-1);
}
int main()
{
int n;
cin>>n;
print(n);
}
| ALGO | 0.999726 | 4.231606 |
8093eae1-ada3-4a26-8c50-e76f09134793 | sarvex/leetcode-beef | solution/1700-1799/1736.Latest Time by Replacing Hidden Digits/Solution.cpp | class Solution {
public:
string maximumTime(string time) {
if (time[0] == '?') {
time[0] = (time[1] >= '4' && time[1] <= '9') ? '1' : '2';
}
if (time[1] == '?') {
time[1] = (time[0] == '2') ? '3' : '9';
}
if (time[3] == '?') {
time[3] = '5'... | ALGO | 0.99985 | 6.6279 |
8b5b56c7-b765-433a-8454-667b93eec6e0 | re-side/Inf_university | ALG/lab7/Backtracking.cpp | #include <iostream>
#include <vector>
#include <numeric>
//
void print_partition(const std::vector<int>& partition) {
for (size_t i = 0; i < partition.size(); ++i) {
std::cout << partition[i] << (i == partition.size() - 1 ? "" : " ");
}
std::cout << std::endl;
}
//
void find_partitions_rec... | ALGO | 0.999909 | 6.558156 |
6cc39a0a-939f-4959-b1f3-0db83ee7731b | AryanJaiswal763/DSA | practiceprob.cpp | #include<bits/stdc++.h>
using namespace std;
bool isPalindrome(int n) {
int r;
int x=n;
vector<int> ans;
if(x<0)
{
return false;
}
else
{
r=n%10;
ans.push_back(r);
n=n-r;
n=n/10;
}
int sum... | ALGO | 0.999926 | 4.376939 |
003b5fe1-ed4a-41b4-8ee2-face25e8adc5 | Badhansen/LeetCode-Solutions | 1758-minimum-changes-to-make-alternating-binary-string/1758-minimum-changes-to-make-alternating-binary-string.cpp | class Solution {
public:
int minOperations(string s) {
int start0 = 0, start1 = 0;
for (int i = 0; i < s.size(); i++) {
if (i % 2 == 0) {
s[i] == '0' ? start1++ : start0++;
} else {
s[i] == '0' ? start0++ : start1++;
}
}
... | ALGO | 0.99995 | 6.22007 |
b58f85f0-0c24-47cb-9037-458b4a1d7cf0 | crosswalk-project/chromium-crosswalk | third_party/WebKit/Source/platform/audio/IIRFilter.cpp | #include "platform/audio/IIRFilter.h"
#include "wtf/MathExtras.h"
#include <complex>
namespace blink {
// The length of the memory buffers for the IIR filter. This MUST be a power of two and must be
// greater than the possible length of the filter coefficients.
const int kBufferLength = 32;
static_assert(kBufferLe... | ALGO | 0.950264 | 7.084573 |
b971239f-4856-40fe-af0f-f6d89122f01a | feng3245/term3-p1 | src/Eigen-3.3/unsupported/doc/examples/MatrixPower.cpp | #include <unsupported/Eigen/MatrixFunctions>
#include <iostream>
using namespace Eigen;
int main()
{
const double pi = std::acos(-1.0);
Matrix3d A;
A << cos(1), -sin(1), 0,
sin(1), cos(1), 0,
0 , 0 , 1;
std::cout << "The matrix A is:\n" << A << "\n\n"
"The matrix power A^(pi/4) is:\n"... | ALGO | 0.999625 | 3.790203 |
4b727fc9-d14a-4d9a-be51-383ab9cffe30 | caosytrung/PicCollage | MediaCreator/library/src/main/jni/cge/filters/cgeSharpenBlurAdjust.cpp | /*
* cgeSharpenBlurAdjust.cpp
*
* Created on: 2013-12-26
* Author: Wang Yang
* Mail: <EMAIL>
*/
#include "cgeSharpenBlurAdjust.h"
#include <cmath>
#include <cstdlib>
#define TEXTURE_SHARPENBLUR_BIND_ID 0
const static char* const s_fshFastBlur = CGE_SHADER_STRING_PRECISION_H
(
varying vec2 textureCoordin... | TOOL | 0.931348 | 5.027805 |
708c5dc7-4a3f-4813-b806-ee4ea2ea128e | Kminseokk/sf3_02 | project_05/project_05.cpp | ////////////////////////////////////////////////////////////////////////////
// :: C++ ํ๋ก์ ํธ 05 ๋ฒ ๋ฌธ์ ::
// ์ผ๊ตฌ ๊ฒ์
// ์ซ์์ ์๋ฆฌ์ ๊ฐ์ด ๋ชจ๋ ๊ฐ์ผ๋ฉด strike
// ์๋ฆฌ๋ ๋ค๋ฅด์ง๋ง 3๊ฐ์ ์ซ์ ์ค ํฌํจ ๋์ด ์์ผ๋ฉด ball
//
///////////////////////////////////////////////////////////////////////////
#include <iostream>
#include <vector>
#incl... | ALGO | 0.999103 | 4.329237 |
9648e531-832e-4760-b329-4db1463db664 | allexandre97/GROMACS-OSC | gromacs-osc/src/gromacs/correlationfunctions/autocorr.cpp | /*! \internal \file
* \brief
* Implements function to compute many autocorrelation functions
*
* \author David van der Spoel <<EMAIL>>
* \ingroup module_correlationfunctions
*/
#include "gmxpre.h"
#include "autocorr.h"
#include <cmath>
#include <cstdio>
#include <cstring>
#include <algorithm>
#include "gromac... | ALGO | 0.995279 | 5.824403 |
39e0ae64-aa1e-451c-b169-34d67c68cfdd | meruem89/dsa-lb | Lecture009 Introduction to Arrays in C++/reverse.cpp | #include<iostream>
using namespace std;
void reverse(int arr[], int n) {
int start = 0;
int end = n-1;
while(start<=end) {
swap(arr[start], arr[end]);
start++;
end--;
}
}
void printArray(int arr[], int n) {
for(int i=0; i<n; i++) {
cout << arr[i] << " ";
... | ALGO | 0.99042 | 5.320953 |
fdc17825-7351-49b5-907f-86cd2cf4d87c | shishirsthakur/cpp | luvcpp/unorderedsets.cpp | #include<bits/stdc++.h>
using namespace std;
void print(unordered_set<string> &s){
for(string value: s){
cout << valueb << endl;
}
}
int main(){
unordered_set<string> s;
s.insert("abc");
s.insert("zsdf");
s.insert("bcd");
s.insert("abc");
auto it = s.find("abc");
if(it != s.end()){
s.erase(it);
}
print(... | ALGO | 0.968008 | 4.489544 |
f8d35f90-4454-408f-a5d8-860041f0ef96 | andyluo03/problems | problems/CF-1836B.cpp | //wecu's template -- works with c++17
#include <algorithm>
#include <bitset>
#include <climits>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <vector>
#define... | ALGO | 0.999447 | 3.858685 |
823747f0-0a92-4c42-92db-f55659cd68f0 | ishandutta2007/codeforces | liouzhou_101/normal/161/C.cpp | #include<iostream>
#include<algorithm>
using namespace std;
int L[2],R[2];
int full[2][40],L_full[2][40],R_full[2][40],L_have[2][40],R_have[2][40];
void solve(int p,int k,int L,int R)
{
if (full[p][k]) return;
int tmp=(1<<k)-1;
int mid=(1+tmp)>>1;
if (R<mid)
solve(p,k-1,L,R);
else if (L>m... | ALGO | 0.999572 | 3.12795 |
220d5dc1-8de2-4ca1-ac72-551c70b7aad7 | EshaanSeth/Competitive_Coding | Problem Solutions/CodeChef/COOK90/SURVIVE.cpp | /* author : sahilbansal17
date : 21st Jan, 2018
*/
#include <bits/stdc++.h>
using namespace std;
int main(){
#ifndef ONLINE_JUDGE
freopen("input.txt","r",stdin);
freopen("output.txt","w",stdout);
#endif
int t,n,k,s,res;
cin >> t;
while(t--){
cin >> n >> k >> s;
if(n >= k && s < 7){
res = cei... | ALGO | 0.999253 | 3.681783 |
6a435bec-fe29-407d-8925-c8d561be2b3c | chiseungii/Algorithm_Study | ํ๋ก๊ทธ๋๋จธ์ค/์ฐ์ต๋ฌธ์ /Lv2/์ ์ฐ๊ธฐ/์ ์ฐ๊ธฐ.cpp | #include <string>
#include <vector>
#include <cmath>
using namespace std;
long long solution(int k, int d) {
long long cnt = 0;
for(long long i=0; ; i+=k){
if(i*i > (long long)d*(long long)d) break;
long long j = sqrt((long long)d*(long long)d - i*i);
cnt += (j/k+1);
}
... | ALGO | 0.998819 | 3.500382 |
ee5586c3-a1be-4507-9e32-79bffee0f4fa | D-ICE/chrono | src/chrono_vehicle/tracked_vehicle/track_assembly/ChTrackAssemblySinglePin.cpp | #include <cmath>
#include "chrono/core/ChLog.h"
#include "chrono_vehicle/tracked_vehicle/track_assembly/ChTrackAssemblySinglePin.h"
namespace chrono {
namespace vehicle {
// -----------------------------------------------------------------------------
// Assemble track shoes over wheels.
//
// Returns true if the t... | ALGO | 0.995915 | 5.94241 |
c94116db-0bc2-435b-8b62-4623c26d65f2 | Suryadev25/CodeChef | richierich.cpp | #include <iostream>
using namespace std;
int main() {
int t,a,b,x,y;
cin>>t;
while(t--){
cin>>a>>b>>x;
y=(b-a)/x;
cout<<y<<endl;
}
return 0;
}
| ALGO | 0.999412 | 3.251191 |
88454aa1-b4c2-4b45-a0e1-55be4eb299e3 | ICUlizhi/Data-Structure-and-Algorithm-A-of-pku | homework/oj็ญๆก/ไธ ๆ ไธ้ๅ/3.ไธญ็ผ่กจ่พพๅผ็ๅผ.cpp | #include <bits/stdc++.h>
using namespace std;
// ่ทๅ่ฟ็ฎ็ฌฆไผๅ
็บง
int precedence(char op) {
if (op == '+' || op == '-') return 1;
if (op == '*' || op == '/') return 2;
return 0;
}
// ่ฎก็ฎไธคไธชๆฐ็่ฟ็ฎ็ปๆ
int applyOp(int a, int b, char op) {
switch (op) {
case '+': return a + b;
case '-': return a - b;
... | ALGO | 0.999894 | 5.146969 |
ec7accbd-60fb-4478-a7c6-49e8eccbb64d | aca123321/Competitive-Programming | square sum.cpp | #include<bits/stdc++.h>
using namespace std;
#define lli long long int
main()
{
lli n;
cin>>n;
cout<<((n)*(n+1)*((2*n)+1))/6;
}
| ALGO | 0.999717 | 4.340467 |
9f871d76-0584-49f9-acee-37c29f75a1ef | deepin-community/r-cran-rcppeigen | src/fastLm.cpp | #include "fastLm.h"
#if !defined(EIGEN_USE_MKL) // don't use R Lapack.h if MKL is enabled
#include <R_ext/Lapack.h>
#endif
#ifndef FCONE
# define FCONE
#endif
namespace lmsol {
using Rcpp::_;
using Rcpp::as;
using Rcpp::CharacterVector;
using Rcpp::clone;
using Rcpp::List;
using Rcpp::NumericM... | ALGO | 0.9986 | 7.086001 |
23b60337-9df3-4872-a8d7-e9cd83654feb | IamAnkit19/Codes | C++ Programs/SpecialPrograms/NQueenProblem.cpp | #include<iostream>
#include<vector>
using namespace std;
class Solution{
public:
void addSolution(vector<vector<int>> &ans, vector<vector<int>> &board, int n){
vector<int> temp;
for(int i=0; i<n; i++){
for(int j=0; j<n; j++){
temp.push_back(board[i][j]);
... | ALGO | 0.99997 | 5.724095 |
f3190d01-d9c9-4425-a181-7ff5d9168a29 | owhyy/cpp-primer | ch6/6.33.cpp | #include <iostream>
#include <vector>
#include <string>
#include <fstream>
using namespace std;
using std::string;
using std::vector;
void Print(vector<int>::iterator beg, vector<int>::iterator end)
{
if (beg != end)
{
cout<<*beg;
Print(beg+1, end);
}
}
int main()
{
vector<int> v{1, 2... | ALGO | 0.994045 | 4.041375 |
8f7a8acb-d8b7-4689-82a0-b76f2e35abe4 | nawngs/CompetitiveProgramming | thmb/day4/rgame.cpp | #pragma GCC optimize ("O2")
#include <bits/stdc++.h>
#define ll long long
#define ld long double
#define fi first
#define se second
#define pll pair < ll, ll >
#define pii pair < int, int >
#define fast ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
using namespace std;
const string NAME = "";
const string NAME2 =... | ALGO | 0.999898 | 3.582402 |
15c71366-a048-40a7-b100-770a414913d3 | PrakharUniyal/CompiArchives | Old Contest and Practice Problems/tokitsu.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
int n; cin>>n;
if (n%4==0) cout<<1<<" A"<<endl;
else if (n%4==1) cout<<0<<" A"<<endl;
else if (n%4==2) cout<<1<<" B"<<endl;
else cout<<2<<" A"<<endl;
} | ALGO | 0.999967 | 3.695575 |
ef1d9181-a89f-4d54-9a03-fcf238605661 | Tensor-Robotics/navigation_stack | src/modules/trajectory_generation/domain/trajectory_generation/lattice_trajectory_generator.cpp | #include <lattice_trajectory_generator.hpp>
#include <cmath>
#include <math_utils/geometry.hpp>
#include <iostream>
#include <stdexcept>
namespace trajectory_generation::trajectory_generation{
LatticeTrajectoryGenerator::LatticeTrajectoryGenerator(const core_datastructures::Posture& start,
... | ALGO | 0.996741 | 5.502049 |
1b6db79a-1980-4a75-9cef-fb395e8e0ff5 | spcl/cppless-clang | llvm/tools/llvm-cov/CoverageExporterJson.cpp | //===----------------------------------------------------------------------===//
//
// The json code coverage export follows the following format
// Root: dict => Root Element containing metadata
// -- Data: array => Homogeneous array of one or more export objects
// -- Export: dict => Json representation of one Cove... | TOOL | 0.94952 | 7.867465 |
0518f5ce-10ca-4e52-b6db-daa85b0a5334 | DeepForest2002/C-plus-plus | Basic codes/functions/inline.cpp | #include<iostream>
using namespace std;
inline int cube(int x) { return x * x * x; }
int main(){
cout << "The cube of 3 is" << cube(3);
return 0;
} | TOOL | 0.853247 | 3.822072 |
a99274fa-4921-4951-a7db-7289edf34d9b | anjonmir/Note_pad | 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.998733 | 6.76775 |
ee6e5a61-7f85-40c8-860e-bb592972e54c | endo1322/AtCoder | abc/abc418/d/main.cpp | #include <bits/stdc++.h>
using namespace std;
#include <atcoder/all>
using namespace atcoder;
#define rep(i, n) for (int i = 0; (i) < (int)(n); ++(i))
#define rep3(i, m, n) for (int i = (m); (i) < (int)(n); ++(i))
#define rrep(i, n) for (int i = (int)(n) - 1; (i) >= 0; --(i))
#define rrep3(i, m, n) for (int i = (int)(n... | ALGO | 0.999974 | 5.535448 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.