uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
f97e4519-0bb1-4664-99de-f60d980dcf25 | Juanseco199/UMNG | 04-06-21/Ejercicio22.cpp | /*
Realizar un programa en C++, que permita mostrar la siguiente figura utilizando
instrucciones repetitivas anidadas:
*
* *
* * *
* * * *
* * * * *
Autor: Juan Sebastián Herrera Bahamón
Fecha: 06/04/2021
*/
#include <iostream>
using namespace std;
int main()
{
system("color a");
int n = 0;
for (int i = ... | ALGO | 0.989105 | 3.504757 |
5b6198cf-8d4d-403a-8716-4758d89831e0 | Nanfengzhiwo1/UE5_2_L | Engine/Source/ThirdParty/Imath/Imath-3.1.3/docs/examples/Matrix33.cpp | #include <Imath/ImathMatrix.h>
#include <Imath/ImathMatrixAlgo.h>
void
matrix33_example()
{
Imath::M33f M (Imath::UNINITIALIZED); // uninitialized
M.makeIdentity();
assert (M[0][0] == 1.0f);
assert (M[0][1] == 0.0f);
Imath::M33f Minv = M.inverse();
Imath::M33f R;
assert (R == Imath::iden... | TEST | 0.984305 | 4.607773 |
68230a83-7da3-4e09-a5c8-9e5c5981a94b | U-DK/LargeX | source/MacOS/heap.cpp | #include "heap.h"
#include <iostream>
Heap::Heap(int max) :capacity(max), size(0)
{
for (int i = 0; i != capacity; ++i)
{
DataInfo f = { 0,0 };
vec.push_back(f);
}
}
Heap::~Heap()
{
}
DataInfo Heap::Peek()
{
return GetData(0);
}
void Heap::Pop()
{
}
void Heap::DownHeap()
{
int bg = 0;
int ed = capac... | TOOL | 0.954795 | 4.369511 |
a636a1f1-335f-4eb1-80d5-a7aeae59f4fb | petrbroz/gill | src/core/math.cpp | #include <vector>
#include <algorithm>
#include "core/math.h"
namespace gill { namespace core {
using namespace std;
struct Sample {
float x, y;
bool operator<(const Sample &rhs) const { return x < rhs.x; }
};
float average_samples(const vector<Sample> &samples, float x0, float x1) {
int num_samples = s... | ALGO | 0.999662 | 5.752874 |
95fe1e2f-1065-425e-a45a-bc3e339a583d | tofazzal-shuvo/competitive_programming | codeforces/A. Required Remainder.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
int t;
cin>>t;
while(t--)
{
int x,y,n;
cin>>x>>y>>n;
cout<<((n-y)/x)*x+y<<endl;
// int d = n/x;
// do
// {
// if((d*x)+y<=n)
// {
// cout<<(x*d)+y<<endl;
// ... | ALGO | 0.999954 | 3.478497 |
46db591d-8f07-4b83-88f9-824a89cd81a0 | Jackesgamero/Solved-ACR-problems | Problemas/292 - Repartiendo paquetes/26 - Repartiendo paquetes/Source.cpp | // Autor : Jaime Martinez Gamero
#include <iostream>
#include <vector>
#include <queue>
#include <map>
#include <limits.h>
#include <memory>
#include <stdexcept>
template <typename Valor>
class AristaDirigida {
public:
AristaDirigida() : pimpl(nullptr) {}
AristaDirigida(int v, int w, Valor valor) : pimpl(std::make... | ALGO | 0.999945 | 4.459094 |
30eddd12-59f3-48e6-babe-388c209046db | ishandutta2007/codeforces | dancho/normal/587/F.cpp | #include <algorithm>
#include <cstdio>
#include <cstring>
#include <vector>
using namespace std;
const int lim = 320;
int ln = 0;
struct T {
int next, son[26], id;
};
int lnd = 2, R = 1;
T nds[1 << 17];
int where[100020], C[100020];
int fin[100020];
vector<int> a[100020];
vector<int> son[100020];
int ag[100020... | ALGO | 0.999835 | 3.89984 |
d2343efa-def0-4943-8bd2-f986df00797f | vasubansal1033/DSA_dups | Datastructures/009 Priority Queues or Heap/014 kFrequentWords.cpp | typedef pair<int, string> p;
class Solution {
public:
vector<string> topKFrequent(vector<string>& words, int k) {
unordered_map<string, int> m;
for(int i=0; i<words.size(); i++){
m[words[i]]++;
}
auto myComparator = [&](p a, p b){
if(a.first==b.first)
... | ALGO | 0.999992 | 6.229557 |
9990ecd1-f4fc-46e4-96d9-3b2a160e6f31 | lpr16/beecrowd | bee1019.cpp | /*******************************************
1019
Read an integer value, which is the duration in seconds of a certain event in a factory,
and inform it expressed in hours:minutes:seconds.
Input
The input file contains an integer N.
Output
Print the read time in the input file (seconds) converted in hours:minutes:s... | ALGO | 0.994311 | 4.83977 |
4ac18869-32d8-4f92-b76b-d05bd4226b37 | calofmijuck/BOJ | Codes/14400/14499.cpp | #include <bits/stdc++.h>
using namespace std;
int arr[22][22], dx[5] = {0, 0, 0, -1, 1}, dy[5] = {0, 1, -1, 0, 0};
class Dice {
public:
int up, down, north, east, south, west;
Dice() {
up = down = north = east = south = west = 0;
}
void rollN() {
int tmp = up;
up = south;
... | ALGO | 0.99994 | 4.479764 |
bcacb42b-c9ef-4826-97fb-e6ec6563d0a0 | SRIJAN-KUMAR7/Codeforces... | oddeevn.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
long long n, k;
cin>>n>>k;
long long odd_count = (n + 1)/2;
if (k <= odd_count){
cout << 2 *k - 1 << endl;
} else{
cout << 2 *(k -odd_count) << endl;
}
return 0;
}
| ALGO | 0.999958 | 3.757522 |
1bf33dc4-09eb-46d4-8add-4fdfb0de3db9 | ishabhray/Competitive-Programming | codeforces/1559B.cpp | #include <bits/stdc++.h>
using namespace std;
#define PI 3.141592653589
#define ll long long int
#define ld long double
#define vi vector<int>
#define vl vector<ll>
#define ii pair<int,int>
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define pll pair<ll,ll>
#define vv vector
#define al... | ALGO | 0.999961 | 4.394422 |
42b8f081-929d-4fc1-9399-6caa9c56dc12 | ishandutta2007/codeforces | pavelkunyavskiy/normal/1158/C.cpp | #include <iostream>
#include <fstream>
#include <vector>
#include <set>
#include <map>
#include <cstring>
#include <string>
#include <cmath>
#include <cassert>
#include <ctime>
#include <algorithm>
#include <sstream>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <cstdlib>
#include <cstdio>... | ALGO | 0.999848 | 3.91871 |
c99b8a07-6991-4a33-92ed-e1a4d95ebce7 | OpenXRay/xray-soc-history | xr_3da/xrGame/AI/Monsters/ai_monster_squad_rest.cpp | #include "stdafx.h"
#include "ai_monster_squad.h"
#include "../../entity.h"
#include "../../ai_object_location.h"
void CMonsterSquad::ProcessIdle()
{
m_temp_entities.clear();
VERIFY(leader && !leader->getDestroy());
//
for (MEMBER_GOAL_MAP_IT it_goal = m_goals.begin(); it_goal != m_goals.end(); it_goal++... | ALGO | 0.992873 | 4.988104 |
9b1f6c0a-bee2-441a-9e6c-1f0a1b097ff7 | harshjoshiiii/C-PLUS-PLUS-WITH-HARSH | SECTION_1_BASIC/increment4.cpp | #include<iostream>
using namespace std;
int main(){
int x=5;
int y;
y=++x;
cout<<x<<endl;
cout<<y<<endl;
return 0;
}
// isme y=++x hai to phle ++x hoga than
// eual to y mtlb x ki value 6 and y ki
// value bhi 6 | TOOL | 0.995433 | 3.169264 |
d87e9e32-47ba-41cf-807e-051d6d98679f | ericbrandwein/competencias | Codeforces/1269/b/b.cpp | //#pragma GCC optimize("Ofast")
//#pragma GCC optimize("unroll-loops,no-stack-protector")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#include <bits/stdc++.h>
#define IOS ios::sync_with_stdio(false);cin.tie(0);cout.tie(0)
#define endl '\n'
#define elif else if
#define ll long long i... | ALGO | 0.999986 | 3.668647 |
843ea7a3-aa5f-4dff-b324-1b7a44d87c79 | ishandutta2007/codeforces | al3xstr33t/normal/1508/E.cpp | #include<bits/stdc++.h>
using namespace std;
const int maxN = 300009, maxLog = 20;
int sons[maxN], t[maxN], p[maxN], pos[maxN], lev[maxN], N;
bool active[maxN], everActive[maxN];
long long sum = 0;
vector < int > v[maxN], ans[maxN];
bool DBG;
void dfs (int nod)
{
for (auto it : v[nod])
lev[it] = lev[nod]... | ALGO | 0.999981 | 3.712983 |
2873683c-dc04-4704-9bab-315107db28a0 | Vishu-hp/FJP-DSA | Level-1/Recursion/getMazePaths.cpp | #include<iostream>
#include<vector>
using namespace std;
// sr - source row
// sc - source column
// dr - destination row
// dc - destination column
// vector <string> getMazePaths(int sr, int sc, int dr, int dc) {
// if(sr==dr && sc==dc){
// vector<string>base;
// base.push_back("");
// r... | ALGO | 0.999639 | 3.110477 |
727008df-c196-4277-a65a-e1a2e8262ef5 | iprosenjitp/Online-Judge | LeetCode/2-Add Two Numbers.cpp | #include <bits/stdc++.h>
#define ll long long
using namespace std;
struct ListNode
{
int val;
ListNode *next;
};
ListNode *createListNode(int val, ListNode *next)
{
ListNode *newNode = (ListNode *)malloc(sizeof(ListNode));
newNode->val = val;
newNode->next = next;
return newNode;
}
void prin... | ALGO | 0.999862 | 4.360419 |
3b2b54d4-e366-4076-a080-40d0be19814e | lwher/Algorithm-exercise | C++/BZOJ/BZOJ 1609.cpp | #include<iostream>
#include<cstring>
using namespace std;
int a[100000],best[100000];
int main()
{
long long int n;
long long int i;
cin>>n;
for (i=1;i<=n;++i)
cin>>a[i];
long long l=1,ans=0,r=0;
for (i=1;i<=n;++i)
{
... | ALGO | 0.999978 | 4.053946 |
c5347ee2-203e-4262-9ded-8e82cacbe8d8 | everything411/BIT_Exercises | ACM/code/2019BIT冬训-二分三分快速幂矩阵快速幂/template/int_bin_search.cpp | /*
int solve()
{
//ret记录满足条件的最优解
int left = 0, right = sum / k, ret = 0;
while (left <= right)
{
mid = left + (right - left) / 2;
if (count(mid) >= k)
{
ret = mid;
left = mid + 1;
}
else
right = mid - 1;
}
return ret;
}
... | ALGO | 0.999978 | 3.469271 |
8d26e273-c04b-4d7f-92e3-2cc59b67c933 | YuvrajxChopra/CodeQuotient-Programming_Abstraction | CodeQuotient - Programming Abstraction/Section-1/findTheLeaders.cpp | /*
Leaders in an array
Given an array, you have to print the LEADER elements of it. An element is called LEADER if it is greater than all the elements to its right side, note that the rightmost element is always a leader.
For example in the array {12, 27, 14, 11, 25, 6, 7}, leaders are 27, 25 and 7.
Complete the fun... | ALGO | 0.999959 | 3.186802 |
79a6e790-e051-481c-b14b-bda0dcfe18e7 | jiayishen21/leetcode | 2420-medium.cpp | #include <iostream>
#include <vector>
using namespace std;
/*
2420. Find All Good Indices
Leetcode medium
https://leetcode.com/problems/find-all-good-indices/
time: 50 minutes
notes:
i made WAYYYYY too many careless mistakes (forgetting to update code in multiple parts, etc.)
which caused me to waste a lot of time deb... | ALGO | 0.999915 | 5.75873 |
bb5bd201-0f37-49c4-8b91-5fca8a9c612b | PlasmaControl/FreeMHD | OpenFOAM-v2206/ThirdParty/sources/boost/boost_1_74_0/libs/compute/test/test_radix_sort.cpp | #define BOOST_TEST_MODULE TestRadixSort
#include <boost/test/unit_test.hpp>
#include <iostream>
#include <boost/compute/system.hpp>
#include <boost/compute/algorithm/is_sorted.hpp>
#include <boost/compute/algorithm/detail/radix_sort.hpp>
#include <boost/compute/container/vector.hpp>
#include "quirks.hpp"
#include "c... | TEST | 0.859623 | 7.227653 |
541d9301-189b-4d95-a80f-b4728f9a4ebf | ari1337an/Algorithm-Vault | String Algorithm/String Hashing/Heavy/Examples/String Search.cpp | vector<string> a = {"abc","edf","sdf","bacs","home"};
vector<string> q = {"edf","bacs","sdx"};
// PRE PROCESS
vector<ll> a_hash((int)a.size());
for (int i = 0; i < a.size(); ++i) {
a_hash[i] = StringHash(a[i]).forward_hash();
}
// Dont Forget
sort(all(a_hash));
// QUERIES
// O(|q|)
int cnt = 0;
for (int i = 0; i < q... | ALGO | 0.999646 | 5.039323 |
f11fd514-61ae-4985-b664-cfbfe7facd9d | mcrescas/viltrum-mitsuba | mitsuba/src/librender/vpl.cpp | #include <mitsuba/render/vpl.h>
#include <mitsuba/core/plugin.h>
#include <mitsuba/core/statistics.h>
MTS_NAMESPACE_BEGIN
static StatsCounter prunedVPLs("VPL renderer", "Pruned VPLs", EPercentage);
static void appendVPL(const Scene *scene, Random *random,
VPL &vpl, bool prune, std::deque<VPL> &vpls) {
pruned... | ALGO | 0.916355 | 6.556772 |
752680fc-8bc4-4bad-91a5-c60d88204a59 | AraujoStreicher/maratona-de-programacao-2024 | Aula3/Maximum.cpp | /*
Gabriel Araujo Streicher
Maratona 2024
UFSCar Sorocaba
*/
#include <bits/stdc++.h>
using namespace std;
int main(){
int n;
int array[10][10];
cin >> n;
for(int i = 0; i < n; i++){
array[0][i] = 1;
array[i][0] = 1;
}
for(int i = 1; i < n; i++){
for(int ... | ALGO | 0.999961 | 4.824035 |
d2e082cb-8c65-4657-afbc-234652b7e4d4 | hellozts4120/DS-homework | MidReview/Anagram Groups.cpp | #include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
struct word{
char str[50];
char tras[50];
}WordIn[30005];
struct collect{
char str[50];
int size;
int start;
}WordGroup[30005];
int cmp1(word a, word b){
if(strcmp(a.tras,b.tras) != 0){
return (strcmp(a.tras,b.tras... | ALGO | 0.99979 | 3.280053 |
fd787cc7-5aef-432e-b2b3-cc9897a94b2c | Ilyassov/Magma-GOST-R-34.12-2015-p.5-with-modes-GOST-R-34.13-2015 | magma.cpp | #include "headers.h"
int main (int argc, char *argv[]) {
try {
std::vector <char> c_fl(14, 0); //Количество каждого флага в вызове функции
check_args(argc, argv, c_fl);
std::vector <unsigned long long> text; //Вектор для хранения текста по 8 байт
std::vector <unsigned long long> ctext; //Век... | ALGO | 0.973887 | 3.78874 |
15ae86f8-b982-4421-9765-aa9d723ad92e | tasumath/rule_code_solution | A52.cpp | #include<iostream>
#include<vector>
#include<cmath>
#include<stack>
#include<string>
#include<queue>
using namespace std;
int q;
int querytype[100009];
int main(){
cin>>q;
queue<string> s;
for(int i=1;i<=q;i++){
cin>>querytype[i];
if(querytype[i]==1){
string t;
cin... | ALGO | 0.998234 | 4.485302 |
07ae4233-6eae-4cab-9e62-2b4105c4baac | jdnull/LeetCode | 143 Reorder List/main.cpp | #include <iostream>
using namespace std;
struct ListNode {
int val;
ListNode *next;
ListNode(int x) : val(x), next(NULL) {}
};
void reorderList(ListNode *head) {
if (head == NULL || head->next == NULL) return ;
int count = 0, ascendCount;
ListNode *p = head, *q = NULL, *ascendHead = head... | ALGO | 0.999979 | 5.028782 |
ae4bd9cb-d05a-4977-9bc8-4f3fbf4afd76 | quatchi13/Seasons-Greetings | Season's Greetings/SpriteLib3.0-v2.0/include/Box2D/Dynamics/Joints/b2FrictionJoint.cpp | #include "Box2D/Dynamics/Joints/b2FrictionJoint.h"
#include "Box2D/Dynamics/b2Body.h"
#include "Box2D/Dynamics/b2TimeStep.h"
// Point-to-point constraint
// Cdot = v2 - v1
// = v2 + cross(w2, r2) - v1 - cross(w1, r1)
// J = [-I -r1_skew I r2_skew ]
// Identity used:
// w k % (rx i + ry j) = w * (-ry i + rx j)
//... | ALGO | 0.991982 | 7.574437 |
5585e10c-3bb2-4401-8114-633504fa7017 | fmaker/base | media/libstagefright/codecs/aacdec/pv_sqrt.cpp | /*
Filename: pv_sqrt.c
------------------------------------------------------------------------------
REVISION HISTORY
Who: Date: MM/DD/YYYY
Description:
------------------------------------------------------------------------------
INPUT AND OUTPUT DEFINITIONS
Int32 x ... | ALGO | 0.999945 | 5.005769 |
850317d4-80e9-4279-8384-df544e9f9664 | kjm99d/VideoTalk | lib/opencv/sources/modules/features2d/src/matchers.cpp | #include "precomp.hpp"
#ifdef HAVE_OPENCV_FLANN
#include "opencv2/flann/miniflann.hpp"
#endif
#include <limits>
#include "opencl_kernels_features2d.hpp"
#if defined(HAVE_EIGEN) && EIGEN_WORLD_VERSION == 2
# if defined(_MSC_VER)
# pragma warning(push)
# pragma warning(disable:4701) // potentially uninitialized ... | ALGO | 0.952114 | 6.695684 |
270968c0-ab7d-4619-803a-ff1707555a91 | Kawser-nerd/CLCDSA | Source Codes/CodeJamData/15/61/17.cpp | #include <cstdio>
#include <algorithm>
#include <vector>
#include <queue>
#include <deque>
#include <stack>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <string>
#include <cassert>
#include <cmath>
#include <cstring>
#include <functional>
using namespace std;
typedef vector<i... | ALGO | 0.999234 | 3.754488 |
cf46add5-a827-4f24-a12c-dc2fd80c4f95 | Jiyugaoka/Algorithm-video-solution | leetcode/top-interview-questions/C++/删除链表中的节点_ejg.cpp | /**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode(int x) : val(x), next(NULL) {}
* };
* https://leetcode-cn.com/problems/shan-chu-lian-biao-de-jie-dian-lcof/
*/
class Solution {
public:
void deleteNode(ListNode* node) {
node->val = node-... | ALGO | 0.999815 | 5.67251 |
82a340a9-5e2d-4af3-8e52-1f9883d3999e | plaichat1986/eos | contracts/libc++/upstream/test/std/algorithms/alg.sorting/alg.sort/stable.sort/stable_sort_comp.pass.cpp | // <algorithm>
// template<RandomAccessIterator Iter, StrictWeakOrder<auto, Iter::value_type> Compare>
// requires ShuffleIterator<Iter>
// && CopyConstructible<Compare>
// void
// stable_sort(Iter first, Iter last, Compare comp);
#include <algorithm>
#include <functional>
#include <vector>
#include <ra... | TEST | 0.990305 | 6.691721 |
7b63c137-5452-4083-af50-e6124c583427 | ishandutta2007/codeforces | izban/normal/317/A.cpp | #include <iostream>
#include <string>
#include <map>
#include <math.h>
#include <vector>
#include <algorithm>
#include <cstdio>
#include <set>
#include <queue>
#include <sstream>
#include <deque>
#include <memory.h>
using namespace std;
#define ll long long
#pragma comment(linker, "/STACK:64000000")
const int maxn ... | ALGO | 0.999985 | 3.649087 |
65adea35-412a-43e9-97e6-a6e54e1a92ee | raincross7/code-similarity | codes/train_code/problem383/problem383_439.cpp | #include <bits/stdc++.h>
using namespace std;
int main(){
int N;
cin>>N;
string B[N];
for(int i=0;i<N;i++) cin>>B[i];
int M;
cin>>M;
string R[M];
for(int i=0;i<M;i++) cin>>R[i];
int A=0;
for(int i=0;i<N;i++){
int sum=0;
for(int j=i;j<N;j++){
if(B[i]==B[j]) sum++;
}
for(int k=0... | ALGO | 0.999561 | 4.152202 |
e99727cd-8d8a-479f-a1a1-0eeee916630e | MauraPeterson/CPP | Basic_Concepts/numberGuessingGame.cpp | #include <iostream>
#include <ctime>
#include <string>
#include <vector>
#include <fstream>
#include <cmath>
using namespace std;
void print_vector(vector<int> &vector){
for(int num : vector){
cout << num << " ";
}
cout << endl;
}
int get_best_score(){
ifstream input("best_score.txt");
if(!input.is_op... | TOOL | 0.937865 | 4.304717 |
eb00b1b5-a363-40dc-9b1d-97cfe72fd75b | kjm99d/VideoTalk | lib/opencv/sources/modules/video/src/tracking/detail/tracker_feature.cpp | #include "../../precomp.hpp"
#include "opencv2/video/detail/tracking.detail.hpp"
namespace cv {
namespace detail {
inline namespace tracking {
TrackerFeature::~TrackerFeature()
{
// nothing
}
void TrackerFeature::compute(const std::vector<Mat>& images, Mat& response)
{
if (images.empty())
return;
... | ALGO | 0.983991 | 6.804374 |
c6e1ac39-aa10-455c-8ecb-0a05457eaaab | smartzcy/My_vscode | C_learn/2023_7/2023_7_7/D.cpp | #include <iostream>
#include <algorithm>
using namespace std;
const int INF = 1e9;
const int N = 1e5 + 10;
int n, q, l[N], r[N];
int tot, ls[N], rs[N], sum[N], a[N], rt[N];
void change(int &rt, int pre, int l, int r, int pos) {
rt = ++tot;
ls[rt] = ls[pre], rs[rt] = rs[pre], sum[rt] = sum[pre] + 1;
if (l ==... | ALGO | 0.999902 | 3.622019 |
fc8257f3-34c2-4219-b080-a9d233204b91 | hungaikev/cs-101 | lib/observer/main.cpp | /*****************************************************************************
* Face Recognition using Eigenfaces or Fisherfaces
******************************************************************************
// Face Detection & Face Recognition from a webcam using LBP and Eigenfaces or Fisherfaces.
// Requires OpenC... | ALGO | 0.937362 | 5.734409 |
0b172411-b414-4d08-a57b-c76773cd05f0 | mayurimahto/Leetcode | 0540-single-element-in-a-sorted-array/0540-single-element-in-a-sorted-array.cpp | class Solution {
public:
int singleNonDuplicate(vector<int>& nums) {
int n=nums.size();
if(n==1) return nums[0];
if(nums[0]!=nums[1]) return nums[0];
if(nums[n-2]!=nums[n-1]) return nums[n-1];
int low=1;
int high=n-2;
while(low<=high){
... | ALGO | 0.999975 | 5.762013 |
88a185b7-e73d-4e44-ad8a-a06e5b557ffa | shuleyu/CPP-Library-Examples | CrossStd2D.cpp | #include<iostream>
#include<vector>
#include<CrossStd2D.hpp>
using namespace std;
int main(){
vector<vector<double>> s1,s2;
s1.push_back({0,0,0,0,0});
s1.push_back({0,1,1,2,0});
s1.push_back({0,1,2,4,0});
s1.push_back({0,1,5,2,0});
s1.push_back({0,0,0,0,0});
s2.push_back({1,2});
s2... | ALGO | 0.997248 | 3.875241 |
64b97d20-f78e-405d-bdf3-c2fed89cad89 | Ayushd70/LeetCodeSolutions | CPP/Cherry-Pickup-II.cpp | class Solution {
private:
// Let's run a simple dfs. If we come to the same cell with two robots, let's subtract that value.
int dfs(int n, int m, int r, int c1, int c2, unordered_map<pair<int, pair<int, int>>, int> &dp, vector<vector<int>> &grid) {
if (c1 < 0 || c1 >= m || c2 < 0 || c2 >= m) {
... | ALGO | 0.999981 | 6.195096 |
4d98f5db-06e7-4c01-90df-5b3e930a8fb2 | NafiHasan/HabiJabi | C++/Codeforces Contests/CF div 2 and div 3/Round 743/a.cpp | #include <bits/stdc++.h>
using namespace std;
#define fast_io() ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL)
int main() {
fast_io();
int tc;
cin >> tc;
while (tc--) {
int n;
string s;
cin >> n >> s;
int ans = 0;
for (int i = 0; i < n - 1; i++) {
if (s[i] != '0') {
ans += (s[i] ... | ALGO | 0.999507 | 4.634115 |
429d57be-fec2-4649-b7cc-9f0dec8df8e0 | sergey-pashaev/practice | cpp/ya/src/stones-and-jewelry.cpp | // stones and jewelry
// Даны две строки строчных латинских символов: строка J и строка
// S. Символы, входящие в строку J, — «драгоценности», входящие в
// строку S — «камни». Нужно определить, какое количество символов из
// S одновременно являются «драгоценностями». Проще говоря, нужно
// проверить, какое количеств... | ALGO | 0.962808 | 5.622535 |
05dc8293-5ce3-4a5c-8bd9-0b0f331f86d2 | Rohitkr2510/365Days_Challenge | 0881-boats-to-save-people/0881-boats-to-save-people.cpp | class Solution {
public:
int numRescueBoats(vector<int>& people, int limit) {
sort(people.begin(),people.end());
int countBoat = 0;
for(int l=0, r=people.size()-1;l<=r;r--) {
countBoat++;
if(people[l] + people[r] <= limit) {
l++;
}... | ALGO | 0.999997 | 5.969059 |
5f8eb970-6dd8-4fb7-a8c0-6d67ffa1d225 | Ferruccio1984/OblivionAerial-HeliPilot | libraries/AC_PID/AC_PID_2D.cpp | /// @file AC_PID_2D.cpp
/// @brief Generic PID algorithm
#include <AP_Math/AP_Math.h>
#include "AC_PID_2D.h"
#define AC_PID_2D_FILT_HZ_DEFAULT 20.0f // default input filter frequency
#define AC_PID_2D_FILT_HZ_MIN 0.01f // minimum input filter frequency
#define AC_PID_2D_FILT_D_HZ_DEFAULT 10.0f // default... | ALGO | 0.998967 | 5.83917 |
51017bcc-e9b3-44f0-a01c-37391157232e | YUNJAEGOONER/Data_Structure_withC | Sort/Bubble_sort.cpp | #include <iostream>
using namespace std;
void Bubble_Sort(int array[5],int size) {
for (int i = 0; i < size - 1 ; i++) {
for (int j = 0; j < size - 1 -i; j++) {
if (array[j] > array[j + 1]) {
int temp = array[j+1];
array[j + 1] = array[j];
array[j] = temp;
}
}
}
for (int i = 0; i < size ; i+... | ALGO | 0.999483 | 3.8732 |
495f3d34-4eb9-4c5e-b694-72f4509df8b7 | rehankmil/LP1DPBO2024C1 | DPR.cpp | // Import Library
#include <iostream>
#include <string>
// Using standard namespace
using namespace std;
// Class declaration, For C++, the first letter doesn't have to be
// capitalized, but it's better so we can distinguish it with the other types
class DPR
{
// Private attribute
private:
string id;... | TOOL | 0.852567 | 6.145992 |
b480ce8b-e780-40c6-9282-80b4b72b5717 | CaQtiml/Problem-Solved | treasure.cpp | #include "bits/stdc++.h"
using namespace std;
#define ll long long
ll arr[(int)2e5] , qs[(int)2e5];
ll fans(ll r1,ll r2,ll r3)
{
ll c1=abs(r2-r1);
ll c2=abs(r3-r1);
ll c3=abs(r3-r2);
return max(max(c1,c2),c3);
}
int main()
{
int n;
cin >> n;
for(int i=1;i<=n;i++)
{
cin >> arr[i];
qs[i]=qs[i-1]+arr[i];
}
l... | ALGO | 0.999957 | 3.822029 |
82967c72-e5d7-4f40-8fe2-26f1911abff8 | CruzPort/100-days-coding | Day 87/Subarray product less than k.cpp | class Solution {
public:
int numSubarrayProductLessThanK(vector<int>& nums, int k) {
ios_base::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL);
if (k == 0)
return 0;
int n = nums.size(), product = 1, cnt {};
int l = 0, r = 0;
while(r < n)
{
... | ALGO | 0.999907 | 5.227533 |
69ad82d5-a979-4800-b27e-eb652df9105b | Akashkumar888/cpp_programming | DSA_2025/word_search_ii.cpp |
#include <vector>
#include <string>
using namespace std;
int m, n;
vector<vector<int>> directions{{1, 0}, {0, 1}, {-1, 0}, {0, -1}};
class TrieNode {
public:
bool endofword;
string word;
TrieNode* children[26];
TrieNode() {
for (int i = 0; i < 26; i++) {
children[i] = NULL;
... | ALGO | 0.999919 | 6.802588 |
05027110-93b9-4894-ac5c-93d05a03d493 | pranavbhosale25/data-structures | linked-list-1/add-linked-list.cpp | /**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode() : val(0), next(nullptr) {}
* ListNode(int x) : val(x), next(nullptr) {}
* ListNode(int x, ListNode *next) : val(x), next(next) {}
* };
*/
class Solution {
public:
ListNode* addTwoNumbe... | ALGO | 0.999889 | 6.135157 |
1736dff2-cccf-47be-a31e-007c5a276a56 | GreatGameDota/leetcode-challenges | easy/maximum-number-of-pairs-in-array/solution.cpp | class Solution
{
public:
vector<int> numberOfPairs(vector<int> &nums)
{
int seen[101] = {};
for (int &i : nums)
seen[i]++;
int cnt = 0, cnt2 = 0;
for (int i = 0; i < 101; i++)
{
cnt += seen[i] / 2;
cnt2 += seen[i] % 2;
}
... | ALGO | 0.999684 | 5.548616 |
e1452dfe-a031-4093-b78c-2f2b5927a0a9 | kuroweb/mathematics-algorithm | example/editorial/chap4-4/prob4-4-3.cpp | #include <iostream>
using namespace std;
long long N;
long long F[10000009];
long long Answer = 0;
int main() {
// 入力 → 配列の初期化
cin >> N;
for (int i = 1; i <= N; i++) F[i] = 0;
// F[1], F[2], ..., F[N] を計算する
for (int i = 1; i <= N; i++) {
// F[i], F[2i], F[3i], ... に 1 を加算
for (int j = i; j <= N; j += i) F[... | ALGO | 0.999967 | 4.425767 |
513afeb6-5f66-4193-b59f-5fbef6ed3961 | ishandutta2007/codeforces | ugly2333/normal/1442/B.cpp | //CF1442B
#include<iostream>
#include<cstdio>
#include<fstream>
#include<algorithm>
#include<vector>
#include<map>
#include<set>
#include<queue>
#include<bitset>
#include<cmath>
#include<cstring>
#include<cstdlib>
using namespace std;
typedef long long LL;
typedef double DB;
const int N = 222222;
const int MO = 9982443... | ALGO | 0.999988 | 3.680634 |
06abbac2-781e-4859-a96c-6a567a43fb3b | iuriizhesson/far2l | multiarc/src/formats/rar/unrar/unpack50.cpp | void Unpack::Unpack5(bool Solid)
{
FileExtracted=true;
if (!Suspended)
{
UnpInitData(Solid);
if (!UnpReadBuf())
return;
// Check TablesRead5 to be sure that we read tables at least once
// regardless of current block header TablePresent flag.
// So we can safefly use these tables below... | TOOL | 0.981269 | 3.901539 |
fa75b9b2-753a-481e-881e-39845ac21200 | 2lian/Legged-Robot-Movability-Cuda | externals/eigen-3.4.0/failtest/qr_int.cpp | #include "../Eigen/QR"
#ifdef EIGEN_SHOULD_FAIL_TO_BUILD
#define SCALAR int
#else
#define SCALAR float
#endif
using namespace Eigen;
int main()
{
HouseholderQR<Matrix<SCALAR,Dynamic,Dynamic> > qr(Matrix<SCALAR,Dynamic,Dynamic>::Random(10,10));
}
| TEST | 0.905109 | 3.076401 |
67a54c43-f4d1-49bb-95fe-32c3963b7860 | kundan2510/comp_codes | chicago.cpp | #include <bits/stdc++.h>
#define infi 100000000
using namespace std;
template <class T>
class min_heap
{
vector <T> heap;
public:
int size(void){ return heap.size();}
void heapify(int index)
{
int i = index;
T t;
int j = heap.size();
while(i <= j/2 - 1)
{
if(heap[i] > heap[2*i])
{
t... | ALGO | 0.999862 | 3.856501 |
e635f205-ba2b-434c-a8b2-a3db2c1dea90 | gromitsun/algorithm | binary-search/74-search-a-2d-matrix.cpp | class Solution {
public:
bool searchMatrix(vector<vector<int>>& matrix, int target) {
// check if matrix is empty
if (matrix.empty() || matrix[0].empty())
return false;
// check if target is smaller than the smallest in matrix
if (target < matrix[0][0])
... | ALGO | 0.999983 | 6.363425 |
2dfcd462-bbb3-4b16-b879-5d56048c50e9 | Nerer/Mjolnir | 2016.07.28-Dhaka2012/F.cpp | #include <cstdio>
#include <iostream>
#include <cstdlib>
#include <cmath>
#include <cstring>
#include <iostream>
using namespace std;
int n, q, Case;
char tmp[128];
char s[128];
char A[128][128][128];
int cnt[128][128];
int main()
{
scanf("%d%d", &n, &q);
scanf("%s", s + 1);
for(int i = 1; i <= n; i++)
{
for(int ... | ALGO | 0.998636 | 3.460731 |
fb1e3e0c-f69b-434d-9b8d-3110df7c3e83 | Rivuozil/DSA-AND-CP-FOR-BEGINNERS | An_Interesting_Sequence.cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
int t;
cin>>t;
for(int g=0;g<t;g++){
long int k;
cin>>k;
long int i=0;
for(k;;k=k/2)
{
if(k%2!=0)
break;
else
i++;
}
cout<<i<<endl;
}
return 0;
} | ALGO | 0.999691 | 4.004348 |
2b58334f-524a-4e4f-92eb-dbc7161ff939 | ishandutta2007/codeforces | fastmath/normal/1463/A.cpp | #include<bits/stdc++.h>
using namespace std;
#define int long long
#define ii pair <int, int>
#define app push_back
#define all(a) a.begin(), a.end()
#define bp __builtin_popcountll
#define ll long long
#define mp make_pair
#define f first
#define s second
#define Time (double)clock()/CLOCKS_PER_SEC
#define debug(x) st... | ALGO | 0.999907 | 4.75503 |
ed1324e7-b24b-42eb-a6fd-cd2bbb831f89 | Atanusaha143/Competitive-Programming | Toph/Concatenation of Perfect Squares.cpp | #include <bits/stdc++.h>
using namespace std;
#define NL '\n'
#define PINF INT_MAX
#define NINF INT_MIN
#define sz(x) x.size()
#define PB push_back
#define MP make_pair
#define asort(x) sort(all(x));
#define PI (2.0*acos(0.0))
#... | ALGO | 0.999547 | 4.233235 |
7c47de76-a3fc-4b5b-bf59-2406fcaf3be8 | JimWongM/OptFuzz | webkit_for_optfuzz/Tools/DumpRenderTree/CyclicRedundancyCheck.cpp | #include "config.h"
#include "CyclicRedundancyCheck.h"
#include <wtf/Vector.h>
static void makeCrcTable(unsigned crcTable[256])
{
for (unsigned i = 0; i < 256; i++) {
unsigned c = i;
for (int k = 0; k < 8; k++) {
if (c & 1)
c = -306674912 ^ ((c >> 1) & 0x7fffffff);
... | TOOL | 0.961547 | 6.577574 |
b1ec77b2-5b03-4e11-a54d-0c619e051427 | Reinn90/OOP | Prac3/Task3-2.cpp | #include <iostream>
#include <iomanip>
#include <ctime>
using namespace std;
const int ROWS = 3;
const int COLS = 4;
void getUserInput(int &rowIndex, int &colIndex)
{
int row, col;
cout << "Using the matrix above, this program will print out what the values adjacent to user input contain." << endl;
cout... | ALGO | 0.982941 | 3.45403 |
9ce1fcb0-99d6-4636-b496-59148d954531 | zhucongx/KN | kn/ansys/src/ClusterExpansion.cpp | #include "ClusterExpansion.h"
#include "Cluster.hpp"
namespace ansys::ClusterExpansion {
using Singlet_t = cfg::Cluster<1>;
using Pair_t = cfg::Cluster<2>;
using Triplet_t = cfg::Cluster<3>;
std::unordered_map<std::string, std::vector<double> > GetOneHotEncodeHashmap(
const std::set<std::string> &type_set) {
s... | ALGO | 0.998517 | 5.592463 |
7b076fb1-dfe6-4c86-8ac3-cf9713b80611 | itsanshulverma/du-cs-undergrad-course | Semester3/DataStructures/Practicals/stacks/13. Sum of polynomials/polynomial_sum.cpp | /*
By Anshul Verma
19/78065
*/
#include <iostream>
using namespace std;
/******************************************
Polynomial Class (OLL)
*******************************************/
class Polynomial {
struct term {
int coeff, pow;
struct term *next;
};
struct term *head, *ptr, *temp, *tail;
public:
... | ALGO | 0.990431 | 4.31554 |
e323f045-59be-4a35-845c-b4dcb44e0acf | chirag-periwal/Project-Euler-Solutions | problem16.cpp | #include<bits/stdc++.h>
using namespace std;
#define ll long long int
ll power(ll a, int b){
ll res=1;
while(b!=0){
if(b%2==1) {
res=res*a;
}
a=a*a;
b=b/2;
}
return res;
}
int main(){
// from python
string s="<BASE64_DATA>";
int sum=0;
for(int i=0;i<s.length();i++){
int k=s[i]-'0';
sum=sum+k;
}
... | ALGO | 0.991434 | 3.988566 |
1e049007-e611-4a7f-9dc7-f57c8ba7b845 | Harsha13-os/LeetCode | 258-add-digits/add-digits.cpp | class Solution {
public:
int addDigits(int num) {
if (num == 0)
return 0;
return 1 + (num - 1) % 9;
}
}; | ALGO | 0.99989 | 6.301698 |
ef46934f-4f8b-4303-b04d-d4fd1d8e3d4e | sonapraneeth-a/competitive-programming_submissions | platforms/leetcode/practice/non-premium/medium/1387__sort-integers-by-the-power-value/solutions.cpp | // clang-format off
/**
* FILE DESCRIPTION
*
* Filename: 1387__sort-integers-by-the-power-value/solutions.cpp
* Created on: 05 September 2021
* Last modified: 05 September 2021
* Author: sonapraneeth_a
* Description: LeetCode submission for 'Sort Integers by The Power Value' problem
... | ALGO | 0.999893 | 5.695358 |
5d9f1863-c6df-4e70-825f-f757e27cf452 | lin376186421/OwenLin2 | MyGame/cocos2d/cocos/storage/local-storage/LocalStorage-android.cpp | /*
Local Storage support for the JS Bindings for iOS.
Works on cocos2d-iphone and cocos2d-x.
*/
#include "storage/local-storage/LocalStorage.h"
#include "platform/CCPlatformMacros.h"
#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID)
#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
#include "jni.h"
#includ... | TOOL | 0.855371 | 6.383219 |
f23e0ecd-b1ec-4f5f-b25c-46474d92e8df | chauhansatyam3112/DSA-problems | 0556-next-greater-element-iii/0556-next-greater-element-iii.cpp | class Solution {
public:
int nextGreaterElement(int n) {
string str=to_string(n);
if(str.length()==1)
{
return -1;
}
int i=str.length()-2;
for(;i>=0 && str[i]>=str[i+1];i--){
}
if(i==-1){
return -1... | ALGO | 0.999864 | 5.492103 |
fb60ce39-dd5c-4c8a-82f0-f1ea3c6226fe | gem5-graphics/gem5-graphics | gpgpu-sim/intersim2/networks/qtree.cpp | // $Id: qtree.cpp 5188 2012-08-30 00:31:31Z dub $
////////////////////////////////////////////////////////////////////////
//
// QTree: A Quad-Tree Indirect Network.
//
//
////////////////////////////////////////////////////////////////////////
//
// RCS Information:
// $Author: jbalfour $
// $Date: 2007/05/17 17:14... | TOOL | 0.938889 | 5.24568 |
699edefb-9e8d-4c44-84f7-37972926daf4 | gongkrmin/gong_lite | godot_edit/scene/resources/bit_map.cpp | /**************************************************************************/
/* bit_map.cpp */
/**************************************************************************/
/* This file is part of: */
/* ... | TOOL | 0.879981 | 6.241192 |
93e4c5c6-8b39-4857-af46-137a27429f72 | Leelaprasad001/DSA-Practise-Solutions | Difficulty: Easy/Geek Jump/geek-jump.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution {
public:
int minimumEnergy(vector<int>& height, int n) {
//using dp(tabulation)
vector<int> dp(n, 1);
dp[0] = 0;
for(int i = 1; i < n; i++){
int J2 = INT... | ALGO | 0.999915 | 6.354088 |
ee0afc5f-fe38-4039-aa90-fc521a9ebd39 | Virddav/Reproduction_UCMP | src/optiroute/datacenter/main_bolt_dynexpTopology.cpp | // -*- c-basic-offset: 4; tab-width: 8; indent-tabs-mode: t -*-
#include "config.h"
#include <sstream>
#include <strstream>
#include <fstream> // needed to read flows
#include <iostream>
#include <string.h>
#include <math.h>
#include "network.h"
#include "randomqueue.h"
#include "pipe.h"
#include "eventlist.h"
... | TOOL | 0.972749 | 3.950091 |
d8a213e9-b623-4cb5-9638-b1db094e28d0 | iPiyushJaiswal/codingPlatform | codePOD/2023/12December/D14M12Y2023/Painting the Fence.cpp | /*Problem GFG (Medium)
Painting the Fence
Question link: https://www.geeksforgeeks.org/problems/painting-the-fence3727/1
---------------------------
Logic: DP
---------------------------
Complexity:
Method 1 : DP
Time Complexity= O(n)
Space Complexity= O(1)
----------------------------------
----------------... | ALGO | 0.999991 | 5.067748 |
77500eca-7043-43a1-b400-78ecf36afca3 | physicalist/ncbs-moose | moose/branches/difbuffer/ksolve/SteadyState.cpp | /**
* This program works out a steady-state value for a reaction system.
* It uses GSL heavily, and isn't even compiled if the flag isn't set.
* It finds the ss value closest to the initial conditions.
*
* If you want to find multiple stable states, it is best to do this
* in Python as it gives a lot of flexibili... | ALGO | 0.999973 | 6.870033 |
abf79c15-579f-4d67-8f8b-60cf76be2594 | subham37853/CP- | Dynamic Programming/Maximum-sum-of-non-adjacent-elements.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
void __print(int x) {cerr << x;}
void __print(long x) {cerr << x;}
void __print(long long x) {cerr << x;}
void __print(unsigned x) {cerr << x;}
void __print(unsigned long x) {cerr << x;}
void __print(unsigned long long x) {cerr << x;}
void __print(floa... | ALGO | 0.999916 | 4.582272 |
5970955b-d05c-48f8-afc9-4292ca650619 | Xyronix99/Deep3DMark | model/backend/_ext/src/crop.cpp | //
// Created by xingyu on 11/29/22.
//
#include "crop.h"
#include "sampling.h"
#include "ball_query.h"
#include "utils.h"
#include "cuda_utils.h"
void crop_points_kernel_wrapper(const int B, const int R, const int S,
const int *__restrict__ cropped_idx,
... | DATA | 0.994143 | 5.849919 |
2f8b13e5-c35d-4d02-b4ef-f25ad4fb882d | dienbk7x/origin | origin/sequence/iterator.test/filter.cpp | #include <cassert>
#include <iostream>
#include <vector>
#include <origin/sequence/iterator.hpp>
using namespace std;
using namespace origin;
bool odd(int n) { return n & 1; }
int main()
{
using V = vector<int>;
V v {0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
auto first = make_filter(v.begin(), v.end(), odd);
auto las... | ALGO | 0.996436 | 4.932058 |
29bc301e-5f3b-463b-ac9e-74643e5b3c76 | abhisheksaurabh812/CodeLib | count_permutation.cpp | #include<iostream>
#include<set>
#include<string>
using namespace std;
void permute(char in[],int i,set<string> &s)
{
if(in[i]=='\0')
{
string t(in);
s.insert(t);
return;
}
for(int j=i;in[j]!='\0';j++)
{
swap(in[i],in[j]);
permute(in,i+1,s);
swap(in[i]... | ALGO | 0.999944 | 4.524596 |
6655bf9d-d41c-4dbf-9e49-8d35aee68279 | MoniKA-Sai123/dsacomplete | week7/recursion-2/recursion2.cpp | #include <iostream>
#include<limits.h>
#include<vector>
using namespace std;
void printArray(int *arr, int size, int index) {
//base case
if(index >= size) {
return ;
}
//recursive call
printArray(arr, size, index+1);
//processing
cout << arr[index] << " ";
}
bool searchArray(int arr[], int size, int targ... | ALGO | 0.99978 | 4.558818 |
2a699efb-cf75-480e-b3ac-dd3c772c0afc | ronniegnr/hacking | src/bd/com/ronnie/hacking/uri_online_judge/beginner/1117-ScoreValidation.cpp | #include<iostream>
#include<stdio.h>
using namespace std;
int main() {
float x, score[2];
for (int i = 0; i < 2; i++) {
cin >> x;
if (x < 0 || x > 10) {
i--;
cout << "nota invalida" << endl;
continue;
}
score[i] = x;
}
printf("media ... | ALGO | 0.920704 | 3.990539 |
8b4c48e3-8800-4026-9330-a03b13a6ceba | Rohit20kokate/Data-Structure-and-fiile | Rohit_kokate32_well_formedness_of_parantheses.cpp | #include<iostream>
using namespace std;
struct name
{
int data;
name *next;
};
class code
{
private:
name *top;
public:
void Creat();
void push(int);
int pop();
bool isempty();
int topstack();
}c;
void code :: Creat()
{
top=NULL;
}
bool code :: isempty()
{
return (top==NULL);
}
void code :: pu... | ALGO | 0.999433 | 4.074846 |
0584d707-41ae-47b0-b4fd-9e150b51cf6a | EzElephant/cses | cses_1625.cpp | #pragma GCC optimize("O3,unroll-loops")
#pragma GCC target("avx2,bmi,bmi2,lzcnt,popcnt")
#include <bits/extc++.h>
using namespace std;
const int dir[4][2] = {1, 0, -1, 0, 0, 1, 0, -1};
queue<pair<int, int>> q;
string buffer;
int ans;
bool grid[9][9];
// bool legal(int x, int y)
// {
// grid[x][y] = true;
// b... | ALGO | 0.99953 | 4.463945 |
ab99984a-9965-4644-be68-445b72a1b362 | danyalmendigali/programming_scientific_codes | vector_scientific_codes/vector_finding_the_minimum_and_maximum_elements.cpp | #include <bits/stdc++.h>
#include <windows.h>
using namespace std;
#define ar array
#define ll long long
#define FOR(i, a, b) for(int i = a; i < b; i++)
// Поиск минимального и максимального элементов в векторе:
int main() {
cin.tie();
SetConsoleOutputCP(CP_UTF8);
SetConsoleCP(CP_UTF8);
vector <int>... | ALGO | 0.999186 | 4.304612 |
d725f7d7-6e1c-4443-ad48-2df303e45dbd | AndreiDaniDev/Informatica | 4287_Veverita4.cpp | #include <fstream>
using namespace std;
ifstream in("veverita4.in");
ofstream out("veverita4.out");
///https://www.pbinfo.ro/probleme/4287/veverita4
///https://www.pbinfo.ro/detalii-evaluare/51606573
///FAST FIBONACCI
struct Mat{ int mat[2][2]; };
const Mat nullMat={{{1, 0},{0, 1}}};
const Mat initMat={{{1, 1},{1, 0... | ALGO | 0.999928 | 4.054965 |
d74345f3-4934-454e-9d8f-b285c45f7b0b | mikhaeljonathan/online-judges | Kattis/quadrant.cpp | #include <stdio.h>
int main () {
int x, y;
scanf("%d %d", &x, &y);
if (x > 0 && y > 0){
printf("1");
} else if (x < 0 && y > 0){
printf("2");
} else if (x < 0 && y < 0){
printf("3");
} else {
printf("4");
}
printf("\n");
return 0;
}
| ALGO | 0.999998 | 3.824897 |
e1e59b8a-39f1-4c03-ad11-28a81781a299 | Toysoft/NNvision | darknet_apache_nvenc/opencv-3.4.4/modules/video/src/bgfg_KNN.cpp | //#include <math.h>
#include "precomp.hpp"
#include "opencl_kernels_video.hpp"
namespace cv
{
/*!
The class implements the following algorithm:
"Efficient Adaptive Density Estimation per Image Pixel for the Task of Background Subtraction"
Z.Zivkovic, F. van der Heijden
Pattern Recognition Letters, vol. 27, no. 7... | ALGO | 0.992102 | 6.886083 |
aaf9faba-4836-463c-894b-d7e8fae4c347 | linhuorong/zcb | src/qt/rpcconsole.cpp | #if defined(HAVE_CONFIG_H)
#include "config/bitcoin-config.h"
#endif
#include "rpcconsole.h"
#include "ui_debugwindow.h"
#include "bantablemodel.h"
#include "clientmodel.h"
#include "guiutil.h"
#include "platformstyle.h"
#include "bantablemodel.h"
#include "chainparams.h"
#include "netbase.h"
#include "rpc/server.h"... | TOOL | 0.890443 | 6.424467 |
28146c59-ccef-42ad-a23a-83f7b21cba1e | tTargiel/UNI-Cpp-Programming | Lista 07/przyklad.cpp | #include <iostream>
#include <vector>
#include <algorithm> // count_if, sort
struct Zliczaj_5
{
bool operator()(int k) const { return k == 5; }
};
int main()
{
std::vector<int> v = {1, 5, 16, 12, 35, 6, 13, 45, 5, 8};
std::cout << std::count_if(begin(v), end(v), Zliczaj_5()) << "\n";
std::cout << std:... | ALGO | 0.999483 | 5.492165 |
49b24205-4972-4b9e-be55-537a5324ed6b | bdqnghi/bi-tbcnn | code/mergesort/cpp/3313.cpp | #include "mergesort.h"
#include <cmath>
void MergeSort::sort(std::vector<int>& elements)
{
merge_sort(elements, 0, elements.size() - 1);
}
void MergeSort::merge(std::vector<int>& elements, int p, int q, int r)
{
std::vector<int> R;
std::vector<int> L;
L.insert(L.end(), elements.begin() + p, elements.begin() +... | ALGO | 0.999924 | 5.226449 |
2a7e79cd-41a5-4a09-beee-a447c57a7413 | eat-swap/LeetCodeDaily | cpp/2303/230318-CN.cpp | #include <string>
/**
* 1616. Split Two Strings to Make Palindrome
*
* You are given two strings a and b of the same length. Choose an index and split both strings at the same index, splitting a into two strings: aprefix and asuffix where a = aprefix + asuffix, and splitting b into two strings: bprefix and bsuffix ... | ALGO | 0.999519 | 6.505449 |
85372a3c-eb9e-40e2-b808-d22ec864fc84 | LieryangStack/c-plusplus-study | 01-C++基础/day04/01_static仓库进货出货.cpp | #include <string.h>
#include <iostream>
using namespace std;
class Goods{
public:
Goods *next;
Goods(){
weight = 0;
next = NULL;
cout << "创建了一个重要为" << "weight" << "的货物" << endl;
}
Goods(int w){
/*需要创建一个w的货物*/
weight = w;
next = NULL;
total_weight += w;
cout << "创建了一个重量为" << w... | TOOL | 0.869898 | 3.956354 |
e22a7779-f367-4328-a0e6-ee43a23d8d78 | danilosgomes/UFC-ED-2023.1 | 01/QuedaDominio/main.cpp | #include <iostream>
using namespace std;
bool ehOrdenado(int n, int v[]){
bool ordenado = false;
for(int i = 0; i < n - 1; i++){
if(v[i] > v[i+1]) return true;
}
return false;
}
int main(){
int n = 0, v[50];
cin >> n;
for(int i = 0; i < n; i++)
cin >> v[i];
... | ALGO | 0.999526 | 4.405452 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.