uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
e5315886-f4bf-4fdc-9af8-35d04cd0d083 | naronchen/Alg_Practice | ICPC_Practice/permuted.cpp | #include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
int sequenceCheck(int array[], int amountNum) {
int arithPass = amountNum - 2;
for(int j = 0; j < amountNum - 2; j++) {
if(array[j+1] - array[j] == array[j+2] - array[j+1]) {
arithPass--;
}
}
return arithPass;
}... | ALGO | 0.999576 | 4.301999 |
7a527739-881d-4e0a-8df0-063a61f84e88 | Sam2much96/monero-godot | include/blockchain_utilities/blockchain_depth.cpp | #include <boost/range/adaptor/transformed.hpp>
#include <boost/algorithm/string.hpp>
#include "common/command_line.h"
#include "common/varint.h"
#include "cryptonote_core/tx_pool.h"
#include "cryptonote_core/cryptonote_core.h"
#include "cryptonote_core/blockchain.h"
#include "blockchain_db/blockchain_db.h"
#include "ve... | TOOL | 0.937833 | 6.249158 |
fc6abba5-703e-4a76-b832-b37de0fae6b5 | Sherlocked0082/DSA | Tree/24_Nodesincompletebtree.cpp | #include<bits/stdc++.h>
using namespace std;
//MOST IMP_>ANALYSE TIME COMPLEXITY AS EXPLAINED logn*logn
struct Node
{
int key;
Node *left;
Node *right;
Node(int k)
{
key=k;
left=NULL;
right=NULL;
}
};
//Naive solution O(n) works for any tree
int countNode(Node *root)
{
... | ALGO | 0.999773 | 5.153525 |
746de06f-2391-4980-9535-6f42e9b5e9d6 | Trietptm-on-Coding-Algorithms/online-judge | fbhackercup/2016/round1/yachtzee.cpp | #include <iostream>
#include <string>
#include <cstring>
#include <algorithm>
#include <utility>
using namespace std;
int N, A, B;
long long C[100005];
/*
* Let E be the expected value from 0 to T, where T is the time for building a
* single yacht. Calculating this is simple. To calculate the expected value
* bet... | ALGO | 0.998588 | 3.718025 |
237f6acd-d197-4e42-b721-95fe7f49c5e4 | ishandutta2007/codeforces | krk/normal/497/A.cpp | #include <cstdio>
using namespace std;
const int Maxn = 1005;
int n, m;
char B[Maxn][Maxn];
bool same[Maxn];
int res;
bool canTake(int c)
{
for (int i = 1; i < n; i++)
if (same[i] && B[i][c] < B[i - 1][c])
return false;
return true;
}
void Take(int c)
{
for (int i = 1; i < n; i++)
same[i] = same[i] && (B[... | ALGO | 0.999909 | 3.825718 |
e3f15aad-3fc1-472b-90b9-485957454daf | woohyunjng/Coding-Practice | PS/Baekjoon/20000/20180.cpp | #include <bits/stdc++.h>
#define int long long
#pragma GCC optimize("O3")
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
using namespace std;
typedef array<int, 2> pr;
const int MAX = 1500000;
const int INF = 0x3f3f3f3f3f3f3f3f;
int A[MAX][2], B[MAX][2], X[MAX], ans = 0;
void dnc(int l, int r, ... | ALGO | 0.999995 | 4.535535 |
2335449c-24a2-4bc2-9d1a-761362cf97cb | djnavarro/series-embers | source/burst_12.cpp | #include <Rcpp.h>
using namespace Rcpp;
#include <iostream>
using namespace std;
// function to be called from R
// [[Rcpp::export]]
NumericMatrix make_burst(int iter, int layers) {
NumericMatrix points(iter, 3); // initially zero
NumericMatrix coeffs(9, layers);
// set coefficients
for(int i = 0; i < 9; i++... | ALGO | 0.998906 | 5.741394 |
49d78d77-d1d8-4776-bc6a-fafad4a65666 | ayegenberdiyeva/cpp_pp1_labs | lab6/lab6_18.cpp | #include <iostream>
using namespace std;
int uppercase_letter(string letter){
int k = (int) letter[0];
if (k >= 97){
k -= 32;
letter[0] = (char) k;
}
cout << letter[0] << endl;
return 0;
}
int main(){
string letter;
cin >> letter;
uppercase_letter(letter);
retur... | TOOL | 0.954956 | 4.274049 |
dbd09d7d-8c91-41f0-b2bc-44e29f6eeb16 | Tprashant1/GFG-Problems | Difficulty: Hard/Circle of strings/circle-of-strings.cpp | //{ Driver Code Starts
// Initial Template for C++
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
// User function Template for C++
class Solution {
public:
void DFS(int startNode,unordered_map<char,list<char>>&adj,vector<bool>&vis){
vis[startNode] = true;
for(a... | ALGO | 0.999959 | 5.82772 |
b0f6ac18-d034-4cd4-bdcc-11fc4959a90e | israt-urme/Codeforces | A2 online judge/A. Twins.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
int n,a[101],a1[101],sum1=0,temp,i;
cin>>n;
for(i=0;i<n;i++)
{
cin>>a[i];
sum1=sum1+a[i];
}
sort(a,a+n);
int j=0;
for(i=n-1; i>=0; i--)
{
a1[j]=a[i];
j++;
}
int sum=0;
for(j=0;j<n;j+... | ALGO | 0.999402 | 3.62165 |
80b96978-3fd8-4b27-8826-e5afdfd75696 | Lisltria/PAT-Advanced-Level-Practice- | 1099.cpp | #include <iostream>
#include <cstdio>
#include <climits>
#include <algorithm>
#include <queue>
using namespace std;
int N[101][5];
int arry[101];
int countNode(int root)
{
if(root==-1)
{
return 0;
}
else
{
N[root][3] = countNode(N[root][0]);
N[root][4] = countNode(N[root][1])... | ALGO | 0.999997 | 3.579488 |
a0c85695-89a1-4f60-81c1-d7b202126241 | bothemrun/CAP-Complete-Algorithmic-Programming | Leetcode_All_Solved/142.cpp | /**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode(int x) : val(x), next(NULL) {}
* };
*/
#include<unordered_set>
class Solution {
public:
ListNode *detectCycle(ListNode *head) {
unordered_set<ListNode*> s;
while(head != NULL){
... | ALGO | 0.999858 | 5.027703 |
0a4b9c66-472a-4b62-b712-d8247c40e484 | sunita-kumawat8319199254/my-C-with-DSA | 8h.cpp | //print counting
#include <iostream>
using namespace std;
int counting(int n)
{
int count = 1;
for (int i = 1; i <= n; i++)
{
cout << count << " ";
count++;
}
return count;
}
int main()
{
int n;
cout << "ENTER THE VALUE OF n" << endl;
cin >> n;
// function calls
... | ALGO | 0.99953 | 4.410966 |
e80c2685-c150-4cca-8e8e-be863d2835ee | memanuel/rfb-twin | rincflo/src/06_convection/02_MOL/incflo_mol_predict.cpp | #include <MOL.H>
#include <AMReX_Slopes_K.H>
using namespace amrex;
namespace {
std::pair<bool,bool> has_extdir_or_ho (BCRec const* bcrec, int ncomp, int dir)
{
std::pair<bool,bool> r{false,false};
for (int n = 0; n < ncomp; ++n) {
r.first = r.first
|| (bcrec[n].l... | ALGO | 0.999684 | 6.352366 |
d8fe5ab7-0470-41a4-9ac6-0f59454ebc20 | qiaozishun4/CSP2024_BJ | BJ-Senior/answers/BJ-S00790/color/color.cpp | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
ll T,n,a[200005],b[200005],maxn=-1,minn=1e8,ans=0;
int main()
{
freopen("color.in","r",stdin);
freopen("color.out","w",stdout);
cin>>T;
while(T--)
{
ans=0;
memset(b,0,sizeof(b));
cin>>n;
for(ll i=1;i<... | ALGO | 0.999755 | 4.691871 |
2503d088-dc38-44e4-9e12-3c28fd38643a | blackout-yash/LeetCode | 1192-critical-connections-in-a-network/1192-critical-connections-in-a-network.cpp | class Solution {
public:
void dfs(int root, int par, int &timer, vector <int> &time, vector <int> &low, vector <int> &vis, vector <vector<int>> &graph, vector <vector<int>> &bridges) {
vis[root] = 1;
time[root] = low[root] = timer;
timer++;
for (int child : graph[root]) {
if (child == par) continue;
els... | ALGO | 0.999906 | 5.824888 |
ec7fc844-fdb9-4d9d-b685-b9cde594284e | Balpreet1003/LeetCode | 0494-target-sum/0494-target-sum.cpp | class Solution {
int x=0;
int solve(vector<int>&a,int i,int& t,int sum,vector<vector<int>>&dp){
if(sum==t && i==a.size())return 1;
if(i>=a.size()) return 0;
if(dp[i][sum+x]!=-1)return dp[i][sum+x];
return dp[i][x+sum]=solve(a,i+1,t,sum+a[i],dp)+solve(a,i+1,t,sum-a[i],dp);
}
p... | ALGO | 0.999993 | 6.098329 |
7111f95f-fcc6-44aa-a384-c920864b34af | drapz13/scripts-and-cmptprog | Competitive Coding/166-E-13481503.cpp | #include<bits/stdc++.h>
#define _fast ios_base::sync_with_stdio(false);cin.tie(0);
#define LL long long int
#define s(a) scanf("%d",&a)
#define ss(a) scanf("%s",a)
#define w(t) while(t--)
#define f(i,n) for(i=0;i<n;i++)
#define fd(i,n) for(i=n-1;i>=0;i--)
#define p(a) printf("%d",a)
#define ps(a) printf("%s",a)
#defin... | ALGO | 0.999982 | 3.87973 |
50048f8c-ad6b-4d6f-a17d-4d301fee365f | ishandutta2007/codeforces | shnirelman/normal/1348/C.cpp | #include <bits/stdc++.h>
#define f first
#define s second
using namespace std;
using li = long long;
using ld = long double;
using pii = pair<int, int>;
const int INF = 1e9;
const int M = 1e9 + 7;
const int N = 2e5 + 13;
void solve() {
int n, k;
cin >> n >> k;
string s;
cin >> s;
map<char, int... | ALGO | 0.999996 | 4.233981 |
e177f43c-0a1e-4f3d-8250-c070fe3fbe9b | manmandh/cross-platform | xylophone/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.998532 | 6.76775 |
8fab2b9b-38ff-49f9-bb4b-3c6c4d0a41bb | okaryo/CompetitiveProgramming | AtCoder/ABC/131~140/135/B.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long LL;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(),(x).end()
int main() {
int n; cin >> n;
int cnt = 0;
vector<int> a(n);
rep(i, n) {
cin >> a[i];
if (a[i] != i + 1) cnt ++;
}
if (cnt <= 2) {
cout ... | ALGO | 0.999931 | 3.623004 |
25ef1df9-5b17-4c5b-8572-77b891eec1c0 | C-mmon/CupHead | Graph/EvaluateDivision.cpp | class Solution {
public:
unordered_map<string, vector<pair<string, double>>> adjList;
double dfs(const string& curr, const string& target, unordered_set<string>& visited) {
if (adjList.find(curr) == adjList.end() || adjList.find(target) == adjList.end())
return -1.0;
if (curr == tar... | ALGO | 0.999991 | 6.420695 |
181cb2f0-054d-4f8a-8925-1957ce483894 | Japanjotsingh/DSA | Leetcode/1768. Merge Strings Alternately/First_attempt_n1_n1.cpp | class Solution {
public:
string mergeAlternately(string word1, string word2)
{
int max_len = min(word1.size() , word2.size());
string ans = "";
int i = 0;
for( ; i < max_len ; i++)
{
ans.push_back(word1[i]);
ans.push_back(word2[i]);
... | ALGO | 0.99995 | 5.812756 |
55df41fc-8933-4a89-9d15-cf451d7d7cd1 | UjjwalSharma07/LeetCodes | 804-unique-morse-code-words/804-unique-morse-code-words.cpp | class Solution {
public:
int uniqueMorseRepresentations(vector<string>& words) {
vector<string>ss = {".-","-...","-.-.","-..",".","..-.","--.","....","..",".---","-.-",".-..","--","-.","---",".--.","--.-",".-.","...","-","..-","...-",".--","-..-","-.--","--.."
};
unordered_set<stri... | ALGO | 0.999881 | 6.484888 |
15d7b4c5-eccd-4f69-a93e-22c05e9912b2 | myeong01/flutter | piscine/sub02/ex02/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.998475 | 6.797273 |
d190cd83-3bc8-475a-adbe-9e4bbbd83cf6 | PeterMatthewKohler/leetcode | 33_SearchInRotatedSortedArray/Solution_Optimized.cpp | class Solution {
public:
int search(vector<int>& nums, int target) {
// Use binary search
int l = 0, r = nums.size() - 1;
while(l <= r)
{
int mid = (l + r)/2;
if(nums[mid] == target){return mid;}
// Which sorted portion is mid in? Left or right?
... | ALGO | 0.999986 | 6.259198 |
db342a4b-fe96-4e94-ad0d-3dd9d0766acd | thermotools/lammps_mie_fh | src/MANYBODY/pair_sw_mod.cpp | // clang-format off
/* ----------------------------------------------------------------------
Contributing authors: Jin-Wu Jiang (Shanghai U) and Wengen Ouyang (Wuhan U)
------------------------------------------------------------------------- */
#include "pair_sw_mod.h"
#include "error.h"
#include "math_const.h"... | ALGO | 0.992517 | 6.638179 |
3c005a9c-dd70-4985-995f-2102adb1b0b0 | Sarvesh-maker14/Daily-DSA-practice | week3/pattern2/numberBridge.cpp | #include<iostream>
using namespace std;
int main()
{
int n;
cout<<"Enter number of rows : ";
cin>>n;
for(int j = 1;j<=2*n-1;j++){
cout<<j;
}
cout<<endl;
int m = n - 1;
int nsp = 1;
for(int i =1;i<=m;i++){
int a = 1;
for(int j = 1;j<=m+1-i;j++){
... | ALGO | 0.999887 | 3.345826 |
3a71b1ab-4a8a-4788-8622-6fd7aba235e0 | AhJo53589/leetcode-cn | problems/reduce-array-size-to-the-half/SOLUTION.cpp |
//////////////////////////////////////////////////////////////////////////
int minSetSize(vector<int>& arr)
{
map<int, int> cnt;
for (auto &n : arr)
{
cnt[n]++;
}
vector<int> v;
for (auto &m : cnt)
{
v.push_back(m.second);
}
sort(v.rbegin(), v.rend());
int sum = arr.size() / 2;
for (int i = 0; i < v... | ALGO | 0.999676 | 5.320926 |
b5ef7883-ff9c-47cf-b7f1-3653c64ebf10 | Oreo-Mcflurry/BaekJoonCPP | 4. 1차원 배열/10811.cpp | #include<iostream>>
using namespace std;
int main(){
int n, m;
int arr[100];
cin >> n >> m;
for(int i=1;i<=n;i++){
arr[i-1] = i;
}
for(int i=0;i<m;i++){
int a,b;
cin >> a >> b;
a--;
b--;
for(int j=0;j<((b-a)/2+1);j++){
int temp = a... | ALGO | 0.999997 | 3.714848 |
0945d173-2110-48bd-8529-13813ec31b59 | alexandru-andronache/adventofcode | 2024/day04/main.cpp | #include "file.h"
#include <iostream>
#include <utilities.h>
namespace aoc2024_day04 {
unsigned long long part_1(std::string_view path) {
std::vector<std::vector<char>> input = file::readFileAsMapChar(path);
int sol = 0;
// horizontal
for (int i = 0; i < input.size(); ++i) {
... | ALGO | 0.980593 | 6.103988 |
d3b356f6-2775-4e03-81dd-d3d3059d54c2 | vieirinha1104/imeplusplus-notes | Homework/Homework 3/A1.cpp | #include <bits/stdc++.h>
#define N 1000000
using namespace std;
//Solucao por grafos, usando BFS, montando a matriz de adj
int dis[N],n,m;
vector<int> adj[N];
void bfs(int s){
memset(dis,63,sizeof(dis));
dis[s]=0;
queue<int> q; q.push(s); int x;
while(!q.empty()){
x=q.front(); q.pop();
f... | ALGO | 0.999863 | 3.562779 |
29530247-2865-4304-9fa3-2ed37cab4736 | ishandutta2007/codeforces | meijer/normal/1265/E.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> ii;
typedef tuple<int, int, int> iii;
typedef vector<int> vi;
typedef vector<ii> vii;
typedef vector<iii> viii;
typedef vector<ll> vll;
#define REP(a,b,c) for(int a=int(b); a<int(c); a++)
#define RE(a,c) REP(a,0,c)
#define RE1(a... | ALGO | 0.999949 | 4.050148 |
937eaf8d-b12a-4b4f-9954-05a5f8af30b6 | JosephNalkara/data-structure | practice/Lab Cycle:2/LabCycle2-7Demo.cpp | #include "LabCycle2-7.cpp"
int main() {
Deque<int> dq;
int choice;
do {
cout << "\nDEQUE Operations:\n";
cout << "1. Insert Front\n";
cout << "2. Insert Rear\n";
cout << "3. Delete Front\n";
cout << "4. Delete Rear\n";
cout << "5. Exit\n";
cout << "E... | ALGO | 0.885201 | 5.768817 |
53cf5758-b342-42ff-b4cd-d140318baec5 | mahmudhera/accelarated_sketch_comparison | eigen/unsupported/doc/examples/MatrixSine.cpp | #include <unsupported/Eigen/MatrixFunctions>
#include <iostream>
using namespace Eigen;
int main()
{
MatrixXd A = MatrixXd::Random(3,3);
std::cout << "A = \n" << A << "\n\n";
MatrixXd sinA = A.sin();
std::cout << "sin(A) = \n" << sinA << "\n\n";
MatrixXd cosA = A.cos();
std::cout << "cos(A) = \n" << cos... | ALGO | 0.982784 | 5.878768 |
49290bff-b2ac-479d-add1-e7f4b9058753 | ishandutta2007/codeforces | mofk/normal/578/C.cpp | #include <bits/stdc++.h>
#define ff(i, a, b) for(int i = (a), _b = (b); i <= _b; i++)
#define fb(i, a, b) for(int i = (a), _b = (b); i >= _b; i--)
#define pb push_back
#define mp make_pair
#define fi first
#define se second
typedef long long ll;
using namespace std;
typedef pair <int, int> ii;
typedef vector <ii> vii;... | ALGO | 0.999935 | 4.04008 |
2841cf48-97c7-4892-a22a-49546250d2e7 | Sookmyung-Algos/2022algos | algos_assignment/플래티넘_스터디/6주차 과제/최예헌_honi/1753.cpp | #include <iostream>
#include <vector>
#include <cstring>
#include <algorithm>
#include <queue>
#include <tuple>
#include <set>
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
#define MAX 100005
#define INF 987654321
int v, e, k;
vector <pii> arr[20002];
int dijk[20002];
void solve(){
priorit... | ALGO | 0.999976 | 4.156084 |
49b87fa8-c836-4073-986d-1fccae613338 | ishandutta2007/codeforces | igorbunov/normal/1419/D2.cpp | #include <algorithm>
#include <iostream>
#include <cstdlib>
#include <unistd.h>
#include <fstream>
#include <stdio.h>
#include <iomanip>
#include <clocale>
#include <string>
#include <vector>
#include <cmath>
#include <ctime>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>
//#pragma GC... | ALGO | 0.999998 | 3.365903 |
3543af25-18d6-46e1-b9de-a51d900f45ef | luphuong/NHAP-MON-LAP-TRINH | BAI TAP 2/tinh e mu x/27.cpp | #include<stdio.h>
#include<math.h>
void nhap(int &x,int &n);
float tinh(int x,int n);
void xuat(float kq);
void main()
{
int x,n;
nhap(x,n);
float kq=tinh(x,n);
xuat(kq);
}
void xuat(float kq)
{
printf("%f ",kq);
}
float tinh(int x,int n)
{
int k=1;
float s=1;
for(int i=1;i<=n;i++)
{
k=k*i;
s=s+float((pow(... | ALGO | 0.999884 | 3.400697 |
5b4e8cea-b2ec-4680-89de-8b66689703d9 | aditya-agr/LeetCode-POTD | 1382. Balance a Binary Search 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.999985 | 6.438948 |
298c34e4-0c49-40e0-80d6-d606929c0103 | 1604078-MEHEDI/Competitive | DataStructures/SegmentTree/GSS3.cpp | /*بِسْمِ اللَّهِ الرَّحْمَنِ الرَّحِيم*/
//#pragma GCC optimize("O3,unroll-loops")
//#pragma GCC target("avx,avx2,fma")
#include <bits/stdc++.h>
using namespace std;
#define FASTIO ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
typedef long long ll;
using pii = pair<int, int>;
const double PI = acos(-1.0)... | ALGO | 0.999873 | 4.755344 |
a8bef502-377b-4638-ae80-a017b598b483 | rhaps0dy/UPF-SWERC | codeforces/Round_333/B.cpp | #include<bits/stdc++.h>
using namespace std;
int x[100000];
int main() {
int N;
cin >> N;
for(int i=0; i<N; i++) {
cin >> x[i];
}
int max_len = 1;
int mx, mn, mx_i, mn_i;
mx = mn = x[0];
mx_i = mn_i = 0;
int j=0;
for(int i=1; i<N; i++) {
if(x[i] >= mx) {
if(abs(x[i] - mn) > 1) {
if(abs(x[i] - mx... | ALGO | 0.999949 | 4.436978 |
f0024c4c-65ef-4860-a2ad-db08534820e1 | chdb-io/chdb | src/Functions/URL/cutToFirstSignificantSubdomainCustom.cpp | #include <Functions/FunctionFactory.h>
#include <Functions/URL/ExtractFirstSignificantSubdomain.h>
#include <Functions/URL/FirstSignificantSubdomainCustomImpl.h>
namespace DB
{
template <bool without_www, bool conform_rfc>
struct CutToFirstSignificantSubdomainCustom
{
static size_t getReserveLengthForElement() { ... | ALGO | 0.92661 | 5.973005 |
ca71d4f8-2231-4ec9-97b9-43f94bb89df7 | HDS07/DSA | Arrays/linearSearch.cpp | #include<bits/stdc++.h>
using namespace std;
bool search(int arr[],int element,int n){
for(int i=0;i<n;i++){
if(arr[i]==element){
return true;
}
}
return false;
}
int main(){
int arr[]={1,42,4,5,2,6,8,3};
int n=sizeof(arr)/sizeof(arr[0]);
cout<< "Enter the element to ... | ALGO | 0.999229 | 5.153459 |
8b7bd4f7-2855-452b-9fce-0ad6411d1617 | gsshch/sc20_system_core | base/strings.cpp | #include "android-base/strings.h"
#include <stdlib.h>
#include <string.h>
#include <string>
#include <vector>
namespace android {
namespace base {
#define CHECK_NE(a, b) \
if ((a) == (b)) abort();
std::vector<std::string> Split(const std::string& s,
const std::string& delimiters) {... | TOOL | 0.992568 | 7.160889 |
8f359308-dd6b-48bb-bf80-6fb300968086 | peer-open-source/xara | SRC/reliability/analysis/analysis/BivariateDecomposition.cpp | //
// Written by Quan Gu UCSD
//
#include <math.h>
#include "BivariateDecomposition.h"
//#include <fstream.h>
BivariateDecomposition::BivariateDecomposition( int pNumAxis,/* Vector * pGradient,*/ PrincipalAxis ** pPrincipalAxes, GridPlane ** thePlane, bool pIsTimeVariant)
// numAxes is the number of principalAx... | ALGO | 0.998075 | 4.383467 |
bb0cf7f3-5bdf-4bff-a5d4-8e52c27b877e | stdstring/leetcode | Algorithms/Tasks.1501.2000/1876.SubstringsOfSize3WithDistinctChars/solution.cpp | #include <algorithm>
#include <array>
#include <string>
#include "gtest/gtest.h"
namespace
{
class Solution
{
public:
[[nodiscard]] int countGoodSubstrings(std::string const &s) const
{
constexpr size_t substringSize = 3;
if (s.size() < substringSize)
return 0;
size_t coun... | TEST | 0.996241 | 7.078264 |
16159cbc-e33c-403f-951f-f5a896574f00 | konradrauscher/eecs598-project | sequential/toojpeg.cpp | // //////////////////////////////////////////////////////////
// toojpeg.cpp
// written by Stephan Brumme, 2018-2019
// see https://create.stephan-brumme.com/toojpeg/
//
#include "toojpeg.h"
// - the "official" specifications: https://www.w3.org/Graphics/JPEG/itu-t81.pdf and https://www.w3.org/Graphics/JPEG/jfif3.pdf... | TOOL | 0.86781 | 7.669805 |
71b728af-fc04-4058-aff2-16c7680d0244 | Shell-Wataru/AtCoder | kakomon/typical90_ax.cpp | #include <iostream>
#include <algorithm>
#include <vector>
#include <deque>
#include <queue>
#include <set>
#include <map>
#include <iomanip>
#include <cmath>
#include <numeric>
using namespace std;
using ll = long long;
const long long BASE_NUM = 1000000007;
//https://scrapbox.io/pocala-kyopro/%E6%8B%A1%E5%BC%B5%E3%8... | ALGO | 0.999978 | 3.932772 |
7cf23a90-df45-4e3c-9bb8-dbe92ca250a5 | mangoleaves/ErrorImage | GCLF-ImageTriSimp/CurvedSimplification/BezierCurveTree.cpp | #include "BezierCurveTree.h"
namespace GCLF
{
namespace ImageTriSimp
{
bool RayBezierCurveInterTraits::intersection(IndexedBezierCurveImpl& curve)
{
const BoundingBox& bbox = tree->tight_box[tree->global_to_local_idx[curve.idx]];
if (bbox.max().x() >= ray_start.x() &&
bbox.min().y() <= ray_start.y() &&
ray... | ALGO | 0.999444 | 6.038025 |
2fd28c6f-9fb8-434b-8c59-4b06a40dfcce | ahanavish/DSA-using-C | prime no between 1 and n..cpp | #include <stdio.h>
main()
{
int i,j,k,n; //f cant be declared here.
printf("enter a no");
scanf("%d",&n);
for(i=2;i<n;i++)
{
int f=0;
for(j=2;j<i;j++)
{
if(i%j==0) //0-not prime ,not 0-prime
f++;
}
if(f==0)
{
printf("%d\n",i);
}
}
}
| ALGO | 0.999857 | 3.263961 |
ebd96204-ce79-45bd-a029-cdfdb4a91b33 | ishandutta2007/codeforces | anta.baka/normal/547/D.cpp | #include <iostream>
#include <fstream>
#include <algorithm>
#include <iomanip>
#include <numeric>
#include <vector>
#include <cstring>
#include <string>
#include <set>
#include <map>
#include <queue>
#include <deque>
#define sz(a) (int)((a).size())
#define all(a) (a).begin(), (a).end()
#define pb insert
using namespa... | ALGO | 0.99991 | 3.949361 |
b9597e73-0214-4994-9838-551d2aefba22 | Pulakesh5/_DSA_ | MAY 24/06 May/Finding middle element in a linked list gfg.cpp | class Solution{
public:
/* Should return data of middle node. If linked list is empty, then -1*/
int getMiddle(Node *head)
{
// Your code here
int listLength=0;
Node *auxHead = head;
while(auxHead!=nullptr)
{
listLength++;
auxHead = auxHea... | ALGO | 0.999874 | 5.243175 |
845ce915-a8b1-4482-96ab-3abb672c7a6d | liuzhongling/DynamicPrgrammingInLeetcode | BestTimetoBuyandSellStock.cpp | #include <iostream>
#include <algorithm>
using namespace std;
int maxProfitN(int prices[], int n) {
int maxPro = 0;
int minPrice = INT_MAX;
for (int i = 0; i < n; i++) {
minPrice = min(minPrice, prices[i]);
maxPro = max(maxPro, prices[i] - minPrice);
}
return maxPro;
}
/*
int main(void) {
int arr[] = { 7, 1,... | ALGO | 0.971425 | 5.149922 |
67b0aece-44c2-4271-9785-ea1067a420aa | NCAR/GPU_workshop | archivedLessons_CUDA/Lesson_2_matrixMult/CUDA/solution/main.cpp | #include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include "pch.h"
//#include "functions.h"
#include <ctime>
#include <chrono>
#include <ratio>
int main(int argc, char* argv[]) {
using namespace std::chrono;
float *h_A, *h_B, *cpu_C, *gpu_C;
high_resolution_clock::time_point t0, t1;
duration<double> t... | ALGO | 0.993038 | 4.859251 |
3d9af6fe-a581-49c9-a0c2-c001dc17aa63 | Johniel/contests | atcoder/abc073/D/main.cpp | #include <bits/stdc++.h>
#define each(i, c) for (auto& i : c)
#define unless(cond) if (!(cond))
using namespace std;
typedef long long int lli;
typedef unsigned long long ull;
typedef complex<double> point;
template<typename P, typename Q> ostream& operator << (ostream& os, pair<P, Q> p) { os << "(" << p.first << "... | ALGO | 0.99995 | 4.455102 |
756c8d8f-071d-49a1-a37f-81719bf33fae | deepaksingh26/data-structure-and-algorithms | 108-convert-sorted-array-to-binary-search-tree/108-convert-sorted-array-to-binary-search-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.999997 | 6.714693 |
0e1d8324-28c9-4e9e-8b13-60de82bdfbad | Dohyungh/6630_Algorithm_study | Calender_2025/1월/도형/boj-2609-최대공약수와최소공배수/main.cpp | #include<iostream>
#include<algorithm>
using namespace std;
int euclide(int A, int B) {
if (A == 0) {
return B;
}
if (B == 0) {
return A;
}
int big, small;
big = max(A, B);
small = min(A, B);
return euclide(B, A % B);
}
int main() {
int A, B;
cin >> A;
cin >> B;
int GCD = euclide(A, B);
int ... | ALGO | 0.999978 | 4.331927 |
a363e2dd-5e3d-402e-967d-6495361c8059 | 113bommy/deepmind_codecontests_refine | cpp_source_filter_file/cpp_train_9117_22.cpp | #include <bits/stdc++.h>
using namespace std;
int c[3000];
double sc, d[3000], dis, dmx;
int main() {
int cnt, a, sum, dsum, j, mx, p, i;
for (scanf("%d", &cnt); cnt--;) {
sum = dsum = mx = 0;
dmx = 10000;
memset(c, 0, sizeof c);
for (i = 0; i < 250; i++) {
scanf("%d", &a);
if (a <= 2000... | ALGO | 0.999688 | 3.056279 |
3ccc4ed3-a136-4192-912b-4b7f22145bea | pingjuiliao/softbound | llvm-project-13.0.0.src/llvm/utils/FileCheck/FileCheck.cpp | #include "llvm/FileCheck/FileCheck.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/InitLLVM.h"
#include "llvm/Support/Process.h"
#include "llvm/Support/WithColor.h"
#include "llvm/Support/raw_ostream.h"
#include <cmath>
#include <map>
using namespace llvm;
static cl::extrahelp FileCheckOptsEnv(
"\n... | TOOL | 0.887599 | 7.410899 |
27b058ae-c273-479d-98ed-04e124e0589e | LuckyN510/CODE_PTIT | C++/Thực hành lần 1/src/bt4.cpp | #include<bits/stdc++.h>
using namespace std;
using ll = long long;
bool isPrime(int n){
for(int i = 2; i <= sqrt(n); i++){
if(n % i == 0){
return 0;
}
}
return n > 1;
}
int main(){
int t; cin >> t;
while(t--){
ll n; cin >> n;
int cnt = 0;
for(in... | ALGO | 0.999521 | 5.16195 |
040a9445-cb7d-4987-b54e-f779aeaf1e88 | luliyucoordinate/Leetcode | src/1363-Largest-Multiple-of-Three/1363.cpp | class Solution
{
public:
string largestMultipleOfThree(vector<int>& digits)
{
int cnt[10] = {};
for (int i : digits) cnt[i]++;
int b1 = cnt[1] + cnt[4] + cnt[7], b2 = cnt[2] + cnt[5] + cnt[8];
int t = (b1 + 2 * b2) % 3;
if (t == 1)
{
if (b1 ... | ALGO | 0.999891 | 6.345051 |
3fb56b0b-1c56-4b76-8753-c3eb5c514704 | Astha5487/Cpp-code | binarytree/spiralTraversal.cpp | #include <iostream>
#include <queue>
#include <vector>
using namespace std;
class node {
public:
int data;
node* left;
node* right;
node(int d) {
this->data = d;
this->left = NULL;
this->right = NULL;
}
};
node* buildTree(node* root) {
cout << "Enter data: ";
int d... | ALGO | 0.999996 | 6.227269 |
446feea9-1b85-49f1-8ea8-f2edb2c4fc8a | ishandutta2007/codeforces | ehnryx/normal/1198/B.cpp | #include <bits/stdc++.h>
using namespace std;
#define _USE_MATH_DEFINES
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
template <typename T>
using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
// DON'T USE THESE MA... | ALGO | 0.999933 | 4.830155 |
ce295c92-9cc2-413c-8904-f1b05e41f837 | projeto-de-algoritmos-2025/Grafos1-Codeforces-Atcoder-Problems | Grafos-Leonardo/policeStations.cpp | #include <bits/stdc++.h>
using namespace std;
typedef vector<vector<int>> graph;
void bfs(graph& G, vector<int> ps, int d, vector<bool>& visited, vector<pair<int,int>>& E, vector<bool>& maintainE, vector<bool>& is_p, vector<int>& indexes){
queue<pair<int,int>> q;
for(int p: ps){{}
q.push({p, 0});
... | ALGO | 0.999966 | 4.3603 |
bc3471b3-2c5c-48c5-9f48-ac98da91d792 | manikanta2901/ubuntu | .history/codingChallenges/cpp/Codechef/longChallenges/August/answer_20200814091527.cpp | #include<bits/stdc++.h>
using namespace std;
#define Mod 1,000,000,007
long long int modularExponentiation(long long int num,long long int a){
num = num % Mod;
long long int result = 1;
if(num == 0){
return 0;
}
while(a > 0){
if(a % 2 == 0){
result = result * num
... | ALGO | 0.999644 | 3.48243 |
d1750ef4-4020-4688-bebb-c5ab10d7b40a | tdvalencia/plasticdevour | detect/lib/opencv/samples/peopledetect.cpp | #include <opencv2/objdetect.hpp>
#include <opencv2/highgui.hpp>
#include <opencv2/imgproc.hpp>
#include <opencv2/videoio.hpp>
#include <iostream>
#include <iomanip>
using namespace cv;
using namespace std;
class Detector
{
enum Mode { Default, Daimler } m;
HOGDescriptor hog, hog_d;
public:
Detector() : m(... | ALGO | 0.96793 | 7.277886 |
d6f5c6d6-6262-4088-99b1-b9b9fa4db2e6 | Deepanshurathore01/Problem_of_The_Day_DSA | Tcs Codevita Prepration Code/DancingPandas/Dp.cpp | #include <iostream>
#include <vector>
#include <numeric> // For std::lcm (C++17 onwards)
using namespace std;
// Function to calculate GCD
int gcd(int a, int b) {
if (b == 0) {
return a;
}
return gcd(b, a % b);
}
// Function to calculate LCM
int lcm(int a, int b) {
return (a / gcd(a, b)) * b; ... | ALGO | 0.999981 | 6.655228 |
f17acaed-de37-4023-9d1c-eec35975f681 | Puellaquae/Algorithms | Graph/Road Construction.cpp | #include <bits/stdc++.h>
void optimize_cpp_stdio() {
std::ios::sync_with_stdio(false);
std::cout.tie(NULL);
std::cin.tie(NULL);
}
struct Edge {
int to, dist, cost;
Edge(int to, int dist, int cost): to(to), dist(dist), cost(cost) {}
};
int main() {
optimize_cpp_stdio();
int n, m;
while... | ALGO | 0.999977 | 4.525703 |
1bcbe9c2-ce20-4719-b067-e7725a7e4d39 | Darelife/CompetitiveProgramming | Problems/Coin_Collector.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;
#define int long long
#define debug(x) cout << #x << " = " << x << "\n";
#define vdebug(a) \
cout << #a ... | ALGO | 0.999532 | 3.457644 |
aadc00df-0b7a-4c0d-92eb-28666015b4a6 | chunhouliu/algorithms | codeforces/1454a.cpp | #include <cstdio>
using namespace std;
int main(int argc, char* argv[]) {
int t;
scanf("%d", &t);
while(t>0) {
int n;
scanf("%d", &n);
printf("%d", n);
for(int i=1; i<n; ++i) {
printf(" %d", i);
}
printf("\n");
--t;
}
} | ALGO | 0.998827 | 3.988798 |
d6738817-959f-449f-82c2-587125f01cba | modanhan/problem-solving | codeforces/513/c.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
vector < pair<int, int> > v(n, pair<int, int>(0, 0));
for (int i = 0; i < n; i++) {
cin >> v[i].second >> v[i].first;
}
sort(v.begin(), v.end());
vector < vector<pair<int, double> > > dp(n, vector<pair<int, double> >());
for (int i =... | ALGO | 0.999666 | 3.864745 |
108a502a-120f-428a-9bc4-08c47909ff1e | smily31/dsa-learning | Basic Algorithm/count_anagrams.cpp | // Given a word pat and a text txt. Return the count of the occurences of anagrams of the word in the text.
// Video reference to understand the code :-> https://www.youtube.com/watch?v=MW4lJ8Y0xXk&list=PL_z_8CaSLPWeM8BDJmIYDaoQ5zuwyxnfj&index=5
#include<bits/stdc++.h>
using namespace std;
// Sliding Window Technique
... | ALGO | 0.999952 | 5.918374 |
66f19369-6555-465d-9e08-c679ab5239ed | toy80/sgf2gif | 3rdpart/Quantize.cpp | #include <windows.h>
#include "Quantize.h"
/////////////////////////////////////////////////////////////////////////////
CQuantizer::CQuantizer (UINT nMaxColors, UINT nColorBits)
{
m_nColorBits = nColorBits < 8 ? nColorBits : 8;
m_pTree = NULL;
m_nLeafCount = 0;
for (int i=0; i<=(int) m_nColorBits; i++)
m_pReduc... | TOOL | 0.882614 | 4.661944 |
9844a0dd-974f-497f-a718-75f8ad744b39 | bhaskarbagchi/References | Ref/least_K_numbers_in_array.cpp | //multiset is implemented as red-black tree so insert, find etc operations are performed in log(n) time
#include <iostream>
#include <set>
#include <vector>
using namespace std;
vector<int> leastK(vector<int> numbers, int k) {
vector<int> ret;
if(k < 1 || numbers.size() == 0 || numbers.size() < k) {
return ret;
... | ALGO | 0.999978 | 4.732696 |
ce4346da-c206-4831-92ed-6fa26e35ea23 | heweimin77/shoran | Leetcode/lcp.36.maxGroupNumber.cpp | #include <string>
#include <array>
#include <vector>
#include "gtest.h"
#include <iostream>
#include <map>
#include <unordered_map>
#include <unordered_set>
#include <algorithm>
#include <queue>
#include <numeric>
#include <iomanip>
#include "support.h"
using namespace std;
namespace {
class Solution{
public:
i... | ALGO | 0.999316 | 6.285606 |
b501896d-e7f9-4c40-a4de-bd4b001963b1 | tuling56/opencv_study | EdgeDetection/square/sqaure_detection.cpp | //Functionμ
//Source:
//Status:
//Improve:
//Info:[11/15/2014 jmy]
#ifdef _CH_
#pragma package <opencv>
#endif
#include "cv.h"
#include "highgui.h"
#include <stdio.h>
#include <math.h>
#include <string.h>
int thresh = 50;
IplImage* img = 0;
IplImage* img0 = 0;
CvMemStorage* storage = 0;
const char* wndname = "Square... | TOOL | 0.973679 | 5.557361 |
a69c7792-a5a9-400d-a608-55b4d2207931 | Theodore9696/Command_and_Conquer_Generals | Generals/Code/Libraries/Source/WWVegas/WWMath/lineseg.cpp | /***********************************************************************************************
*** C O N F I D E N T I A L --- W E S T W O O D S T U D I O S ***
***********************************************************************************************
* ... | ALGO | 0.990952 | 4.998283 |
79ee737a-0b80-4766-b24d-e5732cabd9c3 | maxnelso/algorithms_competitions | ipsc/2014/what.cpp | #include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <queue>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cst... | ALGO | 0.999688 | 4.352582 |
e063b04d-eb2d-436c-a738-de71d349d64c | parmar-prachi/DSA | repetiton-statements/loops/do-while-loop/factors.cpp | #include <iostream>
using namespace std;
int main()
{
// factors of numbers using do-while loop
int n, i = 1;
cout << " Enter a number: ";
cin >> n;
do
{
if (n % i == 0)
{
cout << i << " ";
}
i++;
} while (i <= n);
} | ALGO | 0.992507 | 3.754557 |
77ea5218-7d9a-467a-8253-b3644c6a53e3 | adarsh-verma1/My-DSA-CP-Learning | Codeforces/1598/1598-A.cpp | /*
Author: ADARSH VERMA
Codeforces: adarsh_verma_
Codechef: adarsh_verma_
*/
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define vi vector<int>
#define vvi vector<vi>
#define pii pair<int,int>
#define vs vector<string>
#define pb push_back
#define um unordered_map
#define F first
#define S se... | ALGO | 0.999922 | 4.51493 |
c3610d64-99c9-4fd6-ab72-4807ceaab5a0 | EduardoGoncalvesProg/Estrutura-de-Dados | Lista01/ex01.cpp | //Eduardo Gonalves 32028016 03D
#include <iostream>
using namespace std;
int main(){
setlocale(LC_ALL, "portuguese");
int valor1;
int valor2;
cout << "Digite primeiro valor: ";
cin >> valor1;
cout << "Digite segundo valor: ";
cin >> valor2;
int aux;
aux = valor1;
valor1 ... | ALGO | 0.99646 | 3.750983 |
03023b65-1010-4c84-8a4a-38c6dec6ef78 | ishandutta2007/codeforces | amoo_safar/normal/1456/B.cpp | // har ki ro didi goft mikhad beshe meslemon !
#include <bits/stdc++.h>
#define pb push_back
#define F first
#define S second
#define all(x) x.begin(), x.end()
#define debug(x) cerr << #x << " : " << x << '\n'
using namespace std;
typedef long long ll;
typedef long double ld;
typedef string str;
typedef pair<ll, ll>... | ALGO | 0.999956 | 3.902665 |
884bbca9-fa2e-4112-99ab-91185f913cc5 | ishandutta2007/codeforces | jo_ulej/normal/1268/C.cpp | #include <iostream>
#include <iomanip>
#include <random>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <cmath>
#include <numeric>
#include <cstdlib>
#include <cstring>
#include <deque>
#include <sstream>
#include <bitset>
#include <cassert>
#include <fstream>
#include <queue>
#define le... | ALGO | 0.999962 | 3.547336 |
a07acb4a-e3dd-4682-bde1-13e08754a05a | ned14/boost-trunk | libs/spirit/repository/example/qi/derived.cpp | //[reference_includes
#include <boost/spirit/include/qi.hpp>
#include <boost/spirit/include/phoenix_core.hpp>
#include <boost/spirit/include/phoenix_operator.hpp>
#include <boost/spirit/include/phoenix_container.hpp>
#include <boost/spirit/include/phoenix_object.hpp>
#include <boost/spirit/include/phoenix_fusion.hpp>
#... | TOOL | 0.887461 | 5.301369 |
53b0c42e-70a7-42fa-af35-410df9e6b169 | oasg/NS-FDTD | src/model/HairMultilayerModel.cpp | #include "HairMultilayerModel.h"
#include <filesystem>
HairMultilayerModel::HairMultilayerModel(std::shared_ptr<TYPE::Field> f)
: FazzyModel(f), ep1(1.55*1.55*EPSILON_0_S), ep2(EPSILON_0_S), cuticle_width(0.5), cmc_width(0.06), num_layers(6)
{
}
string HairMultilayerModel::mkdir(string root)
{
std::filesystem::c... | TOOL | 0.875337 | 4.26702 |
40e08064-177e-4fe8-ab4d-b7a26639a903 | HarryChen1995/OpenCV | Homography/homography2.cpp | #include <opencv2/opencv.hpp>
using namespace cv;
using namespace std;
struct userdata{
Mat im;
vector<Point2f> points;
};
void mouseHandler(int event, int x, int y, int flags, void* data_ptr)
{
if ( event == EVENT_LBUTTONDOWN )
{
userdata *data = ((userdata *) data_ptr);
circle(data... | ALGO | 0.991848 | 5.236223 |
fc9584ea-377f-4d09-b379-f0359692b632 | ishandutta2007/codeforces | tiramister/normal/1279/B.cpp | #include <iostream>
#include <algorithm>
#include <vector>
using lint = long long;
int main() {
std::cin.tie(nullptr);
std::ios::sync_with_stdio(false);
int q;
std::cin >> q;
while (q--) {
int n;
lint s;
std::cin >> n >> s;
std::vector<lint> as(n);
for (a... | ALGO | 0.999986 | 3.976476 |
01b434dc-feb2-41b5-b9ce-f0586460277b | MainakRepositor/500-CPP | 288.cpp | // C++ implementation of delete
// operations on Trie
#include <bits/stdc++.h>
using namespace std;
const int ALPHABET_SIZE = 26;
// trie node
struct TrieNode {
struct TrieNode* children[ALPHABET_SIZE];
// isEndOfWord is true if the node represents
// end of a word
bool isEndOfWord;
};
// Returns new trie node ... | ALGO | 0.999901 | 4.899253 |
5c5d0b0c-d77d-4f33-a719-bfacd14ab352 | Anshul194/100_cpp_question | six.cpp | // Write a C++ program that takes a number as input and prints its multiplication table up to 10.
#include<iostream>
using namespace std;
int main(){
int number,i,table;
cout<<"Enter the number which you want table :";
cin>>number;
for(int i=1;i<=10;i++){
table=number*i;
cout<<number<<"*"<<i<... | ALGO | 0.995987 | 3.942354 |
d1c438d9-ab93-4735-ab00-5f848c930862 | mr-optimizer/cp | practice/TLE/DP - 1/1.cpp |
// @author mr_optimizer
#include <bits/stdc++.h>
using namespace std;
#define rep(i,x,y) for(int i=x ; i<y ; i++)
#define F first
#define S second
#define pb push_back
#define ppb pop_back
#define sz(v) int((v).size())
#define all(v) ... | ALGO | 0.999959 | 4.301672 |
8997f3f0-cced-4daa-b8b9-2c7959f67848 | Bgguy154/-CrackYourPlacement | 0834-sum-of-distances-in-tree/0834-sum-of-distances-in-tree.cpp | class Solution {
public:
vector<int> sumOfDistancesInTree(int n, vector<vector<int>>& edges) {
vector<int> ans(n);
vector<int> count(n, 1);
vector<unordered_set<int>> tree(n);
for (const vector<int>& edge : edges) {
const int u = edge[0];
const int v = edge[1];
tree[u].insert(v);
... | ALGO | 0.999958 | 6.327598 |
71f6c26d-316f-47ae-b9b7-ee4ec028fd6f | pascalchibuikem/trainingRepo | 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 |
66e4c35d-986e-401d-84b6-7d82d1eb4e8d | kifah-s/Problem_Solving | Gammal_Tech_Academy/2_C++_Programming_Language/Exercises/Pro_251_Vector_Of_Floating_Program/Vector_Of_Floating_Program_V1.cpp |
//* Vectors Floating Program (Version 1).
/*
* Create a vector of floating-point numbers and find the average numbers = {2.5, 3.0, 5.5, 1.8, 4.2}.
! Output:
! Average: 3.4
*/
#include <iostream>
#include <array>
#include <vector>
#include <string>
#include <algorithm>
#include <set>
using namespace std;
void resu... | ALGO | 0.999686 | 5.739254 |
591d3a91-0f89-40cd-89d2-937c6c72f4b9 | dashsumit/Cpp | unary operator overloading.cpp | #include<iostream>
using namespace std;
/*class coord
{
int x,y;
public:
coord(){x=0;y=0;}
coord (int i,int j){x=i; y=j;}
void get_xy(int &i,int &j){i=x;j=y;}
coord operator ++(){x++;y++;return *this;}
coord operator --() {x--;y--;return *this;}
};
int main()
{
coord ob1(20,30);
coord ob... | ALGO | 0.874863 | 4.057525 |
a7e48a44-de09-4216-aafb-f7652462e218 | webaverse-studios/avatars-wasm | physx/source/scenequery/src/SqCompoundPruner.cpp | #include "SqCompoundPruner.h"
#include "GuSqInternal.h"
#include "GuIncrementalAABBTree.h"
#include "GuPruningPool.h"
#include "GuAABBTreeQuery.h"
#include "GuAABBTreeNode.h"
#include "GuSphere.h"
#include "GuBox.h"
#include "GuCapsule.h"
#include "GuBVH.h"
#include "GuQuery.h"
#include "GuInternal.h"
#include "common/... | ALGO | 0.96573 | 6.863181 |
7186d663-9cee-4e56-9747-e40830d4f63e | ishandutta2007/codeforces | pashka/normal/1270/F.cpp | #include <bits/stdc++.h>
#define long long long int
using namespace std;
// @author: pashka
const int B = 1000;
const int MAX = 50000000;
int cnt[2 * MAX];
int main() {
// freopen("input.txt", "r", stdin);
ios::sync_with_stdio(false);
string s;
cin >> s;
int n = s.size();
cerr << n << endl... | ALGO | 0.999913 | 3.828007 |
ef33dc05-b475-4c42-b8b7-93ad67215d24 | Md-Nasiat-Hasan-Fahim/Problem-Solving-with-C | .acmx/solutions/Codeforces - Codeforces Round 806 (Div. 4)/E_Mirror_Grid.cpp | #include<bits/stdc++.h>
using namespace std;
#define FastIO ios_base::sync_with_stdio(false), cin.tie(0)
#define endl '\n'
#define int long long
#define all(x) x.begin(),x.end()
#define pb push_back
#define YES cout<<"YES\n"
#define NO cout<<"NO\n"
#define check(x) cout << (#x) << " is " << (x) << endl;
const int mod ... | ALGO | 0.999931 | 3.971982 |
550dcb2f-1b5d-47cf-bdf1-b63c0c6eac33 | NIRMAL-S-12/Coding | 0001-two-sum/0001-two-sum.cpp | class Solution {
public:
vector<int> twoSum(vector<int>& nums, int target)
{
vector<int> ans;
map<int, int> mp;
for(auto i : nums)
mp[i]++;
for(int i = 0 ; i < nums.size() ; i++)
{
int a = target - nums[i];
if(mp[a])
{
... | ALGO | 0.999904 | 6.120954 |
0146ef96-6131-44c0-943a-5518e0cf0632 | trago-project/tragocoin | src/tragocoind.cpp | #include "chainparams.h"
#include "clientversion.h"
#include "rpcserver.h"
#include "init.h"
#include "noui.h"
#include "scheduler.h"
#include "util.h"
#include "masternodeconfig.h"
#include "httpserver.h"
#include "httprpc.h"
#include "rpcserver.h"
#include <boost/algorithm/string/predicate.hpp>
#include <boost/files... | TOOL | 0.861629 | 5.890966 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.