uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
2420ec29-7f0f-4599-a687-045fcd98a894 | phrock/acm | spoj/XORROUND/2.cpp | #include <cctype>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <bitset>
#include <deque>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstr... | ALGO | 0.999986 | 3.221202 |
87ba6396-28b2-4984-9555-f696f5642d34 | kacperpoluszejko/Physics-of-complex-systems | FUZ_7/fuz_8_zad_1.cpp | #include <iostream>
#include <vector>
#include <random>
#include <iomanip>
#include <fstream>
#include <queue>
#include <utility>
using namespace std;
class RandomNumberGenerator {
private:
random_device rd;
mt19937 gen;
uniform_real_distribution<double> dist;
public:
RandomNumberGenerator() : gen(rd... | ALGO | 0.999807 | 3.931394 |
4661953a-9f73-47c8-8387-1dd6b51f190a | Z-Pythagoras/CPP_Experiment | Exp3/Exp2_InternetURL.cpp | #include <iostream>
using namespace std;
//除find函数外与实验一相同
class MyString {
public:
MyString(const char* tmp) {
if (tmp == NULL) {
str = new char[1];
str[0] = '\0';
len = 0;
}
else {
int i = 0;
while (tmp[i] != '\0')
i++;
len = i;
str = new char[len + 1];
for (i = 0; i < len; i++)
... | TOOL | 0.952076 | 3.653731 |
274bfeb5-5827-4455-b36f-2a32e452563c | yankee2023/atcoder | ABC/400/C/main.cpp | #include <iostream>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <tuple>
#include <algorithm>
#include <cmath>
#include <iomanip>
#include <queue>
using namespace std;
using ll = long long;
#define rep(i, n) for (int i = 0; i < (int)n; ++i)
const int INF = 1 << 30;
int main()
{
ll n;... | ALGO | 0.999081 | 4.828109 |
36694ba2-15b7-4bc3-90dc-c3f63b0851b8 | Taronyufa/ProgrammingOne | Scripts/Es 29/Max.cpp | // Dati in input da 1 a 5 interi, scrivere una funzione che
// ritorni il valore massimo. Usare argomenti di default per il
// secondo, terzo, quarto e quinto input.
using namespace std;
#include <iostream>
#include <cmath>
#include <cstdlib>
int Max(int, int n2=INT32_MIN,int n3=INT32_MIN,int n4=INT32_MIN,int n5=INT3... | ALGO | 0.99498 | 4.545607 |
e4e04dc3-6513-408b-b385-5597fc655aaa | threalwinky/cp_library | luyencode/sodep.cpp | #include <bits/stdc++.h>
using namespace std;
bool tong10(string s){
int temp = 0;
for (int i = 0; i<s.length(); i++){
temp += (s[i]-'0');
}
if (temp == 10) return true;
else return false;
}
bool isPalindrome(string S)
{
string P = S;
reverse(P.begin(), P.end());
if (S == P) {
... | ALGO | 0.999247 | 4.778239 |
c5bc914e-8174-4273-8e1d-44e691b97467 | bashell/oj | hdu/2719.cpp | #include <cstdio>
#include <iostream>
#include <string>
#include <unordered_map>
using namespace std;
int main()
{
//freopen("in.txt", "r", stdin);
unordered_map<string, string> smap{
{" ", "%20"},{"!", "%21"},
{"$", "%24"},{"%", "%25"},
{"(", "%28"},{")", "%29"},
{"*", "%2a"}
... | ALGO | 0.987642 | 3.781389 |
4b1e004d-aef8-43b9-9fc6-5a4be70d776a | n0IQ/Competitive-Programming | codeforces/1730/C.cpp | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
using namespace std;
#define pb push_back
#define ppb pop_back
#define mp make_pair
#define lb lower_bound
#define ub upper_bound
#define ff first
#define ss second
#define rep(i, a, b) f... | ALGO | 0.999944 | 5.606041 |
9907c9e9-146c-4669-8db6-b02da58fcaf4 | belikeakash/Leetcode | 0061-rotate-list/0061-rotate-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* rotateRight... | ALGO | 0.999997 | 5.313327 |
76fdc82e-ed9c-4003-a2bf-099ee904de7a | dengyujian/ACppTour | src/Chapter05/02/main.cpp | #include <iostream>
#include <algorithm>
#include "extract_fails.h"
using std::vector;
using std::list;
int main(int argc, const char * argv[]) {
vector<Student_info> students;
list<Student_info> student_list;
for (int i = 0; i < 5; i++) {
bool is_even = (i % 2 == 0);
Student... | TOOL | 0.978509 | 3.963783 |
54d1f9c1-f192-4e7d-b46e-3951aa7c2da3 | ssk4988/Coding | CodeForces/goodbye2024/f.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using vi = vector<int>;
using vl = vector<ll>;
using vd = vector<ld>;
using vii = vector<pii>;
using vll = vector<pll>;
using vvi = vector<vi>;
#define f first
#define s se... | ALGO | 0.999818 | 3.686952 |
51b01a88-7780-492e-996e-b5d0244acc5b | alexandraback/datacollection | solutions_5695413893988352_1/C++/svanidz1/A.cpp | #include <bits/stdc++.h>
using namespace std;
int test;
bool can(char A,char B){
if (A=='?') return 1;
return A==B;
}
void tr(string &s,char ch){
for (int i=0;i<s.size();i++)
if (s[i]=='?') s[i]=ch;
}
long long dif(string a,string b){
long long R=0;
for (int i=0;i<a.size();i++)
R=R*10+a[i... | ALGO | 0.999947 | 3.066922 |
9ac64b4e-c4d1-4434-adf1-9ea3d929eb20 | AlekGayko/SandalBotV2 | src/Bitboards.cpp | #include "Bitboards.h"
#include <cmath>
#include <iostream>
#include <limits>
using namespace std;
namespace SandalBot {
dirDist directionDistances[SQUARES_NB];
uint8_t distances[SQUARES_NB][SQUARES_NB]; // Stores distance between any two coordinates
// King and knight movement bitboards
// Pawn shield bitboar... | CONFIG | 0.999249 | 5.055309 |
8b2de37a-e91c-4e5f-8356-ff72e6518324 | Kartik-Mathur/NDLP19SP | Lecture-3/upperlower.cpp | #include<iostream>
using namespace std;
int main()
{
char ch;
cin>>ch;
if(ch>=65 && ch<=90)
{
cout<<"upper case "<<endl;
}
else
{
cout<<"lower case"<<endl;
}
return 0;
} | ALGO | 0.98482 | 3.285557 |
22ac1c7c-72b9-4abd-bc6a-0c68e290c5f2 | neko-huang/oi-code | 250531 D.cpp | #include <iostream>
#include <algorithm>
#include <climits>
using namespace std;
typedef long long ll;
const ll inf = 2147483647;
//const ll inf = LLONG_MAX;
ll dp[10][10];
ll min(ll a, ll b, ll c) {
return min(a, min(b, c));
}
int main() {
int T;
cin >> T;
while (T--) {
int n;
cin >> ... | ALGO | 0.99998 | 4.671359 |
4ae3deb4-4715-4f88-b89c-dd963db525a6 | qdttdev/CS3010-Numerical-Methods | CS3010_Ta_Caroline_Project_2/Project_2.cpp | /*******************************************************************************
* Name: Caroline Ta
* ID: 014 939 652
* Date: 09.28.2020
* Class: CS3010.01 - Numerical Methods
* Assignment: Programming Project 2 - Jacobi & Gaussian-Seidel (Extra Credit)
******************************************************... | ALGO | 0.999256 | 3.928901 |
6ebc8686-6f86-4221-b09b-699ff0127b87 | vivekko/labow | GeeksForGeeks/Love Babbar/BitManipulation/PositionOfOnlySetBit.cpp | class Solution {
public:
int findPosition(int n) {
// code here
int count = 0;
int position;
for(int i=1;i<=32;i++){
if(n&1){
count++;
position = i;
}
n>>=1;
}
if(count == 0 || count > 1) return -1;... | ALGO | 0.999933 | 5.945122 |
9e5f4094-f52f-4931-a1e1-65cc9295039b | ashutoshtewari99/striver_sde_sheet | BalancedBinaryTree.cpp | class Solution
{
public:
int check(TreeNode *root, bool &val)
{
if (!root)
return true;
int lh = check(root->left, val);
int rh = check(root->right, val);
if (abs(lh - rh) > 1)
{
val = false;
}
return 1 + max(lh, rh);
}
boo... | ALGO | 0.999318 | 6.030094 |
ccdb7a3e-cb9f-4c47-af58-8044ad11a924 | zetsux/one-problem-per-day | D58_Codeforces_581A/Codeforces_581A.cpp | #include <stdio.h>
#include <string.h>
#define gc getchar
#define pc putchar
inline void numput (int n)
{
int N = n, rev, count = 0;
rev = N;
if (N == 0) {
pc('0');
pc(' ');
return;
}
while ((rev % 10) == 0) {
count++;
rev /= 10;
}
rev = 0;
while (N != 0) {
rev = (rev<<3) + (... | ALGO | 0.999714 | 3.503882 |
36ff77b9-694d-45d9-a0e5-1d1cf3a46df2 | Phoe-nix-89/LeetCode-Solution | Ancestors_in_a_BinaryTree.cpp | #include<bits/stdc++.h>
using namespace std;
/* https://www.geeksforgeeks.org/problems/ancestors-in-binary-tree/1 */
struct Node
{
int data;
struct Node* left;
struct Node* right;
};
class Solution {
public:
// Function should return all the ancestor of the target node
vector<int> ans;
i... | ALGO | 0.999992 | 5.639485 |
3f519daa-15ef-4bbc-9edb-a50b222f07b9 | GaneshWaje003/leetCode-problems | prob17_phoneLetterCombo.cpp |
/*
17. Letter Combinations of a Phone Number
Given a string containing digits from 2-9 inclusive, return all possible letter combinations that the number could represent. Return the answer in any order.
A mapping of digits to letters (just like on the telephone buttons) is given below. Note that 1 does not map to a... | ALGO | 0.999168 | 6.735495 |
1f42b700-035b-441b-a6c1-af2e7a492a9f | zhangxin0518/opencv-4.1.0 | modules/core/src/channels.cpp | #include "precomp.hpp"
#include "opencl_kernels_core.hpp"
#include "convert.hpp"
/****************************************************************************************\
* Generalized split/merge: mixing channels *
\*******************************************************... | TOOL | 0.948436 | 5.913039 |
0da5daa5-c812-4c50-8364-a45455a253e9 | floreaadrian/AlgCodes | Infoarena/Car/main.cpp | #include<fstream>
#include<vector>
#define MAX_N 505
using namespace std;
int d[(1<<21) + 2];
vector<int>Q[2];
int N,M, sol;
int A[MAX_N][MAX_N];
int dx[8] = { -1, -1, 0, 1, 1, 1, 0, -1 };
int dy[8] = { 0, 1, 1, 1, 0, -1, -1, -1 };
ifstream f("car.in");
ofstream g("car.out");
inline int code(int i, int j, int dir) {... | ALGO | 0.999925 | 3.488747 |
083709df-310f-4d8b-85ed-91790488b476 | devanshV18/DSA | Stacks/maximumAreaHistogram.cpp | #include<iostream>
#include<bits/stdc++.h>
#include<vector>
#include<stack>
using namespace std;
//Brute force method
// Approach -> find all the indices of NSE and PSE of each element of the array ,
// then compute the area for each element as v[i] * (nse-pse-1)
//next smaller element indices -> if found OK and if n... | ALGO | 0.999953 | 6.560922 |
5f23d471-20fa-475b-a711-897a46c95de6 | sajidhasanapon/URI-Solutions | Codes/URI 1512.cpp | #include <bits/stdc++.h>
using namespace std;
unsigned long long GCD(unsigned long long A, unsigned long long B)
{
unsigned long long X = max(A, B);
unsigned long long Y = min(A, B);
if (X % Y == 0) return Y;
return GCD(Y, X%Y);
}
unsigned long long LCM(unsigned long long A, unsigned long long B)
{
... | ALGO | 0.999619 | 3.988125 |
76c064a8-edcb-4f5b-93e9-6dc56c90737d | YURSHAT/stk_2005 | External Library/boost_1_30_0/libs/graph/example/dave.cpp | #include <boost/graph/adjacency_list.hpp>
#include <boost/graph/visitors.hpp>
#include <boost/graph/breadth_first_search.hpp>
#include <boost/graph/dijkstra_shortest_paths.hpp>
using namespace std;
using namespace boost;
/*
This example does a best-first-search (using dijkstra's) and
simultaneously makes a copy of... | ALGO | 0.999975 | 5.642607 |
81f74de9-4056-4726-ae2d-11dfaa928122 | arpanhub/CodingQuest | 450-delete-node-in-a-bst/delete-node-in-a-bst.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.999996 | 6.524755 |
951bb75b-8c6a-43c8-98cc-a1de0f3bf2d4 | cropped33/code_forces | A_Even_Odds.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
long long int n, k;
cin >> n >> k;
// int a = n;
if (n % 2 != 0)
n = n + 1;
// for (int i = 0; i < n; i++)
// {
if (k <= n / 2)
cout << 2 * k - 1;
else
{
k = k - n / 2;
cout << k * 2;
}
... | ALGO | 0.999642 | 3.426029 |
29c19b18-5191-49a8-bfab-1e4c3a6cd69f | mistysamia/Leet-Code---Solutions | Medium/2816. Double a Number Represented as a 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* revers... | ALGO | 0.999915 | 6.308221 |
a7d2dde3-a885-42be-879d-2f89040602da | gejocamo10/preMFE_BaruchCollege | Final Project C++/Final Project C++/Level9Code/Level9Code/VI.6/director.cpp | // director.cpp
//
// Main program to run and test the Binomial method
// for a stock option. This code 'drives' the process
// as it were.
//
// 2005-1-31 DD First official code
//
// The mediator class in the Binomial method
//
//
// (C) Datasim Education BV 2005-2011
//
#include "option.hpp"
#include "binomialme... | ALGO | 0.999792 | 6.226215 |
ce10bf39-d5fb-4add-b045-10c4105e93c8 | watertree34/ImageProcessing | opencv-master/opencv-master/modules/imgproc/src/intersection.cpp | /*M///////////////////////////////////////////////////////////////////////////////////////
//
// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
//
// By downloading, copying, installing or using the software you agree to this license.
// If you do not agree to this license, do not download, instal... | ALGO | 0.999918 | 7.473121 |
d955847e-123b-426e-9483-bf6ed98d624b | oxygen-hunter/Flashboom | data/big-vul-100/add_attention_code/MixtralExpert/top0-100/find-the-largest-palindrome-divisible-by-k-Solution.largestPalindrome/177880_Bypass.cpp | check_file_permissions_reduced(i_ctx_t *i_ctx_p, const char *fname, int len,
gx_io_device *iodev, const char *permitgroup)
{
long i;
ref *permitlist = NULL;
/* an empty string (first character == 0) if '\' character is */
/* recognized as a file name separator as on DOS & Windows... | TOOL | 0.986415 | 3.158362 |
d1bfbfd3-be27-4d8d-9748-683d995bc917 | Chehinebensalah/LeetCode | 1122-relative-sort-array/1122-relative-sort-array.cpp | class Solution {
public:
vector<int> relativeSortArray(vector<int>& a1, vector<int>& a2) {
int n1=a1.size(),n2=a2.size(),ci=0;
map<int,int> c2;
vector<int> res;
for(int i=0;i<n2;i++){
c2[a2[i]]=0;
}
for(int i=0;i<n1;i++){
if(c2.find(a1[i])!=c2.... | ALGO | 0.999997 | 5.302138 |
62f89617-4ce2-4ff1-886e-2554cdd68831 | yunshengtian/ASAP | simulation/externals/eigen/bench/benchmarkXcwise.cpp | // g++ -O3 -DNDEBUG benchmarkX.cpp -o benchmarkX && time ./benchmarkX
#include <iostream>
#include <Eigen/Core>
using namespace std;
using namespace Eigen;
#ifndef VECTYPE
#define VECTYPE VectorXLd
#endif
#ifndef VECSIZE
#define VECSIZE 1000000
#endif
#ifndef REPEAT
#define REPEAT 1000
#endif
int main(int argc, c... | ALGO | 0.966822 | 3.896122 |
a643a733-dc1c-4ac5-9393-0378de8a4989 | my-hoang-huu/My-hh | 1. Nhap mon lap trinh_chuong04_ma tran/bai095.cpp | #include<iostream>
#include<iomanip>
#include<cstdlib>
#include<ctime>
using namespace std;
void Nhap(int[][50], int&, int&);
void Xuat(int[][50], int, int);
int Dem(int);
int DemCot(int[][50], int, int);
int Max(int[][50], int, int);
void LietKe(int[][50], int, int);
int main()
{
int a[20][50];
int m;
int n;
Nhap... | ALGO | 0.998166 | 3.161352 |
0de71499-b330-4b61-86fc-4ff68eef4019 | ThaisNg1003/c-ptit | KTNGTO004-Ước nguyên tố lớn nhất.cpp | // Ước nguyên tố lớn nhất
#include <bits/stdc++.h>
using namespace std;
long long largest_prime_factor(long long N)
{
long long largest_prime = -1;
while (N % 2 == 0)
{
largest_prime = 2;
N /= 2;
}
for (long long i = 3; i <= sqrt(N); i += 2)
{
while (N % i == 0)
... | ALGO | 0.999933 | 5.171718 |
876503e2-ab14-4f59-b8ed-8b154f7fb6bb | StrawHatWess/Competitive-Programming-Solutions | Atcoder/B228/D.cpp | //Never stop trying
#include "bits/stdc++.h"
using namespace std;
#define boost ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0)
typedef long long ll;
#define int ll
typedef string str;
typedef long double ld;
typedef pair<int, int> pi;
#define fi first
#define se second
typedef vector<int> vi;
typedef vector... | ALGO | 0.999956 | 4.838897 |
8c03b37f-acc9-4a90-a52e-3611ce6f16e2 | Nomalah/School | assign10/main.cpp | #include <iostream>
#include <math.h>
#include <string>
#define b inputs[0]
#define l inputs[1]
#define c inputs[2]
#define r inputs[3]
#define h inputs[4]
using namespace std;
int main()
{
double inputs [5]; // b = 0,l = 1,c = 2,r = 3,h = 4 Each array section represents a variable
string questionNames [5] =... | ALGO | 0.981814 | 3.625985 |
33b550b4-cc27-4ad2-a33c-d83afe17809e | NotSimone/foo_cnn_bpm | include/librosa/eigen3/doc/examples/TutorialLinAlgExComputeSolveError.cpp | #include <iostream>
#include <Eigen/Dense>
using namespace std;
using namespace Eigen;
int main()
{
MatrixXd A = MatrixXd::Random(100,100);
MatrixXd b = MatrixXd::Random(100,50);
MatrixXd x = A.fullPivLu().solve(b);
double relative_error = (A*x - b).norm() / b.norm(); // norm() is L2 norm
cout << "The ... | ALGO | 0.999776 | 3.625966 |
3a5ecbc5-7fa7-4b33-87a3-adf324c23d43 | WY0809/Leetcode_practice | 0083-remove-duplicates-from-sorted-list/0083-remove-duplicates-from-sorted-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* deleteDupli... | ALGO | 0.999912 | 5.75528 |
086d381b-098a-4dfe-9b2a-85715f5a85e9 | wenliangsun/LeetCode | 字符串/字符串相乘.cpp | #include <bits/stdc++.h>
using namespace std;
string add(string s1, string s2) {
string res = "";
int carry = 0;
// 注意这儿代码的写法 技巧
for (int i = s1.size() - 1, j = s2.size() - 1; i >= 0 || j >= 0 || carry;
i--, j--) {
int n1 = i < 0 ? 0 : s1[i] - '0';
int n2 = j < 0 ? 0 : s2[j] -... | ALGO | 0.999931 | 4.631824 |
917981ea-8ba0-4521-920e-7c7367914a5d | CarIsFast/DSA | lecture-52/cloneLL.cpp | // //{ Driver Code Starts
// #include <bits/stdc++.h>
// #include <iostream>
// #include <map>
// #include <sstream>
// #include <vector>
// using namespace std;
// /* Link list Node */
// struct Node {
// int data;
// Node *next;
// Node *random;
// Node(int x) {
// data = x;
// nex... | ALGO | 0.998765 | 5.313024 |
a2543bca-87df-4e60-a6c1-6bb6b3c5188f | zhb94430/PlannerProject | Libraries/boost_1_70_0/libs/numeric/ublas/doc/samples/matrix_matrix_solve.cpp | #include <boost/numeric/ublas/triangular.hpp>
#include <boost/numeric/ublas/io.hpp>
int main () {
using namespace boost::numeric::ublas;
matrix<double> m1 (3, 3), m2 (3, 3);
for (unsigned i = 0; i < (std::min) (m1.size1 (), m2.size1 ()); ++ i)
for (unsigned j = 0; j <= i; ++ j)
m1 (i, j... | ALGO | 0.999918 | 3.54414 |
476f2ea3-a4fe-488d-99f5-ee0e6e7dd559 | ishandutta2007/codeforces | ffao/normal/1208/B.cpp | #include <string>
#include <vector>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <bitset>
#include <algorithm>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
... | ALGO | 0.999928 | 3.950704 |
3d7211c4-f65d-4a05-9fd6-34f1a2030276 | ssharma1991/autonomous-car-highway-driving | src/Eigen-3.3/failtest/fullpivqr_int.cpp | #include "../Eigen/QR"
#ifdef EIGEN_SHOULD_FAIL_TO_BUILD
#define SCALAR int
#else
#define SCALAR float
#endif
using namespace Eigen;
int main()
{
FullPivHouseholderQR<Matrix<SCALAR,Dynamic,Dynamic> > qr(Matrix<SCALAR,Dynamic,Dynamic>::Random(10,10));
}
| TEST | 0.86806 | 3.150836 |
f3afdb09-af91-464e-b97d-0fa0f1535115 | Meteor0223/2023aaia3 | week06/week06-2c.cpp | //week06-2c.cpp
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main(){
int now;
vector<int> a;
while(cin>>now){
a.push_back(now);
sort(a.begin(),a.end());
int N=a.size();
if(N%2==1)cout<<a[N/2]<<"\n";
else cout <<(a[N/2-1]+a[N/2])/2<<"\n";
//for(int b:a)cout<<b<<' ';
... | ALGO | 0.999828 | 3.926568 |
582bd33e-123f-4b12-beee-f9ab50782444 | apoorva0918/DSA | Difficulty: Easy/Find length of Loop/find-length-of-loop.cpp | /*
class Node {
public:
int data;
Node *next;
Node(int x) {
data = x;
next = NULL;
}
};
*/
class Solution {
public:
int lengthloop(Node* slow, Node* fast){
int cnt=1;
fast=fast->next;
while(slow!=fast){
cnt++;
fast=fast->n... | ALGO | 0.999937 | 5.443911 |
bafbf7a7-2e02-40f0-a3d4-d51e87fd469d | RalphVita/ProgramacaoCompetitiva | IDCodes.cpp | #include <iostream>
#include <algorithm>
using namespace std;
int main()
{
string str;
while (true)
{
cin >> str;
if(str == "#")
return 0;
if (next_permutation(str.begin(), str.end()))
cout << str << endl;
else
cout << "No Successor" << en... | ALGO | 0.999883 | 4.040316 |
2fb0ef0b-d021-4316-b794-f186df2e32ef | MedAzizTousli/Competitive-Programming-Solutions | AtCoder/ABC046/B_Painting_Balls_with_AtCoDeer.cpp | #include <bits/stdc++.h>
#define ll long long
#define rep(i, begin, end) for (__typeof(end) i = (begin) - ((begin) > (end)); i != (end) - ((begin) > (end)); i += 1 - 2 * ((begin) > (end))) // rep(i, 1, 5) --> {1,2,3,4} // rep(i, 5, 1) --> {4,3,2,1} // rep(it, end(v), begin(v)) --> *it
using namespace std;
ll pw(ll a,... | ALGO | 0.999955 | 3.856438 |
c635d14a-c2df-48a9-91f6-45bf932299cb | YujinChoi0410/c-primer-plus | Listing5-9_strSwitch.cpp | #include <iostream>
#include <string>
using namespace std;
int main() {
cout << "Enter a word: ";
string word;
cin >> word;
cout << endl << word.size() << endl;
char temp;
int i, j;
for (j = 0, i = word.size() - 1; j < i; i--, j++) //i--, --i .
{
temp = word[i];
word[i] = word[j];
word[j] = temp;
}
... | ALGO | 0.97911 | 4.506368 |
90deae92-03af-4f34-b4d9-025507e4a5c1 | KarBagi/optimization_problems | TS_SA/src/SimulatedAnnealing.cpp | #include "pch.h"
#include "SimulatedAnnealing.h"
#include <vector>
#include <algorithm>
#include <cmath>
#include <iostream>
#include <ctime>
void SimualtedAnnealing::apply()
{
vector<int> best;
vector<int> permutation = random_permutation(size);
vector<int> next(permutation);
clock_t start;
int firstToSwap;
int... | ALGO | 0.999881 | 3.559756 |
dabe28bc-3d70-489c-becb-f3859d7d8855 | its-satyam/Leetcode-Solutions | 56-merge-intervals/56-merge-intervals.cpp | class Solution {
public:
vector<vector<int>> merge(vector<vector<int>>& intervals) {
if(intervals.size()<=1)
return intervals;
sort(intervals.begin(), intervals.end());
vector<vector<int>> output;
output.push_back(intervals[0]);
for(int i=1; i<intervals.size(); i... | ALGO | 0.999999 | 6.022591 |
49446566-9a08-4b0d-b69e-afdf7d7137dc | aman-aman/ProjectEuler | circular-prime.cpp | #include<bits/stdc++.h>
using namespace std;
/*Aman kumar jha*/
#define ll long long
vector<bool> prime(1000001,true);
bool circularprime(ll number)
{
ll rem;
ll check;
ll size=floor(log10(number))+1;
check=number;
do
{
rem=check%10;
check=rem*pow(10,size-1)+check/10;
if(!prime[check])
return false;
}w... | ALGO | 0.999908 | 5.216942 |
22b722bc-b8e7-4c9e-81aa-bd79285e6366 | fujicoin/fujicoin-0.19.0 | src/versionbits.cpp | #include <versionbits.h>
#include <consensus/params.h>
ThresholdState AbstractThresholdConditionChecker::GetStateFor(const CBlockIndex* pindexPrev, const Consensus::Params& params, ThresholdConditionCache& cache) const
{
int nPeriod = Period(params);
int nThreshold = Threshold(params);
int64_t nTimeStart =... | ALGO | 0.997082 | 7.514751 |
2a5824d1-3294-4185-8ff8-b8fe7c59aaa6 | WzDTj/Keep-Coding | ZOJ/1382.cpp | #include <iostream>
using namespace std;
int main() {
const int list[21] = {
1, 2, 4, 8,
16, 32, 64, 128,
256, 512, 1024, 2048,
4096, 8192, 16384, 32768,
65536, 131072, 262144, 524288,
1048576};
const int LENGTH = 1000001;
int t, n, comp;
cin >> t;
while (t --) {
cin >> n;
for (int i = 1; i ... | ALGO | 0.999796 | 3.517523 |
04aa18a0-d4c9-41d9-9ffc-98140620baf7 | nmhienbn/Competitive-Programming | Mr.Minh/24.10.2021/check/check.cpp | #include <bits/stdc++.h>
#define fi(i, a, b) for(int i = a; i <= b; i++)
#define fid(i, a, b) for(int i = a; i >= b; i--)
#define pii pair<int,int>
#define pb push_back
#define ll long long
#define faster ios_base::sync_with_stdio(0); cin.tie(NULL);
#define NunuAndWillump "check"
const int maxn = 2005;
using namespace... | ALGO | 0.999926 | 3.979258 |
3bb719e9-beb1-4516-bf8a-2330b605a05f | shubhampachori12110095/PDSTSP-1 | problem.cpp | #ifndef PDSTSP_PROBLEM
#define PDSTSP_PROBLEM
#include <bits/stdc++.h>
#include "point.cpp"
#include "constant.cpp"
using namespace std;
namespace Problem
{
int n; // Number of customers
int m; // Number of drones
int depot = 0;
vector<double> dCost; // cost of traveling by a drone from depot to cus... | ALGO | 0.999202 | 5.371673 |
54ccb03b-bac2-4d31-93e6-5136bdfc0d5b | aa08453/Geometry_Dash | JumpDJump.cpp | #include "JumpDJump.hpp"
#include <iostream>
// Constructor for the JumpDJump class
JumpDJump::JumpDJump()
{
// Initialize the source rectangle for texture mapping
srcRect = {2311, 593, 71, 133};
// Initialize the mover rectangle for the JumpDJump object
// Positioned at (1400, 370) with a width ... | ALGO | 0.977795 | 5.958225 |
58bedc3c-c842-4a2d-aac5-a9196ff7323c | minhyukjang/Bulnabi_PX4_test | src/modules/fw_att_control/ecl_roll_controller.cpp | /**
* @file ecl_roll_controller.cpp
* Implementation of a simple orthogonal roll PID controller.
*
* Authors and acknowledgements in header.
*/
#include "ecl_roll_controller.h"
#include <float.h>
#include <lib/geo/geo.h>
#include <mathlib/mathlib.h>
float ECL_RollController::control_attitude(const float dt, cons... | ALGO | 0.944891 | 5.741422 |
9f186fe0-aaf2-4e83-9dc7-53f1ca693b4d | JairZhu/AI-LAB | final_project/Othello.cpp | #include <iostream>
#include <time.h>
#include <vector>
#include <algorithm>
#include <random>
#include <unordered_map>
#include <fstream>
#include <string>
using namespace std;
struct Node {
int mode;
char board[8][8];
double score;
pair<int, int> action;
vector<Node> children;
Node(char raw_board[8][8], int cu... | ALGO | 0.993986 | 4.277665 |
a8383786-6afb-44dd-bd33-867c46d9d5e5 | ishandutta2007/codeforces | rednextcentury/normal/31/A.cpp | # include <iostream>
# include <algorithm>
using namespace std;
int a[1000000];
int main()
{
int n;
cin>>n;
for (int i=0;i<n;i++)
cin>>a[i];
for (int i=0;i<n;i++)
{
for (int j=0;j<n;j++)
{
for (int k=0;k<n;k++)
{
if (i==j || i==k || j==... | ALGO | 0.999952 | 3.622737 |
4ce40b02-6ada-431f-9c72-de6317ce291b | airgames/vuforia-gamekit-integration | Gamekit/bullet/src/BulletCollision/CollisionDispatch/btBoxBoxDetector.cpp | ///ODE box-box collision detection is adapted to work with Bullet
#include "btBoxBoxDetector.h"
#include "BulletCollision/CollisionShapes/btBoxShape.h"
#include <float.h>
#include <string.h>
btBoxBoxDetector::btBoxBoxDetector(btBoxShape* box1,btBoxShape* box2)
: m_box1(box1),
m_box2(box2)
{
}
// given two boxes (p... | ALGO | 0.99972 | 6.66771 |
cb831874-56c5-4ea5-93fb-d6b8c07ecca1 | ishandutta2007/codeforces | -is-this-fft-/normal/866/C.cpp | #include <iostream>
#include <iomanip>
using namespace std;
const int MAX_N = 55;
const int MAX_T = 5e3 + 5;
const int ITERS = 100;
typedef long double ld;
ld P [MAX_N];
int F [MAX_N];
int S [MAX_N];
ld dp [MAX_N][MAX_T];
ld solve (int n, int R, ld X) {
for (int t = 0; t < MAX_T; t++) {
if (t <= R) {
d... | ALGO | 0.999712 | 4.089843 |
8678c1b3-29b2-4f4f-aeb3-ee89dd433ae7 | New-to-the-World/Harish_S-4027-Slot_B-DS | 3. Factorial without recursion.cpp | #include<stdio.h>
int main(){
int i,f=1, num;
printf("Enter a number: ");
scanf("%d", &num);
if((num==1)||(num==0)){
f=1;
}
else{
for(i=1;i<=num;i++){
f = f * i;
}
printf("%d! = %d\n", num, f);
}
return 0;
}
| ALGO | 0.999828 | 3.524023 |
bf0a74f3-ea85-4884-b29c-e93b22b55599 | suditya/LEETCODE-Practice | 329-longest-increasing-path-in-a-matrix/329-longest-increasing-path-in-a-matrix.cpp | class Solution {
public:
int dp[300][300];
int row;
int col;
int dfs(int i,int j,vector<vector<int>>& matrix)
{
if(i<0 or j<0 or i>=row or j>=col)
{
cout<<"hi4"<<i<<j<<"\n";
return 0;
}
else if(dp[i][j]!=-1)
{
cout<... | ALGO | 0.999994 | 5.38637 |
7787be48-5a44-4ea9-aed1-299c1ef9bbe7 | Agent-Orange9two5/LP1-AIA-1 | Grupa 2/Borta_Antonio_GR2/Lab2.cpp | #include <iostream>
using namespace std;
int main()
{
int v[]={1,2,3,4,5,6,7,8,9,10},i,s=0;
for(i=0;i<=9;i++)
{
if(v[i]%2==1)
s=s+v[i];
}
for(i=9;i>=0;i--)
cout<<v[i]<<",";
cout<<endl<<"nr pare = ";
for(i=0;i<=9;i++)
{
if (v[i]%2==0)
cout<<v[i]<<",";
}
cou... | ALGO | 0.999696 | 3.415242 |
37ba487c-482f-4288-8496-45c3447f9899 | DenialRiver1434/USACO-Study | 0-USACO/b-Silver/2018O-P3.cpp | #define pb push_back
#define mp make_pair
#define mt make_tuple
#define is insert
#define ll long long
#include <bits/stdc++.h>
using namespace std;
int N, grid[250][250], original[250][250], actual[62501], sized[62501];
set<int> conn[62501];
bool searched[250][250], searched2[250][250];
void ffill (int x, int y, int... | ALGO | 0.998101 | 3.376549 |
50d62999-ae50-4409-9551-f75e77136427 | arkaslittlemind/Competitive-Programming | A2OJ Ladder- Codeforces/450A Jzzhu and Children.cpp | Question Link- https://codeforces.com/problemset/problem/450/A
// Implementation //
#include <iostream>
#include <iosfwd>
#include <iomanip>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <ctime>
#include <cmath>
#include <cassert>
#include <cctype>
#include <climits>
#include <vector>
#include <bit... | ALGO | 0.999996 | 4.307816 |
fe67db81-01af-495e-91ea-8608123b0ae5 | dhrvjha/competitive | Hackerrank/cpp/cpp-sets.cpp | #include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <set>
#include <algorithm>
using namespace std;
int main() {
set<int> st;
int cho;
int size; cin >> size;
while (size--) {
cin >> cho;
int num; cin >> num;
if (cho == 1)
st.insert(num);... | ALGO | 0.999414 | 4.042298 |
319ed3d5-410c-4b1f-b4cc-68acb69632cf | jki14/competitive-programming | 2010/zoj10Aug/POJ/p2240/src/p2240.cpp | #include <iostream>
#include <sstream>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <ctime>
#include <climits>
#include <algorithm>
#include <map>
#include <vector>
using namespace std;
#define maxn 100
#define maxl 200
#define u q[0]
int timer;
int n,m,e[maxn];
double g[maxn][maxn],d[maxn];
map<stri... | ALGO | 0.999786 | 3.849688 |
4fc8c13c-5fcb-496c-b84c-6bcdc2e0ed1e | Garzzza7/zadania | CodeForces/TODO/Miscellaneous/Destroying_Bridges.cpp | #include <bits/stdc++.h>
#include <cmath>
#include <stdlib.h>
#define print_rvalues(vec) \
for (auto &&a : (vec)) { \
cout << a << " "; \
} \
cout << "\n";
#define print_lvalues(vec) \
for (const auto &a : (vec)) { \
cout << a << " "; \
} ... | ALGO | 0.999953 | 4.02236 |
7bf07f6c-9d0e-4467-a107-ce2ec4435a0f | vfolunin/archives-solutions | EOlymp/4176.cpp | #include <iostream>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <string>
using namespace std;
int main() {
freopen("input.txt", "r", stdin);
freopen("output.txt", "w", stdout);
string a, b;
cin >> a >> b;
vector<pair<int, int>> res;
for (int l = 0; l < a.size(); l++) {
if (a... | ALGO | 0.999922 | 4.642068 |
04495b2c-b637-424d-bd8f-a412822abb46 | dseco/acmudec | ValentinaHernandez/Semestre1-2017/comentados/UVA-00978.cpp | /*
https://www.davidudelson.com/blog/2015/07/23/uva-978-lemmings-battle/
*/
#include <iostream>
#include <vector>
#include <set>
using namespace std;
/*El algoritmo inserta los datos en un multiset, luego se sacan los mas
grandes para compararlos, si el verde es mas grande, se inserta la resta
al set verde, en el cas... | ALGO | 0.999886 | 4.198846 |
13fd7fc4-8b87-4fb2-aac1-0f2d3762c6fd | bobleblob123/yuzu-android | src/shader_recompiler/frontend/maxwell/translate/impl/half_floating_point_add.cpp | #include "shader_recompiler/frontend/maxwell/translate/impl/half_floating_point_helper.h"
namespace Shader::Maxwell {
namespace {
void HADD2(TranslatorVisitor& v, u64 insn, Merge merge, bool ftz, bool sat, bool abs_a, bool neg_a,
Swizzle swizzle_a, bool abs_b, bool neg_b, Swizzle swizzle_b, const IR::U32& s... | TOOL | 0.976358 | 7.013033 |
604cadc6-4425-429d-9a7e-c44b7e64c169 | Kalpesh910/-6Companies30days | Comany 2: Goldman Sachs/593. Valid Square.cpp | class Solution{
public:
float dis(vector<int>& p1, vector<int>& p2){
int x1=p1[0], y1=p1[1], x2=p2[0], y2=p2[1];
int x=(x2-x1)*(x2-x1);
int y=(y2-y1)*(y2-y1);
return x+y;
}
bool perpendicular(vector<int>& p1, vector<int>& p2, vector<int>& p3, vector<int>& p4){
int x1... | ALGO | 0.999752 | 4.842361 |
a5a9241e-24f3-421d-9423-ed765ee10e10 | rk3288-dev/android_external_skia | src/core/SkEdge.cpp | #include "SkEdge.h"
#include "SkFDot6.h"
#include "SkMath.h"
/*
In setLine, setQuadratic, setCubic, the first thing we do is to convert
the points into FDot6. This is modulated by the shift parameter, which
will either be 0, or something like 2 for antialiasing.
In the float case, we want to turn the ... | ALGO | 0.991656 | 6.298848 |
a3103751-6832-4fba-860a-f44223058659 | vitsalis/project-euler | prob-50/prob50.cpp | #include <cstdio>
using namespace std;
int max;
int find[ 1000001 ];
int check( int num ) {
int i, count = 0, j;
int sum = 0, m = 0;
for ( i = 0; i < max && find[ i ] <= num; ++i ) {
sum += find[ i ];
for ( j = i + 1; j < max && find[ j ] <= num; ++j ) {
sum += find[ j ];
++count;
if ( sum > num ) {
... | ALGO | 0.999972 | 4.596389 |
26635dd2-73eb-441e-8a54-65213b62aa8d | luckyman2907/CPP_PTIT | sap dat day so.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
int t;
cin >> t;
while(t--){
int n;
cin >> n;
long long a[n], b[n];
for(auto &x : a) cin >> x;
for(int i = 0; i < n; i++){
b[i] = -1;
for(int j = 0; j < n; j++){
if(i == a[j]){
b[i] = i;
break;
}
}
}
... | ALGO | 0.999958 | 3.877528 |
f4f499aa-7be8-4af5-b1b3-3b0406b84764 | g-kohl/Competitive-Programming | contests/codeforces/round952/e.cpp | #include<bits/stdc++.h>
using namespace std;
void solve(){
int x, y, z;
long long k, quant=0;
cin >> x >> y >> z >> k;
for(long long a=1; a<=x; a++)
for(long long b=1; b<=y; b++){
long long c = k / (a*b);
if(a*b*c == k && c <= z)
quant = max(quant, (x-... | ALGO | 0.99996 | 3.923656 |
88630275-c378-4df0-9411-7abdc33e5dd4 | vitun7komee/exm2.3 | HashTable3.cpp | #include "HashTable3.h"
HashTable3::HashTable3(size_t maxSize)
{
this->maxSize = maxSize;
table.resize(maxSize);
}
size_t HashTable3::hash(std::string key)
{
size_t summ = 0;
for (auto& symb : key)
summ += symb;
return summ % maxSize;
}
bool HashTable3::insert(info_t pair)
{
bool re... | ALGO | 0.904928 | 4.753782 |
eb22c439-4b0f-419c-b916-6e254fd4006b | cosmicray001/academic | problem_solving/SPOJ/CPTTRN1/16891121_AC_0ms_16384kB.cpp | #include <bits/stdc++.h>
using namespace std;
void fnc(int a){
for(int i = 1; i <= a; i++){
if(i & 1) printf("*");
else printf(".");
}
printf("\n");
}
void fnc1(int a){
for(int i = 1; i <= a; i++){
if(i & 1) printf(".");
else printf("*");
}
printf("\n");
}
... | ALGO | 0.999758 | 3.48976 |
17c70bb9-e722-483d-9772-50408c38a410 | Akshaykalwar8933/Flutter_calculator_app | 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 |
9e29e86d-3dba-4dd4-a8c9-e1385978e12a | Meetguna92/C-programming | C++ language/Exsta Task/PHASE 1/Que-18.cpp | #include <iostream>
using namespace std;
int Factotial(int number)
{
int temp = 1;
for (int i = number; i >= 1; i--)
{
temp *= i;
}
return temp;
}
int main()
{
int num;
cout << "Enter Number To Factorial: ";
cin >> num;
cout << "Your Factorial Number Is: " << Factotial(n... | ALGO | 0.948166 | 4.367125 |
55733724-4065-445a-84f2-ab7a9100fd25 | AshDaGrat/Competitive-Programming-Problems | practice problems/football.cpp | //https://codeforces.com/problemset/problem/96/A
#include <iostream>
using namespace std;
int main() {
string s;
cin>>s;
int len = 0;
int count = 0;
for(int i = 1; i<s.length(); i++) {
if(s[i] == s[i-1]) {
count++;
len = max(len, count);
} else {
... | ALGO | 0.999982 | 3.835675 |
09971b78-d222-408b-a3df-13b7de83af3d | Jossan84/Algorithms | TestLists/C++/TestList.cpp | //TestList.cpp
//10/03/2022
#include <iostream>
#include <vector>
using namespace std;
class list_element{
public:
list_element(int n=0, list_element* ptr=0):d(n), next(ptr){}
int d;
list_element* next;
};
class list{
public:
list():head(0), cursor(0){}
list(const int* arr, int n);
list(const li... | TOOL | 0.91787 | 4.288754 |
076be43c-1a76-436f-80eb-c3ff380f0f45 | KashifAhmad1789/KashifAhmad-dsa | Sorting And Searching/18_InfiniteArray.cpp | /*
Find position of an element in a sorted array of infinite numbers
Difficulty Level : Medium
Last Updated : 17 Aug, 2021
Suppose you have a sorted array of infinite numbers, how would you search an element in the array?
Source: Amazon Interview Experience.
Since array is sorted, the first thing clicks into mind is ... | ALGO | 0.999953 | 5.162044 |
d4be8891-d9e6-4c12-b988-b6311c3add81 | Suhail7985/DSA | CPP/11_LinkedList/floyd_Loop_detection_algo.cpp | //floyd loop detection algorithm
#include <iostream>
using namespace std;
class Node
{
public:
int data;
Node *next;
Node(int val){
data=val;
next=NULL;
}
};
Node* floydLoopDetection(Node* head){
Node *slow=head;
Node *fast=head;
while(slow!=NULL && fast!=NULL && fast->... | ALGO | 0.999953 | 5.103849 |
f460c6c3-d278-4d34-9dcb-18dd2c9a4bbc | Hanunnisasalsabila/130_ConditionalStatement | PertemuanKedua/PertemuanKedua.cpp | #include <iostream>
using namespace std;
int main() {
srand(time(0));
int nBil = (rand() % 10);
string status;
if (nBil % 2 == 0) {
status = "Genap";
}
else {
status = "Ganjil";
}
cout << "Bilangan =" << nBil << endl;
cout << "Status Bilangan =" << status << endl;
} | ALGO | 0.995916 | 3.751469 |
1de2a644-d4dd-483a-9c41-5ba103f006af | xfsysu/Agenda | src/Storage.cpp | #include "Storage.hpp"
#include "Path.hpp"
#include <iostream>
#include <vector>
#include <sstream>
#include <fstream>
using namespace std;
shared_ptr<Storage> Storage::m_instance = nullptr;
Storage::Storage() {
m_dirty = false;
}
/**
* read file content into memory
* @return if success, true will b... | TOOL | 0.913662 | 6.105761 |
6210ba9d-2fce-48c9-8988-4546e6d3f4eb | algorithmSSU/yejiHong | Weekly problem solving(2023~)/September/beakjoon/bruteforce/14888_연산자끼워넣기.cpp | #include <iostream>
#include <string>
using namespace std;
int n;
int number[12];
int Operator[4];
int Minv = 1e9;
int Maxv= -1e9;
void search(int value, int cnt){
//종료조건
if(cnt==n-1){
//연산끝나고 최소값, 최대값 갱신
Maxv =max(Maxv,value);
Minv =min(Minv,value);
}
//연산자만큼 돌아준다.
for(int i=0;i<4;i++){
... | ALGO | 0.99996 | 4.111284 |
774dd281-a951-4b2b-a9b5-23219eb9409f | ShucunZhao/Leetcode | C++/19JZOffer/65SumOptWithoutArithmeticSymbol/solwithBitOperations.cpp | class Solution {
public:
int Add(int num1, int num2) {
/*
num1 num2
3 + 5
11 + 101
int n: 0^1 = 1
int c: 0&1 then << 1
so the sum = num1 + num2
= n + c ... | ALGO | 0.999901 | 5.48359 |
2c5c7e45-3bd4-4444-a0a9-975d5ab048f2 | judythecatlover/RobotPuzzle | Robot.cpp | #include <iostream>
#include <vector>
#include <cstdlib>
#include "Robot.h"
#include "Railroad.h"
Robot::Robot(char *name)
{
this->name = name;
this->location = rand() % 1000;
this->flag = true;
}
void Robot::moveLeft()
{
if(location<=0)
{
cout<<"reaches the left end"<<endl;
}
else
{
location --;
}
}
... | TOOL | 0.876807 | 3.920573 |
132b21f8-745b-40a1-8c1e-541a5916c845 | namwoam/classFiles | algorithmic-toolbox/14.cpp | #include <iostream>
#include <vector>
#include <algorithm>
int main()
{
int n;
std::cin >> n;
std::vector<long long> ad(n), slot(n);
for (int i = 0; i < ad.size(); i++)
{
std::cin >> ad[i];
}
for (int i = 0; i < slot.size(); i++)
{
std::cin >> slot[i];
}
std::sor... | ALGO | 0.99995 | 3.535846 |
3f1f3a4f-667d-487c-90f5-63427dbe8b48 | Xilinx/HPCG_FPGA | src/ComputeMG.cpp | //@HEADER
// ***************************************************
//
// HPCG: High Performance Conjugate Gradient Benchmark
//
// Xilinx Alveo U280 vesion
//
// Alberto Zeni, Kenneth O'Brien - albertoz,kennetho{@xilinx.com}
// ***************************************************
//@HEADER
#include "ComputeMG.hpp"
#inclu... | ALGO | 0.999106 | 5.947796 |
0bb35d20-bee3-4c00-8b09-ca4cab9f88d4 | Akshaj-Padmakar/DSA-Lab | Week-2/A.cpp | #include <bits/stdc++.h>
using namespace std;
#ifndef ONLINE_JUDGE
#include "algo/debug.h"
#define debug(x...) cerr << "[" << #x << "] = ["; _print(x)
#else
#define debug(x...)
#endif
#define int long long
void swap(int *xp, int *yp) {
int temp = *xp;
*xp = *yp;
*yp = temp;
}
int ans = 0;
void selectionSort(vect... | ALGO | 0.99973 | 3.55891 |
62f1fe38-d9de-4b41-886c-ecf25f55fba6 | DDK1127/Problems | UVA/12694.cpp | // Meeting Room Arrangement.
#include<bits/stdc++.h>
using namespace std;
bool cmp(pair<int, int> p1, pair<int, int> p2){
return p1.second < p2.second;
}
int main(){
int t, s, f;
cin >> t;
pair<int, int> p;
while(t-- > 0){
vector<pair<int, int> > v;
while(cin >> s >> f){
... | ALGO | 0.999908 | 3.970246 |
63f10694-201a-48d7-820a-04632ed7991b | Kirzyx/CPSC-2430 | lab5/lab5.cpp | //Ryan Luo
//lab 5
#include <iostream>
#include <chrono>
using namespace std::chrono;
void heapSort(int* A, int n);
void percolateDown(int* arr, int size, int index);
void mergeSort(int* A, int n);
void merge(int* arr, int start, int mid, int end);
void quickSort(int* A, int n);
int partition(int* arr, int start, i... | ALGO | 0.999968 | 5.713051 |
34085c58-2a6e-4179-bb33-e91ae6ee1871 | onkar-03/Striver-A2Z-DSA-Sheet | 03. Solve Problems On Arrays/01. Easy/09. Union of 2 Sorted Arrays with Duplicates.cpp | #include <bits/stdc++.h>
using namespace std;
/*
* Approach-1: Brute Force using Ordered Set
* - Use a `set` to store unique elements from both arrays.
* - Insert all elements from array `a` into the `set`.
* - Insert all elements from array `b` into the `set`.
* - A `set` automatically maintains sorted order... | ALGO | 0.999935 | 6.666086 |
436385bc-b1d0-4446-84ff-55370382c853 | havlenapetr/android_external_skia | experimental/SkSetPoly3To3_D.cpp | #include "SkMatrix.h"
typedef int64_t SkDScalar;
static SkScalar SkDScalar_toScalar(SkDScalar value) {
SkDScalar result = (value + (1 << 15)) >> 16;
int top = result >> 31;
SkASSERT(top == 0 || top == -1);
return (SkScalar)result;
}
static SkDScalar SkDScalar_setMul(SkScalar a, SkScalar b) {
retu... | ALGO | 0.939111 | 6.723788 |
d6f4930c-e70d-4561-bacd-d95894f5c8a8 | ishandutta2007/codeforces | papa3/normal/960/C.cpp | #include<bits/stdc++.h>
using namespace std;
#define int long long
#define double long double
#define mod 1000000007ll
#define INF 1000000000
vector<int> wy;
int32_t main() {
ios_base::sync_with_stdio( 0 );
cin.tie( 0 );
int x, d;
cin >> x >> d;
for( int i=1; ; i+=d+1 ) {
int a=2;
... | ALGO | 0.99991 | 3.411816 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.