uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
0f099980-e666-4278-baaa-0590df0492d4 | JYOTHIkudipudi/GeekForGeek | LinkedListInsertionEnd.cpp | /* Linked List Insertion At End
Given the head of a Singly Linked List and a value x, insert that value x at the end of the LinkedList and return the modified Linked List.
Examples :
Input: LinkedList: 1->2->3->4->5 , x = 6
Output: 1->2->3->4->5->6
Explanation:
We can see that 6 is inserted at the end of th... | ALGO | 0.99862 | 5.819818 |
20aaf333-a340-496d-bc7e-6ec556cd3b0b | kpyrkosz/reversing | ThePilotOfTheService/ThePilotOfTheService/BoundingBox.cpp | #include "BoundingBox.hpp"
#include "Maths.hpp"
void BoundingBox::Reset(std::vector<XYPair>&& polygonxyPairs, unsigned int newHeightDifference)
{
maxHeightDifference = newHeightDifference;
xyPairs = std::move(polygonxyPairs);
}
bool BoundingBox::isInsideBox(int x, int y, unsigned int heightDifference)
{
if (xyPair... | TOOL | 0.990017 | 6.362728 |
6dad0e8e-f5f6-4660-ab4e-6fddd48bb426 | takumi34/atcoder | abc159/159b.cpp | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define repi(i, s, n) for (int i = (s); i < (int)(n); i++)
#define all(x) (x).begin(), (x).end()
typedef long long int ll;
typedef pair<int, int> P;
const long long INF = 3e18 + 12;
const int inf = 1e9;
int main() {
... | ALGO | 0.999994 | 4.490929 |
9a9deccf-06a8-496e-a91e-74100c9c7d39 | cyb3rb34s7/Leetcode-prog | 295-find-median-from-data-stream/295-find-median-from-data-stream.cpp | class MedianFinder {
public:
priority_queue<int> maxx ;
priority_queue<int,vector<int>,greater<int>> minn ;
MedianFinder() {
}
void addNum(int num) {
if(maxx.empty())
{ maxx.push(num) ;
return;
}
if(maxx.size()>minn.size()){
... | ALGO | 0.999992 | 6.002656 |
b2edf70b-847e-4a34-bcd4-47f766f92eb6 | 3shmawi/New-3c-directories | 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.998733 | 6.76775 |
bbbffefd-c20e-4481-9849-bc218cbac777 | ezrazka/Competitive-Programming | KEP.uz/C.cpp | #include <bits/stdc++.h>
using namespace std;
#define int long long
#define pii pair<int, int>
#define fi first
#define se second
#define debug(x) cout << "(" << #x << " : " << x << ")\n"
#define debughere cout << "HERE\n"
void solve(){
int n; cin >> n;
string s = to_string(n);
reverse(s.begin(), s.end()... | ALGO | 0.999721 | 4.157434 |
59e6f0ec-4fae-4fa2-9b09-5c60a8a163d4 | nitishhsinghhh/Tips-and-Tricks-for-Programming-using-Cpp | Misc/Leetcode/242/Valid_Anagram.cpp | /**
* 242. Valid Anagram
* (https://leetcode.com/problems/valid-anagram/description/)
*/
#include<iostream>
class Solution {
public:
bool isAnagram(std::string s, std::string t) {
// Declare two array for counting frequency of characters of string
int freq1[26] = { 0 };
int freq2[26] = { 0 };
// Counting c... | ALGO | 0.999928 | 6.229988 |
51d5ff0f-092f-4ed1-9629-b8e7697256a0 | manikanta2901/ubuntu | .history/practice/cpp/codeforces/moveBrackets_20200629211222.cpp | #include<bits/stdc++.h>
#include<vector>
#include<iostream>
#include<cmath>
#include<algorithm>
#include<iterator>
#include<string>
#include<map>
#define F first
#define S second
#define MP make_pair
#define EXECUTE_FASTER ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define printVect(vect,dataStruc... | ALGO | 0.999364 | 4.246926 |
0d1f1082-bf24-4ee8-836f-db71c6027ac4 | wujunjian/preServer | Config.cpp | #include "Config.h"
Config *Config::s_Instance = NULL;
Config::Config(void)
{
}
Config::~Config(void)
{
}
int Config::Load(string filename)
{
if (!m_IniParser.open(filename.c_str())) return -1;
ServerIP = GetParamStringValue("ServerIP", "Server");
ListenPort = GetParamIntegerValue("ListenPort", "Server", 8... | CONFIG | 0.8708 | 4.821654 |
6247841d-e5f0-4f38-8185-0f6144ab5862 | preru98/Data-Structures-HeaderFiles | linkedLists/createLinkedListAppendAtBeginning.cpp | #include<iostream>
using namespace std;
struct Node{
int data;
Node *next;
};
Node* create_node(int);
void insert_at_beg(int);
void display(Node*);
Node *start=NULL, *rear=NULL;
int main(){
int list[] = {4,7,2,9,1,0,2,6,9,10};
int size =sizeof(list)/sizeof(list[0]);
for(int i=0;i<size;i++){
... | ALGO | 0.99152 | 4.437257 |
d9c0733b-6246-46ae-843f-aa437253d289 | ishandutta2007/codeforces | leaf1415/normal/1626/C.cpp | #include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <ctime>
#include <cstdlib>
#include <cassert>
#include <vector>
#include <list>
#include <stack>
#include <queue>
#include <deque>
#include <map>
#include <set>
#include <bitset>
#include <string>
#include <algorithm>
#include <utility>
... | ALGO | 0.999962 | 3.475784 |
432ca73b-f8d3-40df-8493-678c509e683d | Allen-5xn/homework | HW3/HW3.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
struct Node {
int coef;
int exp;
Node* link;
Node(int c = 0, int e = 0, Node* l = nullptr) : coef(c), exp(e), link(l) {}
};
class Polynomial {
private:
Node* first;
public:
Polynomial() {
first = ... | ALGO | 0.999306 | 4.386199 |
393ce658-d95a-4545-85fc-b9ae955d3acd | nkrishnan94/obstacle_growth | eff_pop_cooperative.cpp | #include <iostream>
#include <iomanip>
#include <fstream>
#include <math.h>
#include <sstream>
#include <string>
#include <unistd.h>
#include <array>
#include <vector>
#include <random>
#include <ctime>
#include <gsl/gsl_rng.h>
#include <gsl/gsl_randist.h>
//define default parameters of simulation
const int NDeme = 3... | ALGO | 0.999939 | 5.51725 |
2a742429-46fd-4a18-a4d2-a719c594360a | dipeshsirohia/Cplus_programming | Dpseries/powerof2.cpp | # include <iostream>
using namespace std;
int main()
{
cout<<"Enter the number of terms \n";
int n;
cin>>n;
int prd=1;
cout<<prd<<" ";
while(n-1){
prd=prd*2;
cout<<prd<<" ";
n--;
}
return 0;
} | ALGO | 0.99975 | 3.757373 |
3a902f7d-dbda-482d-a718-e0dddc00e3b8 | awerty1/basics_C_plus_plus_programming | 5 variant/5_1.cpp | /*
Задание 1. Вводится строка произвольного текста. Вывести на экран все
строчные буквы из этой строки. Если таких букв нет, вывести -1.
*/
#include <iostream>
#include <string>
#include <iomanip>
int main()
{
std::string text;
std::cout << "Введите текст: ";
std::getline(std::cin, text);
bool h... | TOOL | 0.97572 | 5.75859 |
22ee2ed4-f9a3-425f-bca8-45cfc9d21015 | oss5824/practice | 동적계획법1/11054.cpp | #include <iostream>
#include <algorithm>
using namespace std;
int main()
{
cin.tie(NULL);
ios::sync_with_stdio(false);
int n = 0, _max = 0, _max2 = 0, result = 0;
cin >> n;
int* arr = new int[n];
int* M = new int[n];
int* M2 = new int[n];
for (int i = 0; i < n; i++)cin >> arr[i];
for (int i = 0; i < n; i++)
{... | ALGO | 0.999969 | 3.845617 |
6f7f6f71-1a51-4f1c-98a6-c357013a69e9 | LeNgocQuy2901/LTNC_Homework | week7/1.cpp | #include <iostream>
#include <algorithm>
using namespace std;
int binarySearchOnDecreaseUsingLoop(int arr[], int start, int end, int target)
{
while (end > start)
{
int mid = (end + start) / 2;
if (arr[mid] == target)
{
return mid;
}
if (target > arr[mid])
... | ALGO | 0.999968 | 4.828843 |
d68af6f1-a5d1-4643-9910-d0e62a16efa5 | ishandutta2007/codeforces | y0105w49/normal/768/F.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef complex<ld> pt;
#define fi first
#define se second
#define pb push_back
#define mp make_pair
const ld TAU=2*acos(-1);
const ld eps=1e-7;
const int inf=1e9+99;
const ll linf=1e18+88;
const int P=1e9+7;
int powq(int x,int... | ALGO | 0.999888 | 3.691933 |
8e2b6474-9f94-4b5c-9340-a37953395b00 | were/ProgramsInUndergrad | ACM/sjtu/s1050.cpp | #include <cstdio>
#include <cstdlib>
const int MaxN = 300010;
int N, M;
struct Node {
int ky;
Node *s[2];
}*root[MaxN], a[MaxN * 2], *tot = a;
Node *merge(Node *l, Node *r) {
if (!l || !r) {
return l ? l : r;
}
if (l->ky > r->ky) {
return merge(r, l);
}
int p = rand() & 1;
return l->s[p] = merge(l->s[p]... | ALGO | 0.999977 | 4.238773 |
c06410cb-334f-4c30-b16e-2904de1c2507 | HelenRabbit/Data_Structures_and_Algorithms_PTIT | Dynamic Programming/DSA05033 - XÂU ĐỐI XỨNG 2.cpp | // Created by Nguyễn Mạnh Quân
#include<bits/stdc++.h>
using namespace std;
#define mp make_pair
#define fi first
#define se second
#define pb push_back
#define sz size()
#define ll long long
#define FOR(i, a, b) for(int i = a; i <= b; i++)
#define FORD(i, a, b) for(int i = a; i >= b; i--)
#define F(i, a, b) for(int... | ALGO | 0.999939 | 4.416478 |
dc759ab9-c2e3-45df-985d-03ce70155566 | vik673/C-Workspace | STL/STLAlgorithm/MutatingSTLAlgorithm/Sort/chocholateDistribuation.cpp | #include <iostream>
#include <algorithm>
#include <climits>
using namespace std;
/*
Given an array representing chocolate packet sizes and the number of children, the task is to distribute these packets to the children such that each child should receive at exact one packet, and the goal is to minimize the difference ... | ALGO | 0.999999 | 6.08811 |
a609ce75-f062-4128-a76f-2773eaf43546 | ishandutta2007/codeforces | dlalswp25/normal/1361/C.cpp | #include <bits/stdc++.h>
using namespace std;
int A[505050];
int B[505050];
int indeg[1050505];
multiset<pair<int, int> > adj[1050505];
vector<int> path;
int N;
vector<int> ans;
vector<int> chk[1050505];
void dfs(int v) {
while(adj[v].size()) {
int w = adj[v].begin() -> first;
int id = adj[v].begin() -> seco... | ALGO | 0.999982 | 3.459657 |
813e280f-9b1f-4acd-87a2-a2c70d4c2615 | KartavyaKothari/lpu_K20PT | week7/read_write_file.cpp | #include<bits/stdc++.h>
// #include<fstream>
using namespace std;
int main(){
string names[5];
int ages[5];
// ifstream f;
fstream f;
f.open("outfile.kartavya");
// f.open("outfile.kartavya",ios::in | ios::out);
if(! f){
cout<<"Some error has happened"<<endl;
}else{
fo... | TOOL | 0.900191 | 3.472631 |
0a39cce8-5d5a-4494-aac3-61d79690cbf4 | Mokuroh54/Comp_Prog | Codeforces/1501-2000/1801-1900/1821-1830/1830/1830_C_Copil_Copac_Draws_Trees.cpp | /*
___
(o,o)
< . >
--"-"---
Rowlet is orz
_ _ _
>(.)__ >(.)__ >(.)__
(___/ (___/ (___/
I am dum duck
*/
#include <bits/stdc++.h>
using namespace std;
#define FF first
#define SS second
#define pb push_back
#define ll long long
#define ld long double
#define ull unsigned ll
#define endl "\n"
ll INF ... | ALGO | 0.999785 | 4.958066 |
bd26a695-d8fd-4d19-8efc-351564c7330b | ksungkeun84/datastructure | fds/c5/hier.cpp | #include <iostream.h>
enum Boolean {FALSE, TRUE};
const int DefaultSize = 20;
class MaxPQ {
public:
virtual void Insert(const int) = 0;
virtual int* DeleteMax(int&) = 0;
};
class SearchStruct {
public:
virtual void Insert(const int) = 0;
virtual int* Delete(int&) = 0;
virtual Boolean Search(const... | ALGO | 0.997639 | 4.274038 |
42c3dc23-c78c-4939-8d35-df35d46bdebc | AtharvaPanegai/DSA-Aman | Array/LinearSearchInArray/program.cpp | #include "bits/stdc++.h"
using namespace std;
int main()
{
vector<int> v = {12, 45, 23, 51, 19, 8};
// find the position of the 23
for (int i = 0; i < v.size(); i++)
{
if (v[i] == 23)
{
cout << i << " ";
}
}
return 0;
} | ALGO | 0.998673 | 4.759492 |
69566b91-5b1b-4ae0-a1bc-67c517ec9dee | antrap/DSA | Strings/GFG practice/Longest Common Prefix in an array.cpp | //Complex solution done by own---3/500 test case pass
class Solution{
public:
string longestCommonPrefix (string arr[], int N)
{
int minLenIndex=0;
int minNum=arr[0].length();
for(int i=1;i<N;i++){
if(arr[i].length()<minNum){
minNum=arr[i].lengt... | ALGO | 0.999723 | 5.556473 |
2000511c-a15c-4666-951b-396474b19fad | parthsarthiprasad/Competitive_Programming | dynamic_programming/codechef/p1.cpp | #include<bits/stdc++.h>
using namespace std;
#define int64_t int
const int mod = 1e9+9;
const int nax = 1e6+1;
vector<int> factorial(nax), facinv(nax), naturalinv(nax);
int findexp(int n,int k){
return ((factorial[n]*facinv[k])%mod * facinv[n-k])%mod;
}
int32_t main(){
ios_base::sync_with_stdio(false);
cin.... | ALGO | 0.999984 | 4.251364 |
c71973c5-a460-4bdc-8bbf-94d677a7de94 | Samikshaborude9/leet_code | 128-longest-consecutive-sequence/longest-consecutive-sequence.cpp | class Solution {
public:
int longestConsecutive(vector<int>& nums) {
int n = nums.size();
if(n ==0){ return 0 ;}
int longest = 1;
unordered_set <int> st ;
for(int i = 0 ; i<n ;i++){
st.insert(nums[i]);
}
for(auto it : st){
... | ALGO | 0.999955 | 5.626346 |
98588903-acda-497e-9a11-d07b7f4f489d | bqmnhat/CompetitiveProgramming | Codeforces/TheatreSquare/main.cpp | #include <iostream>
#include <bits/stdc++.h>
using namespace std;
long long n,m,a;
long long Solution() {
long long ans = (((n-1LL)/a)+1LL)*(((m-1LL)/a)+1LL);
return ans;
}
int main()
{
cin >> n >> m >> a;
cout << Solution();
return 0;
}
| ALGO | 0.999327 | 4.057947 |
d31c2da4-c168-4d65-bde9-3b4d863028a4 | phannhathuy2804/CMPT431-Distributed-Systems | assignment4-tasks-decomposition-and-mapping-strategies/assignment4/page_rank_pull_parallel.cpp | #include "core/graph.h"
#include "core/utils.h"
#include <iomanip>
#include <iostream>
#include <stdlib.h>
#include <thread>
#define DEFAULT_STRATEGY "1"
#define DEFAULT_GRANULARITY "1"
#ifdef USE_INT
#define INIT_PAGE_RANK 100000
#define EPSILON 1000
#define PAGE_RANK(x) (15000 + (5 * x) / 6)
#define CHANGE_IN_PAGE_R... | ALGO | 0.999403 | 4.47309 |
c1926a37-d291-4c08-8394-efccaee9ee5c | Rodrigo61/GUAXINIM | treino11/l.cpp | #include<bits/stdc++.h>
using namespace std;
vector<int> G[100001];
int solve(int x, int p)
{
int r = 1;
for(int i = 0; i < G[x].size(); i++)
if(G[x][i] != p)
r = max(r, solve(G[x][i], x)+1);
return r;
}
main()
{
int N, a, u, v;
scanf("%d %d", &N, &a);
for(int i = 1; i < N; i++)
{
scanf("%d %d", &u, &... | ALGO | 0.998962 | 3.778691 |
c99abb2c-9eab-43cc-b25d-251e877b260c | shAwmitrAcse134582/phitron_course | Algorithm/Module-6/DFS_implementation.cpp | #include<bits/stdc++.h>
#define ll long long int
#define pb push_back
#define get_out return 0
#define fast ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
using namespace std;
const int N=1e5+3;
vector<int>adj[N];
bool visited[N];
void dfs(int u){
// section-1:action just after entering Node U
visited[u]=tr... | ALGO | 0.999977 | 4.605966 |
0642d80f-1000-4e3d-a535-16fed4d10791 | aoken7/contests | AtCoder/dp/A/main.cpp | #include<bits/stdc++.h>
#define all(a) a.begin(), a.end()
#define put(i) cout<<i<<endl
#define rep(i,s,n) for(long long i=s;i<(long long)(n);i++)
using namespace std;
using ll = long long;
template <typename T>
void putl(T t) {
for (auto x : t) cout << x << " ";
cout << endl;
}
int main(){
ll n;
cin >... | ALGO | 0.999954 | 3.924164 |
d4797cc2-c87e-4584-bf5e-8f6d30d445be | kokosabu/atcoder | cpp/abc159_c/main.cpp | #include <iostream>
#include <iomanip>
using namespace std;
int main()
{
double L;
cin >> L;
cout << fixed << setprecision(7) << (L/3)*(L/3)*(L/3) << endl;
return 0;
}
| ALGO | 0.999267 | 3.781624 |
6dea4f08-7220-474c-9048-7f593cb320a3 | abhi1998goyal/gfg_dsa | Medium/Negative weight cycle/negative-weight-cycle.cpp | //{ Driver Code Starts
#include<bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution {
public:
int isNegativeWeightCycle(int n, vector<vector<int>>edges){
int lop=n;
vector<int> dist(n,INT_MAX-1000);
dist[0]=0;
while(lop>0){
//bool chng=false;
for(int i=0... | ALGO | 0.999861 | 6.036568 |
2303b8ef-ccbc-4962-9df8-7ec8783fec26 | st106433/programming-c-2022-autumn | 2022.10.02-Homework-2/Task9/Source.cpp | #include <iostream>
int main(int argc, char* argv[])
{
int m = 0;
int n = 0;
int x = 0;
int y = 0;
std::cin >> m;
std::cin >> n;
std::cin >> x;
std::cin >> y;
if (x - 1 > 1)
{
std::cout << x - 1 << ", " << y << std::endl;
}
if (x + 1 < m + 1)
{
std::cout << x + 1 << ", " << y << std::endl;
}
if (y... | ALGO | 0.99913 | 3.823435 |
ef781cb5-a4b1-4906-ba8a-04bf74c974c0 | kamyu104/LeetCode-Solutions | C++/maximum-length-substring-with-two-occurrences.cpp | // Time: O(n + 26)
// Space: O(26)
// freq table, sliding window, two pointers
class Solution {
public:
int maximumLengthSubstring(string s) {
static const int COUNT = 2;
int result = 0;
vector<int> cnt(26);
int right = 0, left = 0;
for (int invalid_cnt = 0; right < size(s... | ALGO | 0.999876 | 6.018171 |
d89da6b5-c7a6-456d-aa50-09c0b403e22b | VINI-DS001/beecrowd-C-Cpp | C++/1064.cpp | #include<iostream>
#include<iomanip>
using namespace std;
int main()
{
float num, soma=0;
int i, p=0;
for(i=1;i<=6;i++){
cin >> num;
if(num>0){
soma= soma + num;
p++;
}
}
float media = soma/p;
cout<<p<<" valores positivos"<<endl;
cout<<... | ALGO | 0.999394 | 3.25041 |
07dd506f-a844-4bd6-acd6-576c101e107d | YurBoiDanny/Algos | Graph_Algos/Graph_Traversal/dfs.cpp | #include <vector>
#include <iostream>
using namespace std;
#define N 1000
vector <int> adj[N];
bool visited[N];
//Depth First Search; Time Complexity = O(n+m)
//n - # of nodes ; m - # of edges
void dfs(int s)
{
if (visited[s])
{
return;
}
visited[s] = true;
//process node s
for... | ALGO | 0.999699 | 3.81202 |
ae4efaad-662d-43bf-ab1d-874db7587f27 | khbminus/code2020 | contests/spbkoshp/h.cpp | #include <bits/stdc++.h>
#include <ostream>
using namespace std;
using ll = long long;
#define SZ(x) (int)((x).size())
#define ALL(x) (x).begin(), (x).end()
#define RALL(x) (x).rbegin(), (x).rend()
#define TMAX(type) numeric_limits<type>::max()
#define TMIN(type) numeric_limits<type>::min()
#ifdef LOCAL
#define as... | ALGO | 0.999992 | 3.593205 |
a6d5a707-7d8f-4c10-8ca6-049c8c054d26 | mandysingh150/LeetCode | Edit Distance - GFG/edit-distance.cpp | // { Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution {
public:
int rec(string &s, int i, string &t, int j, vector<vector<int>> &dp) {
if(i==s.size())
return t.size()-j;
if(j==t.size())
return s.size()-i;
if(dp[... | ALGO | 0.999995 | 6.585695 |
390c0627-59e8-4789-9bcb-b89917807c27 | mmtos/problem_solve | src/main/cpp/acmicpc/P10828.cpp | #include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
int main(){
int top = -1;
int max;
scanf("%d", &max);
int a[max];
fill(a, a+max, -999);
for(int i=0; i < max ; i++){
char s[6];
int d;
scanf("%s", s);
if(strcmp(s, "push") == 0){
scanf("%d", &d);
top = top + 1;
a[top] ... | ALGO | 0.998876 | 3.793663 |
86ff403a-e50e-49fc-9f3b-242f4a9e2b70 | quanganh208/THCS2-CodePTIT | C01018 - SỐ CHÍNH PHƯƠNG.cpp | #include <stdio.h>
#include <math.h>
int main(){
int t;
scanf("%d", &t);
while (t--){
int n;
scanf("%d", &n);
if (pow((int)sqrt(n), 2) == n) printf("YES\n");
else printf("NO\n");
}
return 0;
}
| ALGO | 0.999737 | 4.659077 |
219ccfe9-0109-4de4-b6d7-96103ef4184f | syrus44/bomberman-gredu | src/Computer.cpp | //
// Computer.cpp for Computer in /home/bettin_j//SVN/bomberman-gredu/trunk/caille_l
//
// Made by jordan bettin
// Login <<EMAIL>>
//
// Started on Thu May 2 15:12:45 2013 jordan bettin
// Last update Sun Jun 9 11:31:44 2013 florent cerfon
//
#include "Computer.hh"
#include "Map.hh"
/*
** Fonctionnement de ... | ALGO | 0.987633 | 3.187584 |
2762fe60-1f89-4c94-b25c-a80d9abcf8b4 | djsharma/Code-Files | CPP/infix_to_postfix.cpp | #include<iostream>
#include<stdio.h>
#include<stdlib.h>
#include<stack>
#include<string>
using namespace std;
int getPrecedence(char a)
{
switch(a)
{
case '-': return 1;
case '+': return 2;
case '/': return 3;
case '*': return 4;
case '^': return 5;
case '@': return 0;
}
}
void infixToPostfix(string str)
{... | ALGO | 0.999761 | 4.254323 |
693c556e-f356-446c-8a32-55aa99ebee3a | trungdangtapcode/Competitive-Programming-Notebook | archived/my_desktop_grade11/SPOJ/LUCKYNUMBER.cpp | #include <bits/stdc++.h>
#define fix cout<<"fix"<<endl;
using namespace std;
int main(){
long int n;
cin >> n;
queue<string> q;
q.push("6");
q.push("8");
long int i = 1;
while (i <= n){
string s = q.front();
q.pop();
if (i==n){
cout << s;
return 0;
};
i++;
if (s[s.length()-1]=='6'){
q.pu... | ALGO | 0.999731 | 3.631891 |
88eb26a8-b4d1-4b7b-961e-a5bade51005f | ishandutta2007/codeforces | 18michael/normal/934/C.cpp | #include<bits/stdc++.h>
using namespace std;
int n;
int a[2002],pre1[2002],pre2[2002],f[2002],g[2002];
template<class T>void read(T &x)
{
x=0;int f=0;char ch=getchar();
while(ch<'0' || ch>'9')f|=(ch=='-'),ch=getchar();
while(ch>='0' && ch<='9')x=(x<<3)+(x<<1)+(ch^48),ch=getchar();
x=f? -x:x;return ;
}
int main()
{
... | ALGO | 0.99998 | 3.565006 |
efdccbed-beea-4fbc-917f-d828cbcf00de | Vishesh3011/Cpp-work | a2oj/codeforcesDiv2A/eugenyAndTheArray.cpp | #include<iostream>
typedef long long ll;
using namespace std;
int main(){
ll n, m;
cin>>n>>m;
ll a[n];
ll noOfOnes = 0, noOfMinusOnes = 0;
for(ll i = 0; i < n; i++){
cin>>a[i];
if(a[i] == 1){
noOfOnes++;
}
if(a[i] == -1){
noOfMinusOnes++;... | ALGO | 0.999992 | 3.911288 |
c62cc9eb-f754-4002-83f7-d25d46cb43e9 | Korhal-lul/CompetitiveProblemas | USP/G.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> ii;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<ii> vii;
typedef tuple <int, int, int> i3;
const ll MAX = 1e5+5, INF = 1e12;
void solve(){
string s;
cin >> s;
vector<char> vec;
// vec.push_back(s[0... | ALGO | 0.99996 | 3.949097 |
6572c8bd-52e3-4fb5-bc38-cc7f420cdde8 | SHAHCoinvip/shahcoin | src/consensus/hybrid.cpp | AlgoType SelectNextAlgo(int height) {
// 33/33/34 rotation for SHA256d/Scrypt/Groestl. PoS interleave to be handled elsewhere.
int m = height % 3;
if (m == 0) return AlgoType::SHA256D;
if (m == 1) return AlgoType::SCRYPT;
return AlgoType::GROESTL;
}
const char* AlgoName(AlgoType a) {
switch (a)... | ALGO | 0.998855 | 6.855552 |
17d5853a-d920-4ed0-8e8b-a91e874a180c | johnoneil/mupen64plus-web | boost_1_59_0/libs/bimap/example/mi_to_b_path/mi_bidirectional_map.cpp | /******************************************************************************
Boost.MultiIndex
******************************************************************************/
#include <boost/config.hpp>
//[ code_mi_to_b_path_mi_bidirectional_map
#include <iostream>
#include <boost/tokenizer.hpp>
#include <boost/m... | ALGO | 0.954894 | 6.431124 |
09471fbc-fb78-4bca-968b-45ec6a99d1b4 | rishavranjandtu/DSA_Leetcode | 0046-permutations/0046-permutations.cpp | class Solution {
public:
vector<vector<int>>ans;
int n;
void perm(int i, vector<int>&nums)
{
if(i==n)
{
ans.push_back(nums);
return;
}
for(int j=i;j<n;j++)
{
swap(nums[i],nums[j]);
perm(i+1,nums);
swap(nums[i],nums[j]);
}
}
vector<vector<int>> perm... | ALGO | 0.999993 | 6.063904 |
bdd286ac-7f28-410c-bb4b-8ac16869b9e1 | TheProjecter/igatools | source/basis_functions/bspline_element_accessor.cpp | #include <igatools/basis_functions/bspline_element_accessor.h>
#include <igatools/basis_functions/bernstein_basis.h>
#include <igatools/base/exceptions.h>
#include <igatools/basis_functions/bspline_space.h>
#include <igatools/base/function.h>
#include <igatools/utils/multi_array_utils.h>
#include <algorithm>
#include ... | ALGO | 0.994756 | 7.547074 |
155806ca-70b1-483c-9665-68c7c71ff58d | mpfeifer1/Codeforces | 0118a.cpp | #include <iostream>
using namespace std;
int main() {
string s;
cin >> s;
for(auto& c : s) {
c = tolower(c);
if(!(c == 'a' || c == 'e' || c == 'i' || c == 'o' || c == 'u' || c == 'y')) {
cout << "." << c;
}
}
cout << endl;
}
| ALGO | 0.991926 | 3.543825 |
465829b1-d83a-4921-b73b-4615700b634b | ampl/coin | Couenne/Cbc/examples/simpleBAB.cpp | #include <cassert>
#include <iomanip>
#include "CoinPragma.hpp"
#include "OsiClpSolverInterface.hpp"
#include "CoinPackedVector.hpp"
//#define USE_CBC
#ifdef USE_CBC
#include "CbcModel.hpp"
#endif
int main(int argc, const char *argv[])
{
OsiClpSolverInterface model;
CoinBigIndex start[] = { 0, 1, 2 };
int ind... | ALGO | 0.985301 | 6.38993 |
812dd3d9-d01e-4318-966e-efbe9375fd01 | rajesh-1920/Competitive_Programming_Problem_Solving | Vjudge/O_Diverse_Game.cpp | // Author: Rajesh Biswas
// CF : rajesh-1920
// Date : 22.03.2025
#include <bits/stdc++.h>
using namespace std;
//----------------------------(definition section)-----------------------------------------
#define dbg(x) cout << #x << " = " << x << '\n'
#define int long long int
#define fi first
#define sc second... | ALGO | 0.99983 | 4.902001 |
f4a84307-f2d7-4300-addf-bc5dcd7e0428 | weekchen/learn_data_structure | BinaryTree/symmetric_tree.cpp | #include "iostream"
#include "deque"
#include "binary_tree.h"
using namespace std;
class IsSymmetric {
public:
bool isSymmetric(TreeNode* root) {
deque<TreeNode*> q;
if(root == nullptr)
return true;
q.push_back(root);
while(!q.empty()){
long queue_size = q.s... | ALGO | 0.999951 | 6.347113 |
8a96ec06-c257-4508-82d7-746082b8f28d | leo-ai-for-trading/numerical_methods_cpp | Main10.cpp | #include "BinModel02.h"
#include "Options06.h"
#include <iostream>
#include <cmath>
using namespace std;
/*
A virtual function with no definition as indicated by =0
is called a pure virtual function, and the class containing
it is called an abstract class.
We have the abstract concept of European option represented
... | ALGO | 0.922152 | 5.211176 |
8de7c129-e94e-4c91-8c8f-d5ba186e8490 | mquang279/DSA | 17. Backtracking/sinh08.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int n;
int a[15], b[15], visited[15], cnt;
void Try(int i){
if (i == n){
cnt++;
for (int j = 0; j < n; j++){
if (a[j] != b[j]) return;
}
cout << cnt << endl;
return;
}
for (int j = 1; ... | ALGO | 0.999914 | 3.812361 |
2046eea4-4806-4ebb-9229-a5c5e7e3ab4f | RobertRosolek/programming_contests | codeforces/179/C.cpp | #include <stdio.h>
#include <ctype.h>
#include <math.h>
#include <iomanip>
#include <iostream>
#include <fstream>
#include <sstream>
#include <utility>
#include <algorithm>
#include <cassert>
#include <string>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <list>
#include <stack>
using... | ALGO | 0.999091 | 3.385505 |
b2968b49-d9a4-435d-bb0f-57737aa60219 | tmastercoding/clang | USACO/Silver/BinarySearch2/s11.cpp | #include <iostream>
#include <algorithm>
using namespace std;
int main(){
long long l, n, m, rocks[50001];
cin >> l >> n >> m;
for(int i = 0; i < n; i++){
cin >> rocks[i];
}
rocks[n] = l;
sort(rocks, rocks+n);
long long lo = 1, hi = 1000000000, mid, cnt, prev;
while(lo < hi){
... | ALGO | 0.999968 | 3.400464 |
000d03bd-49de-4b9e-98e3-c06b5f150eab | helloobaby/llvm_msvc | libc/src/math/gpu/remainderf.cpp | #include "src/math/remainderf.h"
#include "src/__support/common.h"
namespace LIBC_NAMESPACE {
LLVM_LIBC_FUNCTION(float, remainderf, (float x, float y)) {
return __builtin_remainderf(x, y);
}
} // namespace LIBC_NAMESPACE
| ALGO | 0.889172 | 6.424978 |
c7344982-e5bc-4aa0-a73e-db35effbd2cb | gaolichen/contest | code_template/kmp/kmp.cpp | #include<iostream.h>
#include<string.h>
#define MAXN 1000
#define T char
#define match(a,b) ((a)==(b))
//kmpģʽƥ㷨
int kmp(T *s,int ls,T *p,int lp){
int i,j;
int nxt[MAXN];
for(nxt[i=0]=j=-1;i<lp;){
// if(j==-1||match(s[i],p[j]))
// nxt[++i]=++j;
// else j=nxt[j];
j==-1||match(s[i],p[j])?(nxt[++i]=++j):(j=nxt[j... | ALGO | 0.999703 | 3.759926 |
6b03653d-fa7f-4408-8e02-3946b24a8b35 | songshan0321/SFND | SFND_Lidar_Obstacle_Detection/src/cluster.cpp | #include <chrono>
#include <string>
#include "kdtree.h"
void proximity(KdTree* tree, const std::vector<std::vector<float>>& points, std::vector<int>& cluster, std::vector<bool>& processed, int index, float distanceTol)
{
processed[index] = true;
cluster.push_back(index);
std::vector<int> nearbyPoints = tree->search... | ALGO | 0.999593 | 6.265037 |
2e830ab3-f097-4244-a0b7-48f89d97a39f | vaishnave28/data-structures | Untitled7.cpp | #include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
// Structure to represent a stack
struct Stack {
int top;
unsigned capacity;
char* array;
};
// Function to create a stack of given capacity
struct Stack* createStack(unsigned capacity) {
struct Stack* stack = (struct Stack*)malloc(sizeof(str... | ALGO | 0.999658 | 7.007151 |
624619fc-6451-45e5-b81d-5f4bffd9f764 | HUSS41N/DSA | archive/Array/range-and-coefficient-of-range-of-array.cpp | #include <bits/stdc++.h>
using namespace std;
int main(){
int n;
cin>>n;
int arr[n];
for(int i=0;i<n;i++){
cin>>arr[i];
}
int mx = INT_MIN;
int mn = INT_MAX;
for(int i=0;i<n;i++){
mx = max(mx,arr[i]);
mn = min(mn,arr[i]);
}
int range = mx - mn;
float ... | ALGO | 0.998856 | 3.628271 |
db1b1e7c-1473-422d-bc7a-5ca02c82a6cd | akhilr007/Leetcode-problems | 287-find-the-duplicate-number/287-find-the-duplicate-number.cpp | class Solution {
public:
int findDuplicate(vector<int>& nums) {
int slow = 0, fast = 0;
do{
slow = nums[slow];
fast = nums[nums[fast]];
}
while(slow != fast);
slow = 0;
do{
slow = nums[slow];
f... | ALGO | 0.999981 | 6.161415 |
95c7af43-5d76-4e7e-9287-2aa8178aba43 | wlsh44/algorithm | boj/1138.cpp | #include <iostream>
using namespace std;
int arr[10];
int N;
void solve() {
cin >> N;
for (int i = 1; i <= N; i++) {
int num;
int cnt;
cnt = 0;
cin >> num;
for (int j = 0; j < N; j++) {
if (cnt == num && arr[j] == 0) {
arr[j] = i;
break;
} else if (arr[j] == 0)
cnt++;
}
}
for (int... | ALGO | 0.999952 | 3.840807 |
91428fc3-a116-4a1c-8a49-1f899a21934d | mushkul/Vanderbilt-CP | solutions/claude-3-5-haiku-20241022/2417.cpp | #include <iostream>
#include <vector>
#include <algorithm>
int gcd(int a, int b) {
while (b) {
a %= b;
std::swap(a, b);
}
return a;
}
int main() {
int n;
std::cin >> n;
std::vector<int> arr(n);
for (int i = 0; i < n; i++) {
std::cin >> arr[i];
}
in... | ALGO | 0.999951 | 5.282979 |
6d0108f1-89e7-4147-b368-84c7ce54b138 | Honepa/Labs_PSTU | bachelor/2_semestr/16_labs/16_labs.cpp | //Духанин Алексей. 16 лаб.
#include <iostream>
using namespace std;
int * create_arr(int n)
{
int *arr = new int[n];
for(int counter = 0; counter < n; counter++)
{
arr[counter] = counter;
cout << counter << '\t';
}
cout << endl;
return arr;
}
int search_murrr(string words, string... | ALGO | 0.972603 | 4.146908 |
aa99dacb-972b-477d-89a5-6f9a1d304b99 | KieranHorgan/Codeforces-Problems | 219C-Color_Stripe.cpp | #include <iostream>
using namespace std;
void check() {
int n;
cin >> n;
int k;
cin >> k;
string inp;
cin >> inp;
string inpA = "";
string inpB = "";
int noOfMoves = 0;
int noOfMovesA = 0;
int noOfMovesB = 0;
if(k > 2)
{
for(int i = 1; i < n; i++)
... | ALGO | 0.999951 | 4.123977 |
ab11b7ee-dff6-43e2-9020-03c742454d65 | nirzha/persontrack | OpenPose-Multi-Person/opencv-3.4.0/samples/cpp/tutorial_code/xfeatures2D/LATCH_match.cpp | #include <iostream>
#include "opencv2/opencv_modules.hpp"
#ifdef HAVE_OPENCV_XFEATURES2D
#include <opencv2/features2d.hpp>
#include <opencv2/xfeatures2d.hpp>
#include <opencv2/imgcodecs.hpp>
#include <opencv2/opencv.hpp>
#include <vector>
// If you find this code useful, please add a reference to the following pape... | ALGO | 0.975852 | 6.073016 |
120215e2-3ed0-470a-9406-0ebdbe0d98e4 | sarvex/cpp-leetcode | 1570.Dot Product of Two Sparse Vectors.cpp | class SparseVector {
public:
unordered_map<int, int> d;
SparseVector(vector<int>& nums) {
for (int i = 0; i < nums.size(); ++i) {
if (nums[i]) {
d[i] = nums[i];
}
}
}
// Return the dotProduct of two sparse vectors
int dotProduct(SparseVector&... | ALGO | 0.999871 | 6.782088 |
5cc35e37-d7cf-4c45-ac67-376f30558b4c | PritishDoc/DSA-in-C- | Leetcode_Problem/SerializeAndDeserialize.cpp | /*
Serialize and deserialize a binary tree
Difficulty: MediumAccuracy: 51.67%Submissions: 90K+Points: 4Average Time: 45m
Serialization is to store a tree in an array so that it can be later restored and deserialization is reading tree back from the array. Complete the functions
serialize() : stores the tree into an a... | ALGO | 0.999974 | 6.83968 |
38931dcf-de86-4161-a57b-f3c9c62f2fc6 | UBCSailbot/obstacle-detection | src/main/ObjectDetectionModelGenerator.cpp | /*
This example program shows how you can use dlib to make an object detector
for things like faces, pedestrians, and any other semi-rigid object. In
particular, we go though the steps to train the kind of sliding window
object detector first published by Dalal and Triggs in 2005 in the paper
Hist... | ALGO | 0.864475 | 7.732142 |
1b716ae8-5a4c-447b-b8f9-8b3680108a4e | P41NT/Competitive-Programming | Codeforces/1968E_CellsArrangement/E. Cells Arrangement.cpp | #include <bits/stdc++.h>
using namespace std;
namespace __DEBUG_UTIL__
{
using namespace std;
/* Primitive Datatypes Print */
void print(const char *x) { cerr << x; }
void print(bool x) { cerr << (x ? "T" : "F"); }
void print(char x) { cerr << '\'' << x << '\''; }
void print(signed short int x... | ALGO | 0.999869 | 4.286583 |
ecc1dc9d-92ae-4226-b6f8-4bc2d319b74b | bobot/CVC4.old-svn | src/proof/proof_manager.cpp | /********************* */
#include "proof/proof_manager.h"
#include "util/proof.h"
#include "proof/sat_proof.h"
#include "proof/cnf_proof.h"
#include "util/cvc4_assert.h"
namespace CVC4 {
bool ProofManager::isInitialized = false;
ProofManager* ProofMana... | TOOL | 0.897295 | 7.200001 |
ceb8eb39-d072-4fd7-a059-b70964306937 | Prabhat2002/Data_Structure_and_Algorithm | Continuous Subarray Sum.cpp | class Solution {
public:
bool checkSubarraySum(vector<int>& nums, int k)
{
map<int,int>mp;
mp[0]=-1;
long long int s=0;
for(int i=0;i<nums.size();i++)
{
s+=nums[i];
int x=s%k;
// cout<<x<<" "<<i<<endl;
if(mp.find(x)!=mp.end... | ALGO | 0.999882 | 5.064274 |
98e164e8-e915-49f6-a761-eb5003893c97 | koosaga/olympiad | Library/USACO-master/Contests/USACO Solutions/2019-20/Feb/Plat/help_NKlogN+K^2.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define f first
#define s second
const int MOD = 1e9+7;
void setIO(string s) {
ios_base::sync_with_stdio(0); cin.tie(0);
freopen((s+".in").c_str(),"r",stdin);
freopen((s+".out").c_str(),"w",stdout);
}
struct mi {
int v; explicit operator... | ALGO | 0.999973 | 3.956674 |
4c6d4bb7-71e2-4143-aaa2-452de08bcc02 | andrewqt/Competitive-Programming | CodeForces/_0522_C_ChickenOrFish/_0522_C_ChickenOrFish.cpp |
// Problem : C. Chicken or Fish?
// Contest : Codeforces - VK Cup 2015 - Qualification Round 1
// URL : https://codeforces.com/contest/522/problem/C
// Memory Limit : 256 MB
// Time Limit : 1000 ms
// Powered by CP Editor (https://github.com/cpeditor/cpeditor)
#include <bits/stdc++.h>
using namespace std;
int arr[1... | ALGO | 0.999783 | 4.088753 |
44e3b897-f4b9-4a1e-9f25-920b42047075 | IVLDen/skillbox_practic_8.6 | z2_main.cpp | #include <iostream>
#include <cmath>
int main()
{
int hp, resist; // здоровье и сопротивляемость для ввода пользователем целыми значениями
int damage; // урон для ввода пользователем целыми значениями
std::cout << " Введите уровень здоровья и сопротивления орка в процентах \n";
std::cin >> hp >> resi... | TOOL | 0.934196 | 4.419712 |
0be2f03f-91b8-4fc6-b1b1-1df356e10100 | dusagong/Algorithm | 백준/15829.cpp | #include <iostream>
using namespace std;
long long pow(int a, int b){
long long temp =1 ;
for(int i = 0; i < b; i++){
temp *= a;
temp %= 1234567891;
}
return temp;
}
int main(){
int n;
cin >> n;
char alphabet;
long long sum = 0;
int temp;
for(int i = 0; i < n; ... | ALGO | 0.999956 | 3.953706 |
24802968-0147-4324-82fc-dddc57913250 | quiverteam/Engine | src/thirdparty/bullet/src/BulletCollision/CollisionDispatch/btDefaultCollisionConfiguration.cpp | #include "btDefaultCollisionConfiguration.h"
#include "BulletCollision/CollisionDispatch/btConvexConvexAlgorithm.h"
#include "BulletCollision/CollisionDispatch/btEmptyCollisionAlgorithm.h"
#include "BulletCollision/CollisionDispatch/btConvexConcaveCollisionAlgorithm.h"
#include "BulletCollision/CollisionDispatch/btCom... | TOOL | 0.939384 | 6.787295 |
445aaf12-99d5-4b26-9a75-4760a46e3d61 | land555/algorithm-analy-sis | week14.cpp | #include<iostream>
#define MAXSIZE 100
using namespace std;
int n=5,j=2; //nΪjΪ
int best=100;
int besttime[100];//ŵȷ
int t[5]={1,5,2,10,3};//ÿҪʱ
int sum[100];//ǰiҪʱ
int T[100];//洢Ľ
//Ҷӽʱʱ
int search(){
int J[MAXSIZE]={0};
for(int i=0;i<n;i++)
{
J[sum[i]]+=t[i];
}
int max=J[1];
for... | ALGO | 0.999922 | 3.463193 |
1e198710-3099-4099-b18a-76f0296021e3 | ishandutta2007/codeforces | burnedchicken/normal/1554/E.cpp | #include <bits/stdc++.h>
using namespace std;
#pragma GCC optimize("Ofast,unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,avx,avx2,fma,tune=native")
#define ll long long
#define int ll
#define ull unsigned ll
#define ld long double
#define rep(a) rep1(i,a)
#define rep1(i,a) rep2(i,0,a)
#define rep2(i,b,a) ... | ALGO | 0.999733 | 4.715321 |
941dc440-fd91-49e5-b3ac-349563291747 | avalonLZ/Practices | DataStruct_Calculate/Hash链地址法/Simple_Hash_table.cpp | /*************************************************************************
> File Name: Simple_Hash_table.cpp
> Author:
> Mail:
> Created Time: Mon 13 Mar 2017 01:15:44 AM PDT
************************************************************************/
#include"Simple_Hash_table.h"
HashList::HashList()
{
unsi... | ALGO | 0.915818 | 3.84269 |
12ccdabf-2665-4b14-a5ee-761ef9168179 | archit81/HPC-Lab-Assignments | ESE/Q.1/Firstprivate.cpp | // firstprivate clause program Demo
#include <omp.h>
#include <bits/stdc++.h>
using namespace std;
int main()
{
// the program adds the addNum value to each element of array A
int n = 10, no_threads = 5, i, addNum = 10;
vector<int> A = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
#pragma omp parallel for num_threads(... | ALGO | 0.997884 | 3.724298 |
a02e2b92-29cd-4cd0-a8d6-34e9ef7eb257 | Ahashanakash/Problem_Solving | Codeforces/A_Card_Exchange.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
void solve()
{
int t;
cin >> t;
while (t--)
{
ll n, k;
cin >> n >> k;
map<ll, ll> freq;
for (int i = 0; i < n; i++)
{
ll x;
cin >> x;
freq[x]++;
}
... | ALGO | 0.999923 | 3.759845 |
1a604dd8-8764-4065-b880-3ff0d4fed867 | alexandraback/datacollection | solutions_5686275109552128_1/C++/IlyaSM/taskB.cpp | #include <iostream>
#include <stdio.h>
#include <fstream>
#include <set>
#include <map>
#include <cmath>
#include <algorithm>
#include <vector>
#include <queue>
#include <cstdlib>
#include <climits>
#include <cassert>
#include <string>
#include <string.h>
#include <stack>
#include <ctime>
#include <sstream>
#include <t... | ALGO | 0.999623 | 3.907673 |
42e310d1-5e04-4bb6-9ac6-ce94538e6d73 | codeaholic-shub/ALGO-ADDICT | LEETCODE/C++/minimum-number-of-removals-to-make-mountain-array.cpp | // Time: O(nlogn)
// Space: O(n)
class Solution {
public:
int minimumMountainRemovals(vector<int>& nums) {
vector<int> left_lis_len(size(nums));
vector<int> lis;
for (int i = 0; i + 1 < size(nums); ++i) {
auto it = lower_bound(begin(lis), end(lis), nums[i]);
left_li... | ALGO | 0.999986 | 5.999676 |
5a846489-3165-41a8-8761-9fb3c60f49df | KshitijGupta07/Leetcode__-problems | 2819-remove-trailing-zeros-from-a-string/remove-trailing-zeros-from-a-string.cpp | class Solution {
public:
string removeTrailingZeros(string num) {
if(num[num.length()-1]!='0'){
return num;
}
int ans=0;
for(int i=num.length()-1;i>=0;i--){
if(num[i]!='0'){
ans=i;
break;
}
}
retur... | ALGO | 0.999586 | 5.788922 |
0d8eb5e3-cb18-456d-816d-1a056aecad97 | YBoy-git/AsteroidProblem | AsteroidProblem/asteroidFind.cpp | #include "asteroidFind.h"
Point findAsteroidCoords(const Point& asteroid) {
using namespace std;
const Point probe1(0.0l, 0.0, 0.0);
const Point probe2{ static_cast<long double>(Point::bounds),0.0,0.0 };
const long double a{ Point::getDistance(probe1, asteroid) };
const long double b{ Point::getD... | ALGO | 0.913891 | 6.146823 |
0327bb26-b01b-442d-8fb5-b071ca8ffae1 | jmsman3/Singly-Linked-list-DSA- | Singly Linked list/Module 6.5 (Practise)/Question_3.cpp | #include <iostream>
using namespace std;
class Node
{
public:
int val;
Node *next;
Node(int val)
{
this->val = val;
this->next = NULL;
}
};
void insert_at_tail(Node *&head, int v)
{
Node *newNode = new Node(v);
if (head == NULL)
{
head = newNode;
return... | ALGO | 0.999775 | 4.894396 |
6de940e5-b1f2-404b-9c79-9ed8e69ec84c | elnahassahmed34/EL2024 | 02C++/01_introduction/tasks/lab5.cpp | #include <iostream>
using namespace std;
int main() {
int num;
cout << "Enter a number to display its multiplication table: ";
cin >> num;
for (int i = 1; i <= 10; ++i) {
cout << num << " x " << i << " = " << num * i << endl;
}
return 0;
}
| TOOL | 0.974229 | 4.017776 |
d1c81f02-166a-4b69-b04e-53b08091bd70 | Blavtes/V3.2 | projects/WeboxLaucherV3/cocos2d/cocos/math/MathUtil.cpp | #include "MathUtil.h"
#include "base/ccMacros.h"
NS_CC_MATH_BEGIN
void MathUtil::smooth(float* x, float target, float elapsedTime, float responseTime)
{
GP_ASSERT(x);
if (elapsedTime > 0)
{
*x += (target - *x) * elapsedTime / (elapsedTime + responseTime);
}
}
void MathUtil::smooth(float* x, ... | TOOL | 0.913144 | 6.296041 |
b7f82052-43cd-40cf-aaf0-3408e66abb72 | rishabhgargdps/coding_prep | oracle/design_twitter.cpp | class Twitter
{
public:
/** Initialize your data structure here. */
int timestamp = 0;
unordered_map<int, unordered_set<int>> followed;
unordered_map<int, unordered_map<int, int>> tweets;
Twitter()
{
timestamp = 0;
followed.clear();
tweets.clear();
}
/** Compose... | ALGO | 0.999348 | 6.474209 |
c5d4326e-d3bc-49ef-af3d-d3ae1a3df08d | rishabhjha05/CodeStruct | Module_06/Assignment2/Ques3.cpp | #include <iostream>
using namespace std;
int main()
{
int x, y;
cin >> x >> y;
x += y;
x -= y;
x %= y;
cout << x;
}
| ALGO | 0.999729 | 3.121794 |
f9166e68-d736-4228-a797-0a2cef7e7a7a | mvancompernolle/ai_project | data/DisjunctionSumScorer.cpp | #include "CLucene/_ApiHeader.h"
#include "Scorer.h"
#include "ScorerDocQueue.h"
#include "SearchHeader.h"
#include "Explanation.h"
#include "CLucene/util/StringBuffer.h"
#include "_DisjunctionSumScorer.h"
CL_NS_DEF(search)
DisjunctionSumScorer::DisjunctionSumScorer( DisjunctionSumScorer::ScorersType* _subScorers, c... | ALGO | 0.854613 | 5.708969 |
31734189-b7e9-4ba9-9cfd-1b382136c1a7 | 444JJJ/Projects | CPP - Practice/1--/po4.cpp | #include<iostream>
using namespace std;
void swap(int a, int b){
cout<<a<<" "<<b<<endl;
int temp =a;
a=b;
b=temp;
cout<<a<<" "<<b<<endl;
}
void swap2(int *a, int *b){
cout<<*a<<" "<<*b<<endl;
int temp=*a;
*a=*b;
*b=temp;
cout<<*a<<" "<<*b<<endl;
}
int main(){
int x=5, y... | ALGO | 0.998998 | 4.070638 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.