uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
4559e25e-3897-4393-a4da-99c8295cf12f | yashmittal-git/LeetCoding | best-time-to-buy-and-sell-stock-ii.cpp | // 122. Best Time to Buy and Sell Stock II
// Say you have an array for which the ith element is the price of a given stock on day i.
// Design an algorithm to find the maximum profit. You may complete as many transactions as you like (i.e., buy one and sell one share of the stock multiple times).
// Note: You may no... | ALGO | 0.999856 | 6.164948 |
b6025fbe-2b68-43b3-95ce-cfb2029c5fe2 | davidloarte/c-programs | 20_pilas/pila2.cpp | #include <stdlib.h>
#include <stdio.h>
#ifndef NDEBUG
#define DEBUG(...) printf(__VA_ARGS__);
#else
#define DEBUG(...)
#endif
#define N 0x100
typedef struct {
int cima;
int data[N];
} Pila;
void push(int dato, Pila *cual_pila){
DEBUG("->%5.i\n", dato);
cual_pila->data[cual_pila->cima] = dato;
cu... | ALGO | 0.9954 | 3.641295 |
264a75f5-48b1-42fe-94d0-7a234144e0b3 | POC-2025/leetcode | solution/2300-2399/2360.Longest Cycle in a Graph/Solution.cpp | class Solution {
public:
int longestCycle(vector<int>& edges) {
int n = edges.size();
vector<bool> vis(n);
int ans = -1;
for (int i = 0; i < n; ++i) {
if (vis[i]) {
continue;
}
int j = i;
vector<int> cycle;
f... | ALGO | 0.999761 | 5.287726 |
8894535f-0d23-4e08-ae00-1fe4e31b6422 | Jatin-Shihora/LeetCode-Solutions | 0833-bus-routes/0833-bus-routes.cpp | class Solution {
public:
int numBusesToDestination(vector<vector<int>>& routes, int S, int T) {
unordered_map<int, vector<int>> to_routes;
for (int i = 0; i < routes.size(); ++i)
for (int j : routes[i])
to_routes[j].push_back(i);
queue<pair<int, int>> bfs;
... | ALGO | 0.999936 | 6.175759 |
17e717b2-bde3-4725-88dc-8e29ab3714d4 | Nabin-09/Data_Structures_and_Algorithms | 6-Bit-Manipulation/Basics/4_Check_Set_bit.cpp | //Problem statement lists to check the if the i-th bit of the number is 1 or not.
#include<iostream>
using namespace std;
bool checkKthBit(int n, int k) {
return (n>>k) & 1;
}
int main()
{
int n ;
cin >> n;
int k ; //the position of i-th bit(remember counting starts from LSB).
cin >> k;
cout... | ALGO | 0.999812 | 3.863552 |
dab0515a-5f47-4fe1-a262-02b93723adc1 | krrish94/ssc | caffe_code/caffe3d_suncg/src/caffe/layers/pooling_layer.cpp | #include <algorithm>
#include <cfloat>
#include <vector>
#include "caffe/layers/pooling_layer.hpp"
#include "caffe/util/math_functions.hpp"
namespace caffe {
using std::min;
using std::max;
template <typename Dtype>
void PoolingLayer<Dtype>::LayerSetUp(const vector<Blob<Dtype>*>& bottom,
const vector<Blob<Dty... | DATA | 0.939905 | 3.65626 |
2a93a2fb-ec83-4a10-a7c8-31cf126a7c87 | grigorii-sum/programming_ITMO | laba_1.cpp | #include <iostream>
#include <fstream>
#include <vector>
#include <cstdlib>
using namespace std;
class Matrix
{
private:
int rows, cols;
int **table;
public:
//constructor
Matrix(int rows, int cols)
{
this->rows = rows;
this->cols = cols;
... | ALGO | 0.992548 | 4.363192 |
fa8873ef-233b-4bb0-b67d-5c2242d71af5 | rustem24liu/Programming-Principles--1 | lab/maximum.cpp | #include <iostream>
#include <algorithm>
using namespace std;
int i = 0;
int maxo(string n, int i){
if(i == n.size()) return 0;
return max((n[i] - 48), maxo(n, i+1));
}
int main(){
string n;
cin >> n;
cout << maxo(n,i);
} | ALGO | 0.999423 | 3.906123 |
578a2f6f-cc6f-47ab-aa92-895fb85d4220 | KyleJu/ACM | practice/2016_Sep_21_Codeforces/c.cpp | #include<bits/stdtr1c++.h>
using namespace std;
int cost[505];
deque<int> sta;
bool vis[505];
int main() {
int n, m; cin >> n >> m;
for(int i = 1 ;i <=n; i++) {
cin >> cost[i];
}
vector<int> arr;
int tm;
for(int i = 0; i < m; i++) {
cin >> tm;
arr.push_back(tm);
if(!vis[tm]) {
sta.push_back(tm);
vi... | ALGO | 0.999924 | 3.299703 |
dd5a270b-3e04-4651-a46f-e3021c6dfb9a | sarvex/leetcode-prolog | solution/1100-1199/1195.Fizz Buzz Multithreaded/Solution.cpp | class FizzBuzz {
private:
std::mutex mtx;
atomic<int> index;
int n;
public:
FizzBuzz(int n) {
this->n = n;
index = 1;
}
// printFizz() outputs "fizz".
void fizz(function<void()> printFizz) {
while (index <= n) {
std::lock_guard<std::mutex> lk(mtx);
... | ALGO | 0.997861 | 7.059049 |
6251867b-bd27-41b5-b853-5ee29d3d90c0 | AdRo07/frameworks_av | media/libstagefright/codecs/amrnb/common/src/lsp.cpp | /*
Pathname: ./audio/gsm-amr/c/src/lsp.c
Functions:
------------------------------------------------------------------------------
REVISION HISTORY
Description: Updated template used to PV coding template.
Changed to accept the pOverflow flag for EPOC compatibility.
Description: Per review comments, added pOve... | ALGO | 0.902212 | 3.745082 |
f5a297da-4b43-4a69-a26b-8f7b7e204005 | miodragpop/ZeroClassic | src/chain.cpp | #include "chain.h"
/**
* CChain implementation
*/
void CChain::SetTip(CBlockIndex *pindex) {
if (pindex == NULL) {
vChain.clear();
return;
}
vChain.resize(pindex->nHeight + 1);
while (pindex && vChain[pindex->nHeight] != pindex) {
vChain[pindex->nHeight] = pindex;
pind... | ALGO | 0.998996 | 6.072457 |
73738b3e-defc-4d48-b771-36491f6b8061 | kasa021/atcoder-archives | abc255/abc255_b_32403012_WA.cpp | /*
* Author: kAsA02
* Submission URL: https://atcoder.jp/contests/abc255/submissions/32403012
* Submitted at: 2022-06-11 13:06:22
* Problem URL: https://atcoder.jp/contests/abc255/tasks/abc255_b
* Result: WA
* Execution Time: 14 ms
*/
#include <bits/stdc++.h>
#include <cmath>
using namespace std;
#define rep(i... | ALGO | 0.999899 | 4.275024 |
977fdf45-17cb-41f6-9de2-6a6af1ad25c0 | Tariod/DS-problems | lab3/lab3.cpp | #include <iostream>
#include <fstream>
#include <sstream>
using namespace std;
int side = 0;
int isOriented = 0;
int **parseFile(string fileName);
int **matrixMultiplication(int **arr1, int **arr2, int side);
int **transitiveClosure(int **array, int side);
int **FloydWarshall(int **array, int side);
int main() {
... | ALGO | 0.996927 | 4.68856 |
5bbe00e4-4440-444c-8f27-e1ec0e576ece | raincross7/code-similarity | codes/train_code/problem009/problem009_81.cpp | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
using namespace std;
typedef pair<int, int> p;
typedef long long ll;
const int inf = 1000000007;
int main() {
int n, m;
cin >> n >> m;
vector<vector<int>> g(n);
rep(i, m) {
int a, b;
cin >> a >> b;
a--;
b--;
g[a].pus... | ALGO | 0.999996 | 3.884016 |
907fa358-486d-403e-a6bd-cc5a596c25af | aslezar/CompetitiveProgramming | LeetCode/Daily/April23/17Apr23.cpp | #include <iostream>
#include <vector>
using namespace std;
#define el << '\n'
#define ws << ' '
class Solution
{
public:
vector<bool> kidsWithCandies(vector<int> &candies, int extraCandies)
{
int max = 0;
for (auto &&i : candies)
if (i > max)
max = i;
vector... | ALGO | 0.999772 | 4.895216 |
9cf21ed4-668a-40c1-8464-78d7113ecd1e | Emrace/Intro-Programming-2015 | Intro-Programming-K2/71592_Стефан Иванов~checked/71592_StefanIvanov/kontr_zad2.cpp | #include<iostream>
using namespace std;
int main(){
cout << "Vyvedete cifra: ";
int n,a;
cin >> a;
cout << "Vyvedete chislo: ";
cin >> n;
cout << contains(n,a);
}
bool contains(int n, int b) {
int temp = n % 10;
if(temp == b) {
return true;
}
if(n % 10 == 0) {
... | ALGO | 0.995331 | 3.399848 |
a0ec5768-b9c6-40e8-835e-86b127cb6f9c | Hoang17072004/DSA | CodeforcesProblem/makingAntiParilin.cpp | #include<bits/stdc++.h>
using namespace std;
void solve(int n,string &s) {
if (n%2==1) {
cout<<-1<<endl;
return;
}
vector<int> cnt(26);
for (int i=0;i<n;i++) cnt[s[i]-'a']++;
for (int i=0;i<26;i++) {
if (cnt[i]*2>n) {
cout<<-1<<endl;
return;
}
}
int pairs=0;
vector<int> cnt_pairs(26);
for (int i=... | ALGO | 0.999951 | 4.219432 |
065842a3-45ec-4e9a-8b47-5bbdc70c41af | dongdong-2009/opencv_sample | cpp/tutorial_code/features2D/Homography/perspective_correction.cpp | #include <iostream>
#include <opencv2/opencv_modules.hpp>
#ifdef HAVE_OPENCV_ARUCO
#include <opencv2/core.hpp>
#include <opencv2/imgproc.hpp>
#include <opencv2/calib3d.hpp>
#include <opencv2/highgui.hpp>
#include <opencv2/aruco.hpp>
using namespace std;
using namespace cv;
namespace
{
enum Pattern { CHESSBOARD, CIRCL... | ALGO | 0.985076 | 6.209002 |
b795fc5f-1649-42a8-b45d-a92eeb5af555 | jw0293/BOJ | boj_#14929.cpp | #include <bits/stdc++.h>
#define fastio ios::sync_with_stdio(false), cin.tie(0), cout.tie(0)
#define Mod 1000000007
#define endl '\n'
using namespace std;
int N;
long long ps[100000 + 1], psum[100000 + 1];
void input(){
cin >> N;
for(int i=1;i<=N;i++) {
cin >> ps[i];
psum[i] = psum[i-1] + ps[i];
}
}
long lon... | ALGO | 0.999877 | 3.657047 |
ef4625f2-0bc7-4a09-b5d7-2f4da5b74b84 | akarshmadan4/crack-your-placement-challange | Linked List/Merge Two Sorted Lists.cpp | class Solution {
public:
ListNode* mergeTwoLists(ListNode* list1, ListNode* list2) {
if(list1==NULL)return list2;
if(list2==NULL)return list1;
if(list1->val<=list2->val)
{
list1->next=mergeTwoLists(list1->next,list2);
return list1;
}
else
... | ALGO | 0.999905 | 5.437277 |
603558ad-e7e0-41b8-8475-2fe0cca3cd9e | ZGCTroy/ACM-Code-Model | 动态规划dp/dp基础--背包专题/5.分组的背包问题.cpp | #include <iostream>
#include <cstring>
#include <algorithm>
#include <cmath>
using namespace std;
const int N=1e5+5; //Ʒ
const int MAXV=1e3+5; //
typedef long long LL;
/*********************************************************************************************
ı
NƷһΪVı
iƷv[i]ֵw[i]
... | ALGO | 0.999972 | 4.099227 |
0268c7e4-089f-4347-90ba-b8a55dba4298 | Huzaifa17/Geeksforgeeks | School/Reverse_array.cpp | #include <iostream>
using namespace std;
int main() {
//code
int i,j,k,t,n;
cin>>t;
for(i=0;i<t;i++)
{
cin>>n;
int arr[n];
for(j=0;j<n;j++){
cin>>arr[j];
}
for(j=n-1;j>=0;j--)
{
if(j==n-1)
{
cout<<arr[j... | ALGO | 0.999465 | 3.414863 |
41510353-9845-4769-a6ff-14be32ef53ea | greglinv/Assignment-2 | Assignment 2/single_linked_list.cpp | #include "single_linked_list.h"
using namespace std;
Single_Linked_List::Single_Linked_List() {
headPtr = nullptr;
}
//Add an item to the front
void Single_Linked_List::push_front(const string item) {
Node* newNode = new Node;
newNode->data = item;
if (empty()) {
headPtr = tailPtr = newNode;
... | TOOL | 0.944331 | 4.725493 |
2c25e96c-df43-4770-8bf8-40cfc053846a | arjun0927/data-structure-code | Firstocc.cpp | #include<iostream>
#include<vector>
using namespace std;
int main()
{
vector<int> arr={1,2,2,2,2,2,2,3,3,3,3,4,4,4,4,5,5};
int n= arr.size();
int target=4;
int s = 0;
int e= n-1;
int m = s+(e-s)/2;
int ans=-1;
while(s<=e){
if(target==arr[m]){
ans=m;
// for first occurence
e=m-1;
// for last occurence
// ... | ALGO | 0.99994 | 5.083408 |
e79646bd-6f43-4daa-b36e-25e5233a5dbb | supriyadiaja/Demo-Flutter-API | 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.998762 | 6.786404 |
f8a0471a-4b56-4621-b910-5108f055a4d3 | santosh-rawat-prof/cpp | linearsearch.cpp | #include<iostream>
using namespace std;
int main()
{
int i, x, counter = 0;
int arr[5];
cout<<"\n Enter elements of array: ";
for(i = 0; i < 5; i++)
{
cin>>arr[i];
}
cout<<"\n Entered elements are :";
for(i = 0; i < 5; i++)
{
cout<<" "<<arr[i];
}
cout<<... | ALGO | 0.999356 | 3.994616 |
4ff3a8b6-994b-4030-9b31-36ca125ad008 | Gurmeher23/Molecular-Dynamics-with-CPP | subprojects/eigen-3.4.0/unsupported/doc/examples/EulerAngles.cpp | #include <unsupported/Eigen/EulerAngles>
#include <iostream>
using namespace Eigen;
int main()
{
// A common Euler system by many armies around the world,
// where the first one is the azimuth(the angle from the north -
// the same angle that is show in compass)
// and the second one is elevation(the angl... | ALGO | 0.989567 | 4.880029 |
da2a0bc2-d18b-4230-9ade-7bcdcbe2b545 | JITENPANDEY/450-DSA-Problems | Dynamic Programming/Misc/Buy and Sell Stock III-with fee.cpp | int maxProfit(vector<int>& prices, int fee) {
int obsp = -1*prices[0]; //oldBoughtStatePrice
int ossp = 0; //oldSellingStateProfit
for(int i=1;i<prices.size();i++){
int nbsp =0; //newBoughtStatePrice
int nssp =0; //newSellingStateProfit
if(ossp - ... | ALGO | 0.999864 | 5.134065 |
af07629a-2ee5-4342-bc6a-749fe00cca7e | 1608-22-737-055/DSA-C-ApnaCollege | L38.cpp | #include<iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
#include <unordered_map>
#include <unordered_set>
#include <map>
using namespace std;
//LC-15 3 sum
int main(){
vector<int> nums = {-1,0,1,2,3,4};
for( int i=0 ; i<nums.size();i++){
for(int j=i+1 ; j<num... | ALGO | 0.99988 | 4.549974 |
96b1c0ff-ca1c-4812-8bb2-c2f3aca2fecf | LMFRomero/SRS_Cards | boost/libs/multi_index/example/serialization.cpp | #if !defined(NDEBUG)
#define BOOST_MULTI_INDEX_ENABLE_INVARIANT_CHECKING
#define BOOST_MULTI_INDEX_ENABLE_SAFE_MODE
#endif
#include <boost/config.hpp> /* keep it first to prevent nasty warns in MSVC */
#include <algorithm>
#include <boost/archive/text_oarchive.hpp>
#include <boost/archive/text_iarchive.hpp>
#include <... | TOOL | 0.984853 | 6.749949 |
63caf51d-e255-4ab3-9e37-a6e90d277cfb | mdiks23/Data-Structure-Algorithm-Practices | Basics of DSA/Patterns & Nested Loops/p-01-SquarePatterns/SqPattern-05.cpp | /*
Pattern-05
A B C
D E F
G H I
*/
#include <iostream>
using namespace std;
int main(){
int n=3;
char ch='A';
for(int i=0; i<n; i++){
for(int j=0; j<n; j++){
cout<<ch<<" ";
ch++;
}
cout<<endl;
}
return 0;
} | ALGO | 0.999779 | 3.577434 |
bfd524e9-7403-4a01-8622-d53e4df3a508 | olivier-stasse/openhrp3-simulator-wo-rtm | hrplib/hrpCollision/Opcode/OPC_TreeBuilders.cpp | ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////... | ALGO | 0.99954 | 7.463291 |
d991455a-bab2-4388-9ee7-5b3e57300a3a | maldiva/CPP-and-ASM | C++/12541 Birthdates.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int people; cin >> people;
map<int,string> names;
for (int i = 0; i < people; ++i) {
string name;
int day,month,year;
cin >> name;
cin >> day >> month >> year;
int temp = year * 1000 + month * 12 + day; // convert 3 separate int input... | ALGO | 0.999475 | 3.965485 |
be19f2b0-a7bb-46a4-bb7a-44d36a998e65 | peterjc123/magma | src/zpotrf_panel_vbatched.cpp | /*
-- MAGMA (version 2.5.4) --
Univ. of Tennessee, Knoxville
Univ. of California, Berkeley
Univ. of Colorado, Denver
@date October 2020
@author Azzam Haidar
@author Tingxing Dong
@precisions normal z -> s d c
*/
#include "magma_internal.h"
#define PRECISION_... | ALGO | 0.989821 | 3.805378 |
1ff9849b-ae26-43f9-a734-845c9689e772 | micheal0919/theia-sfm-windows | 3rdParties/eigen-3.2.8/unsupported/doc/examples/MatrixSinh.cpp | #include <unsupported/Eigen/MatrixFunctions>
#include <iostream>
using namespace Eigen;
int main()
{
MatrixXf A = MatrixXf::Random(3,3);
std::cout << "A = \n" << A << "\n\n";
MatrixXf sinhA = A.sinh();
std::cout << "sinh(A) = \n" << sinhA << "\n\n";
MatrixXf coshA = A.cosh();
std::cout << "cosh(A) = \n"... | ALGO | 0.984655 | 5.890235 |
b9122fba-99b8-489a-baa3-ba0f4647c1a0 | WYK15/swift-Ollvm12 | llvm/tools/llvm-xray/xray-graph-diff.cpp | #include "xray-graph-diff.h"
#include "xray-graph.h"
#include "xray-registry.h"
#include "xray-color-helper.h"
#include "llvm/ADT/iterator_range.h"
#include "llvm/Support/FormatVariadic.h"
#include "llvm/XRay/Trace.h"
using namespace llvm;
using namespace xray;
static cl::SubCommand GraphDiff("graph-diff",
... | TOOL | 0.949267 | 7.62426 |
12caec73-f2d3-481b-a8cf-de447ad12164 | shubham-deshmukh/CP-Contests | Atcoder/dp_contest/d_TD_rec.cpp | #include <iostream>
#include <bits/stdc++.h>
using namespace std;
#ifndef ONLINE_JUDGE
#include "../../../debug.h"
#else
#define debug(x...)
#endif
#define endl "\n"
#define fast ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0200r0.html
template<cl... | ALGO | 0.999996 | 4.6661 |
8f585ad3-5f3d-4cf1-bca5-8db8eedbcebe | linuxdeepin/opencv-mobile | opencv-4.5.4/samples/cpp/tutorial_code/ImgTrans/HoughLines_Demo.cpp | /**
* @file HoughLines_Demo.cpp
* @brief Demo code for Hough Transform
* @author OpenCV team
*/
#include "opencv2/imgcodecs.hpp"
#include "opencv2/highgui.hpp"
#include "opencv2/imgproc.hpp"
#include <iostream>
using namespace cv;
using namespace std;
/// Global variables
/** General variables */
Mat src, edges... | ALGO | 0.960329 | 6.551291 |
30286602-19ac-421b-9f97-034570f433d3 | gmlee329/InstanceShadowDetection | detectron2/layers/csrc/nms_rotated/nms_rotated_cpu.cpp | namespace detectron2 {
template <typename scalar_t>
at::Tensor nms_rotated_cpu_kernel(
const at::Tensor& dets,
const at::Tensor& scores,
const float iou_threshold) {
// nms_rotated_cpu_kernel is modified from torchvision's nms_cpu_kernel,
// however, the code in this function is much shorter because
... | ALGO | 0.996036 | 7.670494 |
5da1d26d-973d-46c7-a90f-91463cd91954 | Sugar-27/Cpp-primer | Cpp-Primer-master/ch03/ex3_20b.cpp | #include <iostream>
#include <vector>
using std::vector;
using std::cout;
using std::endl;
using std::cin;
int main()
{
vector<int> ivec;
for (int i; cin >> i; ivec.push_back(i));
if (ivec.empty())
{
cout << "input at least one integer." << endl;
return -1;
}
// If the vector... | ALGO | 0.999795 | 4.935006 |
c0e38684-3254-443e-b24f-068808c895c9 | TanmayMuthiyan/Programs-in-C-C-Java | program233.cpp | #include<iostream>
using namespace std;
typedef unsigned int UINT;
bool CheckBit(UINT iNo)
{
UINT iMask = 4;
UINT iResult = 0;
iResult = iNo & iMask;
if(iResult == iMask)
{
return true;
}
else
{
return false;
}
}
int main()
{
UINT iValue = 0;
bool bRet = fa... | ALGO | 0.998814 | 5.043418 |
29dae9f9-d609-4c23-a8b6-def4a58a9e97 | oxygen-hunter/Flashboom | data/leetcode_cpp/maximum-number-of-accepted-invitations.cpp | // Time: O(m * n * sqrt(m + n))
// Space: O(m * n)
// template from https://www.geeksforgeeks.org/hopcroft-karp-algorithm-for-maximum-matching-set-2-implementation/
static const int NIL = 0;
static const int INF = numeric_limits<int>::max();
// A class to represent Bipartite graph for Hopcroft
// Karp implementation... | ALGO | 0.999996 | 7.146626 |
9cea210d-c21f-41c1-81bb-f37a5a984d0c | Anagha-Raveendrann/BricksnMix | 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.998756 | 6.772262 |
026235fa-b9a7-4235-b3cf-c0f018ded1e9 | file-citas/via | llvm/libcxx/test/std/algorithms/alg.sorting/alg.nth.element/nth_element_comp.pass.cpp | // <algorithm>
// template<RandomAccessIterator Iter, StrictWeakOrder<auto, Iter::value_type> Compare>
// requires ShuffleIterator<Iter>
// && CopyConstructible<Compare>
// void
// nth_element(Iter first, Iter nth, Iter last, Compare comp);
#include <algorithm>
#include <functional>
#include <vector>
#i... | TEST | 0.949383 | 6.710634 |
08b1eb23-31c2-46f8-9e30-29c7fe82a1c9 | Hwangtaehun/2022_C_and_C_plus_plus_language | 문제7/Project1/test7-5.cpp | #define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
void BaseConversion(int num, int base);
void main()
{
int num, jinsu;
while (1)
{
printf("10 ȯ Էϼ. ( ^Z) ==> ");
if (scanf("%d %d", &num, &jinsu) == EOF)
break;
if (jinsu < 2 || jinsu > 16)
{
printf(" 2~16 Դϴ !!!\n");
continue;
}
BaseConve... | ALGO | 0.971322 | 3.669246 |
1df35b1b-df9d-4afb-8a6b-354141a70e07 | tnoma/ardupilot | libraries/AC_WPNav/AC_WPNav_OA.cpp | #include "AC_WPNav_OA.h"
AC_WPNav_OA::AC_WPNav_OA(const AP_InertialNav& inav, const AP_AHRS_View& ahrs, AC_PosControl& pos_control, const AC_AttitudeControl& attitude_control) :
AC_WPNav(inav, ahrs, pos_control, attitude_control)
{
}
// returns object avoidance adjusted wp location using location class
// returns... | TOOL | 0.876248 | 7.175992 |
ded189a5-6ada-4d6b-a01b-42b0adfc3b85 | nvdmike/CPP-Primer-Plus-Stephen-Prata | class_work/chapter_04/4.23/mixtypes.cpp | // mixtypes.cpp -- некоторые комбинации типов
#include <iostream>
struct antatcica_years_end {
int year;
/* определение других нужных данных */
};
int main() {
antatcica_years_end s01, s02, s03;
s01.year = 1998;
antatcica_years_end *pa = &s02;
pa->year = 1999;
antatcica_years_end trio[3]; // массив из трех стр... | TOOL | 0.901468 | 3.750566 |
db975409-828e-48e9-8823-f9ed24ad057d | Subzero-10/leetcode | .history/62.unique-paths_20200730215657.cpp | /*
* @lc app=leetcode id=62 lang=cpp
*
* [62] Unique Paths
*
* https://leetcode.com/problems/unique-paths/description/
*
* algorithms
* Medium (51.48%)
* Likes: 3409
* Dislikes: 211
* Total Accepted: 496.6K
* Total Submissions: 920.3K
* Testcase Example: '3\n2'
*
* A robot is located at the top-le... | ALGO | 0.999387 | 6.452503 |
236a0e59-19c1-4fb3-a38b-d5ec42d6f135 | c000102/tv | describe_topview.cpp | #include "describe_topview.h"
#include "image_correction.h"
#define OpCv (1)
#if OpCv
#include "opencv2\opencv.hpp"
using namespace cv;
#endif
CFUNC_BEGIN_DECLS
/* local function */
static void convert_RGBA2gray(
MM_U08 output_img[], /* [out] gray image */
MM_U08 src[], /* [in] source iamge(RGBA)... | ALGO | 0.969803 | 4.477156 |
1099f582-ccfd-4dae-9ad8-7c8cc7499cf7 | yzzupgo/MFTCG | Data/abc206_a/Mr_Emrul/wa/23582408.cpp | #include "bits/stdc++.h"
using namespace std;
typedef long long int ll;
typedef pair<ll, ll> pll;
const int Max = 2e6 + 10;
const int Mod = 1e9 + 7;
const ll Inf = 1LL << 62;
void Solve();
void Solve() {
ll n;
cin >> n;
ll x = (n / 100.0) * 108;
if(x == 206) {
cout << "so-so\n";
} else if(x < 205) {
cout << "Yay!";
} e... | ALGO | 0.985813 | 3.287852 |
e9f4cd8f-bbf3-4702-b432-04a3bf54ac76 | binarycraft007/libcronet | src/third_party/llvm-libc/src/src/math/generic/fmaximum_mag_numl.cpp | #include "src/math/fmaximum_mag_numl.h"
#include "src/__support/FPUtil/BasicOperations.h"
#include "src/__support/common.h"
#include "src/__support/macros/config.h"
namespace LIBC_NAMESPACE_DECL {
LLVM_LIBC_FUNCTION(long double, fmaximum_mag_numl,
(long double x, long double y)) {
return fputil::... | TOOL | 0.976611 | 6.140871 |
c573d624-5292-4e08-8a29-6217dce4ad19 | geekbutton/Cpp-Primer | ch11/ex11_13.cpp | #include<iostream>
#include<iomanip>
#include<string>
#include<vector>
#include<iterator>//beign(),end()
#include<cstring>
#include<cstdlib>//abs()
#include<initializer_list>
#include<fstream>
#include<sstream>
#include<map>
#include<list>
#include<deque>
#include<forward_list>
#include<algorithm>
#include<numeric> //a... | ALGO | 0.993102 | 3.460562 |
9bcbe342-771a-4049-85ec-5d70c9232262 | Dsxv/competitveProgramming | codeForces/div2/628/c.cpp | #include <bits/stdc++.h>
using namespace std ;
#define int long long
const int N = 1e5 + 10 ;
vector<int> G[N] ;
vector<int> ans ;
map<pair<int,int>,int> mp ;
void dfs(int start , int parent = -1){
if((int)G[start].size() == 1){
int x = mp[{G[start][0],start}] ;
ans.push_back(x) ;
}
for(auto i : G[start]){
... | ALGO | 0.999955 | 4.377659 |
3421005a-4be9-4772-a1eb-81f9b8449561 | 1337DaKL/Bai_Tap_C_Plus_Plus | baitaphacker28tech/comperatorlowerupper/sapxepchusonguyento.cpp | #include <bits/stdc++.h>
using namespace std;
int demsoNguyenTo(int n)
{
int dem = 0;
while (n)
{
int m = n % 10;
if (m == 2 || m == 3 || m == 5 || m == 7)
dem++;
n /= 10;
}
return dem;
}
bool ok(int a, int b)
{
return demsoNguyenTo(a) > demsoNguyenTo(b);
}
in... | ALGO | 0.999945 | 4.83212 |
bea0ce32-3900-4acb-8977-a25a76e88a17 | kbc19b22/game | GameTemplate/Game/bulletPhysics/src/BulletCollision/BroadphaseCollision/btDbvtBroadphase.cpp | ///btDbvtBroadphase implementation by Nathanael Presson
#include "btDbvtBroadphase.h"
//
// Profiling
//
#if DBVT_BP_PROFILE||DBVT_BP_ENABLE_BENCHMARK
#include <stdio.h>
#endif
#if DBVT_BP_PROFILE
struct ProfileScope
{
__forceinline ProfileScope(btClock& clock,unsigned long& value) :
m_clock(&clock),m_value(&valu... | ALGO | 0.984539 | 7.07729 |
8b625550-ca98-4983-a3c9-bffbef88aae8 | 113bommy/deepmind_codecontests_refine | cpp_gold_filter_file/cpp_test_75_2.cpp | #include <bits/stdc++.h>
#pragma GCC optimize("unroll-loops")
#pragma GCC optimize("O3")
#pragma GCC target("avx2")
using namespace std;
void solve() {
long long n;
cin >> n;
vector<long long> arr(n);
for (long long i = 0; i < n; i++) cin >> arr[i];
long long l = 0, r = 0;
for (l = 0; l < n - 1; l++)
if... | ALGO | 0.999998 | 4.686022 |
5c38ff99-b53b-46e6-bc44-440b6875a082 | galalmuhammed/ProblemSolving2 | Problem13/main.cpp | #include <cmath>
#include <iomanip>
#include <iostream>
using namespace std;
/* ---- Prototype Section ---- */
int readPositiveNumber();
void printSequnce(int number);
/* ---- End Of Prototype Section ---- */
int main() {
printSequnce(readPositiveNumber());
cout << "\n";
system("pause");
return 0;
}... | ALGO | 0.96872 | 3.683195 |
02a2fff2-10e8-4357-aa88-d6f8583d0974 | its-AbhaySahani/Data-Structures-and-Algorithms | Array/reverse-array.cpp | //Description : This program reverses array elements using two pointer method.
//Time Complexity : O(n), where n is the array size
//Auxiliary Space : O(1)
#include<bits/stdc++.h>
using namespace std ;
void reverse_array(vector<int> arr){
// Here we will use two pointer approach
int low = 0 ; //First pointer at the... | ALGO | 0.999858 | 5.991414 |
52496157-8056-4dab-adc8-40eceb5b7760 | Alex4386-vault/foss-crossover | clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp | #include "clang/FrontendTool/Utils.h"
#include "clang/ARCMigrate/ARCMTActions.h"
#include "clang/CodeGen/CodeGenAction.h"
#include "clang/Config/config.h"
#include "clang/Driver/Options.h"
#include "clang/Frontend/CompilerInstance.h"
#include "clang/Frontend/CompilerInvocation.h"
#include "clang/Frontend/FrontendAction... | TOOL | 0.950163 | 7.630249 |
11e40081-d18a-4939-b0b3-b67ff997862c | knerd1/Cpp_Practice | Data-Structure/Recursion/stringIsPalindrome.cpp | #include <iostream>
using namespace std;
bool stringPalindrome(string word, int n, int i) {
if (i >= n / 2)
return true;
if (word[i] != word[n - i - 1])
return false;
return stringPalindrome(word, n, i + 1);
}
int main() {
string word = "madam madam";
bool isPalindrome = stringPalindrome(word, word... | ALGO | 0.99997 | 5.442481 |
9c9fa208-0416-43df-86ed-06c129f3f922 | sanyathisside/Dynamic-Programming | 06- rod cutting (memoization).cpp | #include <iostream>
using namespace std;
int memo[100];
int maxProfit(int arr[], int totalLen){
if(totalLen == 0)
return 0;
if(memo[totalLen] != -1){
return memo[totalLen];
}
int best = 0;
for(int len =1; len <= totalLen; len++){
int netProfit = arr[len] + maxProfit(arr,totalLen - len);
best = max(best,ne... | ALGO | 0.998899 | 3.863304 |
94332fa0-00d5-4ae0-82ae-1cb5132e04c8 | kiranmuddam/leetcode | google-online-assessment/352459.cpp | #include <iostream>
#include <vector>
using namespace std;
int main(int argv, char *argc[]) {
int N, K;
vector<int> inputArray;
cin >> N >> K;
for (int i = 0; i < N; i++) {
int currentInt;
cin >> currentInt;
inputArray.push_back(currentInt);
}
int windowStart = 0, windowEnd = 0, windowSum = 0, startInd... | ALGO | 0.999891 | 4.839901 |
d3e46cf9-7026-4e6f-b49b-1c60b4222971 | Happylilly1231/algorithm-study-2025 | week4_DP/BOJ_2579/계단_오르기_subin.cpp | /*
알고리즘 : DP
시간복잡도 : O(n)
아이디어 : 한 번에 한 계단 또는 두 계단씩 오를 수 있으며, 세 계단 연속으로 밟을 수 없음
dp[i][0] : i번째 계단을 밟지 않았을 때
dp[i][1] : i번째 계단을 밟았고, 직전 계단은 밟지 않은 경우
dp[i][2] : i번째 계단을 밟았고, 직전 계단도 밟은 경우
*/
#include <iostream>
using namespace std;
int main()
{
ios::sync_with_std... | ALGO | 0.999988 | 4.758785 |
5f7a71b2-92d5-4dc0-91e5-607660498fef | BaileySri/Practical-Software-Defense-for-GPS-Spoofing-on-a-Hobby-UAV | libraries/AP_IOMCU/iofirmware/mixer.cpp | /*
mixer for failsafe operation when FMU is dead
*/
#include <AP_HAL/AP_HAL.h>
#include <AP_Math/AP_Math.h>
#include <SRV_Channel/SRV_Channel.h>
#include "iofirmware.h"
#define ANGLE_SCALE ((int32_t)4500)
#define RANGE_SCALE ((int32_t)1000)
/*
return a RC input value scaled from -4500 to 4500
*/
int16_t AP_IOM... | TOOL | 0.853986 | 6.855888 |
78d9a9b4-48e8-4934-aa3d-72905503a226 | DenizIsikli/02393-Programming-in-CPP | ex02/Exercise2.cpp | #include <iostream>
using namespace std;
class PrimeFactorization {
public:
void primefactorization(unsigned int n) {
for (int i = 2; i <= n; i++) {
while (n % i == 0) {
cout << i;
n /= i;
if (n > 1) {
... | ALGO | 0.999952 | 5.149356 |
1576f806-1da7-4011-8acc-28dd5fb853f8 | alexanderwilkinson/visenew | src/search_engine/relja_retrival/v2/indexing/tests/reduce_idxs.cpp | #include "dataset_v2.h"
#include "embedder.h"
#include "hamming_embedder.h"
#include "proto_db_file.h"
#include "proto_index.h"
#include "timing.h"
void reduceIidx(std::string iidxFn, std::string iidxFn_new, uint32_t step, embedderFactory const &embFactory){
protoDbFile dbIidx(iidxFn);
protoIndex iidx(dbI... | DATA | 0.862539 | 4.610582 |
1e898e57-73c3-4a10-8f14-8d6c8eb3aa2e | bvbasavaraju/competitive_programming | interview_questions/full_throttle_labs.cpp | #include <iostream>
#include <vector>
#include <list>
#include <algorithm>
#include <string>
#include <stack>
#include <queue>
#include <map>
#include <unordered_map>
#include <unordered_set>
#include <cmath>
#include <limits.h>
using namespace std;
#include<bits/stdc++.h>
using namespace std;
int Solution (int x1, ... | ALGO | 0.999737 | 3.342751 |
bc422930-16fc-4b1d-923d-56ec5991f2e3 | thedyingkai/ACM-Repository | Contests/Vjudge/test2/test2_e.cpp | #include <iostream>
using namespace std;
int x,n,s;
int a[100086];
int sol(){
int res = n+1;
int sum=0,l=0,r=0;
while(1){
while (sum<s && r<=n){
sum+=a[r++];
}
if(sum<s) break;
if(sum>=s) res=min(res,r-l);
sum-=a[l++];
}
if(res>n) res=0;
return... | ALGO | 0.99987 | 3.181834 |
055932ae-66d4-46b2-ada7-73da6b5d9431 | defauth98/exs-cpp | secao_04/ex47.cpp | #include <iostream>
using namespace std;
int main(){
int num, cifra;
cout << "Numero: ";
cin >> num;
cout << num / 1000 << endl;
cout << (num % 1000) / 100 << endl;
cout << ((num % 1000) % 100) / 10 << endl;
cout << num % 10 << endl;
} | ALGO | 0.986604 | 3.156218 |
56ac112d-3ad8-465d-a326-9eb7f5a47a3c | surya3214/coding | SPOJ/ORDERSET.cpp | // AC - BIT, Data Compression - Ayyyyyyyyyyyyyyyyyyyyyyyyyyyy!
#include <bits/stdc++.h>
#define Q_MAX 200010
#define N_MAX 200010
using namespace std;
int BIT[N_MAX]; // contains info wrt to compressed_idx; in other words, has info about numbers in terms of 1 to N_MAX
int numbers[N_MAX], max_x, max_n;
int compressed_id... | ALGO | 0.99965 | 4.193737 |
cbeb61e5-be2a-4f60-9d9a-ae0e86931b51 | VegetarianLion258/VINS-Mono-ROS-Noted-ChineseSimplify | vins_estimator/src/initial/initial_aligment.cpp | #include "initial_alignment.h"
/**
* @brief 求解陀螺仪零偏,同时利用求出来的零偏重新进行预积分
*
* @param[in] all_image_frame
* @param[in] Bgs
*/
void solveGyroscopeBias(map<double, ImageFrame> &all_image_frame, Vector3d* Bgs)
{
Matrix3d A;
Vector3d b;
Vector3d delta_bg;
A.setZero();
b.setZero();
map<double, Im... | ALGO | 0.987785 | 3.394395 |
0b94d409-10ff-468b-9cb7-47b3c4dbe145 | Sujay-Mohanty/ComputerNetworks_Implementation | HDLC.cpp | #include <iostream>
#include <stdio.h>
#include <string.h>
#include <bitset>
using namespace std;
string xor1(string a, string b){
string result = "";
int n = b.length();
for(int i = 1; i<n; i++){
if(a[i] == b[i])
result += "0";
else
result += "1";
}
return result;
}
string mod2div(string dividend, string divisor){
int... | ALGO | 0.999833 | 4.501997 |
9dc16cc6-6c58-4ecc-add6-8aa819cfafd6 | aiubian-edge/Codechef---Problem-Solving | Volume 04/BLACKJACK.cpp | /******************************************************************************
Blackjack
Problem
Chef is playing a variant of Blackjack, where 33 numbers are drawn and each number lies between 11 and 1010 (with both 11 and 1010 inclusive). Chef wins the game when the sum of these 33 numbers is exactly 2121.
Given th... | ALGO | 0.999713 | 5.137534 |
888b68ce-7c7f-42cc-af37-b0fa9f38dba3 | ShilongLee/ACM | ACM/算法设计与分析/算法设计课/最大字段和.cpp | #include<stdio.h>
#include<math.h>
#include<algorithm>
using namespace std;
int a[505];
int dp[505];
void dpp(int n)
{
for(int i=0;i<n;i++)
dp[i]=max(a[i],dp[i-1]+a[i]);
}
int main()
{
int n;
scanf("%d",&n);
for(int i=0;i<n;i++)
scanf("%d",&a[i]);
dp[0]=0;
dpp(n);
printf("%d\... | ALGO | 0.999841 | 3.453168 |
cb1afd63-1391-4caa-9088-0866e3c74ec5 | catsudon/TOI-prep | passed/posntest/63022-01.cpp | #include<iostream>
using namespace std;
int main()
{
string s; cin >> s;
int dec=0,coef=1;
for(int i=s.length()-1;i>=0;--i)
{
dec+=(s[i]-48)*coef;
coef*=2;
}
cout << dec;
}
| ALGO | 0.999667 | 4.209927 |
111ec4ba-791f-4e67-98fb-f4e04ebd6fff | iamsaquib2508/Competitive-Programminng | Codeforces/CF 1216 A.cpp | #include<bits/stdc++.h>
#define ffr(i,a,b) for(i=a;i<b;i++)
#define ffrr(i,a,b) for(i=a;i<=b;i++)
#define pb push_back
#define mm(a,b) memset(a,b,sizeof(a))
#define ll long long int
using namespace std;
int mn(int a, int b)
{
if(a<b) return a;
return b;
}
int main()
{
int n, i, ans;
string s;
whi... | ALGO | 0.999936 | 3.316681 |
4b0be906-714e-410a-a2d8-a14c2b9c635a | sulav063/2nd-Sem-23081003 | Lab-Reports-OOP/Lab 2(Classes&objects)/q1_largest_number.cpp | /*Write a program to read two numbers from the use and display the largest value on the screen.(
create class Largest with require data-member and member-function to read from user and to
display result.*/
#include <iostream>
using namespace std;
class Largest {
private:
int number1, number2;
publ... | ALGO | 0.980122 | 4.037933 |
dd64007c-362d-4710-b643-7c2f62bbdacf | oldGanon/csg2pointcloud | code/f32x8.cpp |
struct f32x8
{
__m256 mm;
#ifdef __cplusplus
f32x8(__m256 MM) : mm(MM) { };
f32x8(f32 F) : mm(_mm256_set1_ps(F)) { };
#endif
};
// CONSTRUCTORS
inline f32x8 mmF32x8(__m256 mm) { f32x8 Result = { mm }; return Result; }
inline f32x8 F32x8(f32 a, f32 b, f32 c, f32 d, f32 e, f32 f, f32 g, f32 h) { return ... | ALGO | 0.91345 | 6.420875 |
2f1d0daf-d8f0-4540-a924-f04a8d9b50a3 | mhtkmr54/Central-technology-services | paytm_K_closest.cpp | #include <stdio.h>
/* Function to find the cross over point (the point before
which elements are smaller than or equal to x and after
which greater than x)*/
int findCrossOver(int arr[], int low, int high, int x)
{
// Base cases
if (arr[high] <= x) // x is greater than all
return high;
if (arr[low] > ... | ALGO | 0.999999 | 4.061508 |
d8b69ae0-da84-448f-b1b7-2d5dd033e8a8 | frankkn/CodeForce | HackerRank/110_spring_ids_lab_apr_11/DFS.cpp | #include <iostream>
#include <vector>
using namespace std;
vector<int> visited;
void dfs(vector<vector<int>>& graph, int i);
int main() {
int n,m;
cin >> n >> m;
vector<vector<int>> graph(n+1);
while(m--){
int x,y;
cin >> x >> y;
graph[x].push_back(y);
graph[y].pus... | ALGO | 0.999773 | 5.062327 |
9f2b7237-79d1-472c-a5ad-be98af64b3d2 | k-84mo10/studying_algorithm_introduction | chapter7_quicksort/my_quicksort.cpp | #include <iostream>
#include <vector>
class MyQuickSort {
std::vector<int> arr;
public:
MyQuickSort(std::vector<int>& arr) : arr(arr) {
quicksort(0, arr.size() - 1);
print();
}
void quicksort(int p, int r) {
if (p < r) {
int q = partition(p, r);
quickso... | ALGO | 0.999963 | 5.637053 |
7ab6c902-2259-42f4-94e6-a447dc1b4e04 | itlezy/eMule-mods-archive | eMule-0.50a-Xtreme-8.1-src/cryptopp/dsa.cpp | // dsa.cpp - written and placed in the public domain by Wei Dai
#include "pch.h"
#ifndef CRYPTOPP_IMPORTS
#include "dsa.h"
#include "nbtheory.h"
NAMESPACE_BEGIN(CryptoPP)
size_t DSAConvertSignatureFormat(byte *buffer, size_t bufferSize, DSASignatureFormat toFormat, const byte *signature, size_t signatureLen, DSASi... | TOOL | 0.922012 | 7.707673 |
41925082-2e69-44e3-b11b-b365ed11e131 | billfor/mame | 3rdparty/asio/src/examples/cpp11/executors/fork_join.cpp | #include <asio/dispatch.hpp>
#include <asio/execution_context.hpp>
#include <asio/thread_pool.hpp>
#include <condition_variable>
#include <memory>
#include <mutex>
#include <queue>
#include <thread>
using asio::dispatch;
using asio::execution_context;
using asio::thread_pool;
// A fixed-size thread pool used to imple... | ALGO | 0.998711 | 7.708342 |
40d2f476-2a0f-4961-b321-912e528e5ed2 | rhythm-28/Data-Structures-and-Algorithms | Questions/Prime Factorization.cpp | // Prime Factorization
// O(n)
#include<iostream>
using namespace std;
int main()
{
int i,n;
cin>>n;
for(i=2;i<=n;i++)
{
if(n%i==0)
{
while(n%i==0)
{
n=n/i;
cout<<i<<" ";
}
}
}
return 0;
} | ALGO | 0.99999 | 4.291721 |
a6870848-4cfd-47fa-aa0c-99dd52689a2f | StudyingFather/my-code | Atcoder/abc171e.cpp | // Problem : E - Red Scarf
// Contest : AtCoder - AtCoder Beginner Contest 171
// URL : https://atcoder.jp/contests/abc171/tasks/abc171_e
// Memory Limit : 1024 MB
// Time Limit : 2000 ms
// Powered by CP Editor (https://github.com/cpeditor/cpeditor)
#include <iostream>
using namespace std;
int n,a[200005];
int main()... | ALGO | 0.999978 | 3.986179 |
0c8f4dcc-6786-4291-b25c-89736feffed5 | Ash-codes18/Cpp_DSA | Programs/Leetcode/0637-average-of-levels-in-binary-tree/0637-average-of-levels-in-binary-tree.cpp | class Solution {
public:
vector<double> averageOfLevels(TreeNode* root) {
vector<double> ans;
queue<TreeNode*> q;
q.push(root);
while(!q.empty()){
int size = q.size();
double sum = 0;
int count = 0;
for(int i=0;i<size;i++){
... | ALGO | 0.99996 | 6.771724 |
6fa99d6f-c6d0-4b3e-8351-707b45725834 | goncalo1021pt/42lisboa | commoncore/cpp/cpp9/ex01/srcs/RPN.cpp | #include "RPN.hpp"
RPN::RPN() {}
RPN::~RPN() {}
RPN::RPN(const RPN &other) {
*this = other;
}
RPN &RPN::operator=(const RPN &other) {
(void)other;
return *this;
}
bool RPN::isOperator(const std::string &token) {
return (token == "+" || token == "-" || token == "*" || token == "/");
}
double RPN::calculate(dou... | TOOL | 0.985564 | 5.937095 |
98227129-a63c-483b-b641-28de72dc4c16 | SarthakGagapalliwar/LeetCode | 1293-three-consecutive-odds/three-consecutive-odds.cpp | class Solution {
public:
bool threeConsecutiveOdds(vector<int>& arr) {
int cnt=0;
for(int i=0; i<arr.size(); i++){
if(arr[i]%2!=0){
cnt++;
if(cnt==3){
return true;
}
}else{
cnt=0;
... | ALGO | 0.999756 | 5.638402 |
a86415b0-4dc9-43b5-b074-9000a0283df8 | na1x/DeCore | decore/engine.cpp | #include <algorithm>
#include <assert.h>
#include <stdbool.h>
#include "engine.h"
#include "player.h"
#include "rules.h"
#include "deck.h"
#include "dataWriter.h"
#include "dataReader.h"
namespace decore {
Engine::Engine()
: mDeck(NULL)
, mPlayerIdCounter(0)
, mCurrentPlayer(NULL)
, mRoundIndex(0)
... | TOOL | 0.853028 | 6.401772 |
6ff328a8-c224-4a68-80c8-13684778937c | ishandutta2007/codeforces | farhod_farmon/normal/490/C.cpp | #include <bits/stdc++.h>
#define fi first
#define se second
#define sc scanf
#define pr printf
#define pb push_back
#define mp make_pair
#define fin(s) freopen( s, "r", stdin );
#define fout(s) freopen( s, "w", stdout );
const int N = 1000010;
using namespace std;
string s;
int l[N], r[N], a, b;
void ans(int x)
{
... | ALGO | 0.999947 | 3.374708 |
34a4b6ce-033b-4a50-9414-12e4a64f6d85 | monish0001/appClub | day4/TLE.cpp | #include<bits/stdc++.h>
using namespace std;
string solve (int N) {
// Your code goes here
if(N<4) return "No";
else{
bool flag=0;
for(int i=2;i<=N/2;i++)
if(N%i==0){
flag=1;
break;
}
if(flag)
return "Yes";
else return "No";
... | ALGO | 0.999811 | 5.366721 |
101e7848-a908-4ebb-8d6c-d73eb4374a5c | aqscithe/Course-DataStructuresAndAlgorithms | Labs/lab4_Leon_Thompson/BinarySearchTree/BinarySearchTree.cpp | /** @file BinarySearchTree.cpp */
#include <iostream>
#include <iomanip>
#include "BinarySearchTree.h"
#include "BinaryNode.h"
//////////////////////////////////////////////////////////////
//
// Protected Utility Methods Section
//
//////////////////////////////////////////////////////////////
/*************... | ALGO | 0.999779 | 7.674683 |
cccb08f1-e165-4170-8f76-41c6b7af3083 | performeru/Baekjoon-Programmers | 프로그래머스/1/159994. 카드 뭉치/카드 뭉치.cpp | #include <string>
#include <vector>
#include <unordered_set>
using namespace std;
bool canConstruct(vector<string>& cards1, vector<string>& cards2,
vector<string>& goal, int idx1, int idx2, int goalIdx, unordered_set<string>& used)
{
if (goalIdx == goal.size())
{
return true;
}
string ... | ALGO | 0.999977 | 6.238188 |
3011aca2-56a9-42e2-bdbd-944c01b325a3 | Takiwa-i/Atcoder | ABC/139/A.cpp | #include <iostream>
#include <string>
int main(void)
{
std::string s, t;
int ans = 0;
std::cin >> s >> t;
for (int i = 0; i < 3; i++)
{
if (s[i] == t[i])
++ans;
}
std::cout << ans << std::endl;
return (0);
} | ALGO | 0.999776 | 3.398368 |
07b8b858-9387-4937-9a4b-2a3ba79d856e | yukikamome316/atcoder-archive | abc351/abc351_b_52850203_AC.cpp | /*
* Author: yukikamome316
* Submission URL: https://atcoder.jp/contests/abc351/submissions/52850203
* Submitted at: 2024-04-27 21:10:49
* Problem URL: https://atcoder.jp/contests/abc351/tasks/abc351_b
* Result: AC
* Execution Time: 1 ms
*/
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n)... | ALGO | 0.99996 | 4.207049 |
5d7d6ad3-2d1a-4c1e-a6f8-24951c94bcb3 | lclpsoz/competitive-programming | ARCHIVE/2018-12-21-1135/559A.cpp | #include "bits/stdc++.h"
using namespace std;
////////////// Prewritten code follows. Look down for solution. ////////////////
#define x first
#define y second
#define len(x) ((int)(x).size())
using pii = pair<int, int>;
using ll = long long;
using llu = long long unsigned;
using ld = long double;
const ld EPS = 1e-9... | ALGO | 0.999745 | 3.847685 |
5c0da06f-f63b-48e8-bfe6-9ec69924a9ab | commoncoder73/dsa-5june2024 | cpp/16InsertionSort/solution.cpp | #include <bits/stdc++.h>
using namespace std;
// TC: O(N^2) SC: O(1)
// Stable
void sort(int arr[], int n) {
for (int i = 1; i<n; i++) { // n-1
int valToInsert = arr[i];
int ptr = i - 1;
while (ptr >= 0 && arr[ptr] > valToInsert) { //1 2 3 4 5 n-1 ... O(N^2)
arr[ptr+1] = arr[ptr];
ptr-... | ALGO | 0.99997 | 5.330553 |
66fdc2bb-31e3-47cb-b70b-ee1a42272964 | ishandutta2007/codeforces | dreamoon_love_aa/normal/1315/C.cpp | #include<bits/stdc++.h>
const int SIZE = 101;
int b[SIZE], d[SIZE], an[SIZE * 2];;
bool u[SIZE * 2];
void solve() {
int n;
scanf("%d", &n);
for(int i = 1; i <= n; i++) {
scanf("%d", &b[i]);
d[i] = b[i];
u[i * 2] = u[i * 2 - 1] = 0;
}
std::sort(d + 1, d + 1 + n);
for(int i... | ALGO | 0.999489 | 4.281877 |
67dc7d60-0e55-4aae-a661-bab2c6d5edb9 | Xie-Minghui/ACM | 二分搜索-Match Points.cpp | #include<bits/stdc++.h>
using namespace std;
const int maxn = 2e5;
int a[maxn+10];
int n = 0,z = 0;
int main(){
while(~scanf("%d %d",&n,&z)){
for(int i = 1;i <= n;++i){
scanf("%d",&a[i]);
}
sort(a+1,a+1+n);
int l = 0,r = n/2;
int mid = 0,ans = 0;
while(l <= r){
mid = (l + r) / 2;
int sum = 0;
... | ALGO | 0.999887 | 3.560672 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.