uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
1c6cb876-eda0-4114-8e9e-fa72b98d363a | zakki/openhsp | package/win32/iOS/hspproj_gp/hspproj/hsp3dish/gameplay/encoder/src/Heightmap.cpp | #include "Base.h"
#include "Heightmap.h"
#include "GPBFile.h"
#include "Thread.h"
namespace gameplay
{
// Number of threads to spawn for the heightmap generator
#define THREAD_COUNT 8
// Thread data structure
struct HeightmapThreadData
{
float rayHeight; // [in]
const Vector3* rayDirection... | ALGO | 0.990159 | 7.357944 |
7e8d3618-63d3-49fb-b2b5-f7335b478c93 | Tomhawkstorm55557/solutions | 0095-unique-binary-search-trees-ii/0095-unique-binary-search-trees-ii.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.999928 | 5.962527 |
2216c262-e668-469f-a33f-944cf44a0d56 | ishandutta2007/codeforces | nishant403/normal/1294/E.cpp | #include <bits/stdc++.h>
using namespace std;
#define int long long
#define pb push_back
#define S second
#define F first
#define f(i,n) for(int i=0;i<n;i++)
#define fast ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define vi vector<int>
#define pii pair<int,int>
int n,m;
vector<vi> a;
int go(vector<int> ... | ALGO | 0.999943 | 3.426845 |
39a7796d-00fc-4657-b7fd-b4029621d1b4 | dlvguo/NoobOJCollection | LeetCode/Normal/1400-1499/1414.cpp | #include <bits/stdc++.h>
using namespace std;
class Solution
{
public:
int findMinFibonacciNumbers(int k)
{
vector<int> f;
f.emplace_back(1);
int a = 1, b = 1;
while (a + b <= k)
{
int c = a + b;
f.emplace_back(c);
a = b;
b ... | ALGO | 0.999973 | 5.061993 |
b00d77be-b7f5-465a-864a-a0c946ef59c8 | Ayesha049/all_contest_codes | SEPTEMBER 2017/26 sep/UVa 437 The tower of babylon.cpp |
#include <bits/stdc++.h>
#define ll long long
#define f(i,a,b) for(int i=(a);i<(b);i++)
#define fd(i,a,b) for(ll i=(a);i>(b);i--)
#define x first
#define y second
#define si(a) scanf("%d",&a)
#define sii(a,b) scanf("%d %d",&a,&b)
#define siii(a,b,c) sc... | ALGO | 0.999967 | 4.173159 |
1bd8e859-b808-4371-bc55-5827a02775df | geyan3566/mfem_dgd | fem/fespace.cpp | // Implementation of FiniteElementSpace
#include "../general/forall.hpp"
#include "../general/text.hpp"
#include "../mesh/mesh_headers.hpp"
#include "ceed/interface/util.hpp"
#include "fem.hpp"
#include <cmath>
#include <cstdarg>
using namespace std;
namespace mfem {
template <>
void Ordering::DofsToVDofs<Ordering... | TOOL | 0.908392 | 5.081855 |
b358fb9e-32f3-4284-9bef-83e9f6a99a04 | HimanshuYadav0/DSA-Questions | 0058-length-of-last-word/0058-length-of-last-word.cpp | class Solution {
public:
int lengthOfLastWord(string s) {
int length = 0;
int i = s.length() - 1;
// Skip trailing spaces
while (i >= 0 && s[i] == ' ') {
i--;
}
// Count the characters of the last word
while (i >= 0 && s[i] != ' ') {
... | ALGO | 0.99828 | 6.737016 |
8db7e9eb-6d84-4652-8537-d0863eca54f2 | yxyang/jumping_cod | third_party/eigen3/include/unsupported/test/polynomialsolver.cpp | #include "main.h"
#include <unsupported/Eigen/Polynomials>
#include <iostream>
#include <algorithm>
using namespace std;
namespace Eigen {
namespace internal {
template<int Size>
struct increment_if_fixed_size
{
enum {
ret = (Size == Dynamic) ? Dynamic : Size+1
};
};
}
}
template<typename PolynomialType>
Pol... | TEST | 0.917067 | 6.584 |
f788b603-c7c4-4828-b366-10c71568ecb7 | openharmony/third_party_boost | libs/geometry/doc/src/examples/views/box_view.cpp | // Boost.Geometry (aka GGL, Generic Geometry Library)
// QuickBook Example
//[box_view
//` Shows usage of the Boost.Range compatible view on a box
#include <iostream>
#include <boost/geometry.hpp>
int main()
{
typedef boost::geometry::model::box
<
boost::geometry::model::point<double, 2, boo... | TOOL | 0.893169 | 7.031379 |
851a3e27-0da3-4550-875f-dd96e95359f9 | EvelinaK1/practice_rep | 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 |
4bdb9cb1-1532-41b3-aa6a-dee3a74de72b | mauryavinay1407/DSA-cpp | Arrays/Kadane's Algo/Maximum_Product_Subarray.cpp | // problem: https://www.geeksforgeeks.org/problems/maximum-product-subarray3604/1
/*
Approach-1: Brute Force(by generating all possible subarray using 3 loops)
Time Complexity: O(N^3)
Space Complexity: O(1)
*/
class Solution {
public:
int maxSubarrayProduct(vector<int>& nums) {
int n = nums.size();
int resu... | ALGO | 0.999985 | 6.673868 |
7d126d56-4e1f-43c1-94e3-d8e40d44e225 | sandeshkhadase/Leetcode-Solutions | Leetcode Solutions/solution/3100-3199/3123.Find Edges in Shortest Paths/Solution.cpp | class Solution {
public:
vector<bool> findAnswer(int n, vector<vector<int>>& edges) {
vector<vector<array<int, 3>>> g(n);
int m = edges.size();
for (int i = 0; i < m; ++i) {
auto e = edges[i];
int a = e[0], b = e[1], w = e[2];
g[a].push_back({b, w, i});
... | ALGO | 0.999973 | 6.004848 |
3fe1a57e-1ed0-4534-ab7c-674a7413435d | hetaodie/webrtc_m49 | audio_message/ios/opencore-amr-iOS-master/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/div_32.cpp | /*
Filename: div_32.cpp
------------------------------------------------------------------------------
*/
/*----------------------------------------------------------------------------
; INCLUDES
----------------------------------------------------------------------------*/
#include "basic_op.h"
/*-------------... | ALGO | 0.999332 | 6.256358 |
08a6970b-f049-4fac-81b2-e52f7ad86da5 | elnaddar/shopping_list_flutter_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 |
95c1cf0e-bb70-467d-b049-b430b9feec39 | wuhuaizai/GraphDemo | Drawdemo/MRect.cpp | #include "stdafx.h"
#include "MRect.h"
#include "GlobalUtil.h"
MRect::MRect():Shape()
{
isSelected = false;
}
MRect::MRect(CPoint LT,CPoint RB,COLORREF color,int penWidth):Shape() {
m_LeftTop = CPoint(LT.x,LT.y);
m_RightBottom = CPoint(RB.x,RB.y);
m_LeftBottom = CPoint(LT.x,RB.y);
m_RightTop = CPoint(RB.x,LT.y);... | TOOL | 0.884092 | 5.053972 |
579ae665-6c01-4f43-8bb3-0cf408223f6a | hieu712010/200_BaiC- | bai24.cpp | #include <bits/stdc++.h>
using namespace std;
int main(){
int a, b; cin >> a >> b;
int cnt = 0;
while(a <= b){
cnt++;
a *= 3;
b *= 2;
}
cout << cnt;
return 0;
} | ALGO | 0.999697 | 4.125775 |
f4661f89-e656-4a29-b918-2932ec5b67ef | Tapesh-Vashisth/Leetcode_Solutions | 2035_Partition_Array_Into_Two_Arrays_to_Minimize_Sum_Difference.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
void helper(vector <int> & store, int index, int sum, vector <vector <int>> & diff, int & total, int counter) {
if (index == store.size()) {
diff[counter].push_back(sum - (total - sum));
return ;
}
// take
... | ALGO | 0.999815 | 5.416285 |
19530a16-6521-4525-bd57-6fafbaa8b2b3 | azel263/Chapter2Exercise18 | Chapter2Exercise18.cpp | /*
File Name: Chapter2Exercise18.cpp
Programmer/Developer: Alejandro Andres Pepito
Date: 5/04/2025
Requirements summary:
"Write a program that displays an approximate of energy drink buyers per week, and an approximate of buyers who prefer citrus-flavored energy drinks."
*/
#include <iostream>
... | ALGO | 0.986877 | 6.912914 |
e9349307-b5fb-4a3f-97ab-d88750c4e3d8 | ishandutta2007/codeforces | nachia/normal/219/C.cpp | #include<bits/stdc++.h>
using namespace std;
using UL = unsigned long;
using ULL = unsigned long long;
using LL = long long;
#define rep(i, n) for(int i = 0; i < (n); i++)
struct Problem {
UL dp[500001];
void Solve() {
UL N, K; cin >> N >> K;
string S; cin >> S;
if (K == 2) {
... | ALGO | 0.999999 | 5.330778 |
607fea69-56bb-4320-8a86-6618c027004a | cc20mtech11006/Data-Structures-and-Algorithms | 33_Graphs/33.4_TopologicalSort.cpp | // Topological sort in a directed acyclic graph.
// Input
// 4 4
// 0 1
// 1 2
// 2 3
// 3 4
// output : 0 1 2 3
#include<bits/stdc++.h>
using namespace std;
int main(){
int n, m; // n: no of vertices, m: no of edges
cout << "Enter number n and m and edges ";
cin >> n >> m;
vector<vector<int>> adj(n);
vector<... | ALGO | 0.999998 | 5.10762 |
d2da7a62-a962-489c-b5f4-8da8eb92b2f6 | GabrielBReis/URI | C/uri1012.cpp | #include <math.h>
int main(){
double a,b,c;
scanf("%lf %lf %lf",&a,&b,&c);
printf("TRIANGULO: %.3lf\nCIRCULO: %.3lf\nTRAPEZIO: %.3lf\nQUADRADO: %.3lf\nRETANGULO: %.3lf\n",(a*c)/2,(3.14159*(pow(c,2))),((a+b)*c)/2,pow(b,2),a*b);
return 0;
} | ALGO | 0.993317 | 3.332686 |
4b7100a7-c69a-404a-962e-e9d67ec8c66d | Hardik-Kumar1101/DS-Algorithm | Tree/construct_BS_to_doubly_list.cpp | #include<bits\stdc++.h>
using namespace std;
struct node {
node *left;
node *right;
int data;
node(int a)
{
data=a;
right=left=NULL;
}
};
node *Tree_to_Doubly_List(node *root)
{
if(root==nullptr) return root;
node *head = Tree_to_Doubly_List(root->left);
static node... | ALGO | 0.999974 | 4.533246 |
1b6fd581-780a-484e-a8ad-e73661008f18 | IntelLabs/c3-llvm | libcxx/test/std/algorithms/alg.nonmodifying/alg.find.first.of/find_first_of.pass.cpp | // <algorithm>
// template<InputIterator Iter1, ForwardIterator Iter2>
// requires HasEqualTo<Iter1::value_type, Iter2::value_type>
// constexpr Iter1 // constexpr after C++17
// find_first_of(Iter1 first1, Iter1 last1, Iter2 first2, Iter2 last2);
#include <algorithm>
#include <cassert>
#include "test_macros.... | TEST | 0.984044 | 6.538524 |
af227c96-d217-4747-b8a0-661dc1523eed | jamesrayman/sport | cses/countingpaths.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pll = pair<ll, ll>;
template<typename T>
struct SegTree {
ll n;
vector<T> t;
T noval = { 1e8, -1 };
T f (T a, T b) {
return min(a, b);
}
void combine (int p) {
t[p] = f(t[2*p], t[2*p+1]);
}
voi... | ALGO | 0.99993 | 4.547729 |
c1502d32-9d15-43dd-9062-90f88631f256 | amitpatil89/programs | c++/bulb_switcher.cpp | // Leetcode #672. Bulb Switcher II
//
// There is a room with n lights which are turned on initially and 4 buttons on the wall. After performing exactly m unknown operations towards buttons, you need to return how many different kinds of status of the n lights could be.
//
// Suppose n lights are labeled as numb... | ALGO | 0.999972 | 6.7531 |
f68d93bf-c5e7-48e9-9d2d-d7a5f9475c3e | Uni-coder-harsh/CPP | Patterns/rectangle.cpp | #include<iostream>
using namespace std;
int main(){
int l , b ;
cout<<"Enter the length ";
cin>>l;
cout<<endl;
cout<<"Enter the breadth ";
cin>>b;
for(int i=1;i<=l;i++){
for(int j=1;j<=b;j++){
cout<<"*";
}
cout<<endl;
}
return 0;
} | ALGO | 0.999295 | 3.45864 |
8835a058-e0fe-4cd3-a707-26eda824aa8a | ioqoo/PS | Algorihm Category/Implement/1525.cpp | #include <bits/stdc++.h>
using namespace std;
map<string, int> dist;
set<string> visited;
int di[] = {-3, -1, 1, 3};
bool is_out(int i){
if (i < 0 || i >= 9) return true;
return false;
}
int main(){
#ifndef ONLINE_JUDGE
freopen("input.txt", "r", stdin);
#endif
ios_base::sync_with_stdio(0); cin.tie(0); cout.... | ALGO | 0.999869 | 4.056307 |
3467bb04-df02-4909-a6b0-e113f05a5474 | jeetsavsani1173/LeetCode-Solution | 0352-data-stream-as-disjoint-intervals/0352-data-stream-as-disjoint-intervals.cpp | class SummaryRanges {
public:
/** Initialize your data structure here. */
map<int, int> m;
SummaryRanges() {
}
void addNum(int val) {
if(m.count(val)) return;
m[val] = val;
int mn = val, mx = val;
if (m.count(val - 1)) mn = m[val-1];
if (m.count(val + 1))... | ALGO | 0.999967 | 5.967147 |
236ad44e-831a-49f4-a584-90d5e75b6de2 | rubonz/soledjvu | djvu/djvu/libdjvu/BSByteStream.cpp | #ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#if NEED_GNUG_PRAGMAS
# pragma implementation
#endif
// - Author: Leon Bottou, 07/1998
#include <stddef.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include "BSByteStream.h"
#undef BSORT_TIMER
#ifdef BSORT_TIMER
#include "GOS.h"
#endif
#ifdef HAVE_NA... | TOOL | 0.921482 | 6.040823 |
bed3ba3b-4706-4196-90e6-1a646ae1abc8 | sarvex/leetcode-solidity | solution/0000-0099/0021.Merge Two Sorted Lists/Solution.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* mergeTwoLis... | ALGO | 0.999933 | 5.894645 |
c407ef3d-52d7-4fe3-89e0-c4244132ff7e | minhthinh145/LeetCode | 121.cpp | #include <bits/stdc++.h>
using namespace std;
//dp:
// int maxProfit(vector<int>& prices) {
// if(prices.empty()) return 0;
// vector<int> dp(prices.size(),0);
// int min_prices = prices[0];
// for(int i = 0 ; i < prices.size() ; i++)
// {
// dp[i] = prices[i] - min_pri... | ALGO | 0.999323 | 5.083893 |
3d0e4de8-8d11-40aa-83f0-7c2167142f5a | SumitRaikwar18/Hacktoberfest | C++/nextgreaterelement.cpp | #include <bits/stdc++.h>
#include<algorithm>
#include<vector>
#include<map>
#define ll long long
using namespace std;
void nextLargerElement(vector<long long> arr, int n){
stack<ll>s;
vector<ll>vect1;
vector<ll>vect(n,-1);
for(int i=0;i<n;i++){
while(!s.empty() && arr[s.top()]<arr[i]){
vect[s.top()]=(i);... | ALGO | 0.999915 | 4.345333 |
d191fcc0-66cd-4a39-a674-101a0ed069f5 | nkirov/nkirov.github.com | 2005/netb151/sources/ch8/primebug.cpp | /* 1 */ #include <iostream>
/* 2 */
/* 3 */ using namespace std;
/* 4 */
/* 5 */ /**
6 Tests if an integer is a prime.
7 @param n any positive integer
8 @return true iff n is a prime
9 */
/* 10 */ bool isprime(int n)
/* 11 */ {
/* 12 */ if (n == 2) return true;
/* 13 */ ... | ALGO | 0.996843 | 5.497255 |
7ad181d2-3b10-44a8-8988-7c8fe4f629b7 | avneeshlingwal9/codes | C++/temo/up.cpp | #include <iostream>
using namespace std ;
int main(){
string s ;
cout << "Enter the string : - " << endl ;
getline(cin,s);
char a ;
for(int i = 0 ; i < s.length(); i++){
if(s[i]>91 && s[i]<123){
s[i]= s[i]-32;
}
}
cout << s << endl ;
}
| TOOL | 0.946318 | 4.070307 |
98e592dd-f64a-4985-9757-0c00207b59a2 | jikongabc/test-jikong | P1892.cpp | #include <iostream>
#include <algorithm>
#include <cstring>
#include <string>
#include <vector>
#include <queue>
#include <deque>
#include <map>
#include <set>
#include <unordered_map>
#include <cmath>
#define inf 0x3f3f3f3f
using namespace std;
using LL = long long;
using ULL = unsigned long long;
typedef pair<int, in... | ALGO | 0.999663 | 4.1279 |
f2609504-240b-4403-af28-9807bcde531c | Xydon/CSES-Solutions-and-Extras | range_queries/3_dynamic_range_sum_queries.cpp | #include <bits/stdc++.h>
using namespace std;
class SQRTDecomposition {
int n, sqrt_n;
vector<long long> arr, block;
public:
void init(vector<long long> arr) {
this->arr = arr;
n = arr.size();
sqrt_n = sqrt(n);
//* write function for processing
long long temp = 0;
for (int i = 0; i < n... | ALGO | 0.999919 | 5.027352 |
fe01754f-d71c-44d9-8d4b-e6460f93904d | yyl-20020115/vampire_win | Kernel/SubformulaIterator.cpp | /**
* @file SubformulaIterator.cpp
* Implements a class SubformulaIterator that iterates
* over subformulas in formula lists, and formulas.
*
* @since 06/01/2004 Manchester
* @since 02/06/2007 Manchester changed to new datastructures
* @since 06/05/2015 Gothenburg in order to support FOOL, we need to search for ... | TOOL | 0.965404 | 3.946708 |
fae42e8e-9d18-4989-a641-5f1790e78dbc | ishandutta2007/codeforces | alex9801/normal/1089/F.cpp | #include <bits/stdc++.h>
using namespace std;
using lint = long long;
using pi = pair<int, int>;
int extract_one_soinsu(int n){
for(int i=2; i*i<=n; i++){
if(n % i == 0) return i;
}
return n;
}
pi get_sol(int p, int q){
if(p < q){
auto ret = get_sol(q, p);
return pi(ret.second, ret.first);
}
for(int i=1; ... | ALGO | 0.999885 | 4.371911 |
0e167d2f-442a-48de-b684-9ac27b2512a9 | ssong86/leetcode-problem-solving | June-LeetCoding-Challenge-2020/Week2/75-Sort-Colors.cpp | // Time Complexity: O(n)
// Space Complexity: O(1)
// Runtime: 4 ms, faster than 49.05%
// Memory Usage: 8.4 MB, less than 41.64%
class Solution {
public:
void swap(int &a, int &b){
int temp = a;
a = b;
b = temp;
}
void sortColors(vector<int>& nums) {
int left =... | ALGO | 0.999883 | 6.101902 |
2ba9992f-d454-4757-9f58-bb82126db647 | ishandutta2007/codeforces | ivan100sic/normal/818/B.cpp | #include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <set>
#include <map>
#include <numeric>
#include <iterator>
#include <cstring>
using namespace std;
int l[105], n, m;
int a[105];
int modd(int x) {
if (x > n) {
return x-n;
}
if (x < 1) {
return x+n;
}
return x;
}
int main... | ALGO | 0.999994 | 3.522208 |
73ce516a-4b7c-4b7b-9ef8-fea4812a7a07 | zdanowiczkonrad/Connect4 | source/mainwindow.cpp | #include <cmath>
#include <QMessageBox>
#include <QtCore/QDebug>
#include "mainwindow.h"
#include "ui_mainwindow.h"
#include "label.h"
/****************************************************/
/* Klasa: Plansza */
/****************************************************/
//konstruktor
Pla... | ALGO | 0.851923 | 4.836093 |
95897296-45ed-4077-a914-f5b117ef092b | rikuya6/ICPC_learning | AOJ/0020.cpp | #include <iostream>
#include <algorithm>
#include <string>
#include <cctype>
using namespace std;
#define REP(i, j) for (int i = 0; i < j; i++)
int main()
{
string s;
getline(cin, s);
for (int i = 0; i < s.size(); ++i) {
s[i] = toupper(s[i]);
cout << s[i];
}
cout << endl;
return 0;
}
| ALGO | 0.985629 | 4.876877 |
380a964a-b8f7-4fb8-8683-eda085bfacb7 | Sachleen095/DSA | 2414-move-pieces-to-obtain-a-string/move-pieces-to-obtain-a-string.cpp | class Solution {
public:
bool canChange(string start, string target) {
int n=start.length();
int i=0,j=0;
while(i<n || j<n) {
while(i<n && start[i]=='_') {
i++;
}
while(j<n && target[j]=='_') {
j++;
}
... | ALGO | 0.999902 | 6.039151 |
474f9d3d-803c-4b30-b11a-cd2588f4f104 | bhavikmk/vision-arm | arm_ws/src/kuka_arm/src/Eigen-3.3/lapack/cholesky.cpp | #include "lapack_common.h"
#include <Eigen/Cholesky>
// POTRF computes the Cholesky factorization of a real symmetric positive definite matrix A.
EIGEN_LAPACK_FUNC(potrf,(char* uplo, int *n, RealScalar *pa, int *lda, int *info))
{
*info = 0;
if(UPLO(*uplo)==INVALID) *info = -1;
else if(*n<0) ... | ALGO | 0.998468 | 6.004565 |
156dc2d6-78f1-40b8-84a0-403e37b4156d | ZeinVan/GFHKSDGM | OOT/202304/BankAccountManage.cpp | //
// Created by Anthony Wong on 2023/4/5.
//
#include <iostream>
#include <cmath>
using namespace std;
class SavingAccount{
private:
int id;
double balance;
double rate;
int lastDate;
double accumulation;
void record(int count, double amount);
double accumulate(int date) const{
re... | TOOL | 0.968677 | 4.800871 |
1f0ebd08-0b42-4146-9af3-a94a1cdb2925 | IlluMinati-Github/DSA | 3830-find-closest-person/find-closest-person.cpp | class Solution {
public:
int findClosest(int x, int y, int z) {
int distX = abs(x - z);
int distY = abs(y - z);
int a=1;
int b=2;
int c=0;
if (distX < distY) return a;
else if (distX==distY) return c;
else return b;
}
}; | ALGO | 0.999972 | 5.175688 |
bd4799c9-117e-47c5-9535-2bb0888ddd68 | Tazri/Problem-Solving-By-C-and-C-Plus-Plus | codeforce/1000/1515.B.PhoenixandPuzzle.cpp | // link : https://codeforces.com/problemset/problem/1515/B
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef double dl;
#define optimize() \
ios_base::sync_with_stdio(0); \
cin.tie(0); \
cout.tie(0)
#define fraction() \
cout.un... | ALGO | 0.9994 | 5.448911 |
a4de67f8-e7f0-47a0-803d-7635bf0c792d | ishandutta2007/codeforces | meijer/normal/1195/D1.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> ii;
typedef vector<int> vi;
typedef vector<ii> vii;
typedef vector<ll> vll;
#define REP(a,b,c) for(int a=int(b); a<int(c); a++)
#define RE(a,c) REP(a,0,c)
#define REV(a,b,c) for(int a=int(c-1); a>=int(b); a--)
#define INF 1e9
#d... | ALGO | 0.999938 | 4.351563 |
08b0c202-a479-47a6-9ab2-4af8867944af | aditya-sar/LeetCode | 2059-unique-length-3-palindromic-subsequences/unique-length-3-palindromic-subsequences.cpp | class Solution {
public:
int n;
int ans = 0;
int countPalindromicSubsequence(string s) {
n = s.size();
vector<int> minMap(26, INT_MAX), maxMap(26, INT_MIN);
for(int i=0; i<n; i++) {
int pos = s[i] - 'a';
minMap[pos] = min(minMap[pos], i);
maxMap[p... | ALGO | 0.999728 | 6.315751 |
84f49849-aadc-4c1a-bd15-bfc389b785a2 | 0xMUEL/leetCode-Prac | Samuel/643. Maximum Average Subarray I.cpp | #include <vector>
using namespace std;
using std::vector;
class Solution {
public:
double findMaxAverage(vector<int>& nums, int k) {
auto size = nums.size();
if(size == 1){
return nums[0];
}
double sum = 0;
for(int i = 0; i < k; i++){//initialize the first sum
... | ALGO | 0.999907 | 6.027049 |
37c99bc7-3393-4369-a974-c8993da4d48c | Xuchaoxiong/PAT | B1042/B1042/B1042.cpp | // B1042.cpp : ̨Ӧóڵ㡣
//
#include "stdafx.h"
#include "stdio.h"
#include "stdlib.h"
int main()
{
char word;
int list[52] = { 0 };
while (true)
{
word = getchar();
if (word=='\n')
break;
if (word >= 'a'&&word <= 'z')
list[int(word - 'a')]++;
if (word >= 'A'&&word <= 'Z')
list[int(word - 'A')]++;
... | ALGO | 0.992181 | 3.40255 |
3141aeba-25b4-491b-b6d9-773c858bfbdd | zhanghefan123/C-Plus-Plus-Algorithm | math/lcm_sum.cpp | /**
* @file
* @brief An algorithm to calculate the sum of LCM: \f$\mathrm{LCM}(1,n) +
* \mathrm{LCM}(2,n) + \ldots + \mathrm{LCM}(n,n)\f$
* @details An algorithm to calculate the sum of LCM: \f$\mathrm{LCM}(1,n) +
* \mathrm{LCM}(2,n) + \ldots + \mathrm{LCM}(n,n)\f$ where
* \f$\mathrm{LCM}(i,n)\f$ denotes the Leas... | ALGO | 0.999602 | 7.153933 |
f7c5a0de-e96e-414c-a093-002c9edb91d2 | AkshatAggarwal14/Competitive-Programming | CodeForces/Heuristics/53D.cpp | //**********************master._.mind**********************
//-----------------Author: Akshat Aggarwal-----------------
//If you don't understand the code below... dont worry, i didn't either
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define lld long double
#define ull unsigned long long
#defi... | ALGO | 0.999963 | 4.920422 |
7f5562ae-a544-4bc1-9b4a-9337c227c897 | seokhyunpark/algorithm-practice | AP.1/1.1.cpp | void seqsearch(int n, vector<int> S, int x, int& location) {
location = 0;
for (int i = 1; i < n+1; i++) {
if (x == S[i])
location = i;
}
}
| ALGO | 0.999751 | 3.617159 |
8af099c0-ca36-42e5-ae23-293a17524f84 | 9yuR/Algorithm-Study | 프로그래머스/lv0/120924. 다음에 올 숫자/다음에 올 숫자.cpp | #include <string>
#include <vector>
using namespace std;
int solution(vector<int> common) {
int answer = 0;
if (common[1] - common[0] == common[2] - common[1])
answer = common.back() + common[2] - common[1];
else
answer = common.back() * common[2] / common[1];
return answer;
} | ALGO | 0.999432 | 4.753836 |
26287c5c-35ca-4509-b022-a8b222785d08 | jiyizhongdenuo/algorithms_4_CPP | algorithms/1.1.26.cpp | #include<iostream>
int main()
{
using std::cout; using std::endl;using std::cin;
int a,b,c;
cin>>a>>b>>c;
cin.ignore(1000,'\n');
int t;
if (a > b) {
t = a;
a = b;
b = t;
}
if (a > c) {
t = a;
a = c;
c = t;
}
if (b > c) {
t ... | ALGO | 0.999613 | 3.170098 |
79fe797a-2795-44a9-aae5-c2cef5fb2b8f | AOSC-Tracking/virtualbox | src/VBox/Runtime/common/math/lroundf.cpp | /* $Id: lroundf.cpp $ */
/** @file
* IPRT - No-CRT - lroundf().
*/
/*********************************************************************************************************************************
* Header Files ... | ALGO | 0.95961 | 5.438345 |
70832fc8-5dcb-40f9-8d01-7804285fab8a | VadVergasov/OlympTasks | CodeForces/293762/H/main.cpp | using namespace std;
vector<pair<long long, int> > tree;
vector<int> a;
void push(int v, int tl, int tr) {
if (tree[v].second != -10000) {
tree[v * 2].second = tree[v * 2 + 1].second = tree[v].second;
int tm = (tl + tr) / 2;
tree[v * 2].first = (long long)tree[v].second * (tm - tl + 1);
... | ALGO | 0.999934 | 3.835816 |
61ebad48-b3df-48ae-a5af-b56e8b61dab4 | wenqingliu/zzy_fish | Trunk/frameworks/cocos2d-x/cocos/platform/linux/CCDevice-linux.cpp | #include "platform/CCPlatformConfig.h"
#if CC_TARGET_PLATFORM == CC_PLATFORM_LINUX
#include "platform/CCDevice.h"
#include <X11/Xlib.h>
#include <stdio.h>
#include <algorithm>
#include <vector>
#include <map>
#include <string>
#include <sstream>
#include <fontconfig/fontconfig.h>
#include "platform/CCFileUtils.h"
#i... | TOOL | 0.86328 | 5.597022 |
7394d71b-c983-4e6c-a270-a59057dec317 | alinaamanzhol/pp1 | lab4/11.cpp | #include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
int main(){
int n;
cin >> n;
vector<int> v(n);
for(int i = 0; i < n; i++)
{
cin >> v[i];
}
for(int i = 0; i < n; i++)
{
int a;
cin >> a;
v.push_back(a);
}
int k;
... | ALGO | 0.999699 | 3.15884 |
8f189241-b0ea-4304-9960-9f50c75612b7 | algorithm003/algorithm | Week_03/id_58/LeetCode_529_58_BFS.cpp | class Solution {
public:
vector<vector<char>> updateBoard(vector<vector<char>>& board, vector<int>& click) {
if (board.empty())
return {};
int m = board.size(), n = board[0].size();
queue<pair<int, int>> q({{click[0], click[1]}});
while (!q.empty()) {
int row ... | ALGO | 0.999377 | 6.896775 |
2a512b42-c4e9-4251-991d-941e8a9750a4 | ishandutta2007/codeforces | andreasyan/normal/703/E.cpp | #include <bits/stdc++.h>
using namespace std;
#define m_p make_pair
const int N = 1003, M = 10004;
const long long INF = 1000000009000000009;
long long gcd(long long x, long long y)
{
if (x == 0)
return y;
return gcd(y % x, x);
}
int n;
long long k;
long long a[N], aa[N];
vector<long long> vv;
void p... | ALGO | 0.999973 | 3.691448 |
9a7b8924-6282-497d-95e7-24ac63c8fda7 | raincross7/code-similarity | codes/train_code/problem344/problem344_270.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vl = vector<ll>;
#define rep(i, n) for(ll i = 0; i < (ll)(n); i++)
int main() {
ll n;
cin >> n;
vl p(n);
unordered_map<ll, ll> mp;
set<ll> s;
rep(i, n) {
cin >> p[i];
mp[p[i]] = i; //値 => INDEX
s.insert(p[i]);
}
... | ALGO | 0.999969 | 3.590683 |
f3d584ec-8e2d-4241-a7b7-ff7a7d0bdb67 | jimidovich/momi | eigen3/doc/examples/Tutorial_BlockOperations_print_block.cpp | #include <Eigen/Dense>
#include <iostream>
using namespace std;
int main()
{
Eigen::MatrixXf m(4,4);
m << 1, 2, 3, 4,
5, 6, 7, 8,
9,10,11,12,
13,14,15,16;
cout << "Block in the middle" << endl;
cout << m.block<2,2>(1,1) << endl << endl;
for (int i = 1; i <= 3; ++i)
{
cout << "B... | ALGO | 0.990258 | 3.6853 |
284873d7-eb2b-4f00-b38f-a485ffa4bbff | PranishW/Graph-Algorithms | shortestpathgraph(bfs).cpp | #include <bits/stdc++.h>
using namespace std;
void bfs(unordered_map<int,vector<int>>& g)
{
queue<int> q;
unordered_map<int,int> visited,parent;
int src,dest;
cout<<"Enter the source vertex :- ";
cin>>src;
cout<<"Enter the dest vertex :- ";
cin>>dest;
q.push(src);
visited[src] = 1;
parent[src]=-1;
while(!q.e... | ALGO | 0.999956 | 5.096931 |
477e78f3-17af-430d-a7ff-9205be9e27dc | Waleedhasn/PD-Semester-1 | Lab manual 5 Tasks/task4cp.cpp | #include <iostream>
#include <cmath>
using namespace std;
float height(float ,float);
main()
{
float dist,angle,result;
cout << "Enter the distance from base of the tree(in feet): ";
cin >> dist;
cout <<"Enter the angle of elevation(in degrees): ";
cin >> angle;
result = height(dist,angle);
cout << "The height ... | TOOL | 0.99801 | 4.227822 |
507896c2-73b0-4d9b-99e5-b43e573fe670 | Abul-Basar-Alba/Programming | Chapter_4_Linear_Array/4.3_Deleting_from_Linear_Array.cpp | // //(Deleting from a Linear Array)
// #include <bits/stdc++.h>
// using namespace std;
// void deleteelement(int a[], int k, int &n)
// {
// if (k < 1 || k > n)
// {
// cout << "Invalid Position" << endl;
// return;
// }
// for (int i = k - 1; i < n - 1; i++)
// {
// ... | ALGO | 0.999423 | 4.099545 |
2561c53e-9980-42ac-b9da-d7de19300b30 | yuancf1024/algorithm-go | leetcode-cpp/18.4Sum/18.4Sum.cpp | /* 18. 四数之和
给你一个由n个整数组成的数组nums ,和一个目标值target 。
请你找出并返回满足下述全部条件且不重复的四元组
[nums[a], nums[b], nums[c], nums[d]]
(若两个四元组元素一一对应,则认为两个四元组重复):
- 0 <= a, b, c, d < n
- a、b、c 和 d 互不相同
- nums[a] + nums[b] + nums[c] + nums[d] == target
你可以按 任意顺序 返回答案 。
示例 1:
输入:nums = [1,0,-1,0,-2,2], target = 0
输出:[[-2,-1,1,2],[-2,0,0,2]... | ALGO | 0.999978 | 5.363961 |
99b393d8-33b6-4df5-aeed-b09aa4fda2b2 | Rajhitu/OOPS | LAB8_OPERATOR_OVERLOADING/q6_unary_friend.cpp | #include<iostream>
using namespace std;
class unaray
{
int a,b,c;
public:
void getdata()
{
cin>>a>>b>>c;
}
void output()
{
cout<<a<<"\n"<<b<<"\n"<<c<<"\n";
}
friend unaray operator -(unaray x)
{ unaray temp; //NO NEED TO CREATE AN EXTRA OBJECT use this-->*t... | ALGO | 0.998263 | 3.58233 |
3a6e381e-89ee-4460-838e-7177f90ae796 | jh9amn/Master-DSA | GRAPH/DSU/DSU.cpp | #include<iostream>
#include<bits/stdc++.h>
using namespace std;
int find(vector<int> &parent, int x){
return parent[x] = (parent[x] == x) ? x : find(parent, parent[x]);
}
void Union(vector<int> &parent,vector<int> &rank, int a, int b){
a = find(parent,a);
b = find(parent,b);
if(rank[a] >= rank[b]){
... | ALGO | 0.999757 | 5.117625 |
677a3900-1c24-4a7c-b690-895d0f783b50 | rilianx/ibex_ipopt | src/bisector/ibex_MinlpSmearSumRelative.cpp | using namespace std;
namespace ibex {
MinlpSmearSumRelative::MinlpSmearSumRelative(System& sys, double prec, LargestFirst& lf, bool gb, bool ps) : MinlpSmearFunction(sys,prec, lf,gb,ps) {}
MinlpSmearSumRelative::MinlpSmearSumRelative(System& sys,const Vector& prec,LargestFirst& lf, bool gb,bool ps) : MinlpSm... | ALGO | 0.999769 | 5.840852 |
974cbaab-6cdc-4496-9025-5f8c3d0782cc | WLFJ/PAT_Training | 简单模拟/打印-1031.cpp | // 使用哨兵+Next数组可以解决大多数画图问题
#include <iostream>
#include <string>
using namespace std;
char cc[1000][1000];
int Next[][2] = {1, 0, 0, 1, -1, 0};
int main(void){
string line;
cin >> line;
int l = line.length();
int mx = (l + 2) / 3;
int my = l - mx * 2 + 2;
for(int i = 0; i < mx; i ++){
for... | ALGO | 0.999996 | 3.581815 |
cbb26711-2d6a-4c17-8f07-c4ef4fa0adcb | MarcusGDaniels/lammps-original | lib/gpu/lal_buck_coul.cpp | /***************************************************************************
buck_coul.cpp
-------------------
Trung Dac Nguyen (ORNL)
Class for acceleration of the buck/coul/cut pair style.
____________________________________... | ALGO | 0.89252 | 6.213476 |
50089e22-21fb-4091-81a8-0aefe560f3e1 | DoraSafrv/PM.Safronovich.2020 | Лабораторная работа 6/3/файлы.cpp | #include <iostream>
#include <fstream>
using namespace std;
class Fraction
{
private:
int chis;
int znam;
public:
Fraction() { chis = 0; znam = 0; }
Fraction(int c, int z) { chis = c; znam = z; }
Fraction(const Fraction& ob); //
void Enter();
void Show(std::ostream&);
Fraction operat... | ALGO | 0.993789 | 3.934731 |
bff8a059-f86f-4117-937d-704c70d26a95 | zubayer-talukder/Programming_Problem_Solution | URI - Beecrowd/1050 - DDD.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
int x;
cin >> x;
if (x == 61)
{
cout << "Brasilia" << endl;
}
else if (x == 71)
{
cout << "Salvador" << endl;
}
else if (x == 11)
{
cout << "Sao Paulo" << endl;
}
else if (x == 21)
{
... | ALGO | 0.999301 | 4.986639 |
c223fe34-71fe-4f65-910c-b1e6cd00cc25 | ishandutta2007/codeforces | lucina/normal/1102/E.cpp | #include<bits/stdc++.h>
using namespace std;
const int mod=998244353,maxn=2e5+10;
int n,a[maxn];
map<int,int> fuck;
int main(){
scanf("%d",&n);
for(int i=1;i<=n;i++){
scanf("%d",&a[i]);
fuck[a[i]]=i;
}
long long ans=1;
int pt=fuck[a[1]];
int i;
for(i=1;i<=n;i++){
if(i... | ALGO | 0.999988 | 4.245004 |
9d6deba4-41bf-4053-badd-2b6c82eb17e9 | Domain-Cmap/assignments-day-1-to-day-9-Rishuk1 | Day 6/Very Easy/2.cpp | #include <iostream>
#include <cmath>
using namespace std;
struct TreeNode {
int val;
TreeNode *left;
TreeNode *right;
TreeNode(int x) : val(x), left(NULL), right(NULL) {}
};
int getHeightLeft(TreeNode* node) {
int height = 0;
while (node) {
height++;
node = node->left;
}
... | ALGO | 0.999985 | 6.760862 |
a96bee34-83bf-4a19-98dd-15bdd2d0529b | sdr999/daa | week5q1duplicate.cpp | #include<iostream>
using namespace std;
char findmax(char a[], int n)
{
char m=a[0];
for(int i=1;i<n;i++)
{
if(a[i]>m)
{
m=a[i];
}
}
return m;
}
void count_sort(char a[],int n)
{
int i,*c,j,dup,temp;
char max=findmax(a,n);
int m=int(max);
c = new ... | ALGO | 0.999623 | 4.014091 |
b6f658f1-697a-4b58-95bf-e9789618c13b | Insh72amim/multithreading_in_cpp | leetcode/print_in_order.cpp | #include <iostream>
#include <mutex>
#include <thread>
#include <condition_variable>
#include <future>
using namespace std;
void printFirst() { cout << "first\n"; };
void printSecond() { cout << "second\n"; };
void printThird() { cout << "third\n"; };
// using mutex and conditional variables
class FooM
{
int ord... | TOOL | 0.926585 | 5.513528 |
d7b5cf5d-ce43-4d7c-a9ef-792c0aea22e7 | mohismtaoism/Alexander-CodeWorks | KayakAlgorithmsTests/eigen-3.3.7/doc/snippets/MatrixBase_all.cpp | Vector3f boxMin(Vector3f::Zero()), boxMax(Vector3f::Ones());
Vector3f p0 = Vector3f::Random(), p1 = Vector3f::Random().cwiseAbs();
// let's check if p0 and p1 are inside the axis aligned box defined by the corners boxMin,boxMax:
cout << "Is (" << p0.transpose() << ") inside the box: "
<< ((boxMin.array()<p0.array(... | ALGO | 0.983309 | 3.51303 |
e82b0677-560b-49f2-80fe-7487a8fa49e3 | jayin92/NYCU-AI-Capstone | hw2/Project #2 (game AI)/c++/110550088.cpp | #include "STcpClient_1.h"
#include <stdlib.h>
#include <iostream>
#include <vector>
#include <chrono>
#include <thread>
#include <random>
#include <algorithm>
#include <map>
#include <string>
using namespace std;
const int id = 110550088;
int T = 5500;
double c = 0.35;
std::random_device rd;
/*
input position (... | ALGO | 0.999459 | 3.072445 |
6124e6df-a5f8-4ffd-a9b6-1954ffc01b83 | dansonZhang/ZZX_RUN | navigation/base_local_planner/src/latched_stop_rotate_controller.cpp | /*
* latched_stop_rotate_controller.cpp
*
* Created on: Apr 16, 2012
* Author: tkruse
*/
#include <base_local_planner/latched_stop_rotate_controller.h>
#include <cmath>
#include <Eigen/Core>
#include <angles/angles.h>
#include <nav_msgs/Odometry.h>
#include <base_local_planner/goal_functions.h>
#include... | TOOL | 0.927943 | 6.828835 |
236d3fdf-afe3-47dc-a740-ee8de45830f2 | fiking/algorithm | leetcode/practice/backtracking/78/main.cpp | #include <iostream>
#include <vector>
using namespace std;
class Solution {
public:
vector<int> t;
vector<vector<int>> ans;
void dfs(int cur, vector<int> &nums) {
if (cur == nums.size()) {
ans.push_back(t);
return;
}
t.push_back(nums[cur]);
dfs(cur... | ALGO | 0.999839 | 5.42024 |
b8eac297-0ed9-45f9-a9f6-ec306b1697bb | rprakashdass/Leetcode-Problems | DSA/Easy/509. Fibonacci Number/iterative.cpp | class Solution {
public:
int fib(int n) {
if(n == 0)
return 0;
if(n == 1)
return 1;
int p = 0, ip = 1, fib = 0;
for(int i = 2;i <= n;i++){
fib = p + ip;
p = ip;
ip = fib;
}
return fib;
}
};
| ALGO | 0.99999 | 6.073758 |
5a77a815-15b2-4d44-bafd-c81d554a0bf3 | patryk-kubiczek/noneq-cthalfhyb | cthalfhyb_qmc/QMC.cpp | #include "QMC.h"
QMC::QMC(const std::string &name, double beta, double t_max, const InputParams &input_params)
: bw_type(NUMERIC_BW), lw_type(NUMERIC_LW),
model(name, beta, t_max, input_params),
configuration(t_max, beta, model.n_flavor),
bath_weight(model, configuration, bw_type)... | ALGO | 0.870342 | 5.857958 |
20412908-22ee-454d-bd41-e19dbc8d124c | EN-CodeBase/Transformer-Model-C- | multihead.cpp |
#include "multihead.h"
// SET WO ---------------------------------------------------
void MultiHead::set_WO(void){
WO = Eigen::MatrixXd::Random(nH*dv, dm);
}
// INIT -----------------------------------------------------
void MultiHead::init(size_t n_H, size_t d_m){
// nH = head count
// suppose dk = dv ... | ALGO | 0.998563 | 4.115693 |
ffdb38e0-c013-4d6c-b088-ff0931606ea6 | TrMTan/DSA-PTIT | ctdlgt codeptit/DSA06024 sap xep chon.cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
int n;
cin >> n;
int a[n];
for(int &i : a) cin >> i;
for(int i = 0; i < n - 1; i++){
int min = i;
for(int j = i + 1; j < n; j++){
if(a[j] < a[min]){
min = j;
}
}
swap(a[i], a[min]);
cout << "Buoc " << i + 1 << ": ";
for(int k = 0; k <... | ALGO | 0.999981 | 3.514929 |
cb1ab478-488b-4dcb-b4d2-a6dca78589ba | odnaks/Codeforces | A/469a.cpp | //02.02.19 @odnaks
#include <iostream>
using namespace std;
int main()
{
int n, p, q;
cin >> n >> p;
int str1[p];
int str[n + 1];
int k = 0;
for (int i = 0; i < n + 1; i++)
str[i] = 0;
for (int i = 0; i < p; i++)
{
cin >> str1[i];
if (str[str1[i] - 1] == 0)
k++;
str[str1[i] - 1] = 1;
}
cin >> ... | ALGO | 0.999573 | 3.014641 |
99859f7b-3869-46ae-97bb-2fd0c139c0ee | snaprick/ADS2021 | Week3/Lab/E.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
int n,m,mx=-1111,mx2;
int main()
{
cin >> n;
for(int i =1;i<=n;i++)
{
cin >> m;
if(m > mx)
{
mx2 =mx;
mx = m;
}
if(m > mx2 && m < mx)
{
mx2=m;
}
... | ALGO | 0.999981 | 3.653654 |
b9a6e9af-1de3-47ed-bddd-97c60eccbebe | b1ns4oi/AlgorithmImplementation | radix_sort.cpp |
#include <iostream>
#include <algorithm>
#include <iterator>
using std::max_element;
using std::cout;
using std::cin;
using std::endl;
using std::copy;
void counting_sort_helper(int pow, int *a, int *b, int n)
{
int i;
int c[10] = { 0 };
for(i = 0; i < n; ++i)
c[a[i]%pow/(pow/10)]++;
for(i = 1; i < 10; ++i)
... | TEST | 0.999252 | 4.828557 |
dcca8074-6717-40a9-a9aa-1b80c1938c0b | The-Ashwani-Kumar/CSES-Sheet-Solutions | Introductory Problems/2. Missing Number.cpp | #include<bits/stdc++.h>
#define ll long long
#define f(i,a,b) for(ll i=a;i<=b;i++)
#define rf(i,a,b) for(ll i=a;i>=b;i--)
#define fg(i,a,b,gap) for(ll i=a;i<=b;i+=gap)
#define v(dataType) vector<dataType>
#define vv(dataType) vector<vector<dataType>>
#define vp(dataType1,dataType2) vector<pair<dataType1,dataType2>>
#de... | ALGO | 0.999779 | 3.660018 |
95f2c130-200d-4997-a289-620fc363ef2d | mohit-flutterdev/Flutter_Apps | Assignment10_AppBar and Container/Que9/que09/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.998534 | 6.76073 |
ddb27bbd-f3f2-43e0-bbce-0bf8b061a30e | r4pidstart/problems | by_category/math/1735.cpp | // https://www.acmicpc.net/problem/1735
// 2021-12-21 05:47:02 0ms
#include<bits/stdc++.h>
using namespace std;
int main(void)
{
int a,b,c,d; scanf("%d%d%d%d", &a,&b,&c,&d);
int top=a*d + b*c, bottom=b*d;
printf("%d %d", top/gcd(top,bottom), bottom/gcd(top,bottom));
}
/*
*/ | ALGO | 0.999851 | 5.586467 |
af348dd1-e432-4adf-aeee-223a61733b29 | falcaoanderson/CompetitiveProgramming | juizes/neps-2367.cpp | // 21/08/23 //
#include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#include <set>
#include <unordered_set>
#include <map>
#include <unordered_map>
#include <tuple>
#include <cstring>
#include <stack>
using namespace std;
#define ll long long
#define endl "\n"
#define fast_io ios_base::sync_wit... | ALGO | 0.999735 | 4.108155 |
25e8973e-f911-4959-a300-40323a6ff8e5 | ninad-moree/DataStructuresAlgorithms | Hashtable/1002-FindCommonCharacters.cpp | /*
Given a string array words, return an array of all characters that show up in all strings within the words (including duplicates).
You may return the answer in any order.
Example 1:
Input: words = ["bella","label","roller"]
Output: ["e","l","l"]
*/
#include<bits/stdc++.h>
using namespace std;
... | ALGO | 0.999944 | 5.790564 |
2915a889-7162-478f-ba15-2872e2c443a0 | CFOP2357/competitive_programing | codeforces/Codeforces Round #603 (Div. 2)/D.cpp | //#include <bits/stdc++.h>
#include <iostream>
#include <climits>
#include <vector>
#include <algorithm>
#include <cmath>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <unordered_map>
#include <unordered_set>
#include <assert.h>
//#include <time.h>
using namespace std;
/*
#include <ext... | ALGO | 0.999885 | 4.388347 |
a1a807ad-439d-404f-a016-a408d288853f | stone725/AOJ-SourceCode | Volume 11/1180.cpp | #include <bits/stdc++.h>
using namespace std;
#define FOR(i, s, n) for(int i = s; i < (int)n; i++)
#define per(i, n) for(int i = n; i >= 0; i--)
#define ROF(i, s, n) for(int i = s; i >= (int)n; i--)
#define FORIT(i, A) for (auto i : A)
#define PRINT(x) cout << (x) << "\n"
#define ALL(a) (a).begin(),(a).end()
#define RA... | ALGO | 0.999164 | 3.076219 |
cb1a7037-cd4b-46f9-8997-53837bc03525 | zqdeGarden/Holocubic_Firmware | src/app/game_2048/game_2048.cpp | #include "game_2048.h"
#include "game_2048_gui.h"
#include "game2048_contorller.h"
#include "sys/app_contorller.h"
#include "common.h"
#include <esp32-hal-timer.h>
void taskOne(void *parameter)
{
while (1)
{
//心跳任务
lv_tick_inc(5);
delay(5);
}
Serial.println("Ending task 1");
... | TOOL | 0.906616 | 5.094256 |
6c4b78a5-1d67-4203-8a12-842661b5cd90 | PaukIsUha/optimizing_formating_code | predictions/submissions-aizu-cot-gpt4/Codenet/p01126/761698151/response_0.cpp | #include <iostream>
#include <map>
#include <utility>
using namespace std;
int main() {
int m, a;
while (true) {
cin >> m >> a;
if (m == 0 && a == 0) {
break;
}
map<pair<int, int>, int> amida;
int max_h = 0;
for (int i = 0; i < m; i++) {
int h, p;
cin >> h >> p;
amid... | ALGO | 0.999683 | 3.650743 |
65e31ddd-e7a6-4ac3-a676-6f2cc44ae215 | andeplane/AtomifyVisionPro | LAMMPS/src/KOKKOS/third_order_kokkos.cpp | // clang-format off
/* ----------------------------------------------------------------------
Contributing author: Charlie Sievers (UC Davis), charliesievers at cox.net
------------------------------------------------------------------------- */
#include "third_order_kokkos.h"
#include "angle.h"
#include "atom_ko... | ALGO | 0.989834 | 7.203978 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.