uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
a84425ac-f049-4c87-a420-cfffffdcd2f7 | liangkang233/leetcode-cpp | 541.ๅ่ฝฌๅญ็ฌฆไธฒ-ii.cpp | /*
* @lc app=leetcode.cn id=541 lang=cpp
*
* [541] ๅ่ฝฌๅญ็ฌฆไธฒ II
*/
#include <iostream>
#include <string>
#include <algorithm>
using namespace std;
// @lc code=start
class Solution {
public:
void myrever(string& s, int l, int r) {
char temp;
while(l < r) {
temp = s[l];
s[l++... | ALGO | 0.999808 | 6.252493 |
a3ed5cea-0970-43ef-9ca2-5457155b7ea2 | ishandutta2007/codeforces | gabrielpessoa/normal/593/D.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll ms = 2e5+5;
vector<pair<ll, pair<ll, ll>>> g[ms];
ll sz[ms], par[ms], h[ms];
ll t, in[ms], out[ms], rin[ms], nxt[ms];
ll arr[ms];
ll magia[ms];
ll n;
ll seg[2 * ms];
ll merge(ll a, ll b) {
if(a > 2000000000000000000ll/b) return 10000000... | ALGO | 0.999986 | 4.548615 |
2e986be2-7146-449e-855b-bdbd5b7d9115 | alexandraback/datacollection | solutions_5658571765186560_0/C++/Stonefeang/zad.cpp | #include <iostream>
#include <cstdio>
#include <algorithm>
using namespace std;
int t;
int a, b, c;
int main()
{
scanf("%d", &t);
for (int h=1; h<=t; h++)
{
scanf("%d%d%d", &a, &b, &c);
printf("Case #%d: ", h);
if (((b*c)%a) || a>=7 || a>max(b, c) || (a>>1)>=min(b, c))
{
... | ALGO | 0.999918 | 3.760314 |
79ab028b-cf1b-4516-ade2-a47f2e02f93b | ishandutta2007/codeforces | subscriber/normal/627/B.cpp | #include<stdio.h>
#include<iostream>
#include<vector>
#include<cmath>
#include<algorithm>
#include<memory.h>
#include<map>
#include<set>
#include<queue>
#include<list>
#include<sstream>
#include<cstring>
#define mp make_pair
#define pb push_back
#define F first
#define S second
#define SS stringstream
#define sqr... | ALGO | 0.99919 | 3.413262 |
c6515fe1-fa67-43dc-a80c-13642f8b324f | mir183/CodeForces | 176Long Comparison/main.cpp | #include <iostream>
using namespace std;
int main() {
int t;
cin >> t;
while (t--) {
long long a, b, c, d;
cin >> a >> b >> c >> d;
int mn = min(b, d);
b -= mn;
d -= mn;
if (b >= 7)
cout << ">" << endl;
else if (d >= 7)
cout ... | ALGO | 0.999854 | 4.420142 |
16acc769-a711-4680-b4a6-f418c5f4bae7 | kth496/Algorithm-study | Programmers/kakao_2019_winter/4.cpp | #include <iostream>
#include <string>
#include <vector>
using namespace std;
vector<long long> solution(long long k, vector<long long> room_number) {
vector<long long> answer;
long long minn = 1;
// vector<bool> isFree(k + 1, true);
long long notFree = 0;
for (auto e : room_number) {
if (!... | ALGO | 0.999882 | 3.745102 |
69ff2b68-eceb-49d4-96bb-1613dfeb1d22 | zxyDEDIRE/ACM_CODE | ็็/็ๅฎขๅฐ็ฝๆ่ต81/E.cpp | #include<bits/stdc++.h>
using namespace std;
#define endl "\n"
#define pp(x) array<int,x>
using ull=unsigned long long;
using ll=long long;
using pii=pair<int,int>;
using pdd=pair<double,double>;
const int dx[]={0,0,1,-1,1,-1,1,-1};
const int dy[]={1,-1,0,0,1,-1,-1,1};
const int mod=998244353;
const int inf=0x3f3f3f3f;... | ALGO | 0.99997 | 4.340853 |
d93f6d9b-6c0d-4591-b772-507c658988b4 | ishandutta2007/codeforces | arthurpd/normal/370/A.cpp | #include <stdio.h>
#include <vector>
#include <stdlib.h>
using namespace std;
int main(void)
{
int x1, y1, x2, y2;
scanf("%d %d %d %d", &x1, &y1, &x2, &y2);
int ans[3];
ans[0] = int(x1 != x2) + int(y1 != y2);
ans[1] = int((x1+y1) != (x2+y2)) + int((x1-y1) != (x2-y2));
ans[2] = max(abs(x1 - x2), abs(y1 - y2));
i... | ALGO | 0.999568 | 3.33734 |
9ac4041f-6057-4f12-bc83-881de53a20a7 | novakoki/PAT | 1097.cpp | #include <iostream>
#include <sstream>
#include <vector>
#include <list>
#include <queue>
#include <algorithm>
#include <iomanip>
#include <map>
#include <unordered_map>
#include <unordered_set>
#include <string>
#include <set>
#include <stack>
#include <cstdio>
#include <cstring>
#include <climits>
#include <cstdlib>
... | ALGO | 0.999455 | 3.437012 |
abbc8f2c-ea64-47b7-b5fc-64278b55201d | gupta-manas6268/learning-C | TLE Eliminators/TLE Eliminators Level-3/Ch-006.2/0_12_pr.cpp | // Correct.
// (I Solved by seeing Test-case in Submissions.)
// B. Rectangles
// https://codeforces.com/problemset/problem/844/B
#include<bits/stdc++.h>
using namespace std;
#define endl '\n'
#define int long long
const int MOD = 1e9 + 7;
const int INF = LLONG_MAX >> 1;
int power(int base, int exp){
int resu... | ALGO | 0.99994 | 4.07652 |
0e84ab78-008d-499e-b289-67b16f320893 | oxygen-hunter/Flashboom | data/big-vul-100/add_attention_code/Gemma/top0-100/number-of-paths-with-max-score-Solution.pathsWithMaxScore/177809_Bypass.cpp | restore_page_device(i_ctx_t *i_ctx_p, const gs_gstate * pgs_old, const gs_gstate * pgs_new)
{
gx_device *dev_old = gs_currentdevice(pgs_old);
gx_device *dev_new;
gx_device *dev_t1;
gx_device *dev_t2;
bool samepagedevice = obj_eq(dev_old->memory, &gs_int_gstate(pgs_old)->pagedevice,
&gs_int_g... | ALGO | 0.999143 | 3.015927 |
ac2c5463-2b5c-4483-ac25-bdc96e45f280 | marcusPrado02/Solution_of_Programming_Problems | Leetcode/Easy/LengthOfLastWord/LengthOfLastWord.cpp | class Solution {
public:
int lengthOfLastWord(string s) {
int i = s.length() - 1;
for(i; i >= 0 && s[i] == ' '; --i);
const int lastIndex = i;
for(i; i >= 0 && s[i] != ' '; --i);
return lastIndex - ... | ALGO | 0.986023 | 5.544648 |
ab473520-38e2-43b4-85f4-439662a1c03c | JyVenom/Competitive-Programming | CodeForces/C++/P314C3.cpp | #include <bits/stdc++.h>
using namespace std;
#define X first
#define Y second
const int N = 100020;
typedef pair<int,int>ii;
ii a[N];
int c[N];
int n,p=1000000007;
void R(int x,int y)
{
for(x++;x<=n+1;x+=x&-x)
c[x]=(c[x]+y)%p;
}
int G(int x)
{
int re=0;
for(x++;x;x-=x&-x)
re=(re+c[x])%p;
return re;
}
int m... | ALGO | 0.999894 | 3.874269 |
f80e09ff-f73a-49e3-a4ad-122c3e3ec114 | joshgrib/2015F-coursework | qf365/trees/ex1/main.cpp | #include <iostream>
#include <string>
using namespace std;
int heapArr[16] = {0};
bool rooted = false;
void myReheap(int i){
//if i>parent, swap and recurse
int swap;
int j;
//cout << "Reheaping" << endl;
if(i%2 == 1){
j = i-1;
}else{
j = i;
}
if(heapArr[i] > heapArr[j/... | ALGO | 0.99945 | 4.18821 |
14f5b7b3-c810-4b2d-8161-20c1d5a49911 | Lucien950/Contests | CodeForces/Round #273/d.cpp | #include <cmath>
#include <iostream>
using namespace std;
int main() {
int r, g;
cin >> r >> g;
int h = floor(sqrt(2 * (r + g) + 0.25) - 0.5);
cout << h << endl;
} | ALGO | 0.999192 | 3.9262 |
54ac57be-68cc-4d5d-8e70-f1956bb41509 | vittorioromeo/UNIME_numerical_calculus | test/nc/matrix_norms.cpp | #include "../utils/test_utils.hpp"
#include <nc_cpp.hpp>
#include <random>
template <int TV>
using int_v = std::integral_constant<int, TV>;
auto print_matrix = [](const auto& x)
{
std::cout << "matrix(\n[\n";
for(std::size_t i(0); i < x.row_count(); ++i)
{
std::cout << "[";
for(std::size_... | TEST | 0.917027 | 5.916469 |
624ce872-42ec-49a8-88de-4e09e905263a | ishandutta2007/codeforces | bluediamond/normal/817/F.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N = (int) 1e5 + 7;
const int A = 2 * N;
bool inv[4 * A];
int val[4 * A];
int cnt[4 * A];
void push(int v, int tl, int tr)
{
if (val[v] != -1)
{
cnt[v] = val[v] * (tr - tl + 1);
if (tl < tr)
{
i... | ALGO | 0.999992 | 3.886654 |
8fc11e0d-2319-4bad-9c06-6060d416938e | Kuldeep9870/Leetcode-Solutions | Move all negative elements to end - GFG/move-all-negative-elements-to-end.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution{
public:
void segregateElements(int arr[],int n)
{
// Your code goes here
vector<int> e,o;
for(int i=0;i<n;i++)
{
if(arr[i]>=0)
{
... | ALGO | 0.999547 | 6.167424 |
77389d44-bf74-4030-bc4f-fa887745abf4 | dkhonker/sysu | ๆฐๆฎ็ปๆ/ๆฐๆฎ็ปๆๅฎ้ช่ฏพๆไปถ/EXP16-graph(topo,scc)/EXP16-graph(topo,scc)/fortest/source/20354001/scc.cpp | #include <stdio.h>
#include <stdlib.h>
#include <memory.h>
const int maxn=50000;
const int maxm=500000;
int n,m;
int a[maxm + 1], b[maxm + 1];
int p[maxn + 2];
int linkto[2 * maxm + 1];
/*p linkto าปฮฌ ๆดขฺฝำฑ (สนรทใฃฌรถฬฌ้ฃฉ
linkto าปฮฌ p[v]+1...p[v+1] ะฉฮปรดๆดขvึฑำบฬก
อจฤถฮบฤด๋ฃฌplinkto */
void input_data() {
scanf("%d %d", &n, &m);
... | ALGO | 0.999978 | 4.115935 |
de8e4362-8358-4129-9322-2a157e0a6eaa | asettar/algorithms | binary tree/problem6.cpp | #include <bits/stdc++.h>
using namespace std;
//link : https://www.youtube.com/watch?v=Et9OCDNvJ78&list=PLgUwDviBIf0q8Hkd7bK2Bpryj2xVJk8Vk&index=23&ab_channel=takeUforward
// top view of a binary treee inorder fro left to right
struct TreeNode {
int val;
TreeNode *left;
TreeNode *right;
TreeNode() : val(0), left(n... | ALGO | 0.999997 | 5.649446 |
434745ee-05b7-42dc-9696-936a21cacee4 | SarveshShukla23/SelfDrivingCar-ND-Term2 | CarND-MPC-Project-master/src/Eigen-3.3/doc/examples/tut_arithmetic_redux_basic.cpp | #include <iostream>
#include <Eigen/Dense>
using namespace std;
int main()
{
Eigen::Matrix2d mat;
mat << 1, 2,
3, 4;
cout << "Here is mat.sum(): " << mat.sum() << endl;
cout << "Here is mat.prod(): " << mat.prod() << endl;
cout << "Here is mat.mean(): " << mat.mean() ... | ALGO | 0.998942 | 3.870119 |
fc3e9bae-cda6-43a6-a264-e2e4287eee60 | nimxor/competitive_progeamming | codeforces/579-A/579-A-15891910.cpp | #include<bits/stdc++.h>
using namespace std;
#define ll long long int
#define mod 1000000007
#define fi first
#define se second
#define mp make_pair
#define pb push_back
int main()
{
ll x;
ll cnt=0;
cin>>x;
while(x!=0)
{
if(x&1)
cnt++;
x/=2;
}
cout<<cnt<<endl;
return 0;
} | ALGO | 0.999935 | 4.307714 |
61d87d41-00dc-4131-9bab-9272c5a9ea9a | Sillyplus/Solution | Timus/1792.cpp | /*******************************************************************************
> File Name: 1792.cpp
> Author: sillyplus
> Mail: <EMAIL>
> Created Time: Wed Jan 7 21:19:39 2015
******************************************************************************/
#include <iostream>
using namespace std;
int a[10]... | ALGO | 0.999945 | 3.23495 |
74b18660-3d23-40f9-ad75-71c3f8534020 | Mahmud394/phitron | Basic Data Structures/list_Palindrome.cpp | //check if the list is Palindrome.
#include<bits/stdc++.h>
using namespace std;
bool isPalindrome(list<int>&l){
auto front = l.begin();
auto back = l.rbegin();
for(int i=0; i<l.size()/2; i++){
if(*front != *back) return false;
front++;
back++;
}
return true;
}
int main(){
... | ALGO | 0.997977 | 4.93038 |
af78b013-84a4-4bad-aa03-7502ba6870c4 | Rodrigo61/GUAXINIM | URI/1330/main.cpp | bool debug = false;
//<editor-fold desc="GUAXINIM TEMPLATE">
/******** All Required Header Files ********/
#include "bits/stdc++.h"
using namespace std;
#define all(container) container.begin(), container.end()
#define mp(i,j) make_pair(i,j)
#define space " "
#define pb push_back
typedef pair<int,int> pii;
typedef... | ALGO | 0.999769 | 4.317109 |
8e709b77-e00c-481c-a6de-d425b138f69e | ghozt777/cp | practice/cpp/UnorderedSets/main.cpp | // unordered sets in STL is implementede using hashing
// ordered sets in STL is implemented using Red Black Trees
// TC : insert , erase , find , count -> O(1) on average
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vii;
typedef pair<int,int> pi;
ty... | ALGO | 0.90019 | 4.35242 |
f21f643a-30a0-4c03-b6d0-c30178ed24fc | wsavoie/SmarticleSim | matlabScripts/newSimScripts/codegen/lib/generatePackingFromSimDatPLANE/generatePackingFromSimDatPLANE.cpp | // Include Files
#include <math.h>
#include <string.h>
#include "rt_nonfinite.h"
#include "generatePackingFromSimDatPLANE.h"
#include "quat2rotm.h"
#include "distancePointEdge3d.h"
#include "intersectRayPolygon3d.h"
#include "pdist.h"
#include "generatePackingFromSimDatPLANE_emxutil.h"
// Function Definitions
//
// [... | ALGO | 0.998236 | 3.612908 |
1fbf83d3-c851-4b2e-a5a2-00ac3caf1d5e | dranik-by/cocos2d-x | cocos2d-x/cocos/math/CCVertex.cpp | #include "math/CCVertex.h"
#include "base/ccMacros.h"
NS_CC_BEGIN
void ccVertexLineToPolygon(Vec2 *points, float stroke, Vec2 *vertices, unsigned int offset, unsigned int nuPoints)
{
nuPoints += offset;
if(nuPoints<=1) return;
stroke *= 0.5f;
unsigned int idx;
unsigned int nuPointsMinus = nuPoin... | ALGO | 0.992646 | 5.824827 |
debf1c1e-9cbe-4d91-9149-6d145d29bc37 | raincross7/code-similarity | codes/train_code/problem439/problem439_47.cpp | #include <bits/stdc++.h>
using namespace std;
int solve(int a, int b){
return abs(a-b);
}
int main(){
int N,ans=0; cin >> N;
vector<int> a(N);
for(int i=0; i<N; i++) cin >> a.at(i);
for(int i=0; i<N; i++){
for(int j=0; j<N; j++){
ans = max({ans,solve(a.at(i),a.at(j))});
}
}
cout << ans <<... | ALGO | 0.998876 | 4.198391 |
6d6e745a-8cc5-46e4-ae33-122696a81a95 | bobbydj123/3 | DSA21CL3UPC.cpp | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#repo3
using namespace __gnu_pbds;
using namespace std;
#define fastio() ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define filewr() freopen("input.txt","r",stdin);freopen("output.txt","w",stdout);
int ans = INT_MIN;123
void sol... | ALGO | 0.999885 | 3.684851 |
c1caf6ee-41ef-4a47-afec-eb25bf5ed8d8 | HoyoenKim/PS_solving | 9.๊ธฐ๋ณธ์ํ2/Terat.cpp | #include <iostream>
#include <cmath>
int main() {
int n;
std::cin >> n;
for(int i = 0 ; i < n ; i++) {
double x1, y1, r1, x2, y2, r2;
std::cin >> x1 >> y1 >> r1 >> x2 >> y2 >> r2;
double dist = std::sqrt((x1 - x2)*(x1 - x2) + (y1 - y2)*(y1 - y2));
if (dist == 0) {
... | ALGO | 0.999321 | 4.105897 |
4b3ffad5-0cfb-4c56-9cb7-124364b710f4 | paul2705/OI | contact/EFZ/18.10.27_1/math_bl.cpp | #include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
const int MAXN=25;
int n,m,cnt[MAXN];
bool use[MAXN];
int main(){
freopen("math.in","r",stdin);
freopen("math.out","w",stdout);
scanf("%d%d",&n,&m);
for (int s=0;s<(1<<n);s++){
int res=0; bool f=1;
for (int i=1;i<=2*n... | ALGO | 0.999924 | 3.360318 |
e9c0f76e-0167-47b5-a986-337209d51eff | khushboo-goel/competitive-coding | Queue/295_medianStream.cpp | // https://leetcode.com/problems/find-median-from-data-stream/description/
class MedianFinder {
public:
int count = 0;
priority_queue<int> maxHeap;
priority_queue<int, vector<int>, greater<int>> minHeap;
MedianFinder() {
}
void addNum(int num) {
count++;
maxHeap.pu... | ALGO | 0.999832 | 6.537858 |
4f76813f-2431-419b-8646-293a9bd4db65 | GioMaz/algoritmi-e-strutture-dati | sottoseq/main.cpp | #include <iostream>
#include <fstream>
using namespace std;
int main()
{
int N;
ifstream in("input.txt");
in >> N;
int a[N];
for (int i = 0; i < N; i++) {
in >> a[i];
}
cout << endl;
int aapp[N];
for (int i = 0; i < N; i++) {
int tmp;
if (i == 0)
... | ALGO | 0.999871 | 4.246785 |
7d87c58b-7b5d-4f58-9628-8f2b9e459c08 | zhouyuan/Sorts | src/try_a.cpp | #include <iostream>
#include "kxsort/kxsort.h"
//using namespace std;
template <typename T>
struct RadixTraitsArrowArray
{
static const int nBytes = sizeof(T);
int kth_byte(const T &x, int k)
{
return (x >> (kx::kRadixBits * k)) & kx::kRadixMask;
}
bool compare(const T &x, const T &y) { ret... | ALGO | 0.943197 | 3.113555 |
38935b69-d691-490a-96e9-dfcc0d8b2e3e | SPSPRANAV/CppTemplates | treap.cpp | #include<bits/stdc++.h>
using namespace std;
struct item {
int key, priority;
item * left, * right;
item() { }
item (int key, int priority) : key(key), priority(priority), left(NULL), right(NULL) { }
};
typedef item * node;
void split (node t, int key, node & left, node & right) {
if (!t)
l... | ALGO | 0.999983 | 4.165007 |
111ce541-55bf-47be-a41b-4399e88f4a50 | bilboquet/perf-tests | nth-prime_cpp/nth_prime_array.cpp | #include "nth_prime.h"
#include <vector>
#include <iostream>
using std::cout;
using std::endl;
namespace nth_prime
{
bool is_prime(uint32_t pc, const uint32_t *const primes, uint32_t len)
{
for (uint32_t i = 0; i < len; i++)
{
if (pc % primes[i] == 0)
{
return false;
}
... | ALGO | 0.998785 | 5.565529 |
a7bcf2f4-48f1-48cb-a0c5-c6431eeb52b2 | cyrilggg/ACM | problem/Daily/2022/4/29/CF704/D.cpp | #include <bits/stdc++.h>
using namespace std;
#define int long long
#define endl '\n'
#define returnNo return void(puts("No"))
#define returnYes return void(puts("Yes"))
const int N = 1e5 + 10;
void solve()
{
int a, b, k;
cin >> a >> b >> k;
int tmp = k;
int cnto = k / 3, cntz = k / 3 * 2;
tmp %= 3;... | ALGO | 0.99994 | 3.637799 |
8cd0a7d9-d7f1-4d4c-b951-cb4daf426d1f | ishandutta2007/codeforces | emthrm/normal/1466/G.cpp | #define _USE_MATH_DEFINES
#include <bits/stdc++.h>
using namespace std;
#define FOR(i,m,n) for(int i=(m);i<(n);++i)
#define REP(i,n) FOR(i,0,n)
#define ALL(v) (v).begin(),(v).end()
using ll = long long;
constexpr int INF = 0x3f3f3f3f;
constexpr long long LINF = 0x3f3f3f3f3f3f3f3fLL;
constexpr double EPS = 1e-8;
constex... | ALGO | 0.999672 | 4.61373 |
a7408ddd-cf16-4f83-9e37-c73a8555e35d | alexandraback/datacollection | solutions_2749486_0/C++/jskhirtladze/B.cpp | #include <stdio.h>
#include <cstdlib>
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <math.h>
#include <map>
using namespace std;
FILE *fin=freopen("input.txt","r",stdin);
FILE *fout=freopen("output.txt","w",stdout);
bool good(int i)
{
if ( i<0 ) return false;
if ( i>400 ) ret... | ALGO | 0.999954 | 3.334998 |
51f9dd97-f660-41a3-8cc8-4e69214330a4 | SinceTodayL/CodingPractice | ๆฐ่ฎบไธ็ปๅๆฐๅญฆ/NumberTheorem/BasicAlgorithm/luoguP2044.cpp | #include<bits/stdc++.h>
using namespace std;
typedef unsigned long long ll;
ll m, a, c, x0, n, g;
ll multi(ll x, ll y){
ll ans = 0;
while(y){
if(y & 1)
ans = (ans + x) % m;
x = (x + x) % m;
y >>= 1;
}
return ans;
}
vector<vector<ll>> cal_mat(vector<vector<ll>> a,... | ALGO | 0.999985 | 4.043029 |
55568dd5-cbe4-48d1-aeff-43baa0ca5841 | santirdzrmz/TC1033 | Act2.cpp | #include <iostream>
#include <string>
#include <fstream>
std::string toString(int i){
std::string str = std::to_string(i);
return str;
}
std::string verifyRecurrent(int i, int total){
int pctg = i/total;
std::string afirmativo = "";
if (pctg > 0.2){
afirmativo = "Si tiene mucho contacto";
... | DATA | 0.885035 | 4.410741 |
89e1b01e-b039-4754-9ac0-7eb0a580324f | vmartirosyan/cpp_test | fuzzy_cpu/src/fuzzy_cpu.cpp | #include "fuzzy_cpu.hpp"
#include "fuzzy_alu.hpp"
#include "fuzzy_operations.hpp"
#include <algorithm>
#include <cmath>
#include <iomanip>
#ifndef M_PI
#define M_PI 3.14159265358979323846
#endif
FuzzyCPU::FuzzyCPU(int bits, bool verbose_mode)
: alu(new FuzzyALU(verbose_mode)), num_bits(bits), verbose(verbose_mod... | ALGO | 0.968017 | 7.396471 |
0d173813-26e0-4ed5-ab92-79a00019967d | inte2000/play_with_algo | base/array_link.cpp | #include "stdafx.h"
#include <iostream>
typedef struct
{
int data; //ิชอฃิถ
int next;
}ARR_LINK_NODE;
const int NODE_COUNT = 128;
ARR_LINK_NODE node[NODE_COUNT]; //ๆดขีผ
int freelist = 0;
int head = -1;
void init_array_link()
{
//ิชุดfreelist
for (int i = 0; i < (NODE_COUNT - 1); i++)
{
node[i].n... | ALGO | 0.998998 | 3.948223 |
3cf99d53-fd64-4822-8dd9-1421aad25da6 | pathakshrikant26/C- | Codeforce/467/a.cpp | #include<bits/stdc++.h>
using namespace std;
#define ll long long int
int main()
{
int n;
cin>>n;
int x;
set<int> s;
for(int i=0;i<n;i++)
{
cin>>x;
if(x!=0)
{
s.insert(x);}}
cout<<s.size();
} | ALGO | 0.999829 | 3.523825 |
699c37f8-b00c-4737-927f-5efcde724028 | redknotmiaoyuqiao/Eyer3rdpart | opencv-4.5.0/modules/calib3d/src/posit.cpp | #include "precomp.hpp"
#include "calib3d_c_api.h"
/* POSIT structure */
struct CvPOSITObject
{
int N;
float* inv_matr;
float* obj_vecs;
float* img_vecs;
};
static void icvPseudoInverse3D( float *a, float *b, int n, int method );
static CvStatus icvCreatePOSITObject( CvPoint3D32f *points,
... | ALGO | 0.991502 | 4.877076 |
2aedf561-223f-4ad3-a4ad-1e693610b0a0 | Gurupradeep/Codes | Codechef - Contests/JULY16/POLYEVAL.cpp | #include<bits/stdc++.h>
using namespace std;
#define MOD 786433
int main()
{
long long n;
long long a[10002];
scanf("%lld",&n);
for(int i=0;i<=n;i++)
scanf("%lld",&a[i]);
long long q;
scanf("%lld",&q);
while(q--)
{
long long x;
scanf("%lld",&x);
long long ... | ALGO | 0.999945 | 3.433755 |
580faa49-bac6-457f-86b6-5bfa3420158f | tue-robotics/ed_sensor_integration | ed_sensor_integration/src/kinect/association.cpp | #include "ed/kinect/association.h"
#include "ed/kinect/entity_update.h"
#include "ed_sensor_integration/association_matrix.h"
#include <ed/world_model.h>
#include <ed/entity.h>
#include <ed/update_request.h>
#include <ed/measurement.h>
#include <rgbd/image.h>
#include <rgbd/view.h>
#include <ros/console.h>
// ----... | ALGO | 0.889934 | 5.788541 |
900db87e-cbba-4e97-8d6e-c112e9fcf7f6 | tommasocerruti/algolab-2024 | src/week04/first_hit/solution.cpp | #include <bits/stdc++.h>
#include <CGAL/Exact_predicates_exact_constructions_kernel.h>
typedef CGAL::Exact_predicates_exact_constructions_kernel K;
typedef K::Point_2 P;
typedef K::Segment_2 S;
typedef K::Ray_2 R;
double floor_to_double(const K::FT& x){
double a = std::floor(CGAL::to_double(x));
while (a > x) a -=... | ALGO | 0.999849 | 4.099033 |
dff9a2cf-a282-45e2-9e63-c9d3ed3b6df2 | wisdompeak/LeetCode | Others/1674.Minimum-Moves-to-Make-Array-Complementary/1674.Minimum-Moves-to-Make-Array-Complementary_v3.cpp | class Solution {
static bool cmp(pair<int,int>&a, pair<int,int>&b)
{
return a.first+a.second<b.first+b.second;
}
public:
int minMoves(vector<int>& nums, int limit)
{
int n = nums.size()/2;
vector<pair<int,int>>p;
for (int i=0; i<n; i++)
p.push_back({min(n... | ALGO | 0.99999 | 5.428429 |
a45b2212-bdfa-47dd-8b66-220795800a72 | Malreon/CPP-Path | intermediate/FunctionalPointer.cpp | #include <iostream>
using namespace std;
int example(){
return 100;
}
//declares and uses function pointers
int main(int argc, char** argv){
int (*FunctionPoint)() = nullptr; /* this is a function pointer, it's named FunctionPoint, points to a function-
* that is of type int and h... | TOOL | 0.909661 | 3.659128 |
8d05e0b2-3fbd-4cd1-9e6c-1b8814b96b5c | gpzero/android_frameworks_base | services/surfaceflinger/BlurFilter.cpp | #include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <stdint.h>
#include <utils/Errors.h>
#include <pixelflinger/pixelflinger.h>
#include "clz.h"
#define LIKELY( exp ) (__builtin_expect( (exp) != 0, true ))
#define UNLIKELY( exp ) (__builtin_expect( (exp) != 0, false ))
namespace android {... | TOOL | 0.988262 | 5.87772 |
6fb3df04-faf7-4811-91bd-c3a0f6e5e3bb | dhuamanilu/programacion | 2110/2108A.cpp | #include <bits/stdc++.h>
using namespace std;
//* Debugger
string to_string(string s) {
return '"' + s + '"';
}
string to_string(const char* s) {
return to_string((string) s);
}
string to_string(bool b) {
return (b ? "true" : "false");
}
template <typename A>
string to_string(A v);
template <typename A... | ALGO | 0.999428 | 4.196439 |
4e6381dd-d6ac-46ca-8dbf-06c93666355b | Sukshan/CPSolutions | F - Shifting String.cpp | #pragma GCC optimize("Ofast")
#pragma GCC optimize ("unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#include <iostream>
#include <vector>
#include <cmath>
#include <ctime>
#include <cstdio>
#include <queue>
#include <set>
#include <map>
#include <fstream>
#include <cstdlib... | ALGO | 0.99997 | 4.519582 |
1deac9be-507c-4f83-9539-1d5472b902e8 | kotea/GameFrameWorksProject | include/bullet/Bullet3OpenCL/Raycast/b3GpuRaycast.cpp |
#include "b3GpuRaycast.h"
#include "Bullet3Collision/NarrowPhaseCollision/shared/b3Collidable.h"
#include "Bullet3Collision/NarrowPhaseCollision/shared/b3RigidBodyData.h"
#include "Bullet3OpenCL/RigidBody/b3GpuNarrowPhaseInternalData.h"
#include "Bullet3OpenCL/Initialize/b3OpenCLUtils.h"
#include "Bullet3OpenCL/Paral... | ALGO | 0.921598 | 3.163057 |
bbac6302-8ad4-4dc9-b80b-8945673e2ebd | alsghdlah1/Moonjaehaegul | week1/Prob8.cpp | #include<stdio.h>
void main()
{
int n = 0;
int num = 1;
float result = 0;
printf("Inut Number\n");
scanf("%d", &n);
for (int i = 1; i <= n; i++)
{
num *= i;
result += (float)1 / num;
}
printf("The Result is %f\n", result);
} | ALGO | 0.999752 | 3.545957 |
624e50fc-bb9b-4b4e-b0b3-b7a50ab9d1c1 | Sudipta2002/UEMK-CSE-RESOURCES | Advanced Algorithms/Recursion/Factorial_Using_Recursion.cpp | #include <iostream>
using namespace std;
unsigned int factorial(unsigned int n)
{
if (n == 0)
return 1;
return n * factorial(n - 1);
}
int main()
{
int num = 5;
cout << "Factorial of "<< num << " is " << factorial(num) << endl;
return 0;
}
| ALGO | 0.999858 | 5.461307 |
81301790-a185-4bea-a48f-463a8c24942f | Prateek-5/Leetcode-Problems | Graph-Problems/2316-Count-Unreachable-Pairs-of-Nodes-in-an-Undirected-Graph.cpp | /*
You are given an integer n. There is an undirected graph with n nodes, numbered from 0 to n - 1. You are given a 2D integer array edges where edges[i] = [ai, bi] denotes that there exists an undirected edge connecting nodes ai and bi.
Return the number of pairs of different nodes that are unreachable from each othe... | ALGO | 0.999958 | 6.285047 |
df59a058-afbc-472a-a57a-32265e822320 | McBetaCpp/McBetaCpp | src/world/level/levelgen/synth/PerlinSimplexNoise.cpp | #include "world/level/levelgen/synth/PerlinSimplexNoise.h"
PerlinSimplexNoise::PerlinSimplexNoise(int_t levels) : PerlinSimplexNoise(Random(), levels)
{
}
PerlinSimplexNoise::PerlinSimplexNoise(Random &random, int_t levels)
{
this->levels = levels;
for (int_t i = 0; i < levels; i++)
noiseLevels.emplace_back(ran... | ALGO | 0.85872 | 5.76677 |
b196386a-31d3-46c9-8f40-8b3a5c1fac09 | szw0407/OJ-codes | CCF_CSP/202206-2.cpp | #include<bits/stdc++.h>
using namespace std;
int main() {
int n, L, S;
scanf("%d %d %d", &n, &L, &S);
int i, j;
int tmp;
int x[2005], y[2005];
for (i=0;i<n;i++) {
scanf("%d %d", &x[i], &y[i]);
}
int sm[51][51] = {0};
int k=0;
for (i=0;i<=S;i++){
for (j=0;j<=S;j+... | ALGO | 0.999808 | 3.083436 |
29abf79b-b521-48ff-b1da-6dd3672ff740 | jchoby21/Joecoin | src/rpcnet.cpp | #include "net.h"
#include "bitcoinrpc.h"
using namespace json_spirit;
using namespace std;
Value getconnectioncount(const Array& params, bool fHelp)
{
if (fHelp || params.size() != 0)
throw runtime_error(
"getconnectioncount\n"
"Returns the number of connections to other nodes.");
... | WEB | 0.926101 | 6.646237 |
18885da3-a0ff-45c3-8d77-6dd1944b96d6 | pkalyan264/Code-Snippets-LC | ImplementAtoi.Cpp | #include<iostream>
using namespace std;
int atoi(string s)
{
int sign=1;
int i=0;
int ans=0;
s[i]=='-'?sign=-1:sign=1;
for(i=1;i<s.size();i++)
{
if(s[i]-'0'>=0 and s[i]-'0'<=9)
{
ans=ans*10+(s[i]-'0');
}
else return -1;
}
return ans;
}
| ALGO | 0.998372 | 3.818679 |
dcf92e4b-d015-496f-bb37-9f5bbe6088cd | Ginakira/Code-Archive | Luogu/ๆฐๆฎ็ปๆ-้กบๅบ่กจ.cpp | #include <stdio.h>
#include <stdlib.h>
#include <time.h>
//ๅฃฐๆ็ปๆไฝ
typedef struct Vector {
int *data;
int size, length;
} Vector;
//ๆ้ ๆๅๅงๅ
void init(Vector *v, int n) {
v->size = n;
v->length = 0;
v->data = (int *)malloc(sizeof(int) * n);
return ;
}
//ๆฉๅฎน
int expand(Vector *v) {
int *p = (in... | ALGO | 0.998324 | 3.776716 |
3ada1a49-58e7-4e31-b6a4-1131fc9dbef9 | MohakGupta2004/cses | introductory_problem/increasing_array/main.cpp | #include<iostream>
#include<vector>
using namespace std;
int main(){
long long int n, count=0, result=0;
cin>>n;
vector<long long int> arr(n);
for(long long int i=0;i<n;i++){
cin>>arr[i];
}
for(long long int i=0;i<n-1;i++){
if(arr[i]>arr[i+1]){
result = arr[i]-arr[i+1];
count+=result;
... | ALGO | 0.999911 | 3.574554 |
0c59705c-1baa-4f33-8cd1-de41665c5dba | jiyak12/DSA_IN_C- | Array/prog36.cpp | //Find a way to convert the number into the maximum possible value (by replacing a digit with 9).
//Find a way to convert the number into the minimum possible value (by replacing a digit with 0 or something smallโbut no leading zeros).
/*
Convert the number to a string for easy digit manipulation.
To form the maximum,... | ALGO | 0.999946 | 6.380879 |
94d638ac-a387-442d-9a8f-aba1047818cb | hoang6k/Simple-Application-Algorithms | Dijkstra.cpp | #include <bits/stdc++.h>
using namespace std;
#define MAXN 100001
#define INF INT_MAX
int n, m, s, u, v, c, d[MAXN], pred[MAXN], _count = 1;
typedef pair<int, int> ipair;
list<int> nonfixed;
list<ipair> adj[MAXN];
ipair result[MAXN];
void Dijkstra() {
while (!nonfixed.empty()) {
int _min = INF;
for (list<int>::ite... | ALGO | 0.999884 | 3.508251 |
1528d5a5-55cb-44f7-be4b-4a9e45e09a56 | adityabhise1111/cpp | 31_recursion/1_rec.cpp | #include <iostream>
using namespace std;
int fact(int n){
if(n==0){
return 1;
}
return n*fact(n-1);
}
int main() {
cout << "Hello, World!" << endl;
cout<<fact(5)<<endl;
//recursion means a function calling itself
//recursion is a powerful tool in programming
//it is used to so... | ALGO | 0.997799 | 4.516375 |
ec73ff71-d8aa-4227-9426-955066a25cd8 | thisiseesmaeel/TDDI16 | lab1/simple_remove.cpp | /**
* remove() tar bort elementet x ur trรคdet t, om x finns.
*
* Comparable och Node_Pointer รคr formella typer som fรฅr specificeras pรฅ
* nรฅgot sรคtt (template-parameter, typedef eller ersรคttning med konkret typ).
*/
void remove(const Comparable &x, Node_Pointer &t) {
if (t == nullptr) {
return; // Hรคr ... | ALGO | 0.994056 | 5.322707 |
6e2886a0-268d-4122-9c53-24d79ff8e1a6 | sethdivyansh/cp | global_round27.cpp | //
// _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
// / _ _ _ | | _ _ _ _| |_ _ _ _ _| | | | |
// | | _ _ _ | | _ _ _ | | | |_ _| |
// \ _ _ _ \ | _ _ _| | | | _ _ |
// _ _ _ _| | | | _ _ __ | | | | | |
// |_ _ _ _ / |_ _ _ _ _| |_| ... | ALGO | 0.999849 | 4.555671 |
17efb333-06ca-4ded-8a85-952656382f7e | sadramanouch/leetcode | 2500-delete-greatest-value-in-each-row/2500-delete-greatest-value-in-each-row.cpp | class Solution {
public:
int deleteGreatestValue(vector<vector<int>>& grid) {
int m = grid.size();
int n = grid[0].size();
int result = 0;
for (int i = 0; i<m; i++){
sort(grid[i].begin(), grid[i].end(), greater<int>());
}
for (int col = 0; col<n; col++){
... | ALGO | 0.999982 | 5.809927 |
b6fc6131-aa0e-4e8c-b7e3-31923bd94bac | Chaitya-007/LeetCode | 2414-move-pieces-to-obtain-a-string/2414-move-pieces-to-obtain-a-string.cpp | class Solution {
public:
bool canChange(string st, string tar) {
int n=tar.length();
int i=0,j=0;
while(i<=n && j<=n){
while(i<n && tar[i]=='_') i++;
while(j<n && st[j]=='_') j++;
if(i==n || j==n){
return i==n && j=... | ALGO | 0.999759 | 5.724787 |
f2adf364-2566-4b1d-b33c-add116c692f5 | frankandreace/leetcode_problems | problems/problem_1353.cpp | #include <vector>
#include <algorithm>
#include <iostream>
#include <cassert>
#include <memory>
#include <queue>
using namespace std;
class Solution {
public:
int maxEvents(vector<vector<int>>& events) {
// sorting by starting day
sort(events.begin(), events.end(), [](auto a, auto b){if (a[0] < b[... | ALGO | 0.999579 | 5.855726 |
bdee4630-9b6e-4c39-b224-033b2310b249 | harshagrawal523/CP_Practice | specialistsheet/sheet/a.cpp | #include <iostream>
#include <string>
#include <vector>
#include <algorithm>
using namespace std;
typedef long long ll;
int main(){
int t;cin>>t;
while(t--){
ll n,H;cin>>n>>H;
int a[n];
for(int i = 0 ; i<n ; i++)
{
cin>>a[i];
... | ALGO | 0.99984 | 3.807579 |
bc7cc80e-5360-4298-b684-54cc10cf850c | HarshGupta02/Data-Structure-And-Algorithm | Arrays/Insert Interval.cpp | class Solution {
public:
vector<vector<int>> insert(vector<vector<int>>& intervals, vector<int>& newInterval) {
int n = intervals.size();
vector<vector<int>> ans;
for(int i = 0; i < n; i ++) {
if(newInterval[1] < intervals[i][0]) {
ans.push_back(newInterval);
... | ALGO | 0.999985 | 6.138131 |
feff3ce0-3159-4fa6-ae2e-18c8bf3c82ce | ahr9n/psolving-paradigms | 2.greedy/CodeForces 1338A - Powered Addition.cpp | /* MASTER HAS FAILED MORE TIMES
THAN BEGINNER HAS EVER TRIED
*/
#include <bits/stdc++.h>
using namespace std;
#define endl '\n'
#define all(a) a.begin(), a.end()
#define mem(a, n) memset(a, n, sizeof(a))
#define Unique(n) (n).erase(unique(all(n)), (n).end())
#define NumofDigits(n... | ALGO | 0.999821 | 4.70315 |
f4bdb2eb-4b51-4a50-bfc5-909d32302b26 | Wells-yuan/mds | libsnark/depends/libsnark/depends/libff/libff/common/utils.cpp | /** @file
*****************************************************************************
Implementation of misc math and serialization utility functions
*****************************************************************************
* @author This file is part of libff, developed by SCIPR Lab
* and co... | TOOL | 0.921658 | 7.012414 |
4ca1d23f-9bcf-4841-924f-42fcd5d30b58 | Haribala-09/hyprdots | User/History/f1795b2/mRLF.cpp | #include <bits/stdc++.h>
using namespace std;
#define rev(ans) reverse(ans.begin(), ans.end())
#define mems(a, n) memset(a, n, sizeof(a))
#define pb push_back
#define fst first
#define scd second
#define int long long
using pii = pair<int, int>;
using pci = pair<char, int>;
void dbg_out() { cerr << endl; }
template ... | ALGO | 0.999975 | 3.837185 |
d5c37dd9-45b1-481b-b8fb-2faadc83a072 | tic40/atcoder | abc/abc073/c/main.cpp | #include <bits/stdc++.h>
using namespace std;
#define REP(i, n) for(int i = 0; i < n; i++)
#define COUT(x) cout<<(x)<<endl
#define dump(x) cout << #x << " = " << (x) << endl;
using ll = long long;
using P = pair<int,int>;
using Graph = vector<vector<int>>;
using M = map<int,int>;
using PQ = priority_queue<int>;
using ... | ALGO | 0.999942 | 4.19713 |
38fb5ccc-bc6f-4e93-827f-c49df86e20c4 | CM-0488/Cursos | Lรณgica de Programaรงรฃo/C++/1- IF/11a aula - IF exercรญcio 4.cpp | #include <iostream>
#include <locale.h>
using namespace std;
int main (){
setlocale (LC_ALL, "");
int numero1, numero2, numero3;
string resultado;
cout << "Digite o 1o nmero: \n";
cin >> numero1;
cout << "\nDigite o 2o nmero: \n";
cin >> numero2;
cout << "\nDigite o 3o nmero: \n";
cin >> numero3;
... | ALGO | 0.998257 | 3.944089 |
531c0dc0-c8ef-4117-a761-72cec714ef68 | ML-UCV/ML-CodeBert-DistinctSolutions | Raw Dataset/swap/aib/train/12d88b9d-0b67-11ec-963c-2cf05d84bfc2.cpp | #include<cstdio>
#include<cstring>
#include<list>
using namespace std;
list<int>L[27];
long long n,m,i,j,l,a[50100],x,sum,w[50100];
char s[50100],s1[50100];
FILE *f,*g;
int query(int p){
int s=0;
for(int i=p;i>0;i-=(i&-i)){
s+=a[i];
}
return s;
}
void update(int p,int x){
for... | ALGO | 0.999968 | 3.253923 |
6428b8d3-ed45-460d-88bd-7988bcbed9d3 | cy-goh/orbslam_height_scale | Thirdparty/g2o/g2o/core/hyper_graph.cpp | #include "hyper_graph.h"
#include <assert.h>
#include <queue>
namespace g2o {
HyperGraph::Vertex::Vertex(int id) : _id(id)
{
}
HyperGraph::Vertex::~Vertex()
{
}
HyperGraph::Edge::Edge(int id) : _id(id)
{
}
HyperGraph::Edge::~Edge()
{
}
void HyperGraph::Edge::resize(size_t size)
{
... | ALGO | 0.972785 | 5.546304 |
735f348e-6d55-475d-be90-bbf41816e5c4 | tinaboya/Image-and-Video-Technology | session2/Source.cpp | #define _USE_MATH_DEFINES
#include <fstream>
#include <iostream>
#include <cmath>
#include <stdlib.h>
#include <random>
using namespace std;
// Store function
int store(float* I,string name)
{
int size = 256 * 256;
ofstream outfile(name + ".raw", ofstream::binary);
outfile.write((const char*)I, size * sizeof(floa... | ALGO | 0.997873 | 3.928502 |
4a3410b8-7c3e-4aba-9b97-50049715728f | miamdaegun/cpp-source-code | 2667bfs.cpp | //bfs ์ฐ์ต
#include <iostream>
#include <queue>
#include <vector>
#include <algorithm>
using namespace std;
const int dx[4]={0, 0, 1, -1};
const int dy[4]={1, -1, 0, 0};
void bfs(int i, int j, int &count, vector<vector<int>> house, vector<vector<bool>> &visit, int size)
{
int nx, ny, popx, popy;
queue<pair<int,... | ALGO | 0.999935 | 3.89076 |
4c59865a-d5e0-4090-a735-a78f1c67da4d | rk16449/HierarchyTreesCPP | HierarchyTree/src/Main.cpp | #include "Main.h"
#include "Node.h";
#include <iostream>
using namespace std;
int main(){
// Create the tree
Node* root = 0;
root = root->Insert(root, 10);
root = root->Insert(root, 50);
root = root->Insert(root, 60);
// Hold input
int number;
// Ask for input
cout << "Enter a nu... | ALGO | 0.989618 | 4.508161 |
17e50e06-56db-43bf-9b5c-6e2236459d6c | PhuocVinhLee/online_system_exam_quiz_programming | online_exam_system_backend/temp/uf4iywu.cpp | #include <stdio.h>
int main() {
int number1, number2, sum;
// printf("Enter two integers: ");
scanf("%d", &number1);
// calculate the sum
sum = number1 + number1;
printf("%d", sum);
return 0;
}
| TOOL | 0.992458 | 3.676236 |
91f3d81f-676a-4c23-91bf-29f482efb5be | PaukIsUha/optimizing_formating_code | predictions/submissions-aizu-cot-gpt35/Codenet/p00464/563691719/response_2.cpp | #include <iostream>
using namespace std;
const int MAX_N = 1001;
int mp[MAX_N][MAX_N], dp[MAX_N][MAX_N];
int h, w, n;
void saiki(int x, int y) {
int dx[] = {0, 1}, dy[] = {1, 0};
while (y < h && x < w) {
x += dx[mp[y][x]];
y += dy[mp[y][x]];
}
cout << y + 1 << " " << x + 1 << endl;
}
... | ALGO | 0.999814 | 3.869906 |
e1c02563-e5de-44fd-8920-d70473017565 | JpKarwa/PW-Skills-PPT-program | Arrays/Assignment 4/5.cpp | /*
You have n coins and you want to build a staircase with these coins. The staircase consists of k rows where the ith row has exactly i coins. The last row of the staircase **may be** incomplete.
Given the integer n, return *the number of **complete rows** of the staircase you will build*.
Input: n = 5
Output: 2
E... | ALGO | 0.999634 | 6.341645 |
649c83ce-c84d-4b9b-8c6e-220b2f44f986 | rubel703/Cpp_program | nested while loop.cpp | #include<iostream>
using namespace std;
int main()
{
int i=1;
while(i<=10)
{
int j=1;
while(j<=10)
{
cout<<i<<" "<<j<<"\n";
j++;
}
i++;
}
}
| TOOL | 0.967065 | 3.435833 |
2b98cd46-86bb-4c02-8f97-15efeee7ab2b | cpuz158/samstl | DAY2/3_algo3.cpp | #include <iostream>
#include <vector>
#include <list>
#include <algorithm>
#include "show.h"
// ์๊ณ ๋ฆฌ์ฆ๊ณผ ๋์ผํ ์ด๋ฆ์ ๋ฉค๋ฒ ํจ์๊ฐ ์๋ค๋ฉด ๋ฉค๋ฒ ํจ์๋ฅผ ์ฌ์ฉํ๋ผ.
// ํต์ฌ ์ ๋ฆฌ.. "์ปจํ
์ด๋์ ๋ํด์ ์ด๋ค ์์
์ ์ํํ๊ณ ์ถ๋ค๋ฉด"
// 1. ๋ฉค๋ฒ ํจ์์ ํด๋นํ๋ ์์
์ ์ํํ๋ ํจ์๊ฐ ์๋์ง ์ฐพ์๋ผ!!
// ==> ๋ฉค๋ฒ ํจ์์ ์์ผ๋ฉด.. ์ฌ์ฉ..
//
// 2. ๋ฉค๋ฒ ํจ์์ ์์ผ๋ฉด, "์๊ณ ๋ฆฌ์ฆ(๋ฉค๋ฒ๊ฐ ์๋ ์ผ๋ฐํจ์)" ์์ ์ฐพ์๋ผ!
// ==> ์์ผ๋ฉด ์ฌ์ฉ..
// 3.... | TOOL | 0.949787 | 4.429427 |
66ac583c-5007-4ceb-bc61-aa1d41fba56e | shvmsh20/GFG_POTD | Nov 2023/Frequencies of Limited Range Array Elements.cpp | void frequencyCount(vector<int>& arr,int N, int P)
{
// code here
map<int,int> hashmap;
for(int i = 0; i < N ; i++){
hashmap[arr[i]]++;
}
for(int i = 0; i < N ; i++){
arr.at(i)=0;
}
for(auto iter : hashmap){
if(iter.first... | ALGO | 0.999909 | 4.842632 |
83419548-567d-402a-b1b6-43bf95808796 | Filikec/competitive-programming | kattis/arraySmoothening.cpp | #include <iostream>
#include <algorithm>
#include <unordered_map>
#include <vector>
using namespace std;
unordered_map<int,int> Occurances;
int main(){
int n,k;
cin >> n >> k;
vector<int> heap;
for (int i=0;i<n;i++){
int tmp;
cin >> tmp;
auto it = Occurances.find(tmp);
... | ALGO | 0.999977 | 4.048112 |
9bea9a10-4b78-4cfc-886a-d07f1fcf55c5 | kulhanek/obcore | src/lib/obcore/fingerprints/fingerecfp.cpp | #include <openbabel/babelconfig.h>
#include <openbabel/oberror.h>
#include <openbabel/mol.h>
#include <openbabel/atom.h>
#include <openbabel/bond.h>
#include <openbabel/obiter.h>
#include <openbabel/fingerprint.h>
#include <openbabel/obiter.h>
#include <openbabel/elements.h>
#include <vector>
#include <algorithm>
usi... | TOOL | 0.988207 | 4.818954 |
6a517181-24bd-4add-a281-00ef1763491f | Sandeep-Sanwale/Data-Structure-CPP | Arrays/DSA1array9 _contaguous_subarray_with_max_sum_or_kanade's_algo.cpp | #include <iostream>
using namespace std;
int MaxSum(int arr[], int n)
{
int sum_till_now = 0, max_sum = INT_MIN;
for (int i = 0; i < n; i++)
{
sum_till_now = sum_till_now + arr[i];
if (sum_till_now < arr[i])
sum_till_now = arr[i];
if (sum_till_now > max_sum) //max_sum=max... | ALGO | 0.998979 | 5.173743 |
d549602e-5335-4a14-93b2-1640abfd23fe | hamzahasbi/CP-stuffs | Codechef/Equal_Pairs_Easy.cpp | #include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
#ifdef ONLINE_JUDGE
#pragma GCC optimize("O3")
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4")
#pr... | ALGO | 0.999903 | 4.744915 |
cbfe1dcb-b4c4-49b8-beac-dd0292e7bdc8 | AkshayAnil1080/DSA | Insert a node in a BST - GFG/insert-a-node-in-a-bst.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
#define MAX_HEIGHT 100000
// Tree Node
struct Node {
int data;
Node* left;
Node* right;
Node(int val) {
data = val;
left = right = NULL;
}
};
// } Driver Code Ends
// Function to insert a node in a BST.
/*
struc... | ALGO | 0.99994 | 6.29696 |
4b1b4b0c-4ff1-4e21-90b9-ed29b2d9c4cf | mansinerkar-11/GeeksForGeeks | MaximumProductSubarray.cpp | //{ Driver Code Starts
#include <iostream>
#include<vector>
using namespace std;
// } Driver Code Ends
//User function template for C++
class Solution{
public:
// Function to find maximum product subarray
long long maxProduct(vector<int> arr, int n) {
long long maxi=INT_MIN;
long long prod=1;
for(in... | ALGO | 0.999942 | 6.566573 |
53624f3a-cd31-4a99-bc39-6a493546b9e2 | reactos/reactos | sdk/lib/ucrt/stdlib/lfind.cpp | #ifdef _M_CEE
#define __fileDECL __clrcall
#else
#define __fileDECL __cdecl
#endif
#ifdef __USE_CONTEXT
#define __COMPARE(context, p1, p2) (*compare)(context, p1, p2)
#else
#define __COMPARE(context, p1, p2) (*compare)(p1, p2)
#endif
// Performs a linear search over the array, looking for the value 'k... | TOOL | 0.998215 | 5.65818 |
363dd2b1-7ab3-44a8-8952-8cb5056a32f8 | ishandutta2007/codeforces | peti1234/normal/1716/B.cpp | #include <bits/stdc++.h>
using namespace std;
void solve() {
int n, p[105];
cin >> n;
for (int i=1; i<=n; i++) {
p[i]=i;
}
cout << n << "\n";
for (int i=1; i<=n; i++) {
for (int j=1; j<=n; j++) {
cout << p[j] << " ";
}
cout << "\n";
if (i<n) {... | ALGO | 0.999973 | 4.041472 |
9bfaf206-46d7-4169-a0fe-96129d81e1df | rachitsainii/Leetcode-Solved | 0349-intersection-of-two-arrays/0349-intersection-of-two-arrays.cpp | class Solution {
public:
vector<int> intersection(vector<int>& nums1, vector<int>& nums2) {
unordered_set<int> array1(nums1.begin(), nums1.end());
unordered_set<int> intersection;
vector<int> ans;
for(auto i : nums2){
if(array1.find(i) != array1.end()){
in... | ALGO | 0.999949 | 5.71036 |
8d198713-5aea-4c77-a355-0c59e60608f6 | Laaaaksh/Cp | leetcode/repeatingandmissing.cpp | #include <bits/stdc++.h>
using namespace std;
void getTwoElements(int arr[], int n,
int* x, int* y)
{
int xor1;
// xor of any number with 0 is the number itself
int set_bit_no;
to calculate the rightmost set bit striver video
int i;
int x=0;
int y=0;
xor1 = arr[0];
/* Get the xor of all array elements *... | ALGO | 0.999965 | 4.158339 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.