uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
9b9c9847-7d7a-47f7-a24c-849b94a51a27 | rzando-org/hello-algo | zh-hant/codes/cpp/chapter_tree/binary_search_tree.cpp | /**
* File: binary_search_tree.cpp
* Created Time: 2022-11-25
* Author: krahets (<EMAIL>)
*/
#include "../utils/common.hpp"
/* 二元搜尋樹 */
class BinarySearchTree {
private:
TreeNode *root;
public:
/* 建構子 */
BinarySearchTree() {
// 初始化空樹
root = nullptr;
}
/* 析構方法 */
~Bina... | ALGO | 0.999767 | 6.515461 |
ef1ab1d3-8e23-4ac8-86dd-66ad34b4d63c | ishandutta2007/codeforces | rush_d_cat/normal/1000/B.cpp | #include <iostream>
using namespace std;
const int N=100000+10;
int n,M;
int a[N], pre[N];
int main() {
scanf("%d%d",&n,&M);
for(int i=1;i<=n;i++) {
scanf("%d",&a[i]);
}
a[++n] = M;
for(int i=1;i<=n;i++) {
if(i%2==1)
pre[i]=pre[i-1]+a[i]-a[i-1];
else
... | ALGO | 0.999976 | 3.35591 |
04ecd90c-12a3-4403-a29e-1ab48783e2f5 | PRANAV40/CPP-Traning_Code | C++ Traning Code/LinkedListTest.cpp | // #include <iostream>
// using namespace std;
// class Node
// {
// public:
// int data;
// Node *next;
// Node(int val)
// {
// data = val;
// next = NULL;
// }
// };
// void insertAtTail(Node* &head,int val){
// Node* ptr = new Node(val);
// if(head==NULL){
// he... | TOOL | 0.878967 | 3.455859 |
2c3bffc7-e275-4969-b53d-2b93b3bb8ffb | abualhamd/architecture_patterns | 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.998859 | 6.785645 |
d962b56f-f78e-4047-a87a-32de750ad32a | broitman-eugeny/lab2 | Evklid.cpp | int Evklid(int a, int b)//
{
int k;
while (0 != (k = a%b))
{
a = b;
b = k;
}
return (b>0)?b:-b;
} | ALGO | 0.999896 | 3.773561 |
0f6a1a0f-feab-460e-80c5-65b0e26270c4 | jwdinius/CarND-Term3 | CarND-Path-Planning-Project/src/Eigen-3.3/bench/perf_monitoring/gemm/lazy_gemm.cpp | #include <iostream>
#include <fstream>
#include <vector>
#include <Eigen/Core>
#include "../../BenchTimer.h"
using namespace Eigen;
#ifndef SCALAR
#error SCALAR must be defined
#endif
typedef SCALAR Scalar;
template<typename MatA, typename MatB, typename MatC>
EIGEN_DONT_INLINE
void lazy_gemm(const MatA &A, const Ma... | ALGO | 0.984548 | 6.1125 |
5cdfd160-adcf-4ff8-8fa3-af9483febda7 | tbuchs/webSPDZ | Utils/mixed-example.cpp | /*
* mixed-example.cpp
*
*/
#include "Protocols/ProtocolSet.h"
#include "Machines/SPDZ.hpp"
#include "Machines/SPDZ2k.hpp"
#include "Machines/Semi2k.hpp"
#include "Machines/Rep.hpp"
#include "Machines/Rep4.hpp"
#include "Machines/Atlas.hpp"
template<class T>
void run(char** argv);
int main(int argc, char** argv)... | ALGO | 0.992082 | 5.473828 |
4f3e7597-a976-42fc-9b1b-418ece7b69cb | JiBinquan/Data-Structures_Experiment | 2数据结构实验二:实现单链表各种基本运算的算法/数据结构实验二:实现单链表各种基本运算的算法.cpp | /*************************************************
** : ʵʵֵֻ㷨
** : 2019Jibinquan
** : 2020-9-23 / 15:57
** ϵ : <EMAIL>
/**************************************************/
#include <iostream>
#include <cstdio>
#include <cmath>
#include <algorithm>
#include <cstring>
#include <queue>
#include <stack>
#include <vecto... | ALGO | 0.999729 | 3.087816 |
a5105ab1-a5aa-4da7-9719-a7391838c7d6 | isopropylcyanide/Competitive-Programming | code-cpp/zanSmart.cpp |
#include<bits/stdc++.h>
using namespace std;
int A[105];
int main(){
int n, t;
cin >> n;
for (int i = 0; i < n; i++){
cin >> t;
A[t]++;
}
int ways = 0;
for (int i = 0; i < 100; i++)
ways += A[i]/2;
cout << ways << endl;
return 0;
}
| ALGO | 0.999819 | 3.79563 |
e9c40539-417f-41ce-8c62-b9b6655a3bd6 | satviktiwari/LeetCode | 697-degree-of-an-array/697-degree-of-an-array.cpp | class Solution {
public:
int findShortestSubArray(vector<int>& nums) {
unordered_map<int,int>mp;
for(int i = 0; i < nums.size(); i++){
mp[nums[i]]++;
}
vector<int>v;
int count = INT_MIN;
for(auto it : mp){
if(it.second > count){
... | ALGO | 0.999973 | 5.468309 |
9eeee78b-47cb-4cbc-859a-8c3694c1e8a0 | hjimce/android-image | app/src/main/cpp/opencv-3.2.0/samples/cpp/grabcut.cpp | #include "opencv2/imgcodecs.hpp"
#include "opencv2/highgui.hpp"
#include "opencv2/imgproc.hpp"
#include <iostream>
using namespace std;
using namespace cv;
static void help()
{
cout << "\nThis program demonstrates GrabCut segmentation -- select an object in a region\n"
"and then grabcut will attempt ... | ALGO | 0.880655 | 5.490752 |
8aa8f18d-1d4b-4588-8d7c-0d16069edfc0 | ishandutta2007/codeforces | trivialman/normal/1070/A.cpp | #include<iostream>
#include<cstring>
#include<queue>
#include<string>
using namespace std;
#define N 100000010
class Number{
public:
int modd=0, sumdigit=0;
string num="";
Number(){
this->modd = this->sumdigit = 0;
this->num = "";
}
Number(int x, int y, string z){
this->modd = x;
this->sumdigit = y;
t... | ALGO | 0.998688 | 3.493691 |
a4d53ec0-7bba-4bbd-a89b-a32e5b621b22 | romeorizzi/esami-algo-public | 2020-02-18/hanoi_clockwise/att/template_sol.cpp | /**
* Un template per la tua soluzione di hanoi_clockwise
* Romeo Rizzi, 2020-02-18
*
*/
#include <cassert>
#include <cstdio>
//const int DEBUG = 0;
const int DEBUG = 1;
const int MAXN = 100000;
typedef long long unsigned int llu;
int t, N;
char peg[MAXN+1];
char d[MAXN+1];
llu memo_num2[MAXN+1];
void sposta_d... | ALGO | 0.999936 | 4.648038 |
b8ef6992-4e49-4bed-9229-1531d7ef0f2a | Maruf089/LeetCode | power-of-two/Accepted/6-12-2020, 10_28_28 PM/Solution.cpp | // https://leetcode.com/problems/power-of-two
class Solution {
public:
bool isPowerOfTwo(int n)
{
long i = 1 ;
while(i<n)
{
i *= 2;
}
return (i==n);
}
}; | ALGO | 0.999285 | 6.416395 |
1e393dd9-277c-4ca7-9b63-b55897be991a | TheFenrisLycaon/DSA-C-- | cp/CodeForces/0500-0599/589B.cpp | #include <cstdio>
#include <iostream>
#include <vector>
#include <set>
#include <algorithm>
typedef long long ll;
int main(){
ll n; scanf("%lld", &n);
std::vector<std::pair<ll, ll> > v(n);
for(ll p = 0; p < n; p++){
ll a, b; scanf("%lld %lld", &a, &b);
if(a > b){ll tmp = a; a = b; b = tmp;... | ALGO | 0.999556 | 3.457979 |
b8046260-21b1-4a47-9d56-c69f49a5e3e0 | Monarul007/phitron-xpsc | Week 2/Day 3/C_Most_Similar_Words.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
// Write your code here
ios::sync_with_stdio(false);
cin.tie(0);
int t;
cin >> t;
while(t--){
int n, m;
cin >> n >> m;
vector<string> words(n);
for(int i=0;i<n;i++){
cin >> words[i];
... | ALGO | 0.999983 | 5.37609 |
8a95b60e-bed9-4655-813a-375d3611ded3 | DOGEOFDOGE/DDOGE | src/rpc/client.cpp | #include "rpc/client.h"
#include "rpc/protocol.h"
#include "util.h"
#include <set>
#include <stdint.h>
#include <boost/algorithm/string/case_conv.hpp> // for to_lower()
#include <univalue.h>
using namespace std;
class CRPCConvertParam
{
public:
std::string methodName; //!< method whose params want conversion
... | CONFIG | 0.960718 | 7.255082 |
bab0917c-34b1-47f6-a9ab-fff06249fdc9 | mrBlumper/BgNumbers | primesieve/SieveOfEratosthenes.cpp | ///
/// @file SieveOfEratosthenes.cpp
/// @brief Implementation of the segmented sieve of Eratosthenes.
///
/// Copyright (C) 2013 Kim Walisch, <<EMAIL>>
///
/// This file is distributed under the BSD License. See the COPYING
/// file in the top level directory.
///
#include "primesieve/config.hpp"
#include "primes... | ALGO | 0.999513 | 7.525977 |
dfea090b-8c4b-4c9f-9ac4-78e38feef459 | Michaelmilk/pat | 1069-The Black Hole of Numbers.cpp | #include <iostream>
#include <vector>
#include <string>
#include <iterator>
#include <cmath>
#include <map>
#include <algorithm>
#include <climits>
#include <iomanip>
#include <queue>
#include <stack>
#include <deque>
#include <sstream>
#include <set>
#include <fstream>
#include <cstring>
#include <cstdio>
#include <cs... | ALGO | 0.997574 | 3.37954 |
380e8efc-4daa-455f-86b4-958c66962877 | orihehe/Codeforces | Educational Codeforces Round 67 (Div. 2)/A - Stickers and Toys.cpp | #include <cstdio>
#include <algorithm>
using namespace std;
/* 🐣🐥 */
int main() {
int n, m, k, t;
scanf("%d", &t);
while (t--) {
scanf("%d %d %d", &n, &m, &k);
if (m > k) swap(k, m);
printf("%d\n", n - m + 1);
}
return 0;
} | ALGO | 0.999882 | 3.729566 |
110fbe9a-b2fb-4108-85f2-a7248bee203f | raincross7/code-similarity | codes/train_code/problem063/problem063_500.cpp | #include <iostream>
const int MAXN = (int)1e6 + 1;
int count[MAXN];
int solve(int n) {
int ans = 0;
for (int i = 2; i < MAXN; ++i) {
int num_of_mul = 0;
for (int j = i; j < MAXN; j += i) {
num_of_mul += count[j];
}
if (num_of_mul == n) return 2;
if (num_of_mul > 1) ans = 1;
}
return... | ALGO | 0.999756 | 4.494252 |
94d22095-26fd-4d51-b483-73aace1a8d36 | shadowmydx/jiuduOJ | 简单计算器.cpp | #include <iostream>
#include <stack>
#include <string>
using namespace std;
stack<int> number;
stack<char> oper;
int main(void)
{
string target;
string tmp = "";
while(true)
{
getline(cin,target);
if(target == "0")break;
for(int i = 0;i < target.length();i++)
{
... | ALGO | 0.999122 | 4.443543 |
4e3dfddc-79ce-4691-950c-928b687675d5 | aritrakar/markov_chains | src/main.cpp | #include <iostream>
#include <fstream>
#include <sstream>
#include "markov.hpp"
Eigen::MatrixXd read_tpm_file(std::string tpm_filepath) {
// Read the TPM file
std::ifstream tpm_file (tpm_filepath);
// Construct the NxN TPM matrix
int N = 0;
std::string line;
while (std::getline(tpm_file, line... | ALGO | 0.966087 | 4.295232 |
579f7913-c45f-4a9f-ba09-81c0cb0a0504 | vlady/pe | 136/136.cpp | #include <iostream>
using namespace std;
typedef long long LL;
int sol[50000000];
int main() {
// (x+k)^2 - (x)^2 - (x-k)^2
// x^2 + 2kx + k^2 - x^2 - x^2 - k^2 +2kx
// 4kx - x^2 with k < x and k >= x/4
for (LL x = 0; x < 50000000; ++x) {
for (LL k = x / 4; k < x; k++) {
LL n = 4 *... | ALGO | 0.999571 | 3.508047 |
9f40d946-e124-4f44-a1e5-558a477942fa | Mierulii/Applied-Game-Physics | Ragdoll/Library/PackageCache/com.unity.ide.visualstudio@2.0.17/Editor/COMIntegration/COMIntegration~/COMIntegration.cpp | #include <iostream>
#include <sstream>
#include <string>
#include <filesystem>
#include <windows.h>
#include <shlwapi.h>
#include <fcntl.h>
#include <io.h>
#include "BStrHolder.h"
#include "ComPtr.h"
#include "dte80a.tlh"
constexpr int RETRY_INTERVAL_MS = 150;
constexpr int TIMEOUT_MS = 10000;
// Often a DTE call m... | TOOL | 0.947303 | 6.933585 |
017f5946-b875-4223-a51d-09caa2b3b254 | Junyingw/Inverse-Kinematics | starter/eigen/bench/benchmark-blocking-sizes.cpp | #include <iostream>
#include <cstdint>
#include <cstdlib>
#include <vector>
#include <fstream>
#include <memory>
#include <cstdio>
bool eigen_use_specific_block_size;
int eigen_block_size_k, eigen_block_size_m, eigen_block_size_n;
#define EIGEN_TEST_SPECIFIC_BLOCKING_SIZES eigen_use_specific_block_size
#define EIGEN_T... | TOOL | 0.909401 | 5.950303 |
a2968869-4dc4-4c1c-bb0e-39af6f836047 | routb68/Leetcode-pratice | 671-second-minimum-node-in-a-binary-tree/671-second-minimum-node-in-a-binary-tree.cpp | /**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode() : val(0), left(nullptr), right(nullptr) {}
* TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}
* TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), l... | ALGO | 0.999993 | 6.174062 |
196b3fae-d533-4406-a938-08f375e71897 | wuwendb/cccode | nowcoder/88888/D.cpp | // Problem: 小红的线段
// Contest: NowCoder
// URL: https://ac.nowcoder.com/acm/contest/88888/D
// Memory Limit: 524288 MB
// Time Limit: 2000 ms
#include <bits/stdc++.h>
#define endl "\n"
#define rep(i, a, b) for (int i = (a); i <= (b); ++i)
#define rev(i, a, b) for (int i = (a); i >= (b); --i)
#define all(a) begin... | ALGO | 0.999745 | 3.437937 |
7bb4afd1-919d-489a-9e31-7358046731eb | ashish-khulbey/My-Codechef-Codes | PRB01.cpp | // Problem Link : https://www.codechef.com/problems/PRB01
#include<bits/stdc++.h>
using namespace std;
#define gc getchar_unlocked
#define rep(i,a,b) for(ll i=(a);i<(b);i++)
#define rrep(i,a,b) for(ll i=(a);i>(b);i--)
#define Fo(i,k,n) for(i=k;k<n?i<n:i>n;k<n?i+=1:i-=1)
#define ll long long
#define si(x) scanf("%d",... | ALGO | 0.999532 | 4.553046 |
3f123e81-bf1c-4cc3-a06d-690b1bd679b3 | sandwichfarm/cassette | benchmarks/cpp/benchmark.cpp | #include <iostream>
#include <fstream>
#include <chrono>
#include <vector>
#include <string>
#include <algorithm>
#include <numeric>
#include <sstream>
#include <iomanip>
#include <filesystem>
#include <cstdlib>
#include <ctime>
#include <nlohmann/json.hpp>
#include "cassette_loader.hpp"
using json = nlohmann::json;
u... | TEST | 0.865268 | 7.053483 |
25e2d2a5-adfb-483c-be52-9b15daf1e6f8 | o-zhongchong/leetcode | Leetcode/82.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* deleteDupli... | ALGO | 0.999959 | 5.751536 |
ace90484-c909-4ae2-99fb-1032c3d22d28 | ishandutta2007/codeforces | jhin/normal/1358/B.cpp | #include <bits/stdc++.h>
using namespace std;
const int mod=998244353;
vector<long long> p;
int ho,mi,se,ho1,mi1,cnt;
void fix_time()
{ if(se>59)mi+=se/60,se=se%60;if(se<0)se+=60,mi--;
if(mi>59)ho+=mi/60,mi=mi%60;if(mi<0)mi+=60,ho--;
i... | ALGO | 0.999929 | 4.979972 |
ad9dd12a-e30e-41dc-a698-e92c20bc942a | pauloblazevic/SPA_domaci_2 | Domaci_2/Source.cpp | #include <iostream>
#include <string>
#include <fstream>
#include "game_of_life.h"
using namespace std;
int main() {
game_of_life the_game;
bool dalje;
do {
the_game.iscrtaj();
the_game.sljedeca_generacija();
cout << "Nastavi(1/0)? ";
cin >> dalje;
} while (dalje);
return 0;
} | TOOL | 0.950507 | 4.17742 |
b09d410b-2d4c-4f88-b343-b30b323e3350 | ishandutta2007/codeforces | satashun/normal/710/B.cpp | #include <bits/stdc++.h>
using namespace std;
typedef pair<int, int> pii;
typedef long long ll;
typedef vector<int> vi;
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define fi first
#define se second
#define rep(i,n) rep2(i,0,n)
#define rep2(i,m,n) for(int i=m;i<(n);i++)
#define ALL(c) (c).begin(... | ALGO | 0.999938 | 4.352153 |
e4c284db-8cc6-4d54-969a-42db2a282a19 | DavidRaschidLabiakhTrue/GummySculpting | Stroking.cpp | #include "Stroking.hpp"
#include "TopologyComputation.hpp"
void Sculpting::Stroking::applyStroke(MeshReference cMesh, SculptPayloadReference payload, const int iterations)
{
//auto& cHistory = cMesh.history.currentChangeLog;
//HistoryKeyVertexMap apply;
//const auto rMult = payload.radius * 0.5f * 0.3f * payload.... | ALGO | 0.997732 | 4.128462 |
f38bcfef-3025-4e4a-8978-cd2c3fceafc9 | oToToT/codebook | codes/Geometry/point_class.cpp | template<typename T>
struct Point{
typedef long double llf;
static constexpr llf EPS = 1e-8;
T x, y;
Point(T _=0, T __=0): x(_), y(__){}
template<typename T2>
Point(const Point<T2>& a): x(a.x), y(a.y){}
inline llf theta() const {
return atan2((llf)y, (llf)x);
}
inline llf dis() const {
retur... | ALGO | 0.994516 | 4.382546 |
ac40da82-bab4-465e-83ab-3ff294ae1395 | Maaz-24503/maaz_leetcode | 347 Top K Frequent Elements/347top-k-frequent-elements.cpp | class Solution {
public:
vector<int> topKFrequent(vector<int>& nums, int k) {
unordered_map<int, int> freq;
for(int i = 0; i<nums.size(); i++){
freq[nums[i]]++;
}
priority_queue<pair<int, int>> pq;
for(auto [num, fr] : freq){
pq.push({fr, num});
... | ALGO | 0.999996 | 6.198454 |
3ae2ade0-af8c-4d63-b88d-162adc7fa72f | prajjwal1999/C-CODES | strtok.cpp | #include <iostream>
#include<cstring>
using namespace std;
int main() {
char str[]=" HELLO MYSELF PRAJJWAL SINGH, AND A GOOD BOY";
char *ptr;
ptr=strtok(str," ");
while(ptr!=NULL)
{
cout<<ptr<<endl;
ptr=strtok(NULL,", ");
}
return 0;
}
| TOOL | 0.986181 | 3.262878 |
e2a4b479-cc81-4344-911f-10029fc6d731 | leandrofelix20k/exercicios-ITP | lista-03/ex04.cpp | #include <iostream>
bool ehPrimo(int);
int main(){
int quantidade, numeros;
std::cin >> quantidade;
for(int i=0; i<quantidade; i++){
std::cin >> numeros;
if(ehPrimo(numeros)){
std::cout << numeros << " eh primo\n";
} else{
std::cout << numeros << " nao e... | ALGO | 0.999382 | 5.052298 |
158ececb-9b63-4e29-b55b-bc4852938199 | vinikruger12/cpp | aulas/aula02brute/exercicios/pot.cpp | #include <bits/stdc++.h>
using namespace std;
int main(){
double a;
double b;
double pot;
cin >> a;
cin >> b;
pot = pow(a,b);
cout << fixed << setprecision(4) << pot;
} | ALGO | 0.999504 | 4.611492 |
1bb7c13e-4f38-497e-944f-e6a4732ee8b8 | googlebaba/farmer | Farmer/Farmer/FarmerDemo.cpp | #include "farmer.h"
using namespace std;
int main()
{
slove();
return 0;
}
inline bool farmer(int status)
{
return ((status&0x08)!=0);
}
inline bool wolf(int status)
{
return ((status&0x04)!=0);
}
inline bool cabbage(int status)
{
return ((status&0x02)!=0);
}
inline bool goat(int status)
{
return ((status&0x0... | ALGO | 0.99998 | 3.929069 |
0b2392a1-f21c-4ec5-9073-49df3213ab53 | MITechMerc/random | CPPWF/ch02/prime1.cpp | // Determine if a number is prime.
#include <iostream>
#include <cmath>
using namespace std;
int main() {
int n = 0; // Number to test for prime-ness
int i = 2; // Loop counter
bool is_prime = true; // Boolean (assume true)
// Get a number from the keyboard
cout << "Enter a number and pre... | ALGO | 0.998848 | 5.121917 |
886be538-adb2-4e68-9325-8c5e8749e909 | trebb/phoml | basics/point.cpp | #include "point.h"
#include <cmath>
//#include "rotation_matrix.h"
//#include "rot_matrix.h"//old!
double Point::Quad()
{
/* double d = ( (*this).m_x*(*this).m_x
+(*this).m_y*(*this).m_y
+(*this).m_z*(*this).m_z
);
return d;
*/
return ( (*this).m_x*(*this)... | ALGO | 0.996168 | 3.404457 |
76f26a2a-031e-47ba-9da0-db98333b10fc | JungminMun/BOJ | 1000/1546.cpp | #include <bits/stdc++.h>
using namespace std;
int score[1002], maxx = -99999;
double totscore;
int main(){
int n;
scanf("%d", &n);
for(int i = 0; i < n; i ++){
scanf("%d", &score[i]);
if(score[i] > maxx){
maxx = score[i];
}
}
for(int i = 0; i < n; i ++){
... | ALGO | 0.999033 | 3.865786 |
129aacc5-a098-4af6-b956-c790ead8c281 | AkshayKulkarni3467/TodoList-with-flutter | windows/runner/utils.cpp | #include "utils.h"
#include <flutter_windows.h>
#include <io.h>
#include <stdio.h>
#include <windows.h>
#include <iostream>
void CreateAndAttachConsole() {
if (::AllocConsole()) {
FILE *unused;
if (freopen_s(&unused, "CONOUT$", "w", stdout)) {
_dup2(_fileno(stdout), 1);
}
if (freopen_s(&unuse... | TOOL | 0.9988 | 6.76073 |
13b997ad-401c-4a8c-a949-aa9c5a0876d8 | KausBoss/HP_Codes | 931_LeetCode.cpp | class Solution {
public:
int minFallingPathSum(vector<vector<int>> A){
int n=A.size();
for(int i=1; i<n; i++){
for(int j=0; j<n; j++){
if(j==0){
A[i][j] += min(A[i-1][j], A[i-1][j+1]);
}
else if(j == n-1){
A[i][j] += min(A[i-1][j], A[i-1][j-1]);
}
e... | ALGO | 0.999989 | 5.841213 |
4d989610-218a-488f-8cf0-e93209f33e9e | colonialbiker1122/CPlusPlus | B039.cpp | //Write a function display() using templates to print the values of integer, character, float and string data types with single definition of function.
#include<iostream>
using namespace std;
template <class t1>
void display(t1 ob) {
cout<<ob<<endl;
}
int main() {
display(20);
display('A');
display(65... | TOOL | 0.92604 | 4.522243 |
ea0bfc58-6837-483d-94d8-a77c3eeda413 | ryanzhang15/RJ_HKOI | T202.cpp |
#include <cstdio>
#include <iostream>
#include <cstdlib>
#include <iostream>
#include <cstdio>
#include <iomanip>
#include <fstream>
#include <sstream>
#include <cmath>
#include <cstring>
#include <ctime>
#include <bitset>
#include <deque>
#include <string>
#include <stack>
#include <vector>
#include <map>
#include... | ALGO | 0.999863 | 3.783462 |
6e72fe6e-5ee1-4085-b390-147f08ff0af3 | wassimalharaki/Codeforces | 800/AddOddorSubtractEven.cpp | #include <bits/stdc++.h>
using namespace std;
#define fast ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define int long long
#define all(v) v.begin(), v.end()
#define nl << '\n'
#define v vector
#define vi vector<int>
#define pii pair<int, int>
#define mp make_pair
#define pb push_back
#define INF LONG_LONG... | ALGO | 0.999939 | 4.124669 |
13b6333b-b30c-4248-a926-954b8b7a8799 | ishandutta2007/codeforces | denisson/normal/490/E.cpp | #define _CRT_SECURE_NO_WARNINGS
#pragma comment(linker, "/STACK:256000000")
#include <iostream>
#include <fstream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <ctime>
#include <cstring>
#include <algorithm>
#include <vector>
#include <string>
#include <map>
#include <set>
#include <queue>
#include <s... | ALGO | 0.999922 | 3.313532 |
ff563aa4-90d4-4f1e-9cfb-2b7d0f14e881 | kt117/ProCom | atcoder/abc/101-200/181-190/181/a.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
const ll MOD = 1e9+7;
const ll INF = 1e18;
#define rep(i,m,n) for(ll i = (m); i <= (n); i++)
#define zep(i,m,n) for(ll i = (m); i < (n); i++)
#define rrep(i,m,n) for(ll i = (m); i >= (n); i--)
#define print(x) cout << (x) << end... | ALGO | 0.999801 | 4.278993 |
a6905627-4e2f-48d4-8eb3-5696967dd2a8 | GreatDanton/Training | Cpp/thinkLikeAProgrammer/2.pure_puzzles/4.decode_a_message.cpp | #include <iostream>
// 18,12312,171,763,98423,1208,216,11,500,18,241,0,32,20620,27,10
// should return: "Right? Yes!"
char punctuationChar(int number) {
char outputCharacter;
switch (number) {
case 1:
outputCharacter = '!';
break;
case 2:
outputCharacter = '... | ALGO | 0.999499 | 5.019654 |
734bb351-c51a-4ae9-aed3-61cfc8aaebd0 | 0bcMoon/Competitive-programming | Codeforces/solve/I._Doggo_Recoloring.cpp | #include <iostream>
#include <vector>
using ll = long long;
using lpair = std::pair<ll, ll>;
using ipair = std::pair<int, int>;
void solve()
{
int n;
std::string str;
std::cin >> n >> str;
std::vector<int> vec(26, 0);
for (int i = 0; i < n; i++)
{
int idx = str[i] - 'a';
vec[idx]++;
}
std::string ans = "NO\... | ALGO | 0.999994 | 4.145859 |
c433e369-8fdb-4509-b2cb-c9a1302ec856 | qyliu-hkust/BitTuner | compressor/lib/sdsl-lite/tutorial/expl-11.cpp | #include <iostream>
#include <sdsl/bit_vectors.hpp>
using namespace std;
using namespace sdsl;
int main()
{
bit_vector b = { 0, 1, 0, 1, 1, 1, 0, 0, 0, 1, 1 };
size_t cnt10 = rank_support_v<10, 2>(&b)(b.size());
select_support_mcl<10, 2> b_sel10(&b);
for (size_t i = 1; i <= cnt10; ++i) cout << b_sel... | ALGO | 0.995232 | 3.196502 |
586692d7-73d4-4628-82d7-3599eb30396b | dogmania/Algorithm | 프로그래머스/1/12982. 예산/예산.cpp | #include <bits/stdc++.h>
using namespace std;
int solution(vector<int> d, int budget) {
int answer = 0;
sort(d.begin(), d.end());
for (int i = 0; i < d.size(); i++) {
budget -= d[i];
if (budget >= 0) answer++;
else break;
}
return answer;
} | ALGO | 0.999559 | 5.477451 |
36a636c4-1156-45ff-a3fe-8e2e5cec28e1 | ishandutta2007/codeforces | grt_2018/normal/1013/E.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long LL;
typedef pair<int,int> pi;
typedef vector<int> vi;
#define ST first
#define ND second
#define PB push_back
const int MAXN = 5010;
const int INF = 1000*1000*1000;
LL dp[MAXN][MAXN];
LL minpref[MAXN][MAXN];
int n,a[MAXN];
int main()
{
ios_base::sy... | ALGO | 0.999939 | 3.29445 |
f630619a-f3d7-46e8-b5e8-c6d1273a12e7 | RamazanFIT/codeforces | graph/t1.cpp | #include <bits/stdc++.h>
#define ENDL "\n"
#define ff first
#define ss second
#define all(x) (x).begin(), (x).end()
#define endd return 0;
#define int ll
#define goodluck ios_base::sync_with_stdio(0);cin.tie(NULL);cout.tie(NULL);
using ll = unsigned long long;
using namespace std;
signed main(){
goodluck
... | ALGO | 0.99993 | 4.594632 |
552b50c3-5ce8-42e4-9656-3b3e398ca74b | gelecekvadisi/flutter_1_2024 | Rain-main_template_app/windows/runner/utils.cpp | #include "utils.h"
#include <flutter_windows.h>
#include <io.h>
#include <stdio.h>
#include <windows.h>
#include <iostream>
void CreateAndAttachConsole() {
if (::AllocConsole()) {
FILE *unused;
if (freopen_s(&unused, "CONOUT$", "w", stdout)) {
_dup2(_fileno(stdout), 1);
}
if (freopen_s(&unuse... | TOOL | 0.998052 | 6.785645 |
32a7c2df-6378-464b-b70c-44017731fad2 | shivanshsanoria1/LeetcodeSolutions | CPP [2001-2500]/2341.maximum_number_of_pairs_in_array [1].cpp | class Solution {
public:
vector<int> numberOfPairs(vector<int>& nums) { //T.C.=O(n), S.C.=O(n)
vector<int> ans(2, 0);
unordered_map<int, int> mp;
for(int num: nums)
mp[num]++;
for(auto it: mp)
{
ans[0] += it.second/2;
if(it.second % 2 == 1)... | ALGO | 0.999905 | 5.866438 |
1a38edeb-7406-4164-a2a6-56aa503e3633 | MarkYuan/lclibvlc | modules/demux/hls/playlist/Parser.cpp | #ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include "Parser.hpp"
#include "HLSSegment.hpp"
#include "HLSRepresentation.hpp"
#include "../../adaptive/SharedResources.hpp"
#include "../../adaptive/playlist/BasePeriod.h"
#include "../../adaptive/playlist/BaseAdaptationSet.h"
#include "../../adaptive/playlist/Segmen... | TOOL | 0.889362 | 5.794273 |
dda0a7c1-a936-4cd0-b2b6-c79869eb5f5f | vbonnici/grafe-sim | analysis/data/p01140/s133959317.cpp | #include <iostream>
#include <algorithm>
#include <vector>
#include <set>
#define N1 1501
#define N2 1000
using namespace std;
int hcnt[N1*N2],wcnt[N1*N2];
int main(){
int N,M,h[N1],w[N1];
vector<int> H,W;
set<int> S;
while(1){
cin >> N >> M;
if(N==0&&M==0) break;
for(int i=0;i<N;i++){
cin >> ... | ALGO | 0.999887 | 3.139214 |
65ec6f23-2482-4090-b952-5b1da291d1c4 | IFIFIF23/gem5-riscv | src/systemc/tests/systemc/misc/unit/data/datawidth_bool_to_unsigned/bits_to_bits/datawidth.cpp | /*****************************************************************************
datawidth.cpp --
Original Author: Martin Janssen, Synopsys, Inc., 2002-02-15
*****************************************************************************/
/**************************************************************************... | ALGO | 0.968009 | 5.70026 |
6b6b1368-3da9-48ca-bcde-368c3a8656e8 | ProjectBlaze/frameworks_av | media/module/codecs/amrnb/common/src/shr_r.cpp | /*
Pathname: ./gsm-amr/c/src/shr_r.c
------------------------------------------------------------------------------
REVISION HISTORY
Description: Created separate file for the shr_r function. Sync'ed up
with the current template and fixed tabs.
Description: Passing around pOverflow as per EPOC changes... | ALGO | 0.999311 | 6.392525 |
744d4e37-f259-4ac7-918e-ce5eb5bca5af | memcpy0/LeetCode-Conquest | Solutions/2901-2910/2906. 构造乘积矩阵[前后缀分解,数组] 中等.cpp | /*
** Problem: https://leetcode.cn/problems/construct-product-matrix/
** Article: https://memcpy0.blog.csdn.net/article/details/133854911
** Author: memcpy0
*/
// BEST
class Solution {
public:
vector<vector<int>> constructProductMatrix(vector<vector<int>>& grid) {
const int MOD = 12345;
int n = grid... | ALGO | 0.999966 | 6.383358 |
fe68f69a-3fcf-4990-b576-df20bceb8313 | nishant-ai/DSA-Help | CPP/DataStructures/display-linked-list.cpp | #include <iostream>
using namespace std;
struct Node {
int data;
struct Node *next;
};
struct Node* head = NULL;
void insert(int new_data) {
struct Node* new_node = (struct Node*) malloc(sizeof(struct Node));
new_node->data = new_data;
new_node->next = head;
head = new_node;
}
void display() {
stru... | ALGO | 0.99975 | 4.215797 |
a13c5ccd-8782-4a13-ba6f-f9f6dd5d2a45 | KevinIsYi/100-Days-Of-Code | CP/Codeforces/800/811A.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
int a, b, control(1);
bool can(true);
cin >> a >> b;
while(can) {
can = false;
a -= control++;
b -= control++;
if (a < 0) {
cout << "Vladik\n";
}
else if (b < 0) {
cout << "Valera\n";
}
... | ALGO | 0.999976 | 3.964739 |
f4cfc47d-f023-49d9-b478-d41cc82a7382 | williamchenwl/ACMLibrary | Strings/StringHash.cpp | /*
BKDR_HASH是一种可动态变换的Hash函数
可以直接溢出
*/
typedef unsigned long long ull;
ull seed = 137;
int bkdr_hash(){
int len = s.length();
ull ans = 0;
for (int i = 1;i < s.length();i++)
ans = ans * seed + s[i];
}
| ALGO | 0.998842 | 3.113422 |
dfc031f9-cc6c-4b86-9f81-fd04c7a52bca | Garzzza7/zadania | CodeForces/Longtail_Hedgehog.cpp | #include <bits/stdc++.h>
#include <cmath>
#include <stdlib.h>
using namespace std;
// https://codeforces.com/problemset/problem/615/B
int main()
{
ios::sync_with_stdio(false);
cin.tie(0);
int n, m;
cin >> n >> m;
const int maxN = 1 << 17;
//test sdgdsgsdfgdfgd
//asdasad
int dp[maxN];
vector<... | ALGO | 0.999313 | 4.39096 |
1fe38eac-2ed8-468f-ab47-4b674b6d8a58 | RoboHoboMobo/c_snake | snake.cpp | // Snake structure code
#include "game.h"
void Snake_init(Snake* s) // Snake struct initialization
{
s->size = 1;
Snake_chunk *h = new Snake_chunk(); // head chunk
h->x = FIELD_SIZE/2;
h->y = FIELD_SIZE/2;
h->dir = RIGHT;
h->next = NULL;
s->head = h;
s->tail = h;
}
bool Snake_add(Snak... | TOOL | 0.967517 | 4.568398 |
e0a867f7-6b87-47e3-9bf1-7fb4f7e22df9 | TheSanvi/c_plus_plus_programming | array.cpp/2DArray/row_sum_print.cpp | #include<iostream>
using namespace std;
void printRowWiseSum(int arr[][3],int rows, int cols){
cout<<"printin row wise sum "<< endl;
for(int i=0; i<rows; i++){
int sum= 0;
for(int j =0; j<cols; j++){
sum = sum +arr[i][j];
}
cout<<sum<<endl;
}
}
int main(){
int... | ALGO | 0.999247 | 4.049964 |
b36acd5e-ee96-4244-9cbb-6c343fe0a724 | Alok-Sci/DSA-Series-by-Shradha-Khapra-Madam-CPP | intermediate/functions/func_factorial_of_n_numbers_using_recursion.cpp | #include <iostream>
using namespace std;
int factorial(int num)
{
if (num <= 1)
return num;
return num * factorial(num - 1);
}
int main()
{
int num;
cout << "Enter a number to find factorial of: \n";
cin >> num;
cout << "Factorial of " << num << ": " << factorial(num);
return 0;... | ALGO | 0.999467 | 4.748534 |
c0ef28b8-780c-4873-b780-7f57f60a1c19 | fanacio/ncnn-inference | ncnn-master/src/layer/mips/interp_mips.cpp | #include "interp_mips.h"
#include <math.h>
#if __mips_msa
#include <msa.h>
#endif // __mips_msa
#include "mips_usability.h"
namespace ncnn {
#include "interp_bicubic.h"
#include "interp_bilinear.h"
#if __mips_msa
#include "interp_bicubic_pack4.h"
#include "interp_bilinear_pack4.h"
#endif
Interp_mips::Interp_mips... | ALGO | 0.998197 | 6.13335 |
983dbd43-2a46-47ac-85ab-8f92b671cf06 | rashmitha520/AlgoBloom | dp/jump/jump game -2.cpp | /*Given an array of non-negative integers nums, you are initially positioned at the first index of the array.
Each element in the array represents your maximum jump length at that position.
Your goal is to reach the last index in the minimum number of jumps.
You can assume that you can always reach the last index.
... | ALGO | 0.999987 | 6.025914 |
fc1c9111-87b6-4c9f-bb09-e81bc6c6b68c | AyushKumar1000/cpp_programs | hello.cpp | //write a program to take 6 intigers as inegers as input , store them it an array and calculate the sum of all the elements in the array
#include <iostream>
using namespace std;
int main() {
int arr[8];
int evenCount = 0, oddCount = 0;
cout << "Enter 8 numbers: ";
for (int i = 0; i < 8; i++) {
... | ALGO | 0.991341 | 3.823506 |
d9a69ad1-f164-4b4e-ae3c-b398c3d85478 | qam4/blunder | source/ValidateMove.cpp | /*
* File: ValidateMove.cpp
*
*/
#include "ValidateMove.h"
#include "MoveGenerator.h"
#include "Output.h"
string static is_legal_move_err(Move_t move, const class Board& board);
string static is_valid_move_err(Move_t move, const class Board& board);
bool is_valid_move(Move_t move, const class Board& board, bool... | ALGO | 0.919762 | 5.856691 |
064f5e90-8a9a-4b9e-8449-b0e22091deec | MobClub/ShareSDK-Cocos2d-x-Demo-for-iOS | cocos2d/extensions/Particle3D/PU/CCPUParticleFollower.cpp | #include "CCPUParticleFollower.h"
#include "extensions/Particle3D/PU/CCPUParticleSystem3D.h"
NS_CC_BEGIN
// Constants
const float PUParticleFollower::DEFAULT_MAX_DISTANCE = 3.40282e+038f;
const float PUParticleFollower::DEFAULT_MIN_DISTANCE = 10.0f;
//-----------------------------------------------------------------... | TOOL | 0.92345 | 6.535982 |
943624df-01ca-4b21-9b55-a737a2e7e6f9 | Bishal16/Codeforces_B | 1095B.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
long int n,i,l,h,sl,sh,s=0;
cin>>n;
long int arr[n];
for(i=0;i<n;i++)
cin>>arr[i];
if(n==2)
{cout<<0;return 0;}
sort(arr,arr+n);
l=arr[0];h=arr[n-1];sl=arr[1],sh=arr[n-2];
if(h-sl>sh-l)
cout<<sh-l;
el... | ALGO | 0.999913 | 3.744802 |
ab678268-0c7a-454c-94cd-a99cd92bbdf1 | ishandutta2007/codeforces | dlalswp25/normal/1375/C.cpp | #include <bits/stdc++.h>
using namespace std;
vector<int> v;
int A[303030];
int main() {
int tc; scanf("%d", &tc);
while(tc--) {
int N; scanf("%d", &N);
for(int i = 1; i <= N; i++) scanf("%d", &A[i]);
v.clear();
for(int i = N; i >= 1; i--) {
if(v.size() == 0) { v.push_back(A[i]); continue; }
while(v.... | ALGO | 0.999938 | 4.384256 |
ccafcfe6-604f-4832-af73-dffaa3a60789 | afterlife69/OwlCoder3 | 0279-perfect-squares/0279-perfect-squares.cpp | class Solution {
public:
int numSquares(int n) {
int dp[n+1];
memset(dp,1e9,sizeof(dp));
dp[0] = 0;
for(int i=1;i<=n;i++){
int mn = 1e9;
for(int j=1;j*j <= i;j++){
int cur = j*j;
if(i - cur >= 0){
mn = min(mn,... | ALGO | 0.999909 | 5.729303 |
9d954419-45e1-4630-b26d-8ad9c7a484fb | BionicCat27/adventofcode23 | day1/day1.cpp | #include <iostream>
#include <fstream>
#include <algorithm>
#include <string>
#include <map>
using namespace std;
string NUMBERS[] = {"zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine"};
int part1(ifstream &data);
int part2(ifstream &data);
string makeNumeric(string line);
int getFirstNum... | ALGO | 0.998757 | 6.2004 |
082d25ca-531d-40be-9323-5d413d07d84f | alexandraback/datacollection | solutions_6404600001200128_1/C++/bluewang/aaa.cpp | #include <cstdio>
#include <cstring>
#include <algorithm>
#include <queue>
#include <stack>
using namespace std;
int a[10005];
int main(int argc, char const *argv[])
{
freopen("in.txt","r",stdin);
freopen("out.txt","w",stdout);
int T,ca=0,n=0;
scanf("%d",&T);
while(T--)
{
int ans;
... | ALGO | 0.999467 | 3.390148 |
1e6ab4ea-0929-43c0-a348-e9b92eef4ca7 | NeoAnomaly/xray | 3rd party/MagicSoftware/FreeMagic/Source/Distance3D/MgcDist3DTriTri.cpp | #include "MgcDist3DLinTri.h"
#include "MgcDist3DTriTri.h"
using namespace Mgc;
//----------------------------------------------------------------------------
Real Mgc::SqrDistance (const Triangle3& rkTri0, const Triangle3& rkTri1,
Real* pfTri0P0, Real* pfTri0P1, Real* pfTri1P0, Real* pfTri1P1)
{
Real fS, fT, f... | ALGO | 0.99925 | 6.594707 |
ed66c39f-9568-40fe-a34f-2296a40783d4 | MdAfsarHossain/Phitron | Semester 1/Course 3 [Data Structures]/Week 2 [Time Complexity & Array]/Module 4 [Time Complicity & Linear Search]/1. Time Complexity/Time_Com7.cpp | #include<bits/stdc++.h>
using namespace std;
/**
Time Complexity: O(n)
Memory Complexity: O(n)
**/
int main()
{
int n, k;
cin>>n>>k;
vector<int> a(n);
for(int i=0; i<n; i++)
cin>>a[i];
for(int i=0; i<n; i++)
{
if(a[i] == k)
{
cout<<i<<" -> YES\n";
// ... | ALGO | 0.99999 | 4.076191 |
f2804307-9aa2-44fc-aa20-211f10c1d1e5 | priyam3955/Interview-Prep | 2585-number-of-ways-to-earn-points/2585-number-of-ways-to-earn-points.cpp | class Solution {
public:
int waysToReachTarget(int target, vector<vector<int>>& types) {
int n = types.size(), mod = 1e9 + 7;
vector<vector<int>> dp(n + 1, vector<int>(target + 1));
for(int i=0; i<=n; i++) dp[i][0] = 1;
for(int i=n-1; i>=0; i--) {
for(int t=target; t>=0;... | ALGO | 0.999981 | 6.195135 |
7802c34a-bef7-47fd-9a9d-352935bc5663 | anhtuta/c-cpp | Dijkstra.cpp | #include<stdio.h>
#include<stdlib.h>
#include <iostream>
#define MAX 100
#define INF 99999999
using namespace std;
int n;
int d[MAX]; //d[v] = khoang cach ngan nhat tu dinh s toi dinh v
int p[MAX]; //p[v] = cha cua v tren ddnn
int w[MAX][MAX]; //w[a][b] = gia cua canh (a,b), w la matrix trong so
int s, t; //s = so... | ALGO | 0.999834 | 3.093547 |
58baa15d-a252-4473-bb21-ed488208cb22 | vijaygarg1/UT-Garg-EE382C-EE361C-Multicore | cuda/NVIDIA_CUDA-7.5_Samples/5_Simulations/nbody_screen/nbody_screen.cpp | #include "render_particles.h"
#include <screen/screen.h>
#include <cstdlib>
#include <cstdio>
#include <algorithm>
#include <assert.h>
#include <math.h>
#include <unistd.h>
#include <cuda_runtime.h>
#include <helper_cuda.h>
#include <helper_functions.h>
#include "bodysystemcuda.h"
#include "bodysystemcpu.h"
#inclu... | ALGO | 0.936351 | 5.207686 |
32b8a0e4-1c1b-47d5-a558-cf4aba96c50b | raincross7/code-similarity | codes/train_code/problem400/problem400_209.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main()
{
string a;
cin>>a;
int ans=0;
for(auto i : a)
{
ans+=i-'0';
}
if(ans%9==0) cout<<"Yes"<<endl;
else cout<<"No"<<endl;
return 0;
} | ALGO | 0.999922 | 4.043396 |
0c2b76e1-25b9-46f6-8dbb-0075f137c8aa | mayank171/leetcode | 0124-binary-tree-maximum-path-sum/0124-binary-tree-maximum-path-sum.cpp | class Solution {
public:
int solve(TreeNode* root,int &ans)
{
if(root==NULL)
{
return 0;
}
int x=max(0,solve(root->left,ans));
int y=max(0,solve(root->right,ans));
ans=max(ans,root->val+x+y);
return root->val+max(x,y);
... | ALGO | 0.999992 | 6.267071 |
ce4afe13-d14a-4b0e-963c-b6d175060245 | ishandutta2007/codeforces | louhao088088/normal/1270/F.cpp | #include <cmath>
#include <cstdio>
#include <cstring>
typedef long long LL;
const int MAXN = 2e5 + 5, MAXT = 505;
template<typename _T>
void read( _T &x )
{
x = 0;char s = getchar();int f = 1;
while( s > '9' || s < '0' ){if( s == '-' ) f = -1; s = getchar();}
while( s >= '0' && s <= '9' ){x = ( x << 3 ) + ( x << ... | ALGO | 0.999976 | 3.988428 |
dfc961ae-17a0-4ec7-a9b3-8565277bdefe | mahamudur786/My-pc-c-program | codevitaphiland.cpp | #include<bits/stdc++.h>
using namespace std;
#define ll long long
int calc(int,int);
int main()
{
ios::sync_with_stdio(0);
cin.tie(0);
int test,j;
cin >> test;
while(test--)
{
int n;
cin >> n;
for(int i= 1;i <= n ;i++)
{
int m;
m = (i*(i+1))/2;
if(m>=n)
break;
j = i;
}
cout >> j >> ... | ALGO | 0.99982 | 4.092666 |
d9fc6df8-7846-4686-980f-aaee106d0eec | galessandroni/liceo-marconi | Informatica/AL/fibonacci.cpp | /*********************************************************************************************************************
* fibonacci.cpp *
* La successione di Fibonacci è una successione di numeri interi in cui ciascun n... | ALGO | 0.999254 | 4.732724 |
ca9f4cb3-6c4c-4965-8865-959f286d9789 | abdul-rozzaq/pdp-darslar | 2-modul/2-dars/03.cpp | #include <iostream>
using namespace std;
int getPower(int number){
int count = 0;
while (number > 0)
{
count += 1;
number /= 10;
}
return count;
}
int getOddsCount(int a, int b){
int count = 0;
for (int i = a; i < b; i++)
{
if (i % 2 == 0)
... | ALGO | 0.880272 | 4.704665 |
0691c720-d878-41da-a999-e2a14e0d21a9 | Zaid-bT/OOP-Lab | OOP Lab Task 2/Q2.cpp | #include<iostream>
using namespace std;
void* addOperation(void* arr, int size){
int* arrInt = static_cast<int*>(arr); // casts void ptr to int ptr
for( int i=0;i<size;i++){
arrInt[i]+=1;
}
// void * ret=&c
arr=&arrInt;
return arr;
}
int main(int argc, char* argv[]){
int size;
cout<<"Enter array size: ";
ci... | ALGO | 0.96241 | 4.24829 |
2f3e5d08-7525-4181-a231-6e14d461e95c | NikitaUssyukin/PP1_2025_Spring | Lectures/G1/Week02/c_4.cpp | #include <iostream>
using namespace std;
int main() {
// Operators, arithmetic
/*
++ increment
-- decrement
*/
/*
pre- and post- variants
++a preincrement
a++ postincrement
--a predecrement
a-- postdecrement
*/
int a = 1;
int b = 1;
a++;
++a;
... | ALGO | 0.995111 | 4.34401 |
a1c3b310-a322-4562-9492-ce32796aab34 | wdzeng/cp-solutions | codeforces/contest/1238/a.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<double, double> pdd;
const double PI = acos(-1);
#define x first
#define y second
#define iter(c) c.begin(), c.end()
#define ms(a) memset(a, 0, sizeof(a))
#define mss(a) memset(a, -1, sizeof(a))
#define mp(e, f)... | ALGO | 0.999624 | 4.559275 |
6326beb9-ffa3-431c-9160-c3c512483f2b | wztsir/leetcode | list/leet23.cpp | #include"ListNode.h"
#include<vector>
#include<queue>
#include<functional>
using namespace std;
ListNode* mergeKLists(vector<ListNode*>& lists) {
priority_queue<ListNode*, vector<ListNode*>, function<bool(ListNode*, ListNode*)>> pq(
[](ListNode* a, ListNode* b){return a->val > b->val;});
for(auto it : l... | ALGO | 0.999116 | 5.397257 |
a0095815-4aad-4fe7-a55e-5577fa10612e | Dragonfly-glitch/DSA-LAB | Lab5/circle.cpp | //Program to implement listADT using circular linked lists in C++
#include <iostream>
using namespace std;
class list {
private:
struct node {
int data;
node *next;
};
node *head;
public:
list() { head = NULL; }
bool insertbeg(int);
bool insertend(int);
bool insertpos(int, ... | ALGO | 0.999856 | 4.683434 |
5da39d6e-1fab-4ba9-abbf-18391cb3d66f | RowanHarley/blaze | blazemark/src/mtl/DMatSMatAdd.cpp | //=================================================================================================
//=================================================================================================
//*************************************************************************************************
// Includes
//****... | ALGO | 0.98594 | 5.619654 |
022da0c7-447b-4bf5-b66b-270ed65b33b8 | GVK-Sindhu/GFG | Difficulty: Basic/LCM And GCD/lcm-and-gcd.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution {
public:
// int gcd(int a,int b){
// while(a>0 && b>0){
// if (a>b) a=a%b;
// else b=b%a;
// if (a==0) return b;
// else return a;
// }
/... | ALGO | 0.999487 | 6.315658 |
c7680bad-9690-4211-b398-0a5ab51286c5 | Genius15066/Learn-Programming | CPP/CodeForces/Contest/Cats.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long int
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
#ifndef ONLINE_JUDGE
freopen("../Utilities/input.txt", "r", stdin);
freopen("../Utilities/output.txt", "w", stdout);
#endif
int test;
cin>>tes... | ALGO | 0.999854 | 3.515456 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.