uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
1aa339f9-e878-416b-8ddd-b150f9240f1a | sandialabs/athena | athena_tool/external_repos/timeloop/src/mapspaces/subspaces.cpp | #include <functional>
#include <set>
#include "mapspaces/subspaces.hpp"
namespace mapspace
{
//--------------------------------------------//
// IndexFactorizationSpace //
//--------------------------------------------//
IndexFactorizationSpace::IndexFactorizationSpace() :
tiling_counter_(pro... | TOOL | 0.994396 | 6.908616 |
7db88608-b99a-4cf8-a845-d7d5233232cc | sakshamVerma08/DSA | Sliding Window/problem2024.cpp | #include <iostream>
#include <bits/stdc++.h>
using namespace std;
int maxConsecutiveAnswers(string answerKey, int k)
{
int finalAns = 0;
int left = 0, trueCnt = 0, falseCnt = 0;
for (int j = 0; j < answerKey.size(); j++)
{
if (answerKey[j] == 'T')
trueCnt++;
else
... | ALGO | 0.999628 | 4.852991 |
bf5a482b-cb0c-44f1-886b-66748ad63f38 | luwei0917/GlpG_Nature_Communication | src/USER-MISC/improper_distance.cpp | /* ----------------------------------------------------------------------
Contributing author: Paolo Raiteri (Curtin University)
------------------------------------------------------------------------- */
#include <mpi.h>
#include <math.h>
#include <stdlib.h>
#include "improper_distance.h"
#include "atom.h"
#inclu... | ALGO | 0.999393 | 6.808565 |
40402a75-830f-4f4d-9f2f-16677958720d | Caproner/HDU | 1000-1099/1061.cpp | #include<iostream>
using namespace std;
int solve(int n)
{
int p=n%10;
if(p==0||p==1||p==5||p==6)return p;
else if(p==2)
{
int k=n%4;
if(k==0)return 6;
else if(k==1)return 2;
else if(k==2)return 4;
else return 8;
}
else if(p==3)
{
int k=n%4;
... | ALGO | 0.999695 | 4.44277 |
45673311-a892-4af2-941e-12b499eed860 | zephray/ArithMax | Software/AMEv3/Eigenmath/factors.cpp | // Push expression factors onto the stack. For example...
//
// Input
//
// 2
// 3x + 2x + 1
//
// Output on stack
//
// [ 3 ]
// [ x^2 ]
// [ 2 ]
// [ x ]
// [ 1 ]
//
// but not necessarily in that order. Returns the number of factors.
#include "stdafx.h"
#include "defs.h"
// L... | ALGO | 0.890454 | 4.330092 |
3343aba8-9626-4928-a21f-067b069a89f4 | 2464326176/cEssence | basicsProgram/compilePrinple/function/hash.cpp | /*
* @Author: yh
* @Date: 2022/9/11 15:08
* @Description:
* @FilePath: hash.cpp
*/
#include <iostream>
#include <iomanip>
#include <functional>
#include <string>
#include <unordered_set>
struct S {
std::string first_name;
std::string last_name;
};
bool operator==(const S &lhs, const S &rhs) {
return... | ALGO | 0.981087 | 5.607033 |
4ea4f2c3-2384-4acd-9387-87951714019a | rambhajanmali/Data-structure-and-Algorithms | Queue/sliding-window-max.cpp | #include <iostream>
#include <deque>
#include <vector>
using namespace std;
vector<int> maxSlidingWindow(vector<int> &nums, int k)
{
deque<int> dq;
vector<int> ans;
// first window of k size
for (int i = 0; i < k; i++)
{
// chote element remove kr do
while (!dq.empty() && nums[i] >... | ALGO | 0.999979 | 5.562893 |
70c650c4-b99f-46cb-a458-3c00c506a1eb | raincross7/code-similarity | codes/train_code/problem177/problem177_322.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
string s;
cin >> s;
if ((s[0] == s[1] && s[2] == s[3] && s[0] != s[2]) ||
(s[0] == s[2] && s[1] == s[3] && s[0] != s[1]) ||
(s[0] == s[3] && s[1] == s[2] && s[0] != s[1])) cout << "Yes" << endl;
else cout... | ALGO | 0.999987 | 3.757388 |
231dce4e-d81e-4f39-8f4d-dffb752448bb | UtkarshGupta12/InterviewBit | Binary Search/Search-in-Bitonic-Array.cpp | #include <iostream>
#include <string>
#include <bits/stdc++.h>
#define M 1000000007
using namespace std;
void printVec(vector<int> &v)
{
int N = v.size();
for(int i=0;i<N;i++)
{
cout << v[i] << " ";
}
cout <<endl;}
int FindIndexofPeak(vector<int> &A)
{
int low = 0, high = A.size()-1,mi... | ALGO | 0.999995 | 5.229229 |
b39f855b-a1d5-4013-86cd-6523ed3bdcfa | toantang/PracticeExercise | 20201/IT3040_KTLT/Bai_thuc_hanh_so5/20183998_TangTheToan_Bai5.8.cpp | #include<bits/stdc++.h>
using namespace std;
int dp[610][610];
int H[250];
int W[250];
int n;
int sol(int w, int h){
int res = w*h;
if(dp[w][h] != -1){
return dp[w][h];
}
for(int i=0; i<n; i++){
if(w - W[i] >= 0 && h - H[i] >= 0){
res = min(res, sol(w-W[i],h)+sol(W[i],h-H[... | ALGO | 0.999916 | 4.299168 |
68d8a108-795b-4e1a-a0ff-7ccb8d7e3bce | bartoszgrelewski/Studies-PWR | Algorytmy-i-struktury-danych/Lista_2/descGenerator.cpp | #include <iostream>
#include <random>
#include <algorithm>
#include <functional>
void descGenerator(int arr[], int n){
std::random_device rd;
arr[n];
std::mt19937 mt(rd());
std::uniform_int_distribution<int> dist(1.0, 2*n-1);
for(int i = 0; i < n; i++ ) {
arr[i] = ((int)dist(mt));
}
... | ALGO | 0.997732 | 3.889787 |
477b2d3a-939f-4b8d-affd-9e3e0843c743 | yukikamome316/competition-archive | src/ARC/ARC017/A.cpp | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)n; i++)
#define rep2(i, s, n) for (int i = (int)s; i < (int)n; i++)
using namespace std;
using ll = long long;
int main() {
int N; cin >> N;
bool is_prime = true;
for (int i = 2; i * i <= N; i++) {
if (N % i == 0) {
is_... | ALGO | 0.999897 | 5.582549 |
6d92f365-bcfe-4d7a-8107-f82f89161551 | w1d2s/algorithms-study | 136-邻值查找.cpp | #include <stdio.h>
#include <algorithm>
#include <vector>
#include <cmath>
/* 关键:
* 1. 排序,并且建立原来位置与排序后链表中位置的关系(B数组保存指针直接访问排序后的节点,及其前驱和后继)
* 2. 倒序处理B数组,先处理Bn,此时Bn的前驱、后继的idx均小于n;然后删掉Bn指向的链表节点,继续处理Bn-1....
*/
#define MAX_N 100005
#define INT_MIN -2147483648
#define INT_MAX 2147483647
struct PairNode {
PairNode(): ... | ALGO | 0.999961 | 3.675286 |
fb1ea8e5-1652-4204-a5bd-2ad317b50d38 | Mohamed-Hossam/Problem-Solving | uva/Uva - 920.cpp | //In the name of Allah
#define _CRT_SECURE_NO_WARNINGS
#include<iostream>
#include<algorithm>
#include<vector>
#include<set>
#include<map>
#include<queue>
#include<stack>
#include<iterator>
#include<cmath>
#include<string>
#include<sstream>
#include<cstring>
#include<ctype.h>
#include<iomanip>
#include<functional>
#inc... | ALGO | 0.999843 | 3.973687 |
0362c43c-d1b6-42ad-83d8-6758d41995b9 | OpenHero/gblastn | c++/src/algo/blast/api/deltablast.cpp | #ifndef SKIP_DOXYGEN_PROCESSING
static char const rcsid[] =
"";
#endif /* SKIP_DOXYGEN_PROCESSING */
/** @file deltablast.cpp
* Implementation of CDeltaBlast.
*/
#include <ncbi_pch.hpp>
#include <algo/blast/api/psiblast.hpp>
// PSSM Engine includes
#include <algo/blast/api/pssm_engine.hpp>
#include <objects/sc... | ALGO | 0.87188 | 7.088956 |
76f72851-119f-4ec6-a845-59f1f9eed64e | drewslam/Comp200 | Ptrs_Structs/aug28.cpp | #include <iostream>
using namespace std;
int* EvensArr(int* arr, int size, int sizeEvens) {
int* evensArr = new int[sizeEvens];
int j = 0;
for (int i = 0; i < size; i++) {
if (*(arr + i) % 2 == 0) {
*(evensArr + j) = *(arr + i);
j++;
}
}
return evensArr;
}
i... | ALGO | 0.989191 | 5.234234 |
d528ee30-0534-4d3f-9f43-fb227cebe3f7 | UsmanNadeem/llvm-6-register-allocator | lib/CodeGen/SpillPlacement.cpp | #include "SpillPlacement.h"
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/BitVector.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/SparseSet.h"
#include "llvm/CodeGen/EdgeBundles.h"
#include "llvm/CodeGen/MachineBasicBlock.h"
#include "llvm/CodeGen/MachineBlockFrequencyInfo.h"
#include "llvm/CodeGen/Machin... | ALGO | 0.999093 | 7.803413 |
3493cb6a-773a-45b5-b409-17898e145914 | stwind/atcoder | contests/indeednow-finala-open/C/main.cpp | #include <bits/stdc++.h>
#include <math.h>
using namespace std;
// clang-format off
#define forn(i, x, y) for(int i = x; i < y; i++)
#define IOS ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(NULL)
#define all(s) s.begin(), s.end()
#define MOD 1000000007
#define DEBUG(x) cout << #x << ": " << x << endl;
#defin... | ALGO | 0.999915 | 4.161922 |
8cae57c1-3615-462f-90e7-2148be61b5b8 | nezumimusume/c_purapura_1 | 前期振り返り問題集/ランクB/Answers/Question_01/Question_01/Source.cpp | #include <iostream>
#include <math.h>
#include "lib.h"
using namespace std;
int main()
{
//GenerateInteger̓_100‚̐l쐬āAvaluezɊi[܂B
//̔zlŏ()ɕԂ悤Ƀ\[gsȂB
//\[gASŸ‚̃ou\[g̃ASY͉L̃y[WʼnĂ܂B
//https://www.codereading.com/algo_and_ds/algo/bubble_sort.html
int values[100];
GenerateInteger(values);
//ёւASYB
for (int i = ... | ALGO | 0.998657 | 4.156806 |
1cf993c1-867a-4613-a53d-2e3aac35ba66 | Cryptid-9527/Project-Neltharion-4.3.4 | source/dep/g3dlite/source/SplineBase.cpp | #include "G3D/platform.h"
#include "G3D/Spline.h"
namespace G3D {
float SplineBase::getFinalInterval() const {
if (! cyclic) {
return 0;
} else if (finalInterval <= 0) {
int N = time.size();
if (N >= 2) {
return (time[1] - time[0] + time[N - 1] - time[N - 2]) * 0.5f;
... | ALGO | 0.997418 | 7.841708 |
8825be19-0ae1-4994-96d0-2a4d860bf3a0 | duochen/CPlusPlus-Beginner | Reference/C++CrashCourse/chapter_4/listing_4_2.cpp | #include <cstdio>
static int rat_things_power = 200;
void power_up_rat_thing(int nuclear_isotopes) {
rat_things_power = rat_things_power + nuclear_isotopes;
const auto waste_heat = rat_things_power * 20;
if(waste_heat > 10000) {
printf("Warning! Hot doggie!\n");
}
}
int main() {
printf("Rat-thing power... | TOOL | 0.962435 | 3.844462 |
9fc23e98-68ae-45b1-bb1c-4dcc117577c8 | johngarrett/llvm-research | lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/var-in-aggregate-misuse/main.cpp | #include <stdio.h>
struct Summarize
{
int first;
int second;
};
typedef struct Summarize summarize_t;
typedef summarize_t *summarize_ptr_t;
summarize_t global_mine = {30, 40};
struct TwoSummarizes
{
summarize_t first;
summarize_t second;
};
int
main()
{
summarize_t mine = {10, 20};
summarize... | TOOL | 0.880198 | 5.254245 |
1d17babf-77b2-4a1e-b6b5-37765514d8e7 | ShivangMitra/CODES-n-PROJECTS | Competitive Programming/CodeChef Codes/Practice/compilersAndParsers.cpp | #include <iostream>
#include <stack>
using namespace std;
typedef long long int lli;
int main()
{
ios::sync_with_stdio(0);
cin.tie(0);
lli t;
cin >> t;
while (t--)
{
string syntax;
cin >> syntax;
stack<lli> pile;
bool complete = true;
lli index;
... | ALGO | 0.999035 | 3.35392 |
2eb21ad3-901c-4642-8f43-e6b1f50fca37 | LittleYang0531/CQ-NOIP-2021 | CQ-0011/sequence/sequence.cpp | #include<bits/stdc++.h>
using namespace std;
int read() {
int s=0,w=1;
char ch=getchar();
while(ch<'0'||ch>'9') {if(ch=='-') w=-1;ch=getchar();}
while(ch>='0'&&ch<='9') s=(s<<3)+(s<<1)+(ch^48),ch=getchar();
return s*w;
}
const int mod = 998244353;
int n,m,K,mc[35],f[110][35][35][35],v[110],ans,C[35][35],bt[35];
in... | ALGO | 0.999964 | 4.034671 |
120eabef-ce49-4034-a295-5241d71a0846 | Spenson/Degenerate | DegenBulletWrapper/physics/bullet/BulletCollision/NarrowPhaseCollision/btSubSimplexConvexCast.cpp | #include "btSubSimplexConvexCast.h"
#include "BulletCollision/CollisionShapes/btConvexShape.h"
#include "BulletCollision/CollisionShapes/btMinkowskiSumShape.h"
#include "BulletCollision/NarrowPhaseCollision/btSimplexSolverInterface.h"
#include "btPointCollector.h"
#include "LinearMath/btTransformUtil.h"
btSubsimplexC... | ALGO | 0.995771 | 6.82154 |
39b78126-d313-4a64-a28c-4b630dcc9642 | morymobile/leetcode | atoi/atoi.cpp | class Solution {
public:
int atoi(const char *str) {
// Start typing your C/C++ solution below
// DO NOT write int main() function
if (str == NULL || *str == '\0')
return 0;
while (*str == ' ')
str++;
bool positive = true;
i... | ALGO | 0.998977 | 4.608337 |
6931c741-774b-4e2a-9469-13719b00a053 | BalajiKhavane/DSA | moore's_Algorithm.cpp | #include <iostream>
#include <vector>
using namespace std;
int mooresAlgorithm(vector<int>& vec){ //{1,2,2,4,2,2,3}
int freq=0,ans=0;
for(int i=0;i<vec.size();i++){
if(freq == 0){
ans = vec[i];
}
if(vec[i] == ans){
freq++;
}else{
... | ALGO | 0.999957 | 4.989614 |
67486b3f-90fe-49d5-9f10-4f5a79e6e4f8 | victorjgomez/c_and_cplusplus_competitive_programming_problems | problems/leetcode_704/main.cpp | #include <iostream>
#include <stdio.h>
void swap(int* a, int* b)
{
int temp = *a;
*a = *b;
*b = temp;
}
void heapify(int arr[], int N, int i)
{
// Find largest among root,
// left child and right child
// Initialize largest as root
int largest = i;
// left = 2*i + 1
int left = 2 * ... | ALGO | 0.999973 | 4.974455 |
bc73b850-248d-4a24-95fe-e58a3dbed307 | ishandutta2007/codeforces | flashmt/normal/175/A.cpp | #include <iostream>
#include <algorithm>
#include <cstdio>
#include <vector>
#include <cstring>
#include <string>
#include <cmath>
#include <utility>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <sstream>
#define fr(a,b,c) for (int a=b;a<=c;a++)
#define frr(a,b,c) for (int a=b;a>=c;a--)
#def... | ALGO | 0.999804 | 4.022844 |
f3c3418a-4729-4a51-8805-70e69fa469f1 | KausBoss/CP-SubGrouped | LeetCode/146.cpp | class LRUCache {
list<int> cache;
unordered_map<int, pair<int, list<int>::iterator> > mp;
int csize;
public:
LRUCache(int capacity) {
csize=capacity;
}
int get(int key) {
if(mp.find(key)==mp.end()) return -1;
cache.erase(mp[key].second);
cache.push_front(key)... | ALGO | 0.999758 | 5.687333 |
dce74af2-c859-494f-a0ba-b80ea20653c8 | 1337DaKL/Bai_Tap_C_Plus_Plus | baitaphacker28tech/thamlam/jim-and-the-orders.cpp | #include <bits/stdc++.h>
using namespace std;
bool ok(pair<pair<int, int>, int> a, pair<pair<int, int>, int> b)
{
if (a.first.first + a.first.second == b.first.first + b.first.second)
return a.second < b.second;
return a.first.first + a.first.second < b.first.first + b.first.second;
}
int main()
{
i... | ALGO | 0.999853 | 4.471219 |
3cf86346-37c9-4873-ba7a-2b0522bcb448 | jiafeng5513/Evision | src/EvisionElas/elas.cpp | #include "elas.h"
#include <algorithm>
#include <math.h>
#include "descriptor.h"
#include "triangle.h"
#include "matrix.h"
#include <opencv2/opencv.hpp>
using namespace std;
void Elas::process (uint8_t* I1_,uint8_t* I2_,float* D1,float* D2,const int32_t* dims){
// get width, height and bytes per line
width = ... | ALGO | 0.999317 | 3.681889 |
f19c2b90-e466-4a83-a36e-5340dd27fd0a | gopoma/competitive-programming | tasks/1695C.cpp | //* sometimes pragmas don't work, if so, just comment it!
//? #pragma GCC optimize ("Ofast")
//? #pragma GCC target ("avx,avx2")
//! #pragma GCC optimize ("trapv")
//! #undef _GLIBCXX_DEBUG //? for Stress Testing
#include <bits/stdc++.h>
using namespace std;
//* Debugger
string to_string(string s) {
return '"' +... | ALGO | 0.999922 | 4.613067 |
59485905-4a22-434a-b916-63f733cd129e | AV2409/DSA_Codes | two_pointer/max_points.cpp | #include<iostream>
using namespace std;
int maxSum(int nums[],int k){
int r=8;
int lsum=0;
int rsum=0;
for(int i=0;i<k;i++){
lsum=lsum+nums[i];
}
int maxsum=lsum;
for(int i=k-1;i>=0;i--){
lsum=lsum-nums[i];
rsum=rsum+nums[r];
r=r-1;
int sum=lsum+... | ALGO | 0.999894 | 4.104642 |
deb3b115-9b1f-4b15-9577-3b9b80ee3e04 | Achyu-t/LEC_CPP | Class_and_Object/friend_fxn.cpp | #include<iostream>
using namespace std;
class sample{
friend float mean(sample obj1);
private:
float num1,num2;
public:
void getdata()
{
float a,b;
cout<<"Input Data: "<<endl;
cin>>a>>b;
num1=a;
num2=b;
}
};
float mean(sample obj1)
{
fl... | ALGO | 0.933805 | 4.482164 |
6255335a-7717-4434-bda1-9d5628f545ce | minhdang241/ds-algo | Codeforces/A/CF298.cpp | #include <bits/stdc++.h>
#define LOCAL
//#include "../debug.cpp"
#define REP(i,a,b) for(int i=a; i<=b; i++)
using namespace std;
typedef long long ll;
int main() {
// Fast I/O
ios::sync_with_stdio(0);
cin.tie(0);
int n;
cin >> n;
string str;
cin >> str;
int s = 0, t = 0;
if (str.fi... | ALGO | 0.999908 | 3.291895 |
30c99f13-ef53-4421-b891-f6482d8e77a1 | pratyush-45/Striver-SDE-Sheet | String/ImplementAtoiFunction.cpp | #include<bits/stdc++.h>
int atoi(string str) {
int sign = 1;
int res = 0;
int index = 0;
int n = str.size();
if(index < n && str[index] == '-'){
sign = -1;
index++;
}
for( ; index < n; index++){
if(isdigit(str[index])){
int digit = str[index] - '0';... | ALGO | 0.985936 | 4.423012 |
0bb08763-624b-4a87-9662-561e6b29a7c7 | Suhca228/ClassWork | 26.10.2023/26.10.2023/26.10.2023.cpp | #include <iostream>
#include <Windows.h>
using namespace std;
string question[9] = { "Який фрукт є символом Ньютона?",
"Який фрукт має червоний і жовтий різновид і використовується в салатах?",
"Який фрукт вирощується на пальмі і використовується для виробництва олії?",... | TOOL | 0.955591 | 3.297266 |
9284803e-d78d-4102-b01e-e94395584c3a | KashifMushtaq/AesGcm_Windows | GcmAes/cryptopp870/polynomi.cpp | // polynomi.cpp - originally written and placed in the public domain by Wei Dai
// Part of the code for polynomial evaluation and interpolation
// originally came from Hal Finney's public domain secsplit.c.
#include "pch.h"
#include "polynomi.h"
#include "secblock.h"
#include <sstream>
#include <iostream>
NAMESPACE... | ALGO | 0.998505 | 6.26507 |
293b4892-b5cb-418e-ba8f-c9d5ae3b03ea | Bungmint/competitiveprogramming | contest/boj/3946.cpp | using namespace std;
#pragma region TEMPLATE
using ll = long long;
using vi = vector<int>;
using pii = pair<int, int>;
using vpi = vector<pii>;
using pll = pair<ll, ll>;
using vl = vector<ll>;
using vpl = vector<pll>;
using ld = long double;
template <typename T, size_t SZ>
using ar = array<T, SZ>;
template <typename... | ALGO | 0.999498 | 4.403275 |
158da071-b83c-47a2-9842-ffad59459729 | lucasdmaley/six-degrees-of-collaboration | CollabGraph.cpp | /**
** CollabGraph.cpp
**
** Project Two: Six Degrees of Collaboration
**
** Purpose:
** Represent a collaboration graph of artists, where each artist is
** a vertex and an edge between two artists is a song in which those
** artists have collaborated. Accessor and mutator functions are provided,
** al... | ALGO | 0.978172 | 6.110456 |
ba4dc18a-91a6-4483-b8c3-3345cb01907e | robertbarrera/CIS202 | CIS202/search_sort/sortIDs/main.cpp |
/*
Given a main() that reads user IDs (until -1), complete the Quicksort() and Partition() functions to sort the IDs in ascending order using the Quicksort algorithm, and output the sorted IDs one per line.
Ex. If the input is:
kaylasimms
julia
myron1994
kaylajones
-1
the output is:
julia
kaylajones
kaylasimms
myron... | ALGO | 0.999358 | 5.639413 |
18cbb825-653b-463d-83ed-ae8c40c42789 | eduardohfnascimento/icpc | uri/1009.cpp | #include <iostream>
#include <string>
#include <cstdlib>
#define COMISSAO 0.15
int main(){
std::string nome;
double salario, vendas, aReceber;
std::cin >> nome;
std::cin >> salario;
std::cin >> vendas;
aReceber = salario + (vendas * COMISSAO);
std::cout.precision(2);
std::cout << "T... | TOOL | 0.90981 | 4.743606 |
4928bd5a-38f9-45ae-a04e-ce7ccda60174 | hfhongzy/CodeForOI | loj-2743.cpp | #include <algorithm>
#include <cstdio>
#define rep(i, l, r) for(int i = l; i <= r; i ++)
using namespace std;
typedef long long ll;
const int N = 110, mod = 1e9 + 7;
int n, l, a[N], dp[N][N][N * 10][2][2];
inline void upd(int &x, const int &y) {
(x += y) >= mod ? x -= mod : 0;
}
int main() {
scanf("%d%d", &n, &l);
i... | ALGO | 0.999977 | 3.076881 |
1aa3d54a-9dc0-4eba-a572-9c1a1c7ba29a | Neha993/DSA-ALGO | STACK....balanced parenthesis.cpp | /* Given a string A consisting only of '(' and ')'.
You need to find whether parantheses in A is balanced or not ,if it is balanced then return 1 else return 0.
*/
int Solution::solve(string A) {
stack<char> st;
int i;
for(i=0;i<A.size();i++)
{
if(A[i]=='('||A[i]=='{'||A[i]=='[... | ALGO | 0.999031 | 4.201085 |
4dd601ab-0d90-493b-aeae-3b808c65809a | ou3slati/competitive-programming | Implementations/Codes (post IOI_21)/TOP22/E.cpp | //Never stop trying
#include "bits/stdc++.h"
using namespace std;
#define boost ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0)
typedef long long ll;
#define int ll
typedef string str;
typedef long double ld;
typedef pair<int, int> pi;
#define fi first
#define se second
typedef vector<int> vi;
typedef vector... | ALGO | 0.999997 | 4.360533 |
24f39121-da29-4f8d-be7a-851495480a0a | PhamHuongQuynh13122006/PhamHuongQuynh_Ss3_C | Baitap6_Ss3_C.cpp | #include <stdio.h>
int main() {
float base, height, area;
printf("Nhap do dai canh day cua tam giac: ");
scanf("%f", &base);
printf("Nhap chieu cao cua tam giac: ");
scanf("%f", &height);
area = 0.5 * base * height;
printf("Dien tich cua tam giac la: %.2f\n", area);
return 0;
... | ALGO | 0.952793 | 4.913852 |
80e7c90e-6c8d-4a98-a75c-17d890a3eacf | NaF1sh/problem-solving-1 | codeforces/A_Cover_in_Water.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define cases(n) \
ll n; \
cin >> n; \
while (n--)
#define fastread() \
ios::sync_with_stdio(0); \
cin.tie(0);
void solve()
{
ll m;
cin >> m;
string input;
cin >> input;
ll count = 0;
... | ALGO | 0.999636 | 3.890967 |
0307380a-3110-4d2d-bc43-f0df6d81e3d2 | joechen24/virtual-pooling-caffe | src/caffe/util/im2col.cpp | #include <vector>
#include "caffe/util/im2col.hpp"
#include "caffe/util/math_functions.hpp"
namespace caffe {
// Function uses casting from int to unsigned to compare if value of
// parameter a is greater or equal to zero and lower than value of
// parameter b. The b parameter is of type signed and is always positiv... | TOOL | 0.911194 | 7.823773 |
803e2bf4-6683-4dcb-8f7a-0265ea7e0509 | yubindy/mygit | leection/114.cpp | #include "leection.h"
class Solution {
public:
void flatten(TreeNode* root) {
vector<TreeNode*> p;
if(!root){
return;
}
head(root,p);
for(int i=0;i<p.size()-1;i++){
(p[i])->left=nullptr;
(p[i])->right=p[i+1];
}
p.back()->lef... | ALGO | 0.999941 | 5.073004 |
5e439607-651a-4d83-8ef7-62e4a926959b | Shailendra-Chaudhary/Turing_ | 391326_Turn_2_Model_A.cpp | #include <iostream>
#include <vector>
#include <chrono>
#include <cassert>
// Function to compute the dot product of two arrays using inline assembly
float dotProductAssembly(const float* a, const float* b, size_t n) {
float result = 0.0f;
// Using inline assembly to compute the dot product
__asm__ (
... | ALGO | 0.990251 | 7.382353 |
64c5dbff-7f95-4635-92d5-abdcaf0d9f4c | capt-farvez/Codeforces_Solutions | Contests/Codeforces Round 863 (Div. 3)/A.cpp | // Bismillahir Rahmanir Raheem //
#include <bits/stdc++.h>
#include <iomanip>
#include <cmath>
#define readFirst() (ios_base::sync_with_stdio(false), cin.tie(NULL));
#define ll long long int
#define vll vector<long long int>
#define mll map<long long int, long long int>
#define pb push_back
#define pp pop_back
#define... | ALGO | 0.99995 | 4.440825 |
8a2ca545-703e-48a1-980e-32ab30bb9b8f | Logan1qiu/Desalination-robot-polyu | catkin_ws/src/ipa_coverage_planning/ipa_room_segmentation/common/src/evaluation_segmentation.cpp | #include <ipa_room_segmentation/evaluation_segmentation.h>
#include <ros/ros.h>
#include <ros/package.h>
#include <map>
#include <vector>
#include <set>
//int pixel_number_calculation (cv::Mat matrix)
//{
// int pixel_number;
// for (unsigned int i=0; i<matrix.cols; i++)
// {
//
// for (unsigned int j=0; j<matrix.c... | ALGO | 0.96252 | 5.722877 |
f54f9acd-c7b5-4e01-a062-085bb634a74d | ADS-bot/Leetcode | 0881-boats-to-save-people/0881-boats-to-save-people.cpp | class Solution {
public:
int numRescueBoats(vector<int>& people, int limit) {
int ans = 0;
ranges::sort(people);
for (int i = 0, j = people.size() - 1; i <= j; ++ans) {
const int remain = limit - people[j--];
if (people[i] <= remain)
++i;
}
return ans;
}
}; | ALGO | 0.999987 | 6.214436 |
cac53bfe-3035-4eb1-be68-a1f2fb452376 | PootieT/explain-then-translate | CodeGenMirror/data/transcoder_evaluation_gfg/cpp/DIVISIBILITY_BY_7.cpp | #include <iostream>
#include <cstdlib>
#include <string>
#include <vector>
#include <fstream>
#include <iomanip>
#include <bits/stdc++.h>
using namespace std;
int f_gold ( int num ) {
if ( num < 0 ) return f_gold ( - num );
if ( num == 0 || num == 7 ) return 1;
if ( num < 10 ) return 0;
return f_gold ( num / 10... | ALGO | 0.991166 | 4.758163 |
45478cc1-d90d-4c30-9060-5ccd0e928f02 | Huanghu-H/MyCppProgram | 卡片游戏.cpp | #include<iostream>
#include<cmath>
using namespace std;
int a[25];
int n,k;
int p[25];
int f(int i,int p[])
{
if(k==3)
{
int k1=0,k2=0,k3=0;
k1=p[max(i-2,1)]+p[max(1,i-1)]+p[i];
k2=p[max(i-1,1)]+p[i]+p[min(i+1,n)];
k3=p[i]+p[min(n,i+1)]+p[min(i+2,n)];
if(k1>=2&&k2>=2&&k3>=2)return 1;
else return 0;
}
... | ALGO | 0.999953 | 3.450457 |
8f48805d-d596-4ceb-a25b-6c0ebb0bc874 | ishandutta2007/codeforces | ilith/normal/1508/B.cpp | #include<bits/stdc++.h>
#define rgi register int
#define mid (l+r>>1)
#define fin(x) freopen(x,"r",stdin)
#define fout(x) freopen(x,"w",stdout)
typedef long long ll;
using namespace std;
inline void read(){}template <typename T,typename... Ts> inline void read(T& A,Ts&... As){
T x=0,f=1;char ch=getchar();
while(ch<'0... | ALGO | 0.99989 | 3.7618 |
fc7bb12c-98dd-4ed7-9130-dac06754af27 | NotAdityaPawar/Leetcode-solutions | 0334-increasing-triplet-subsequence/0334-increasing-triplet-subsequence.cpp | class Solution {
public:
bool increasingTriplet(vector<int>& nums) {
int c1 = INT_MAX;
int c2 = INT_MAX;
for (auto i:nums){
if (i<=c1){
c1 = i;
}
else if (i<=c2){
c2 = i;
}
else return true;
}... | ALGO | 0.999959 | 5.815336 |
a5a832fb-ac1c-4731-9966-25e3149e2d63 | katoumorisan/XBluetooth | bolt/compute/tensor/src/embedding.cpp | #include "tensor_computing.h"
#ifdef _USE_CPU
#include "cpu/tensor_computing_cpu.h"
#endif
#ifdef _USE_GPU
#include "gpu/mali/tensor_computing_mali.h"
#endif
EE embedding_infer_output_size(Tensor *inputTensor,
EmbedParamSpec p,
DataType outputDt,
Tensor *outputTensor,
ArchInfo_t archInfo)
{
if (inp... | ALGO | 0.964963 | 4.279165 |
45f091b4-98d1-4583-ba85-7edbee62434a | HetSavani36/c_plus_plus | linked list/lec-1/insertAtHead.cpp | #include<iostream>
using namespace std;
class Node{
public:
int val;
Node* next;
Node(int val){
this->val=val;
this->next=NULL;
}
};
class LinkedList{
public:
Node* head;
Node* tail;
int size;
LinkedList(){
head=tail=NULL;
size=0;
}
void insertAt... | ALGO | 0.997865 | 4.258604 |
f83be005-b69b-46eb-9fb1-63057f1efc75 | tsksnhr/programming_contest | atcoder/abc147a.cpp | #include <bits/stdc++.h>
using namespace std;
int a, b, c;
int main(){
cin >> a >> b >> c;
if (a+b+c>21){
cout << "bust" << endl;
}
else{
cout << "win" << endl;
}
return 0;
} | ALGO | 0.999342 | 3.460318 |
c2c31725-7f33-4702-8fc9-9951a968911e | deepakkasera/Codechef | SimilarDishes.cpp | #include <bits/stdc++.h>
using namespace std;
int main(int argc, char const *argv[])
{
int t;
cin >> t;
std::vector<string> v1(4);
std::vector<string> v2(4);
while(t--){
int cnt=0;
for(int i=0;i<4;i++)
cin >> v1[i];
for(int i=0;i<4;i++)
cin >> v2[i];
for(int i=0;i<4;i++){
for(int j=0;j<4;j++){
... | ALGO | 0.999932 | 3.235292 |
68e5c9aa-bf1c-4eaa-bd93-c7725cf164ad | Keshav76/DSA-with-C- | Sorting/QuickSort.cpp | #include <iostream>
using namespace std;
void swap(int *a, int *b)
{
*a ^= *b;
*b ^= *a;
*a ^= *b;
}
int partition(int arr[], int s, int e)
{
int i = s - 1;
for (int j = s; j < e; j++)
{
if (arr[j] < arr[e])
{
i++;
swap(arr[i], arr[j]);
}
}
... | ALGO | 0.999936 | 5.202878 |
6a2e0f6f-92f5-4361-bdae-6a05382014ed | hannanred/Hashing- | test_chaining.cpp | #include <iostream>
#include <fstream>
#include <vector>
#include <time.h>
#include <thread>
#include <chrono>
#include <future>
#include <memory>
#include "Chaining.h"
using namespace std;
bool timeOut;
promise<bool> done;
void timer(future<bool> done_future)
{
std::chrono::seconds span (3);
if(done_future.w... | TEST | 0.905707 | 4.952173 |
513875fd-bc34-4080-90f8-8da505f67085 | ishandutta2007/codeforces | xuanquang1999/normal/557/A.cpp | using namespace std;
#include <bits/stdc++.h>
#define fdto(i, r, l) for(int i = r; i >= l; --i)
#define fto(i, l, r) for(int i = l; i <= r; ++i)
#define forit(it, type, var) for(type::iterator it = var.begin(); it != var.end(); it++)
#define ii pair<int, int>
#define iii pair<int, ii>
#define fi first
#define se second... | ALGO | 0.99851 | 3.323875 |
0467b0ae-382d-4aed-a0a1-a5c51896012b | elcaminobhushan/CodeForces | Solved/Dice_tower.cpp | #include<bits/stdc++.h>
using namespace std;
int main() {
long long int n;
cin>>n;
long long int a[n],z=0;
for(long long int i=0;i<n;i++)
cin>>a[i];
for(long long int i=0;i<n;i++){
z=(a[i]-1)/14;
if(a[i]>14*z && 14*z+7>a[i] && z>0)
cout<<"YES"<<endl;
els... | ALGO | 0.999968 | 3.426847 |
c4cd562c-98dc-4f45-b73e-967cf8fa51f2 | kjartank13/Algorithm_Projects | babel/babel/babel.cpp |
#include <iostream>
#include <string>
#include "dictionary.h"
using namespace std;
int main() {
dictionary Dict;
string line;
for (getline(cin, line); line.size() != 0; getline(cin, line))
{
//line < english, space, bab >
string eng = "";
string bab = "";
... | TOOL | 0.971316 | 4.625566 |
dd7bd035-07af-45b7-ac8d-215b71d3535d | xylar/moab | src/mesquite/ObjectiveFunction/MaxTemplate.cpp | /*!
\file MaxTemplate.cpp
\brief
This Objective Function is the maximum of the quality metrics
total = max(x)
\author Lori Freitag
\date 2002-07-18
*/
#include <math.h>
#include "MaxTemplate.hpp"
#include "QualityMetric.hpp"
#include "MsqError.hpp"
namespace MBMesquite {
MaxTemplate::MaxTemplate(Qual... | ALGO | 0.991992 | 5.613835 |
0e1435ce-9834-496a-921b-b6e60e92cb39 | leonlazuli/algorithms | repository/maopaoAndInsertionSort.cpp | #include <iostream>
#include <ctime>
#include <limits>
void printArray(int* arr, int size)
{
for(int i = 0; i != size; i++)
{
std::cout << arr[i] << ' ';
}
std::cout << std::endl;
}
void swap(int* arr, int i, int j)
{
int temp = arr[i];
arr[i] = arr[j];
arr[j] = temp;
}
void insertionSort(int* arr, int size... | ALGO | 0.999726 | 4.584491 |
9941d158-dc3b-482f-bf6b-1b15603f86f4 | Acephoeni-X/Data-Structures-And-Algorithms | Bit_Manipulation/basic_bits.cpp | #include <iostream>
#include <fstream>
// remove these lines before submitting
using std::endl;
std::ifstream cin("/Users/rishi/Files/C++/input.txt");
// declare variable
int x, y;
void readInput(){
cin >> x >> y;
}
// move this line to upper
using namespace std;
void solve(){
cout << x << " & " << y << " = " <... | ALGO | 0.999391 | 3.693857 |
893a7134-565a-4b9f-a12f-69d7debeccd9 | Aaanchalsingh/DSA | 4_Array/3_Best_Missing.cpp | //#HASH TABLE TECHNIQUE TO FIND MULTIPLE MISSING IN UNSORTED ARRAY
#include <bits/stdc++.h>
using namespace std;
int main()
{
int A[10] = {10, 4, 3, 2, 1, 12, 11, 9, 7, 6};
int max = A[0];
for (int i = 0; i < 10; i++)
{
if (max < A[i])
{
max = A[i];
}
}
int *... | ALGO | 0.999238 | 3.40721 |
12ace8b8-810a-4b24-894a-c14478883f62 | Kun4lpal/CodePractice | 2_LEETCODE/Easy/Trees/levelOrderBinaryTree.cpp |
void DFS(TreeNode* root, int level, vector<vector<int>> &res){
if (root == NULL) return;
if (level == res.size()){
res.push_back(vector<int>()); // Create a new level
}
res[level].push_back(root->val); // Add the current value to its level
DFS(root->left, level+1,res); // Go to the ne... | ALGO | 0.999994 | 6.003403 |
c45d8791-4c6b-4ea0-9eda-c3091b43a8bb | Bennett-Stice/School_Projects | Data_Struc_Algos/Sorting_Algos_with_Time_Complexities/Proj_1_TurnIn_BS/Sorter.cpp | #include "Sorter.hpp"
#include <iostream>
#include <list>
#include <cstdlib>
#include <string>
using namespace std;
list<string> bubbleSort(list<string>& input)
{
list<string> placeholder; //create list of strings that will hold a temp list
bool sorted=true; //bool to tell if a swap has been made in a round
... | ALGO | 0.999765 | 4.863606 |
4d3e3f36-a8b8-44d5-9958-fc1a52191af5 | microsoft/nnfusion | src/nnfusion/engine/pass/graph/autodiff/dot.cpp | #include "backward_registry.hpp"
#include "nnfusion/core/graph/util/numpy_transpose.hpp"
shared_ptr<op::Reshape>
make_reshape_axes_to_front(const Shape& front_shape, const Shape& back_shape, bool trans)
{
AxisVector input_order;
Shape output_shape;
for (size_t i = 0; i < back_shape.size(); i++)
{
... | ALGO | 0.9361 | 7.660367 |
e1cfd530-1ed7-4d1e-acb9-440b173dbbdc | LChanwoo/backjoon_practice | cpp/p1312.cpp | #include <iostream>
#include <cmath>
#include <string>
using namespace std;
int main(){
int A,B,N;
cin >> A >> B >> N;
int result =0;
for(int i=0; i <= N;i++){
result = A/B;
A%=B;
A*=10;
}
cout << result;
return 0;
} | ALGO | 0.999915 | 3.366429 |
e7e055e8-a24e-4edf-91e7-a207790f7cb6 | takumi152/atcoder | arc127c.cpp | #include <iostream>
#include <iomanip>
#include <vector>
#include <algorithm>
#include <utility>
#include <string>
#include <queue>
#include <stack>
#include <unordered_set>
using namespace std;
typedef long long int ll;
typedef pair<int, int> Pii;
const ll mod = 998244353;
int main() {
cin.tie(0);
ios::sync_wi... | ALGO | 0.999995 | 5.155819 |
99fc5aaf-728b-4696-9083-0a1638e40e61 | kyomin/algorithm | Programmers/programmers_258712.cpp | #include <string>
#include <vector>
#include <map>
#include <sstream>
#include <algorithm>
using namespace std;
vector<string> split(string str, char delimiter) {
vector<string> internal;
stringstream ss(str);
string temp;
while (getline(ss, temp, delimiter))
internal.push_back(temp);
return internal;
}
int ... | ALGO | 0.999635 | 5.217934 |
c3176a54-ec57-467e-977b-186f0fa86395 | bialger/SandPile | lib/basic/basic_functions.cpp | #include "basic_functions.hpp"
#include <climits>
#include <cstring>
#include <iostream>
#include <filesystem>
int64_t IntFromString(char* int_literal, int64_t limit, int8_t base) {
if (strncmp(int_literal, "0b", 2) == 0) {
base = 2;
int_literal += 2;
} else if (strncmp(int_literal, "0o", 2) == 0) {
b... | TOOL | 0.939966 | 6.452058 |
f7ee56d7-9287-45d4-8ac1-7cd84d92b0bf | ishandutta2007/codeforces | rui_er/normal/1391/A.cpp | //By: Luogu@rui_er(122461)
#include <bits/stdc++.h>
using namespace std;
int T, n;
int main() {
scanf("%d", &T);
while(T--) {
scanf("%d", &n);
for(int i=1;i<=n;i++) printf("%d ", i);
puts("");
}
return 0;
} | ALGO | 0.999245 | 3.98825 |
a2e75cdc-2adc-47ef-adc8-f9e3ed43cf10 | sharma-aayush/cpp-competetive-stuff | C++/codeforces/561_div2.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int MOD = (int) 1e9 + 7;
int search(int l, vector<int>&arr)
{
int left = l, right = arr.size()-1, mid;
while(left <= right)
{
mid = (left+right)/2;
if(mid == left)
{
}
if(arr[mid] <= 2*arr[l])
{
left = mid;
}
else
{
... | ALGO | 0.999737 | 3.946031 |
c7e800df-3515-40e5-ae65-4ce530cfadb6 | Abhay-k12/object-oriented-programming-with-cpp | ques35.cpp | /*QUES 35. Create a program that stores a list of integers entered by the user and then:
• Displays the unique elements (i.e., elements that appear only once) in the list. */
#include <iostream>
#include <list>
#include <algorithm>
using namespace std;
int main() {
list<int> numbers;
int num;
cout << "Enter in... | ALGO | 0.996401 | 5.169858 |
f9f36ff3-c7c3-4b93-a9a5-6f1243499f9f | Marines0210/temaOscuro | dark_mode_material_desing/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.998257 | 6.783439 |
3ff0cd5b-c5be-4b4a-9447-57fc6f900fd5 | Ratinkumar/Leetcode-GFG | 3276-minimum-number-of-pushes-to-type-word-ii/3276-minimum-number-of-pushes-to-type-word-ii.cpp | class Solution {
public:
int minimumPushes(string word) {
vector<int>freq(26,0);
for(char c:word)
{
freq[c-'a']++;
}
sort(freq.begin(),freq.end(),greater<int>()); //sort in descending order
int totalpush=0,m=0;
for(int i=0;i<26;i++)
{
... | ALGO | 0.999989 | 5.422726 |
65eea0aa-cf55-4215-a8f6-ed15befbcfa5 | ishandutta2007/codeforces | i_love_tanya_romanova/normal/185/B.cpp | /*
My best friend gave me the best advice
He said each day's a gift and not a given right
Leave no stone unturned, leave your fears behind
And try to take the path less traveled by
That first step you take is the longest stride
If today was your last day
And tomorrow was too late
Could you say goodbye to yesterday?
Wo... | ALGO | 0.999747 | 3.190021 |
9cd2d0c2-b020-4826-a708-fb543c55d7b3 | ishandutta2007/codeforces | amshz/normal/1333/F.cpp | # include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair <int, int> pii;
# define A first
# define B second
# define endl '\n'
# define sep ' '
# define pb push_back
# define InTheNameOfGod ios::sync_with_stdio(0);cin.tie(0); cout.tie(0);
const ll md = 1e9 + 7;
c... | ALGO | 0.999962 | 3.274063 |
28158d11-85d3-4f56-88f3-685d135d945e | 113bommy/deepmind_codecontests_refine | cpp_source_filter_file/cpp_train_5734_4.cpp | #include <iostream>
#include <cstudio>
using namespace std;
int main() {
int a, b;
cin >> a >> b;
printf("%d %d %.8lf\n", a/b, a%b, a/(double)b );
} | ALGO | 0.971753 | 3.157535 |
9da3b4eb-1fc3-4d2c-ba7e-ad26cc418f2b | francofranzini/CP | Codeforces/Round 1037/a.cpp | #include <bits/stdc++.h>
using namespace std;
// Macros
#define fastio ios::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define all(v) (v).begin(), (v).end()
#define sz(v) (int)(v).size()
#define pb push_back
#define fi first
#define se second
#define forn(i, n) for(int i = 0; i<n; i++)
// Typedefs
typedef long lon... | ALGO | 0.999043 | 5.99933 |
713c77ed-52f9-4046-a747-77b81eeb2c55 | AlexandreBinninger/Local-Smooth-Interpolating-MonoCurvature | extern/libigl/include/igl/ray_box_intersect.cpp | template <
typename Derivedsource,
typename Deriveddir,
typename Scalar>
IGL_INLINE bool igl::ray_box_intersect(
const Eigen::MatrixBase<Derivedsource> & origin,
const Eigen::MatrixBase<Deriveddir> & dir,
const Eigen::AlignedBox<Scalar,3> & box,
const Scalar & t0,
const Scalar & t1,
Scalar & tmin,
S... | TEST | 0.999412 | 6.705417 |
f3e9fbde-6bb8-471d-baa3-452679d938e3 | viganesh123/Devil1 | 3 BST(Simple).cpp | #include <iostream>
#include <climits>
#include <stack>
using namespace std;
class TreeNode {
public:
int data;
TreeNode* left;
TreeNode* right;
TreeNode(int value) : data(value), left(nullptr), right(nullptr) {}
};
class BST {
public:
TreeNode* root;
BST() : root(nullptr) {}
void insert(i... | ALGO | 0.999983 | 4.828401 |
6a7338d2-b061-48ab-bd6c-7c8035e6c09c | zhongchong7/opencalib | SensorX2car/lidar2car/3rdparty/g2o/g2o/core/optimization_algorithm_dogleg.cpp | #include "optimization_algorithm_dogleg.h"
#include <iostream>
#include "g2o/stuff/timeutil.h"
#include "block_solver.h"
#include "sparse_optimizer.h"
#include "solver.h"
#include "batch_stats.h"
using namespace std;
namespace g2o {
OptimizationAlgorithmDogleg::OptimizationAlgorithmDogleg(std::unique_ptr<BlockSo... | ALGO | 0.999913 | 6.775023 |
961ee227-4817-4123-b443-09727cc34979 | ryotakano77/atcoder | c++/test3.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int K;
for (int i = 0; i < 2; i++) {
cin >> K;
cout << K+1 << endl;
}
} | ALGO | 0.998341 | 3.424054 |
05361e4d-76a5-47bf-8f6e-35e95fc5a55c | DenizIsikli/LeetCode-CPP | Problemsets/Problems/RabbitsinForest.cpp | #include <vector>
#include <unordered_map>
using namespace std;
class Solution {
public:
int numRabbits(vector<int>& answers) {
unordered_map<int, int> fq;
for (auto &x : answers) fq[x]++;
int cnt = 0;
for (auto &[k, v] : fq) {
int groupSize = k+1;
in... | ALGO | 0.999869 | 6.092268 |
f3cdd9bf-b46d-4a64-8999-6a8ac44b1add | Legion-zialot/s-xray16 | Externals/cryptopp/square.cpp | // square.cpp - originally written and placed in the public domain by Wei Dai
// Based on Paulo S.L.M. Barreto's public domain implementation
#include "pch.h"
#include "config.h"
#include "square.h"
#include "misc.h"
#include "gf256.h"
#if CRYPTOPP_MSC_VERSION
# pragma warning(disable: 4244)
#endif
#if CRYPTOPP_GCC... | ALGO | 0.999722 | 7.323237 |
7462ef56-9a33-4646-8e30-ae8310d57130 | bhanu1129/DSA-codes | Pointers/reference-variable.cpp | #include <iostream>
using namespace std;
void update(int& i){ //Pass by reference
i++;
}
int main(){
int num = 10;
int &num2 = num;
cout<<"Before (num) = "<<num<<endl; //10
cout<<"num2 = "<<num2<<endl; //10
num2++;
cout<<"After (num) = "<<num<<endl; //11
cout<<"num2 = "<<n... | TOOL | 0.998613 | 4.347116 |
d3ec9f91-7b66-4880-96c1-b16eb480835f | GekySan/GB | src/GameBoy/SM83.cpp | #include "SM83.hpp"
#include "GB.hpp"
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cstdint>
void setFlag(SM83* CPU, uint8_t flag, bool value) {
if (value) {
CPU->F |= flag;
}
else {
CPU->F &= ~flag;
}
}
void resolveFlags(SM83* CPU, uint8_t flags, uint8_t pre, uin... | ALGO | 0.980958 | 5.655666 |
c7d36844-3c44-4ef3-a94c-e2135614e454 | GlaucoMasi/CompetitiveProgramming | Olinfo/ois_police4.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int n, r, t, l;
cin >> n >> r >> t >> l;
vector<int> v(n+1); v[0] = 0;
for(int i = 1; i <= n; i++) cin >> v[i];
v.push_back(l);
int ans = 2e9;
vector<vector<int>> dp(n+2, vector<int>(r+1, 2e9));
for(int i = 0; i <= r; i++) dp[0][i] = 0;
f... | ALGO | 0.999871 | 3.259741 |
f2fbca11-9a53-4121-bddd-3178946a2f8b | dearbi/c | 题目/单调栈.cpp |
//数组写法
#include <bits/stdc++.h>
using namespace std;
int main()
{
int n,top=0;
cin>>n;
int a[n];
int l[n];
int stk[n];
for(int i=1;i<=n;i++)
{
cin>>a[i];
}
for(int i=1;i<=n;i++)
{
while(top&&a[stk[top]]>=a[i]) top--;
if(top) l[i]=a[stk[top]];
els... | ALGO | 0.999997 | 4.276353 |
d0c14d31-0ffe-470d-9811-50303bf75fa9 | nakib1948/Competitive-programming | A_Ayat_and_Sorting.cpp | #include<bits/stdc++.h>
using namespace std;
#define ll long long
#define rep(i,n) for(i=0;i<n;i++)
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define debug cout<<"debug"<<endl;
int main()
{
///"In the name of Allah,most gracious and most merciful"///
ll i,j,x,y,z,coun... | ALGO | 0.999774 | 3.098186 |
52255229-a920-4b9c-ac83-de4e41607a47 | manikanta2901/ubuntu | .history/codingChallenges/cpp/Codechef/longChallenges/july/adaKing_20200703164341.cpp | #include<bits/stdc++.h>
#include<vector>
#include<iostream>
#include<cmath>
#include<algorithm>
#include<iterator>
#include<string>
#include<map>
#define F first
#define S second
#define MP make_pair
#define EXECUTE_FASTER ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define printVect(vect,dataStruc... | ALGO | 0.998453 | 3.329153 |
1aadb82c-c556-46ca-80ac-bba9518bcf89 | itsPrajapat/DSA | Recursion/12.cpp | // Permutations of a string
#include<iostream>
using namespace std;
void permutation(string str, string ans){
if(str.length()==0){
cout<<ans<<endl;
return;
}
for(int i=0; i<str.length(); i++){
char ch = str[i];
string ros = str.substr(0, i) + str.substr(i+1);
permu... | ALGO | 0.999967 | 5.242314 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.