uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
7104a119-1824-4f9b-8a25-78ae8339a116 | kkrath/PracticeProblems | Arrays/partition.cpp | #include<iostream>
#include<vector>
using namespace std;
class Partition{
public:
bool equalsSumParititon(vector<int> nums){
if(nums.size() == 0)
return {0};
int sum = 0;
for(int num : nums)
sum += num;
if(sum % 2 != 0)
return {0};
vector<int> subset;
return helper(nums, sum... | ALGO | 0.999653 | 5.573584 |
ec183690-96b9-4b08-b410-0408c3e099fa | atsuchak/Competitive-Programming | HackerRank/Prombel set/Pointer.cpp | #include <bits/stdc++.h>
using namespace std;
void update(int *a, int *b) {
int tempA = *a;
int tempB = *b;
*a = tempA + tempB;
*b = abs(tempA - tempB);
}
int main() {
ios::sync_with_stdio(false);
cin.tie(0); cout.tie(0);
int a, b;
cin >> a >> b;
update(&a, &b);
cout << a << endl;
cout << b << endl;
r... | ALGO | 0.999386 | 3.861079 |
b16fb03f-8142-43d4-a7e3-f27b39e62f4c | EthanLin1688/PA2 | pa2/decoder.cpp | #include "decoder.h"
#include "queue.h"
#include "stack.h"
#include "treasureMap.h"
#include <cmath>
using namespace std;
decoder::decoder(const PNG & tm, pair<int,int> s)
:start(s),mapImg(tm) {
vector<vector<bool>> visit(mapImg.width(), vector<bool> (mapImg.height(), false));
vector<vector<int>> distance(... | ALGO | 0.997234 | 4.168089 |
4473125b-b55a-4939-bc54-a6ce5f1fcc00 | horsewin/ARDiorama_ARMM | Reconstruction/graph.cpp | /* graph.cpp */
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "Reconstruction/graph.h"
template <typename captype, typename tcaptype, typename flowtype>
Graph<captype, tcaptype, flowtype>::Graph(int node_num_max, int edge_num_max, void (*err_function)(char *))
: node_num(0),
nodeptr_block(... | ALGO | 0.960407 | 6.400273 |
216c0368-cba9-49ef-b87b-8bc0714aad20 | YoungJooYoo/For_Coding_Test | Leet Code/884. Uncommon Words from Two Sentences.cpp | class Solution {
public:
vector<string> uncommonFromSentences(string s1, string s2)
{
stringstream ss1(s1); // 스트링을 공백 기준으로 분리
stringstream ss2(s2);
string str1;
string str2;
unordered_map<string, int> freq;
vector<string> result;
whi... | ALGO | 0.999516 | 6.021706 |
bffc3822-4030-4e29-9065-8da9c37b9c74 | chopingu/competitive_programming | neetcode/1d_dp/house_robber_ii.cpp | class Solution {
public:
int rob(vector<int>& nums) {
int n = nums.size();
vector<vector<int>> memo(n, vector<int>(2, -1));
auto dp = [&](int id, int flag, auto&& dp) -> int {
if(id >= n)
return 0;
int &ans = memo[id][flag];
if(ans != -1)... | ALGO | 0.999926 | 5.958532 |
6c573821-f097-4611-bd65-ba93b1142751 | calico-team/calico-fa24 | fortnite/templates/fortnite_template.cpp | #include <iostream>
using namespace std;
/**
* Return the minimum time needed for you to exit the storm.
*
* N: starting health
* H: healing per second
* D: distance out of the storm in meters
* S: running speed in meters per second
* P: storm damage per second
*/
long long solve(long long N, long long H, lo... | ALGO | 0.999449 | 4.207236 |
a91544da-fc70-4819-b8dd-ad1c37e2838e | samuelbozio/Flutter_Exercice | windows/runner/utils.cpp | #include "utils.h"
#include <flutter_windows.h>
#include <io.h>
#include <stdio.h>
#include <windows.h>
#include <iostream>
void CreateAndAttachConsole() {
if (::AllocConsole()) {
FILE *unused;
if (freopen_s(&unused, "CONOUT$", "w", stdout)) {
_dup2(_fileno(stdout), 1);
}
if (freopen_s(&unuse... | TOOL | 0.998859 | 6.785645 |
512d8ced-53c4-4688-963e-b1498a50cd40 | hao-ml/leetcode-practice | 0061/sol1.cpp | #include <bits/stdc++.h>
using namespace std;
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) {}
};
void printLinkedList(ListNode *head) {
while(head != nullptr) {
... | ALGO | 0.999976 | 5.512479 |
a097a29d-0789-4396-a7ff-8807ba5d7518 | ZhangRunzhi20/HASPPP | Src/resource/eigen-3.4.0/doc/examples/TutorialLinAlgExSolveLDLT.cpp | #include <iostream>
#include <Eigen/Dense>
using namespace std;
using namespace Eigen;
int main()
{
Matrix2f A, b;
A << 2, -1, -1, 3;
b << 1, 2, 3, 1;
cout << "Here is the matrix A:\n" << A << endl;
cout << "Here is the right hand side b:\n" << b << endl;
Matrix2f x = A.ldlt().solve(b);
cout << "... | ALGO | 0.999746 | 3.807622 |
58ff71ca-7b73-48f4-b665-abf4350e49ce | akormous/dsa | 5_Trees_and_Graphs/MinCostToConnectAllPts.cpp | #include<bits/stdc++.h>
using namespace std;
class Solution {
public:
struct compareEdgeWt {
constexpr bool operator()(pair<int,int> const& a, pair<int,int> const& b) const noexcept {
return a.first > b.first;
}
};
int minCostConnectPoints(vector<vector<int>>& points) {
... | ALGO | 0.999995 | 5.928728 |
423a6330-869c-4b0f-9e8a-eaa297421644 | NorthStarUAS/rc-flight-legacy | src/filters/archive/curt/glocal.cpp | // Compute local gravity as a function of latitude (radians) and
// altitude (m). Returns the local gravity vector in ned coordinates.
// In other words, it computes the magnitude of the of local gravity
// at the wgs84 reference elliposid using the Somigliana model and
// makes corrections for altitude.
#include <m... | ALGO | 0.998957 | 6.871696 |
2076bc69-df1b-40c9-a774-e18c098334a0 | ishandutta2007/codeforces | keko37/normal/1422/C.cpp | #include<bits/stdc++.h>
using namespace std;
typedef long long llint;
typedef pair <int, int> pi;
const int MAXN = 100005;
const int MOD = 1000000007;
int n, sol;
int pot[MAXN], pref[MAXN], suf[MAXN];
string s;
int add (int x, int y) {x += y; if (x >= MOD) return x - MOD; return x;}
int sub (int x, int y) {x -= y;... | ALGO | 0.999935 | 4.754729 |
39c1a659-0135-4474-a838-8f2650cbed57 | dwaknaa/Programmers | Programmers/배달.cpp | //
// 배달.cpp
// Programmers
//
// Created by user on 2024/11/18.
//
#include <iostream>
#include <vector>
#include <queue>
#include <utility>
#include <climits>
using namespace std;
vector<int> dijkstra(vector<pair<int, int>> road[], int N)
{
priority_queue<pair<int, int>> que;
vector<int> time(N+1, INT_MA... | ALGO | 0.999829 | 5.905686 |
90c8df80-93a5-4d7c-815b-a874781f2b91 | RashmiMaxCoder/Data-Structure-and-algos | LinkedList/segregate.cpp | ListNode* segregate(ListNode* head, int idx)
{
if (head == nullptr || head->next == nullptr)
return head;
int i = 0, data = 0;
ListNode* curr = head;
while (curr != nullptr)
{
if (i == idx)
data = curr->val;
i++;
curr = curr->next;
}
ListNode* smaller = new ListNode(-1);
ListNod... | ALGO | 0.999877 | 4.927121 |
66da072f-5e69-441f-ab6d-16215dc7d084 | hgyuhyeon/Algorithm-old | Leetcode/415_Partition_Equal_Subset_Sum.cpp | class Solution {
public:
bool canPartition(vector<int>& nums) {
int sum = 0;
for (auto num: nums) sum += num;
if (sum % 2 == 1) return false;
else sum /= 2;
vector<bool> dp(sum+1);
dp[0] = true; //0
for (auto num: nums) {
for (int i = sum;... | ALGO | 0.999871 | 5.841177 |
67f48133-a48a-48e2-8c06-54d09bee832f | ishandutta2007/codeforces | fishcathu/normal/1485/A.cpp | #include<bits/stdc++.h>
#define ls i<<1
#define rs i<<1|1
#define fi first
#define se second
#define pb push_back
#define mp make_pair
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
const int N=2E5+10;
ll read()
{
ll a=0;
char b=1,c;
do if((c=getchar())==45)b=-1;while(c<48||c>57);
do a=(a<<3)... | ALGO | 0.999784 | 3.633695 |
64d20bcb-194d-4656-8cfe-76618e5835e0 | open-watcom/open-watcom-v2 | bld/plustest/stl.94/examples/vec6.cpp | // This example compiles using the new STL<ToolKit> from ObjectSpace, Inc.
// STL<ToolKit> is the EASIEST to use STL that works on most platform/compiler
// combinations, including cfront, Borland, Visual C++, C Set++, ObjectCenter,
// and the latest Sun & HP compilers. Read the README.STL file in this
// directory ... | ALGO | 0.892111 | 4.221782 |
6c95280b-e54b-43ba-8f08-dc7835cf2c92 | 113bommy/deepmind_codecontests_refine | cpp_gold_filter_file/cpp_train_1156_0.cpp | #include <bits/stdc++.h>
using namespace std;
vector<long long> v;
vector<long long> w;
void pd(long long n) {
for (long long i = 2; i * i <= n; i++) {
if (n % i == 0) {
v.push_back(i);
n /= i;
long long cnt = 1;
while (n % i == 0) {
n /= i;
cnt++;
}
w.push_back... | ALGO | 0.999954 | 4.707342 |
32f4ab71-f972-4e83-9982-c26ea20c60a0 | lifiaa/LangC | file cpp/daftarBelanja.cpp | #include <iostream> // input output standar
#include <string> // untuk objek string
#include <vector> // untuk std::vector, container dinamis penampung elemen dgn value tidak tetap (dapat berubah-ubah)
using namespace std;
/* void function = tidak bisa mengembalikan nilai (fungsi yg tidak mengambil parameter apapun)
... | TOOL | 0.912611 | 4.609691 |
b137115e-4968-4972-854f-0cdf1944a393 | suzyz/LintCode | GraphValidTree/graph_valid_tree.cpp | class Solution {
public:
/*
* @param n: An integer
* @param edges: a list of undirected edges
* @return: true if it's a valid tree, or false
*/
bool validTree(int n, vector<vector<int>> &edges) {
if (edges.size() != n-1)
return false;
vector<int> fa(n,-1);
for (in... | ALGO | 0.999974 | 6.008414 |
24b1e556-cbe2-40a9-a028-156478e8777e | Tonyxin/driver-fatigue-detection | 单纯的人脸检测/源.cpp | #include<opencv2\opencv.hpp>
#include<stdio.h>
#include<iostream>
using namespace std;
using namespace cv;
#ifdef _EIC //_EiC_EiCΪWIN32
#define WIN32
#endif
static CvMemStorage* storage = 0;
static CvHaarClassifierCascade* cascade = 0;
//ϵͳ
const char* cascade_name;
void detect_and_draw(IplImage*);
i... | TOOL | 0.92334 | 3.282537 |
e1fc9bd9-a7fb-4821-b903-7c0f21ccd2d7 | snmath-pi/DataStructures | Recursion/R12PrintAllPerm.cpp | class Solution {
public:
void dfs(int id, vector<int> &temp, vector<int> &nums, vector<vector<int>> &res, vector<int> &seen) {
if(temp.size() == nums.size()) {
res.push_back(temp);
return;
}
for(int i=0; i<nums.size(); i++) {
if(!seen[i]) {
... | ALGO | 0.999999 | 6.467763 |
77d15e6d-682b-476a-bc5c-14f63f273d2b | hyeongjinnnnn/algorithm | 문제/27. N!의 표현법/N!의 표현법.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int n; cin >> n;
vector<int> arr(n + 1, 0);
vector<int> num(n + 1, 0);
// 佺׳ ü ̿ Ҽ ãƳ
for (int i = 2; i * i <= n; i++) {
if (arr[i] == 1)
continue;
for (int j = 2 * i; j <= n; j += i) {
arr[j] = 1;
}
}
/* μ */
for (int i = 2; i <= n... | ALGO | 0.999771 | 3.777382 |
8421d324-8788-40db-8582-3490724d9585 | mateusz-lamecki/POI-solutions | solutions/KARTY3.cpp | #include <cstdio>
#include <iostream>
#include <vector>
#include <list>
#include <string>
#include <set>
#include <map>
#include <algorithm>
#include <utility>
#include <cmath>
#include <queue>
#include <stack>
#include <cassert>
#include <cstring>
#include <climits>
#define VAR(i,v) __typeof(v) i = (v)
#define SIZE(x)... | ALGO | 0.999974 | 4.221762 |
68038580-377f-413f-af27-e273606d68bc | kraquos/AtCoder | AGC/34/A/main.cpp | #include <iostream>
#include <algorithm>
#include <string>
#include <cmath>
#include <vector>
#define rep(i,n) for(int i=0;i<n;i++)
#define ll long long int
#define MAX 1000000007
using namespace std;
string s;
bool reach(int start, int goal){
int pos=start;
while(pos<goal){
if(pos+2 == goal || pos+1 == goal)retu... | ALGO | 0.999783 | 3.136017 |
80fabbe0-b35d-4cb8-a56e-27477d2fad1b | nays111/algorithm | BOJ/_16234_인구 이동.cpp | #include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <cstring>
#include <cstdio>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <functional>
#include <string>
using namespace std;
int n, l, r;
int arr[51][51];
bool visit[51][51];
int dy[] = { 0,0,-1,1 };
int dx... | ALGO | 0.999941 | 3.854776 |
bf24ba96-ce25-4cb5-a689-c9a80870c55c | okuraofvegetable/AtCoder | atcoder.jp/abc193/abc193_e/Main.cpp | #include <bits/stdc++.h>
using namespace std;
#define eps 1e-9
#define INF 2000000000 // 2e9
#define LLINF 2000000000000000000ll // 2e18 (llmax:9e18)
#define all(x) (x).begin(), (x).end()
#define sq(x) ((x) * (x))
#define rep(i, x) for (int i = 0; i < (int)(x); i++)
#define drep(i, x) for (int i = ((int... | ALGO | 0.999872 | 3.975935 |
a9e046ca-fe86-4463-aadc-42cd39b0773d | Fincoinltd/fincoin | src/crypto/scrypt/generic/scrypt-generic.cpp | #include "scrypt.h"
#ifdef _MSC_VER
#define INLINE __inline
#else
#define INLINE inline
#endif
// Generic scrypt_core implementation
static INLINE void xor_salsa8(uint32_t B[16], const uint32_t Bx[16])
{
uint32_t x00,x01,x02,x03,x04,x05,x06,x07,x08,x09,x10,x11,x12,x13,x14,x15;
int8_t i;
x00 = (B[0] ^= B... | ALGO | 0.99299 | 3.360765 |
4a58ef78-2656-442f-8c98-caa6a51461e0 | Harbeter/Homework | Unit4/4.6.cpp | #include<iostream>
using namespace std;
int main()
{
int x=5,product=5,quotient=5;
product*=x++;
cout<<product<<" "<<x<<endl;
x=5;
quotient/=++x;
cout<<quotient<<" "<<x<<endl;
return 0;
}
| ALGO | 0.997738 | 3.510013 |
24f2ed32-1b10-4402-a91d-5789631a60e8 | PraveenKumarTV/CO | heap.cpp | #include<bits/stdc++.h>
using namespace std;
class minheap{
private:
vector<int>heap;
int left(int i){
return 2*i+1;
}
int right(int i){
return 2*i+2;
}
void heapify(int i){
int small=i;
int lc=left(i);
int rc=right(i);
if(lc<heap.size()&&heap[... | ALGO | 0.999738 | 4.890718 |
a7ecf988-8212-4c9d-972b-459284844072 | Ashrockzzz2003/Data_Structures_and_Algorithms | sorting/insertion_sort/insertion_sort.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
void insertionSort(vector<int>& arr){
int n = arr.size();
for(int i=1;i<n;i++){
int key = arr[i];
int j = i-1;
while(j>=0 && key < arr[j]){
arr[j+1] = arr[j];
j-=1;
}
... | ALGO | 0.999958 | 5.495959 |
c5b8ba8e-fa9c-47bf-8add-994510078a3c | iyaacs/algospot | ANAGRAM.cpp | #include<cstring>
#include<iostream>
#include<algorithm>
#include<sstream>
#include<string>
#include<vector>
#include<cmath>
#include<cstdio>
#include<cstdlib>
#include<fstream>
#include<cassert>
#include<numeric>
#include<set>
#include<map>
#include<queue>
#include<list>
#include<deque>
#include<iomanip>
#define INF 9... | ALGO | 0.999982 | 4.268289 |
529e0a25-c6b1-4647-ab75-5f0549ad3de6 | PriyanshuChoudhary211/Recursion-Problems | 2_Fibonacci.cpp | #include<bits/stdc++.h>
using namespace std;
// Tail recursion --> When the function call is at last than the recursion
// is tail recursion.
int fibonacci(int n)
{
if(n<2)
return n;
return fibonacci(n-1)+fibonacci(n-2);
}
int main()
{
int n;
cin>>n;
cout<<fibonacci(n);
} | ALGO | 0.999989 | 5.234071 |
170564de-4c42-45ee-89fb-a5c3f1fe6fad | microsoft/ExeCoder | evaluation/evaluator/execution_based/transcoder_template/cpp/CALCULATE_SUM_OF_ALL_NUMBERS_PRESENT_IN_A_STRING.cpp | #include <iostream>
#include <cstdlib>
#include <string>
#include <vector>
#include <fstream>
#include <iomanip>
#include <bits/stdc++.h>
using namespace std;
int f_gold ( string str ) {
string temp = "";
int sum = 0;
for ( char ch : str ) {
if ( isdigit ( ch ) ) temp += ch;
else {
sum += atoi ( tem... | ALGO | 0.99725 | 6.022979 |
10fcfc61-b9eb-488c-82cc-05859c4ac87d | thegamer1907/Code_Analysis | Codes/AC/3528.cpp | #include<bits/stdc++.h>
using namespace std;
long long n;
long long Half;
bool Check(long long xx){
long long nn = n;
long long Cou = 0;
while(nn > 0){
long long _ = min(xx, nn);
nn -= _;
Cou += _;
nn -= (nn / 10);
}
return Cou >= Half;
}
int main(){
cin >> n;
Half = n / 2;
Check(22699... | ALGO | 0.999877 | 4.062257 |
9f6f2e8b-bdfe-45f4-8e9a-f0a62ec990fa | ReiAccept/Algorithm | hdu/DIY37719/1007.cpp | #include<bits/stdc++.h>
//#define int long long//__int128
#define mmst0(x) memset(x,0,sizeof(x))
#define mmst3f(x) memset(x,0x3f,sizeof(x))
#define pb(x) emplace_back(x)
#define mkp(x, y) make_pair(x, y)
#define fi first
#define se second
using namespace std;
typedef long long ll;
typedef long double rld;
typedef unsig... | ALGO | 0.999894 | 3.740337 |
0c6e06cd-3b53-4930-8e96-d14ed0e7e3a8 | harsh735/practice | TEAM.cpp | #include <iostream>
#include <string.h>
#include <algorithm>
#include <bits/stdc++.h>
using namespace std;
long long int solve(vector<char> u, vector<char> v)
{
set<char> s(u.begin(), u.end());
long long int temp = 0;
for(auto x:v)
{
if(s.find(x) != s.end())
{
temp++;
... | ALGO | 0.999951 | 4.187491 |
3108d5a2-787d-47f5-86eb-7e1dfd737e0a | Ryoukiwei/Leetcode | 713 Subarray Product Less Than K.cpp | #include <bits/stdc++.h>
using namespace std;
class Solution
{
public:
int numSubarrayProductLessThanK(vector<int> &nums, int k)
{
if (k <= 1)
return 0;
int ans = 0, prod = 1;
for (auto left = nums.begin(), right = nums.begin(); right != nums.end(); ++right)
{
... | ALGO | 0.999949 | 4.879585 |
9da9adec-6c33-47c2-a9bd-b074e2cfbe5e | chiyueOfgit/SmartObliquePhotography | libigl/include/igl/svd3x3_sse.cpp | #include <cmath>
#include <algorithm>
#undef USE_SCALAR_IMPLEMENTATION
#define USE_SSE_IMPLEMENTATION
#undef USE_AVX_IMPLEMENTATION
#define COMPUTE_U_AS_MATRIX
#define COMPUTE_V_AS_MATRIX
#include "Singular_Value_Decomposition_Preamble.hpp"
// disable runtime asserts on xor eax,eax type of stuff (doesn't always work,... | ALGO | 0.99647 | 6.221957 |
4ed1a333-ca49-44a8-a844-5199eb3b516a | abc864197532/big_tic_tac_toe | line_mode/struct/old/Evolution - groups.cpp | void play(Player &p1, Player &p2) {
Game game = Game();
Player p[2]{p1, p2};//p[0] 1 first
int s = 0;
do {
pair<int, int> next_move = p[s].best_move(game);
game.move(next_move.first, next_move.second);
s ^= 1;
} while (!game.Finish());
if (game.Winner() == 1) ++p1.win;
... | ALGO | 0.99945 | 3.811593 |
56c0502d-5de3-46f6-9b6b-a6f21106623a | Just-Andy404/HM_20.05.2024 | ConsoleApplication1/VecOper.cpp | #include "VecOper.h"
int VecOper::minInArr(const vector<int>& vector)
{
return *min_element(vector.begin(), vector.end());
}
int VecOper::maxInArr(const vector<int>& vector)
{
return *max_element(vector.begin(), vector.end());
}
void VecOper::sortDescending(vector<int>& vector)
{
sort(vector.begin(), vector.end()... | TOOL | 0.99337 | 5.471857 |
977764a3-c36f-48f8-978a-6252ceef72f0 | bayren37/beakJoonCodePlus | WEEK_01_MATH/SWL/1676.cpp | #include <cstdio>
using namespace std;
int main(void) {
int N, current;
scanf("%d", &N);
// 10을 만들기 위해서는 2, 5 하나씩 필요
int cnt_2 = 0, cnt_5 = 0;
for (int i = 1; i <= N; i++) {
current = i;
// i에 포함된 2의 개수
while (current % 2 == 0) {
cnt_2 += 1;
current /= 2;
}
// i에 포함된 5의 개수
while (current % 5 ==... | ALGO | 0.999647 | 5.025027 |
e299574a-f228-4b57-8161-bb61582186f0 | Suzumiya7mi/Algorithm | 7-reverse.cpp | #include <iostream>
int reverse(int x) {
unsigned int temp = 0, n; //由于规定最长存储为32位整数,所以用无符号数储存来节省符号位.
int signal;
if (x > 0) signal = 1; //将符号位分离成signal位.
else if (x == 0) return 0;
else signal = -1;
n = abs(x);
//int i = 0;
do {
if (signal == 1 && temp > (INT_MAX - n % 1... | ALGO | 0.999919 | 4.871735 |
fcfe1caa-20f3-4fa8-a53c-a80e22798196 | svn2github/qmcpack | trunk/src/QMCDrivers/DMC/DMCUpdatePbyPFast.cpp | namespace qmcplusplus
{
/// Constructor.
DMCUpdatePbyPWithRejectionFast::DMCUpdatePbyPWithRejectionFast(MCWalkerConfiguration& w,
TrialWaveFunction& psi, QMCHamiltonian& h, RandomGenerator_t& rg):
QMCUpdateBase(w,psi,h,rg)
{
myTimers.push_back(new NewTimer("DMCUpdatePbyP::advance")); //timer for the walker loo... | ALGO | 0.999469 | 5.925088 |
a338db9d-f712-4deb-97c2-3ee659981da0 | morix1500/atcoder | atcoder/ABC052/A/main.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int a, b, c, d;
cin >> a >> b >> c >> d;
cout << max(a * b, c * d) << endl;
} | ALGO | 0.999638 | 4.258183 |
943a2a30-2aa2-4e82-94c8-82f1fe5f606b | Rahul-Nakka-23/DSA | Mathematical/Greatest-of-two.cpp | #include <bits/stdc++.h>
using namespace std;
void greatest(int a, int b)
{
if (a > b)
{
cout << a << "is greater";
}
else
{
cout << b << "is greater";
}
}
int main()
{
int a, b;
cin >> a >> b;
greatest(a, b);
}
| ALGO | 0.996198 | 3.496082 |
403fc726-dad8-4750-951a-3cfbe69d3498 | Mechain5201314/homework | homework5/优先级队列.cpp | #include <iostream>
#include <vector>
#include <queue>
using namespace std;
int main()
{
// 创建一个优先级队列
priority_queue<int> pq;
// 插入一些元素
pq.push(3);
pq.push(1);
pq.push(4);
pq.push(1);
// 访问最高优先级的元素
cout << "Top element: " << pq.top() << endl;
// 删除最高优先级的元素
pq.pop();
// 访问新的最高优先级的元素
cout << "Top e... | ALGO | 0.999058 | 4.483733 |
dfde71f5-6937-491c-962c-c80ba8d39951 | yunzz999/Competitive-Programing | ICPC/ProgComp2025-1/Contest/Contest 3/B.cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
int n;
int sum=0;
cin>>n;
vector<int> v(n);
for(int i=0;i<n;i++){
cin>>v[i];
}
for(int i=0;i<n;i++){
for(int j=i+1;j<n;j++){
sum+=v[i]*v[j];
}
}
cout<<sum<<endl;
}
// AC | ALGO | 0.999977 | 4.063706 |
6c6e940a-ab60-4ea3-bc7f-56ecd035926e | smritisrivastav20/gfg-solution | Medium/Minimum number of jumps/minimum-number-of-jumps.cpp | //{ Driver Code Starts
#include<bits/stdc++.h>
using namespace std;
// } Driver Code Ends
// Function to return minimum number of jumps to end of array
class Solution{
public:
int minJumps(int arr[], int n){
// Your code here
if(arr[0]==0) return -1;
int jump=0,pos=0,des=0;
for... | ALGO | 0.999939 | 5.87913 |
c6f776c4-4792-4d6b-b331-4330aedb05db | Naveen1422github/StiverDp | 1.array/Day1 Arrays/3.nextPermutation/backtrakFunToCulAllPermu.cpp | // gpt wrote this but while thing of solution i found that way myself but couldn't
// code although after seeing this wroty it myself while working on next permution
//problem.
#include <iostream>
#include <vector>
using namespace std;
void backtrack(vector<int>& nums, vector<bool>& used, vector<int>& currPerm, vector... | ALGO | 0.999949 | 6.788152 |
4df63b61-27b2-4f06-b571-df9ba022d7d5 | D4LGONA/2024_multicore | 4장/SKIPLIST1.cpp | #include <iostream>
#include <thread>
#include <mutex>
#include <chrono>
#include <vector>
#include <array>
#include <atomic>
#include <queue>
#include <set>
constexpr int MAX_THREADS = 16;
class NODE {
public:
int key;
NODE* volatile next;
std::mutex n_lock;
bool removed;
NODE(int x) : removed(false), key(x), ... | TOOL | 0.98411 | 4.065807 |
817d5ce7-e9b9-4150-b2a3-4934c65519e8 | deeplukhi/Data-Structures-and-Algorithms | Data_Structure/Linked Lists/singly_linked_list.cpp | #include <iostream>
using namespace std;
struct Node {
int data;
Node* next;
Node(int val) {
data = val;
next = nullptr;
}
};
class SinglyLinkedList {
private:
Node* head;
public:
SinglyLinkedList() {
head = nullptr;
}
void insertAtEnd(int val) {
Node... | ALGO | 0.999782 | 6.008383 |
ee25216c-293f-4cd9-a328-c9cb0e4086c6 | Faareh-Ahmed/30DaysOfLeetCode | 98-validate-binary-search-tree/validate-binary-search-tree.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.999936 | 6.844872 |
5129fd65-250a-4e9a-8e64-fbeac03158ec | lucusfly/leetcode | Anagram.cpp | #include <iostream>
#include <vector>
#include <string>
using namespace std;
bool isAnagram(string s, string t) {
int s1[26] = {0};
int t2[26] = {0};
for (int i = 0; i < s.length(); i++)
{
s1[s[i]-'a']++;
}
for (int i = 0; i < t.length(); i++)
{
t2[t[i]-'a']++;
}
for (int i = ... | ALGO | 0.9999 | 5.079782 |
def33935-1bd3-4c58-8bf2-924ff36d5b66 | ansh8tu/365-Days-Of-Code | LeetCode-DP-Study-Plan/Day-17/35_Longest_Palindromic_Substring.cpp | #include<iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<unordered_map>
#include<unordered_set>
#include<queue>
using namespace std;
class Solution {
public:
string longestPalindrome(string s) {
int start = 0;
int end = 0;
for(int i=0; i<s.length(); i++){
... | ALGO | 0.999958 | 5.393746 |
8ae62107-a40b-40fc-a794-aa769e46ea95 | sjm150/ps | codeforces/rounds/932/f.cpp | #include <bits/stdc++.h>
using namespace std;
typedef pair<int, int> pi;
typedef struct Djset {
vector<int> p, r;
Djset(int n): p(n), r(n, 0) { iota(p.begin(), p.end(), 0); }
int find(int u) {
if (p[u] == u) return u;
return p[u] = find(p[u]);
}
bool uni(int u, int v) {
u = ... | ALGO | 0.99949 | 4.838814 |
b0326e59-3ad4-41b0-be20-cb2caa04a431 | DcmTruman/my_acm_training | Gym/102012A/19311769_AC_1777ms_1956kB.cpp | #include <iostream>
#include <stdio.h>
#include <algorithm>
#include <functional>
#include <algorithm>
#include <queue>
#include <stdio.h>
#define INF 0x7f7f7f7f
#define ull unsigned long long
using namespace std;
const int maxn = 100020;
const int MOD = 1e9+7;
ull k1,k2;
int n,m;
int fa[maxn];
void init(int n)
{
... | ALGO | 0.99995 | 3.768958 |
062f5b2c-a036-4836-817d-f98e92863bb1 | ssong86/leetcode-problem-solving | Top-Interview-Questions/Array-Easy-Collection/66-plus_one.cpp | class Solution {
public:
vector<int> plusOne(vector<int>& digits) {
/* Time Complexity: O(n)
* Space Complexity: O(1)
*/
int n = digits.size()-1;
int carry = 1;
for(int i = n; i >= 0; i--){
digits[i] += carry;
carry ... | ALGO | 0.999733 | 7.130687 |
7e4b0121-ac92-46b4-82d2-d063b602be41 | lucaski2/Competitive-Programming | CodeForcesCompleted/XOUR/main.cpp | #include <iostream>
#include <vector>
#include <map>
#include <algorithm>
int main() {
int t;
std::cin >> t;
while (t--) {
int n;
std::cin >> n;
std::vector<int> temp(n);
for (int i = 0; i < n; i++) {
std::cin >> temp[i];
}
std::vector<std::pair... | ALGO | 0.999896 | 5.371484 |
e371a4ad-f44d-45c4-95e0-14c63c95418d | malikrehman07/assignment | integer and displays whether it is a prime number or not.cpp | #include <iostream>
bool isPrime(int number) {
if (number <= 1) {
return false; // 0 and 1 are not prime numbers
}
for (int i = 2; i * i <= number; i++) {
if (number % i == 0) {
return false; // Number is divisible by a factor other than 1 and itself
}
}
... | ALGO | 0.999158 | 5.575927 |
cc671aa0-95fe-40b8-a080-cc6cbb351adc | Suneel-Kumar/OOP-s-Reviews | wave_sort.cpp | #include <iostream>
using namespace std;
class node{
public:
int data;
node* next;
node(int val){
data = val;
next = NULL;
}
};
void insertAtHead(node* &head, int val){
node* n = new node(val);
n->next = head;
head = n;
}
void insertAtTail(node* &head, int val){
node* n = new node(val);
if(head==N... | ALGO | 0.999938 | 3.687043 |
3030ee80-deb1-4441-849f-22185480c603 | FatmaFarred/News | 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 |
f4b270b7-0328-45dc-b6d1-67f8acedc996 | TzuHuanTai/RaspberryPi-WebRTC | src/signaling/http_service.cpp | #include "signaling/http_service.h"
#include <iostream>
#include <regex>
#include <vector>
#include "common/logging.h"
std::shared_ptr<HttpService> HttpService::Create(Args args, std::shared_ptr<Conductor> conductor,
boost::asio::io_context &ioc) {
return std::mak... | WEB | 0.873147 | 6.766454 |
0571db76-3f9a-4bba-b6cc-d9e19e17a1d5 | raincross7/code-similarity | codes/train_code/problem180/problem180_482.cpp | #include <iostream>
using namespace std;
int main()
{
int a,b,c;
cin>>a>>b>>c;
if(a+b>=c)
{
cout<<"Yes";
}
else if(a+b<c)
{
cout<<"No";
}
} | ALGO | 0.999914 | 3.833155 |
bef12f16-4dac-4125-b8cd-b5cce4840127 | Ruiying-Ma/yao-acg-f24 | rocky_ground.cpp | #include "smallpt.hpp"
void rocky_ground(bool use_normal_map, bool use_height_map) {
FILE *f;
std::string img_path = "images/rocky_ground";
if (use_normal_map) {img_path += "_normal";}
if (use_height_map) {img_path += "_height";}
img_path += ".ppm";
f = fopen(img_path.c_str(), "w");
std::v... | TOOL | 0.857024 | 4.440013 |
b8a86e32-b8e3-418d-ba76-474f9d162076 | chandu-arc/Patterns-C_codes | Rev RAT pattern.cpp | // Reverse Right Angle Triangle * Pattern
#include<stdio.h>
main()
{
int i,j,rows;
printf("enter no of rows:");
scanf("%d",&rows);
for(i=rows;i>=1;i--)
{
for(j=1;j<=i;j++)
printf(" *");
printf("\n");
}
}
| ALGO | 0.999903 | 3.290302 |
99482143-8ab8-4721-9400-0e34b14c5882 | ayushpratap27/DSA-NonStop | Stack and Queues/stackUsingArray.cpp | #include<bits/stdc++.h>
using namespace std;
class Stack {
private:
int capacity;
vector<int> data;
public:
Stack(int capacity) {
this->capacity = capacity;
}
void push(int num) {
if (data.size() < capacity) {
data.push_back(num);
}
}
int pop() {
... | ALGO | 0.99783 | 5.396759 |
fa4024f1-df9d-40d2-b491-5fd139193632 | nawngs/CompetitiveProgramming | gspvh/intpoint.cpp | #include <bits/stdc++.h>
#define name ""
#define test "test"
#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);
#define sz(x) ((int)(x).size())
#define pb push_back
#defin... | ALGO | 0.999437 | 3.738079 |
3364c8e0-cce1-4795-b629-3d9f018de10f | Krythz43/CP-Archieve | codeforces/1195b.cpp | #include <bits/stdc++.h>
using namespace std;
#define fastio ios_base::sync_with_stdio(0);cin.tie(NULL);cout.tie(NULL)
#define lli long long int
#define rep(i,n,z) for(int i=z;i<n;i++)
#define rrep(i,z) for(int i=z;i>=0;i--)
#define nl cout<<endl
#define vi vector<int>
#define vlli vector<long long int>
#define umap u... | ALGO | 0.999969 | 3.956441 |
16111490-d5b5-4707-a5a3-21ac549387f8 | maxzod/flutter_bloc_pagination_example | 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.998689 | 6.792971 |
05ccb080-f3df-447b-8591-ba9bc936077d | BedirT/Algorithms_and_DS | Problems/HackerRank/C++/STL/Lower Bound-STL.cpp | // https://www.hackerrank.com/challenges/cpp-lower-bound
#include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
using namespace std;
int main() {
int n;
cin >> n ;
vector<int> adj;
for(int i = 0 ; i < n ; ++i){
int a;
cin >> a;
adj.push_bac... | ALGO | 0.999924 | 4.353032 |
e44ae23f-82c5-400b-9fde-57d69bcf7eee | shreyamalogi/CP-practice | codechef/L_LUCKY BOUNDARIES.cpp | //https://www.codechef.com/ICM2021A/problems/ICM0013
//AUTHOR : shreyamalogi
#include <bits/stdc++.h>
using namespace std;
int main() {
int tt;
cin >> tt;
while (tt--) {
long long n;
cin >> n;
cout << n << '\n';
}
return 0;
}
| ALGO | 0.99957 | 4.388965 |
dd48cbc0-9355-4cf7-8d08-3ec960e4da30 | nrysk/atcoder | ABC/abc300/a.cpp | // clang-format off
#include <atcoder/all>
#include <bits/stdc++.h>
using namespace std;
using namespace atcoder;
typedef long long ll;
template <class T> using V = std::vector<T>;
template <class T, class E> using P = std::pair<T, E>;
#define rep(i, n, m) for (int i = n; i < (int)(m); ++i)
#define rrep(i, n, m) for (i... | ALGO | 0.999894 | 4.993191 |
7c0c72a5-73a9-49e3-8dac-3c8e21974715 | Masum-Billah1/CodeForces-Accepted-Problem | Perfect Team.contest.cpp | #include<iostream>
using namespace std;
int main()
{
int n,i;
cin >> n;
for(i=0;i<n;i++)
{
int a,b,c,s,t;
cin >> a >> b >> c;
s=a+b+c;
s=s/3;
if(a>b)
t=b;
else
t=a;
if(s>t)
cout << t<<endl;
else
... | ALGO | 0.999913 | 3.316189 |
e1ea92d4-51d0-4437-9465-f3cc3139ca82 | alexandraback/datacollection | solutions_5670465267826688_1/C++/sankettotala/code_jam_2015_q3.cpp | #include<iostream>
#include<algorithm>
#include<cmath>
#include<cstdio>
using namespace std;
//#define debug 1
char mul(char a, char b){
if(a == '1') return b;
if(b == '1') return a;
if(a == b) return '1';
if(a == 'i'){
if(b == 'j') return 'k';
return 'j';
}
if(a == 'j'){
if(b == 'i') return 'k';
return ... | ALGO | 0.999968 | 3.439337 |
0b6c8d1f-2971-43f1-95aa-9fa9a766c8c0 | wyatli/leetcode | 107. Binary Tree Level Order Traversal II/solution2.cpp | /**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode(int x) : val(x), left(NULL), right(NULL) {}
* };
*/
#include <queue>
class Solution {
public:
vector<vector<int>> levelOrderBottom(TreeNode* root) {
vector<vector<... | ALGO | 0.999975 | 6.228044 |
52253482-342a-4fcc-8c70-a052827cbdeb | pyc5714/LiDARTag_docker | src/LiDARTag/internal_eigen3/eigen/unsupported/doc/examples/MatrixLogarithm.cpp | #include <unsupported/Eigen/MatrixFunctions>
#include <iostream>
using namespace Eigen;
int main()
{
using std::sqrt;
MatrixXd A(3,3);
A << 0.5*sqrt(2), -0.5*sqrt(2), 0,
0.5*sqrt(2), 0.5*sqrt(2), 0,
0, 0, 1;
std::cout << "The matrix A is:\n" << A << "\n\n";
std::cout << "... | ALGO | 0.998559 | 3.600575 |
bba5a8cc-085c-43a1-b61b-07fd29744e5c | divyansh12git/cf | 0cp-31/1600/17_1660D.cpp | // Author: * Divyansh Gupta ( divyansh_8 ) *
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp> // Common file
#include <ext/pb_ds/tree_policy.hpp> // Including tree_order_statistics_node_update
using namespace std;
using namespace chrono;
using namespace __gnu_pbds;
/*_ _ _ _ _ _ _ _ _ _ _ _ _ _ ... | ALGO | 0.999482 | 3.964808 |
67b1677e-9329-483c-b355-718d0ef4b4a6 | tramboi/scummvm-test | sound/softsynth/opl/dbopl.cpp | /*
DOSBox implementation of a combined Yamaha YMF262 and Yamaha YM3812 emulator.
Enabling the opl3 bit will switch the emulator to stereo opl3 output instead of regular mono opl2
Except for the table generation it's all integer math
Can choose different types of generators, using muls and bigger tables, try differe... | TOOL | 0.935804 | 5.169558 |
d3f36b72-287e-49b8-9442-3b419f81acc5 | PiperBetle/MyCode | P2713 罗马游戏.cpp | #include<iostream>
#include<cstdio>
#include<algorithm>
#include<cstring>
#include<cassert>
#include<ext/pb_ds/priority_queue.hpp>
namespace pbds=__gnu_pbds;
#define siz(x) int((x).size())
#define cauto const auto
#define all(x) (x).begin(),(x).end()
using std::cin;using std::cout;
using loli=long long;
using venti=__i... | ALGO | 0.999979 | 4.014741 |
30a4e5bc-06c5-4b5f-8afc-bec28f738414 | Framstag/libosmscout | libosmscout-map/src/osmscoutmap/LabelPath.cpp | #include <osmscoutmap/LabelPath.h>
#include <osmscout/system/Math.h>
#include <osmscout/util/Geometry.h>
namespace osmscout {
LabelPath::LabelPath(double minSegmentLength):
length(0), minSegmentLength(minSegmentLength), endDistance(0)
{
offsetIndex.push_back(0);
}
LabelPath::~LabelPath()
{
}
v... | TOOL | 0.913296 | 6.903535 |
b935a8b3-adf8-4570-b231-bde0ade5af63 | goldi1027/EHL | boost_1_64_0/libs/graph/example/edge_coloring.cpp | #include <iostream>
#include <boost/config.hpp>
#include <boost/graph/adjacency_list.hpp>
#include <boost/graph/edge_coloring.hpp>
#include <boost/graph/properties.hpp>
/*
Sample output
Colored using 5 colors
a-d: 4
a-f: 0
b-c: 2
b-e: 3
b-g: 1
b-j: 0
c-d: 0
c-e: 1
d-f: 2
d-i... | ALGO | 0.994267 | 6.229772 |
de56eaba-ee5a-4a1f-8c37-0dc280061a10 | raincross7/code-similarity | codes/train_code/problem325/problem325_57.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define FOR(i,a,b) for(ll i=a;i<=b;i++)
#define FORD(i,a,b) for(int i=a;i>=b;i--)
#define FORL(i,x) for(int i=head[x];i;i=nxt[i])
#define ALL(a) (a).begin(),(a).end()
#define SZ(a) int((a).size())
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(... | ALGO | 0.999984 | 3.178702 |
175840dc-74e7-4c5f-89de-ccd317273fd1 | SSUHYUNKIM/Algorithm | implementation/solution/Bronze/Bronze3/2490.cpp | #include <iostream>
using namespace std;
int input, answer;
string result = "DCBAE";
int main()
{
ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
for(int i = 0; i < 3; i++)
{
answer = 0;
for(int j = 0; j < 4; j++)
{
cin >> input;
answer += input;
... | ALGO | 0.999821 | 3.996799 |
40f60138-d0c5-46f3-af1f-08d30710449a | Warawreh/CP-Library | Contests/COMPFEST 14/j.cpp | #include <bits/stdc++.h>
using namespace std;
#define all(x) (x).begin(), (x).end()
#define fast ios::sync_with_stdio(false);cin.tie(0);
typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
vector<vector<pair<ll,ll>>> g;
ve... | ALGO | 0.999893 | 4.24097 |
95179967-2e48-4956-adfe-a3a8748b7dff | ravenblackhart/ImageProcessing | opencv/sources/samples/cpp/image_alignment.cpp | /*
* This sample demonstrates the use of the function
* findTransformECC that implements the image alignment ECC algorithm
*
*
* The demo loads an image (defaults to fruits.jpg) and it artificially creates
* a template image based on the given motion type. When two images are given,
* the first image is the input image... | ALGO | 0.994757 | 3.941833 |
0812a328-880a-4a1a-9907-8f8880941b73 | pranavajith/CP-Practice | C_Vasya_and_String.cpp | #include <bits/stdc++.h>
#include <iostream>
#include <set>
#include <cmath>
#include <map>
#include <sstream>
#include <deque>
#include <queue>
#include <stack>
#include <algorithm>
#include <limits>
#include <iomanip>
using namespace std;
#define ll long long
ll mod = 1e9 + 7;
// #define TxtIO freopen("input.txt","... | ALGO | 0.999872 | 4.233891 |
0aed5e73-268b-456c-8c13-78b164e9ec1a | miniam/Algorithms-and-dataStructures | Stacks/balanced_paranthesis.cpp | #include <bits/stdc++.h>
using namespace std;
stack <char> s;
char x;
bool isbalanced(string exp)
{
for(int i=0;i<exp.length();i++)
{
if (exp[i]=='('||exp[i]=='['||exp[i]=='{')
{
s.push(exp[i]);
continue;
}
switch (exp[i]){
case '}':
... | ALGO | 0.998759 | 4.698366 |
5fbb61f7-b8f3-43ab-aade-91faa0520d64 | goblinengine/godot3 | thirdparty/bullet/BulletCollision/CollisionDispatch/btCompoundCollisionAlgorithm.cpp | #include "BulletCollision/CollisionDispatch/btCompoundCollisionAlgorithm.h"
#include "BulletCollision/CollisionDispatch/btCollisionObject.h"
#include "BulletCollision/CollisionShapes/btCompoundShape.h"
#include "BulletCollision/BroadphaseCollision/btDbvt.h"
#include "LinearMath/btIDebugDraw.h"
#include "LinearMath/btAa... | ALGO | 0.999629 | 6.929541 |
28c0728f-fffe-4d37-a3f9-b7d19cb48633 | Tubelight30/cp | Ladder_less1300/A_Football.cpp | #include <bits/stdc++.h>
using namespace std;
#define int long long int
void solve(){
int n;
cin>>n;
string a,b;
int count = 0;
for(int i = 0;i<n;i++){
string temp;
cin>>temp;
if(i == 0 || a == temp){
a = temp;
count++;
}
else if(temp != a){
b = temp;
}
}
if... | ALGO | 0.999933 | 3.852974 |
2106a4b1-80e9-4162-87ea-d1d6e2d0efe2 | shailpujan88/leetcode-daily-question | 0088-merge-sorted-array/0088-merge-sorted-array.cpp | class Solution {
public:
void merge(vector<int>& nums1, int m, vector<int>& nums2, int n) {
int p1 = m - 1; // Pointer for nums1
int p2 = n - 1; // Pointer for nums2
for (int p = n + m - 1; p >= 0; p--) {
if (p2 < 0) {
break; // No more elements in nums2 to merge... | ALGO | 0.999966 | 5.965851 |
e31c9293-f941-4c76-ac18-043535602192 | Islam33Ahmed/order-accepted | 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.998776 | 6.763923 |
0a705811-2f53-409a-80b2-fa5a0e9c01ba | AnChanUng/Algorithm | 프로그래머스/1/12937. 짝수와 홀수/짝수와 홀수.cpp | #include <string>
#include <vector>
using namespace std;
string solution(int num) {
string answer = "";
if(num % 2 == 0) {
answer += "Even";
} else {
answer += "Odd";
}
return answer;
} | ALGO | 0.999843 | 5.856505 |
76220412-0ac6-4c71-ab5b-43fa79e3fea5 | tyalie/TyK380-keyboard | debug-tools/debug-keymatrix/src/main.cpp | #include <Arduino.h>
#include <HardwareSerial.h>
#include <string.h>
#include <stdarg.h>
#define PRINT_FULL_MATRIX 1
#define PN (uint8_t)-1
#define COLS_SIZE 15
#define ROWS_SIZE 8
const static uint8_t PIN_COLS[] = {
27, 8, 11, 15, 40, 37, 39, 6,
4, 5, 29, 3, 45, 44, 43
};
const static uint8_t PIN_ROWS[]... | TOOL | 0.872633 | 4.378468 |
aa6983ef-e65f-44f8-9dd1-5a9dd8eb85c9 | UET-2425HK2-INT2210-01/23021932-CTDL-GT | Lect3_Assignments/4.cpp | #include<iostream>
using namespace std;
struct node {
int data;
node *next;
node *prev;
};
struct douList {
node *head;
node *tail;
};
douList *createList(int x){
douList *l = new douList;
l->head = new node;
l->head->data = x;
l->head->prev = NULL;
l->head->next = NULL;
l->tail = l->head;... | ALGO | 0.999354 | 4.63302 |
09a2d99f-b377-4cc6-9a3b-97ba86872874 | Ashish-Chokhani/Competitive_Programming | Codeforces/685B.cpp | #include <bits/stdc++.h>
using namespace std;
vector<int> Size(300001, 0), maxi_depth(300001, 0), centroid(300001, -1), parent(300000, -1);
int DFS(int cur, int par, vector<int> *adj)
{
int nnodes = 0;
for (auto it : adj[cur])
{
if (it != par)
{
nnodes += DFS(it, cur, adj);
... | ALGO | 0.99998 | 4.538268 |
155ee0af-d7f6-42ec-9cc5-7b489babc264 | bioyoshoo/atcoder | ABC/278/c.cpp | #include <bits/stdc++.h>
using namespace std;
#include <atcoder/all>
using namespace atcoder;
using ll = long long;
#define rep(i, n) for (int i = 0; i < (n); i++)
int main() {
int N, Q; cin >> N >> Q;
map<int, map<int, int>> mp;
rep(i, Q) {
int t, a, b; cin >> t >> a >> b;
if (t == 1) {
... | ALGO | 0.999892 | 4.871832 |
c3fd86b4-fcf5-47bf-8b0a-9786b9f20296 | ashishnagpal2498/CPP_Concepts_and_Codes | Competitive Programming/Sunday-Revision/Overview1.0/3_PowPow2.cpp | // POWPOW2
#include<bits/stdc++.h>
#define ll long long int
#define endl "\n"
#define ArrIn(n) for(int i=0;i<n;i++)
#define ArrOut for(int i=0;i<n;i++) {cout<<arr[i]<<" "; }
#define mod 1e9+7
ll modExp(a,x,m){
ll ans=1,a;
while(j)
{ if(j&1)
{
ans = (ans * a) % m;
}
a = ... | ALGO | 0.999751 | 3.065893 |
8b6f93d8-15a9-4e1a-a2ba-3572162f67c0 | phanlinhk43/FreeBSD-ports | games/cube/files/patch-physics.cpp | --- physics.cpp.orig 2015-02-14 01:31:41.351723000 +0100
+++ physics.cpp 2015-02-14 01:40:28.770647000 +0100
@@ -46,14 +46,14 @@
{
entity &e = ents[i];
if(e.type!=MAPMODEL) continue;
- mapmodelinfo &mmi = getmminfo(e.attr2);
- if(!&mmi || !mmi.h) continue;
- const float r = m... | ALGO | 0.99888 | 7.093963 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.