uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
35cece84-a66f-4b21-9b18-67fbcd3d4679 | MariaChrysafis/CompetitiveProgramming | Algorithms/Computational Geometry/Polygons/pointsAndConvexPolygon.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int64_t gcd(int64_t a, int64_t b) {
if (min(a, b) == 0) return max(a, b);
return gcd(max(a, b) % min(a, b), min(a, b));
}
struct Point {
int64_t x;
int64_t y;
bool operator==(Point &p) {
return (p.x == x && p.... | ALGO | 0.999992 | 5.361263 |
8ad5d965-ab75-466e-bbc1-64b333697fa8 | KristianNikulin/Codeforces | 1 Основы C++ 2 часть/J - Экстремумы/J.cpp | #include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
using namespace std;
int main()
{
ios::sync_with_stdio(false);
cin.tie(0);
int n, q;
int min = 0, max = 0, gl_min_pos = 0, gl_max_pos = 0;
cin >> n;
vector<int> ans_min;
vector<int> ans_max;
vector<int> a(n... | ALGO | 0.999871 | 3.340249 |
2496615f-1a5d-4060-842d-14d96ec5e155 | ishandutta2007/codeforces | radewoosh/normal/NA/515.cpp | //~ while (clock()<=69*CLOCKS_PER_SEC)
//~ #pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("O3")
//~ #pragma GCC target ("avx2")
//~ #pragma GCC optimize("Ofast")
//~ #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
//~ #pragma GCC optimize("unroll-loops")
#include <bits/st... | ALGO | 0.999758 | 4.215534 |
c14e7a7b-af9f-4eef-a29b-8bf20c26d316 | luleilutao/jdk8 | openjdk/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.cpp | #include "precompiled.hpp"
#include "classfile/metadataOnStackMark.hpp"
#include "classfile/symbolTable.hpp"
#include "code/codeCache.hpp"
#include "gc_implementation/g1/concurrentMark.inline.hpp"
#include "gc_implementation/g1/concurrentMarkThread.inline.hpp"
#include "gc_implementation/g1/g1CollectedHeap.inline.hpp"
... | TOOL | 0.943232 | 7.718193 |
016b4395-1c5f-48ba-9875-5772d4301146 | mohdkaif1729/DSA | 04_twoPointers/04_twoSubArrayWithEqualSum.cpp | #include <iostream>
using namespace std;
void printArray(int arr[], int n) {
for (int i = 0; i < n; i++) {
cout << arr[i] << " ";
}
cout << endl;
return;
}
int isTwoSubArrayExistWithEqualSum(int arr[], int n) {
int subArray1 = 0, subArray2 = 0;
for (int i = 0; i < n; i++) {
subArray2 += arr[i];
... | ALGO | 0.999919 | 5.338382 |
81a4b3cf-8eab-4a2e-aebb-0d034b263d53 | Char1sk/AlgorithmContestBook | Book/Unit6/Exercise6.2/STrees.cpp | #include <iostream>
#include <string>
int main()
{
int cases = 0;
int depth;
while (std::cin >> depth && depth)
{
int sequence[10] = {0};
for (int i = 0; i < depth; ++i)
{
std::string node;
std::cin >> node;
int n = node.back() - '1';
... | ALGO | 0.998421 | 3.426846 |
7ef976f9-cd39-48c5-ae45-ab0d47bde70b | pacha2880/competitive_programming_codes | B. Mocha and Red and Blue.cpp | #include <bits/stdc++.h>
// #include <ext/pb_ds/assoc_container.hpp>
// #include <ext/pb_ds/tree_policy.hpp>
// #include <ext/rope>
#define mp make_pair
#define pb push_back
#define all(a) (a).begin(), (a).end()
#define sz(a) (int)a.size()
#define eq(a, b) (fabs(a - b) < EPS)
#define md(a, b) ((a) % b +... | ALGO | 0.999958 | 4.974644 |
839ecfae-21b8-4884-8408-fec4d33d3b00 | rootoverswapno/1-1-C-Programming | CP(competetive programming)/probel A.cpp | #include<iostream>
using namespace std;
int main()
{
int t;
cin>>t;
while(t--)
{
int a[100];
int n,k,c=0;
cin>>n>>k;
for(int i=0;i<100;++i)
{
cin>>a[i];
if(a[i]==k){
c++;
}
}
if(c>0)
{
... | ALGO | 0.999855 | 3.386357 |
dfd48532-a1b7-437b-b867-9a521ece2e5b | liuxuanhai/book-code | www.cplusplus.com-20180131/reference/bitset/bitset/count/count.cpp | // bitset::count
#include <iostream> // std::cout
#include <string> // std::string
#include <bitset> // std::bitset
int main ()
{
std::bitset<8> foo (std::string("10110011"));
std::cout << foo << " has ";
std::cout << foo.count() << " ones and ";
std::cout << (foo.size()-foo.count()) << ... | ALGO | 0.958578 | 6.632231 |
d5e5f382-d604-417f-874d-747f8584a546 | Kaulwarmythri/DSA | 334-increasing-triplet-subsequence/334-increasing-triplet-subsequence.cpp | class Solution {
public:
bool increasingTriplet(vector<int>& nums) {
int n = nums.size(), mini = nums[0], first = mini, sec = INT_MAX, third = INT_MAX;
for(int i=1; i<n; i++) {
if(nums[i] == mini)
continue;
else if(nums[i] < mini)
mi... | ALGO | 0.999983 | 6.002242 |
26f850e5-37da-4b54-ac0f-b189c35da052 | JelluSandro/olympic-code-cpp | itmo/Самое дешевое ребро.cpp | #include <bits/stdc++.h>
using namespace std;
vector<vector<int> > g;
vector<vector<int> > gv;
vector<int> used;
vector<int> vx;
vector<int> vi;
vector<int> pr;
int ott;
int otv;
int d[200002][50];
int dp[200002][50];
int n, s;
int cnt = 0;
int cur = 0;
void dfs(int v) {
used[v] = 1;
vx[v] = cnt;
cnt++;... | ALGO | 0.999908 | 4.314158 |
45fb9ddf-f04a-4e92-8e72-5e05ac5574c7 | 113bommy/deepmind_codecontests_refine | cpp_gold_filter_file/cpp_train_11779_28.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int x, y, z, a, b, c;
cin >> x >> y >> z >> a >> b >> c;
int s1 = a - x;
int s2 = s1 + b - y;
int s3 = s2 + c - z;
if (s1 < 0) {
cout << "NO";
} else if (s2 < 0) {
cout << "NO";
} else if (s3 < 0) {
cout << "NO";
} else {
cout ... | ALGO | 0.999803 | 3.326384 |
a46bf1af-0a16-40e3-bc5c-b2a3fe681ab0 | Aadityajain75/CompetitiveProgramming | practice/cf/4.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define f first
#define s second
#define pb push_back
#define REP(i,a,b) for(long long int i=a ; i<b ; i++)
#define mp make_pair
#define INF 1000000000000000000
#define mod 1000000007
#define pi pair<ll,ll>
#define vi vector<ll>
#define vpi vector<pi>
#... | ALGO | 0.999413 | 3.375591 |
f56d0f27-73c7-437a-a941-f7dd04866123 | ArnabC27/leetcode_daily_2024 | 2444. Count Subarrays With Fixed Bounds.cpp | class Solution {
public:
long long countSubarrays(vector<int>& nums, int minK, int maxK) {
long long ans = 0;
int j = -1;
int prevMinKIndex = -1;
int prevMaxKIndex = -1;
for(int i = 0; i < nums.size(); i++) {
if(nums[i] < minK || nums[i] > maxK) {
... | ALGO | 0.999891 | 5.558041 |
f269d1ce-1af3-4f5f-9f45-8e941a521859 | Dev-Reddy/GFGProblems | Easy/Exit Point in a Matrix/exit-point-in-a-matrix.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution {
public:
vector<int> FindExitPoint(int n, int m, vector<vector<int>>& matrix) {
int i = 0, j = 0, dir = 0;
while(i >= 0 && j >= 0 && i < n && j < m)
{
if(matrix[... | ALGO | 0.999907 | 5.779307 |
c0b9c7ab-e135-4a9f-9d20-1a84d244b3c8 | DroidX-UI/frameworks_native | libs/adbd_auth/adbd_auth.cpp | #define ANDROID_BASE_UNIQUE_FD_DISABLE_IMPLICIT_CONVERSION
#include "include/adbd_auth.h"
#include <inttypes.h>
#include <sys/epoll.h>
#include <sys/eventfd.h>
#include <sys/uio.h>
#include <atomic>
#include <chrono>
#include <deque>
#include <optional>
#include <string>
#include <string_view>
#include <tuple>
#incl... | TOOL | 0.947094 | 7.8483 |
80f4a0d4-fe71-4500-9d42-84659e3473f2 | Binary-Bard-Apps/flutter_maths_tricks_alpha | apk/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.998222 | 6.785645 |
4853d7f2-a415-4db5-9a60-dd1be00322a9 | koromamamud/lab | reversebinary.cpp | #include <iostream>
using namespace std;
int main() {
int x;
cin >> x;
while (x > 0) {
cout << (x % 2);
x = x / 2;
}
cout << endl;
return 0;
} | ALGO | 0.999934 | 4.492222 |
0cb57325-b9b8-4d58-a44f-8665fd4e5a4b | sarvex/leetcode-scopes | solution/0400-0499/0492.Construct the Rectangle/Solution.cpp | class Solution {
public:
vector<int> constructRectangle(int area) {
int w = sqrt(1.0 * area);
while (area % w != 0) --w;
return {area / w, w};
}
}; | ALGO | 0.99896 | 6.455166 |
d94f82ff-4a48-4609-887f-0b73e23a5ba6 | Brmoye/CS255 | in-class/sept2.cpp | #include <iostream>
using namespace std;
int main()
{
int ar[10] = {10, 20, 30, 40, 50};
int size = 5;
for(int i = 0; i < size; ++i)
{
cout << ar[i] << "\t";
}
cout << endl;
for(int i = 0; i < size; ++i)
{
cout << *(ar + i) << "\t";
}
cout << endl;
for(int *temp_ptr = ar, i = 0; i < size; ++temp_p... | TOOL | 0.980644 | 3.347442 |
56f487cc-4d29-499e-b3f5-5225e2a07dbc | jrk/tortoisegit | src/TortoiseProc/RevisionGraph/StrictOrderNodePositioning.cpp | // TortoiseSVN - a Windows shell extension for easy version control
#include "StdAfx.h"
#include "StrictOrderNodePositioning.h"
#include "StandardLayout.h"
#include "VisibleGraph.h"
inline bool CompareNodes
( const std::pair<revision_t, CStandardLayoutNodeInfo*>& lhs
, const std::pair<revision_t, CStandardL... | ALGO | 0.970635 | 6.289694 |
a2846f22-36b5-4e92-9e56-5d9114f59757 | lucic71/llvm-ub-free | llvm/lib/CodeGen/MachinePipeliner.cpp | #include "llvm/CodeGen/MachinePipeliner.h"
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/BitVector.h"
#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/MapVector.h"
#include "llvm/ADT/PriorityQueue.h"
#include "llvm/ADT/SetOperations.h"
#include "llvm/ADT/SetVector.h"
#include "llvm/ADT/SmallPtrSet.h"
#include "llv... | TOOL | 0.996065 | 6.470741 |
4a5aa581-f07a-4bcb-9c78-72f1b91f8133 | masterchef2209/coding-solutions | codes/cses/RestaurantCustomers.cpp | /*Read the problem carefully before starting to work on it*/
#include <bits/stdc++.h>
//#include <boost/multiprecision/cpp_int.hpp>
//using namespace boost::multiprecision;
//#include <ext/pb_ds/assoc_container.hpp>
//#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
//using namespace __gnu_pbds;
typedef lo... | ALGO | 0.99992 | 3.999592 |
1eec4dd1-0a39-47b5-a712-05b7968c7b78 | goutamb07/aps-code-library | arrchef1.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
// your code goes here]
int t;
cin >> t;
while (t--) {
int temp, n, carry = 1;
cin >> n;
vector<int> vect(n + 1, 0);
for (int i = 1; i <= n; i++) {
cin >> vect[i];
}
for (int i = n; i >= 0; i--) {
if (vect[i] == 9... | ALGO | 0.999923 | 4.765593 |
9db87abd-1b12-414b-8d69-ce8463ccc71f | thegamer1907/Code_Analysis | contest/1542589521.cpp | #include <bits/stdc++.h>
using namespace std;
int main(){
int i,j,k;
int n;
string s;
cin>>s;
cin>>n;
string ma[111];
for(i=0;i<n;i++) cin>>ma[i];
for(i=0;i<n;i++){
if (s==ma[i]){
cout<<"YES";
return 0;
}
}
for(i=0;i<n;i++){
for(j=0;j<n;j++){
... | ALGO | 0.999956 | 3.414456 |
477aa326-5f13-457c-98b6-2faf14ca1337 | liuwanbing/liuwanbing | 棋牌/PlatForm/GMTools/GMTool/sha1.cpp | #include "stdafx.h"
#include "sha1.h"
/*
* SHA1
*
* Description:
* This is the constructor for the sha1 class.
*
* Parameters:
* None.
*
* Returns:
* Nothing.
*
* Comments:
*
*/
SHA1::SHA1()
{
Reset();
}
/*
* ~SHA1
*
* Description:
* This is the destructor for the sha1 class
*
* Parameters:... | ALGO | 0.974488 | 6.560573 |
83961398-b2df-42b1-8545-68df1a0c5d81 | Saber7X/DaiMaDaQuan | 900. 整数划分2(第二种做法).cpp | #include<bits/stdc++.h>
using namespace std;
const int N = 1010, mod = 1e9 + 7;
int f[N][N];
int main()
{
f[0][0] = 1;
int n; cin >> n;
for(int i = 1; i <= n; i ++ )
{
for(int j = 1; j <= i; j ++ )//Ϊiиiֻiֻi
{
f[i][j] = (f[i - 1][j - 1] + f[i - j][j]) % mod;
}
}
//ٰÿָķ
int ans = 0;
for(int i = 1; i <... | ALGO | 0.99992 | 4.541977 |
bfed5a58-fe3e-4d00-b568-6328255040aa | penguin72487/programing | cses/task1671Dijkstra.cpp | #include <iostream>
#include <queue>
#include <vector>
#include <unordered_map>
using namespace std;
int main(){
cin.tie(0)->sync_with_stdio(0);
cout.tie(0);
int n,q;
cin >> n >> q;
unordered_map<int,unordered_map<int,long long>> map_Neighbors;
while(q--)
{
int a, b;
long lo... | ALGO | 0.99992 | 4.668197 |
da5110dd-0c90-4f73-b427-8fbfd3e7555f | yuenanchen/c_language | 函数调用,统计数中'2’的个数.cpp | #include<stdio.h>
#include<string.h>
int countdigit(int m)
{
int count=0,n;
while(m!=0)
{
n=m%10;
m=m/10;
if(n==2)
{
count++;
}
}
return count;
}
int main()
{
int a,x;
while(scanf("%d",&a)!=EOF)
{
x=countdigit(a);
printf("%d\n",x);
}
}
| ALGO | 0.99295 | 3.002368 |
154019da-5e33-4c98-bc86-454b2ed1d5a5 | durgaprasadbvdp/DSA | 3.BIT MANIPULATION/33.1.cpp | /* 33.1.Check if kth bit is set or not using naive approach.
You will be given a number and you need to find whether the kth bit in binary form is set or not.
INPUT : n = 20, k = 4
OUTPUT : NOT SET
INPUT : n = 10, k = 2
OUTPUT : SET
*/
#include<bits/stdc++.h>
using namespace std;
bool kSet(int n,int k)
{
int ... | ALGO | 0.999045 | 4.787086 |
14963c96-2743-4d2e-af6e-24fa23471dac | Ritik1431/Love-Babbar-DSA | notes/14_search_in_matrix2.cpp | #include <bits/stdc++.h>
using namespace std;
bool searchMatrix(vector<vector<int>>& matrix, int target) {
int row = matrix.size();
int col = matrix[0].size();
int rowIndex = 0;
int colIndex = col - 1;
while(rowIndex < row && colIndex >=0)
{
int element = m... | ALGO | 0.999631 | 5.191452 |
1307effe-fb39-4050-9b3f-953a62fbf6d9 | YuTing-Fang1999/CPE | one star/uva12019.cpp | #include<iostream>
#include<string>
using namespace std;
int MtoD[] = {
0,31,28,31,30,31,30,31,31,30,31,30,31
};
string toStr[] = {"Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"};
int T,M,D,nowDay;
int firstDay = 4;
int main(){
cin>>T;
while(T--){
cin>>M>>D;
nowDay=firstDay + D;
for(in... | ALGO | 0.999896 | 3.731768 |
5424e248-44a3-4939-9a47-a86b5d5ee2ac | yuenanchen/c_language | 偶数排序1.cpp | #include<stdio.h>
int main()
{
int a[100],b[100],n,i,j;
while (scanf("%d",&n)!=EOF)
{
int t=0,c;
for (i=0;i<n;i++)
{
scanf("%d",&a[i]);
}
for (i=0;i<n;i++)
{
if (a[i]%2==0)
{
b[t]=a[i];
t++;
}
}
for (i=0;i<t;i++)
{
for (j=i+1;j<t;j++)
{
if (b[j]>b[i])
{
c=... | ALGO | 0.999984 | 3.023224 |
27b18c77-2309-41bf-bc46-dce5c8de5112 | momo-chenchuw/EC602-Design-by-Software | Assignments/HW8/heavy.cpp | #include <string>
#include <vector>
using std::string;
using std::vector;
using std::stoi;
string convertbase(int num, int tobase) {
// Convert num from base 10 to base 'tobase'
if (num == 0)
return "0";
int remainder;
string newbase_num;
while (num > 0) {
remainder = num % tobase;
num = num / t... | ALGO | 0.999342 | 5.300686 |
0362f999-b749-4839-b7fb-f5a773445194 | miteshkumar77/CSCI-4210-CPU-Scheduling-Simulation-Project | src/SeqGenerator.cpp | /**
* CSCI 4210 Operating Systems
* 2021 Spring
*
* Simulation Project - SeqGenerator.cpp
*
* Author:
* Mitesh Kumar [ kumarm4 ]
*/
#include "SeqGenerator.hpp"
inline double SeqGenerator::nextExp(double lambda) {
return -log(drand48()) / lambda;
}
inline unsigned int SeqGenerator::randNumBursts() {... | ALGO | 0.988251 | 5.576676 |
bfc34b06-a912-4843-b1b2-e2438b0d70d4 | vighnesh-shinde-18/Data-structures-and-algorithms-in-cpp | STRINGS & MAPS/check_for_isomarphic_strings.cpp | #include <iostream>
#include <vector>
#include <map>
using namespace std;
int main()
{
string s = "egg", t = "add";
if (s.size() != t.size())
{
cout << false;
return 0;
}
int freq_s[120], freq_t[120];
for (int i = 0; i < 120; i++)
{
freq_s[i] = -1;
}
for (in... | ALGO | 0.999935 | 4.151048 |
972410f6-0c25-4077-9935-0aac018e141f | ishandutta2007/codeforces | tommyr7/normal/1491/F.cpp | #include <bits/stdc++.h>
using namespace std;
#define Maxn 2007
int T,n;
bool flag[Maxn];
map<pair<pair<int,int>,pair<int,int> >,int>mp;
int calc(int l,int r,int lx,int rx)
{
if (mp.find(make_pair(make_pair(l,r),make_pair(lx,rx)))!=mp.end()) return mp[make_pair(make_pair(l,r),make_pair(lx,rx))];
printf("? %d %d... | ALGO | 0.999841 | 3.443376 |
4aabc779-8de9-404b-839e-7cba52b00303 | edoc0322/ACMProblemSolving | UVa Online Judge/uva834/main.cpp | #include <iostream>
using namespace std;
int main()
{
int n,m;
while(cin >> n && cin >> m)
{
cout << "[" << n/m << ";";
int di,rem;
rem = n%m;
n = m;
m = rem;
int status = 0;
while(n != 1)
{
di = n/m;
rem = n%m;
... | ALGO | 0.999283 | 4.31359 |
73a8aee9-e036-4d59-aee0-da0dc370b6b3 | milmillin/comp-prog | GoogleCodeJam/2019_Qual/datbae.cpp | #include <cstdio>
#include <algorithm>
#include <vector>
#include <string>
#include <cstring>
#include <iostream>
#include <cassert>
using namespace std;
// 11110000
const int maxn = 2048;
vector<int> compress(const string &res) {
vector<int> ans;
int cur = 1;
int cnt = 0;
for (auto c : res) {
if (c - '0' != ... | ALGO | 0.999832 | 3.298764 |
8ea53e69-f540-4163-aa03-f5b148d2f254 | sarvex/leetcode-malbolge | solution/1900-1999/1920.Build Array from Permutation/Solution.cpp | class Solution {
public:
vector<int> buildArray(vector<int>& nums) {
vector<int> ans;
for (int& num : nums) {
ans.push_back(nums[num]);
}
return ans;
}
}; | ALGO | 0.999981 | 5.923581 |
f6c77142-0481-42ce-b317-54405fc7cbd1 | ChaoHuang2018/POLAR_Tool | ARCH-COMP22/ACC/nncs_acc.cpp | #include "../../POLAR/NNCS.h"
//#include "../../flowstar/flowstar-toolbox/Constraint.h"
using namespace std;
using namespace flowstar;
int main()
{
// Check 'ARCH-COMP20_Category_Report_Artificial_Intelligence_and_Neural_Network_Control_Systems_-AINNCS-_for_Continuous_and_Hybrid_Systems_Plants.pdf'
// Declaration o... | ALGO | 0.999209 | 5.280403 |
65ccb6d9-a338-4c33-801d-08663594d5de | Meron3r/Cp-Solutions-Vim | Problemset/214A.cpp | #include <bits/stdc++.h>
using namespace std;
#define debug cout << "I was here!" << '\n'
#define all(a) a.begin(), a.end()
typedef unsigned u;
typedef long long ll;
void solve()
{
int n, m; cin >> n >> m;
int cnt = 0; bool big = false;
for (int i = 1; i < 100 && !big; i++)
{
for (int j... | ALGO | 0.99933 | 5.507116 |
ff9ccf53-5657-405f-b29f-c1ea639163a7 | lurenxiao1998/leetcode-solutions | 0116 填充每个节点的下一个右侧节点指针/recursion.cpp | class Solution {
int depth, prevDepth;
public:
Solution(){
depth = 0;
prevDepth = 1;
}
void recursive(Node* node){
if(node == nullptr)
return;
if(node->left != nullptr && node->right != nullptr){
depth+=2;
node->left->next = node->right;
... | ALGO | 0.999927 | 5.704625 |
226c29ca-2fad-4ecb-8b7f-ff654d32dad6 | gyubeomim/lockdpwn | cpp/3coding/boj/boj11650_3.cpp | /*
* #+DESCRIPTION: 백준 11650, 좌표 정렬하기 문제를 푼 정답코드, cmp 함수를 따로 정의해서 sort의 3번째 파리미터로 사용해서 풀었다
* #+CATEGORY: sort
* #+LEVEL: -
* #+FROM: 알고리즘기초 정렬
* #+DATE: 2018-06-18-월
* #+AUTHOR: Edward Im (<EMAIL>)
*/
#include <cstdio>
#include <iostream>
#include <algorithm>
#include <vector>
u... | ALGO | 0.999707 | 4.890236 |
ded13c38-6d4e-4f12-80b4-0bd5627b9818 | morris821028/UVa | volume014/1400 - Ray, Pass me the dishes.cpp | #include<stdio.h>
#define N 1048576
#define Maxv 1000000000
long long A[N], Ans, f0, f1;
int B[N], st, ed, st0, ed0, st1, ed1;
struct segment {
int l, r, m;
int lc, rc;
int lst, led, rst, red, mst, med;
long long sum, lmax, rmax, midmax;
}ST[2*N + 2];
int max(int x, int y) {
return x >= y ? x : y;
}... | ALGO | 0.999859 | 3.764293 |
6a99b7e9-54f4-4d46-89af-c9b484677f88 | Initel/3DPrinterconfig | buildroot/share/PlatformIO/variants/MARLIN_LERDGE/variant.cpp | #include "pins_arduino.h"
#ifdef __cplusplus
extern "C" {
#endif
const PinName digitalPin[] = {
PB_12,
PB_13,
PB_14,
PB_15,
PD_8,
PD_9,
PD_10,
PD_11,
PD_12,
PD_13,
PD_14,
PD_15,
PG_2,
PG_3,
PG_4,
PG_5,
PG_6,
PG_7,
PG_8,
PC_6,
PC_7,
PC_8,
PC_9,
PA_8,
PA_9,
PA_10,
PA_11,
PA_12,
PA_13,
PA_1... | CONFIG | 0.941526 | 5.010884 |
5b71f5f1-4bd4-4c5b-93db-e22e6ece2495 | Tang1705/Happy-Reconstruction | Lib/opencv/sources/modules/core/src/sum.dispatch.cpp | #include "precomp.hpp"
#include "opencl_kernels_core.hpp"
#include "stat.hpp"
#include "sum.simd.hpp"
#include "sum.simd_declarations.hpp" // defines CV_CPU_DISPATCH_MODES_ALL=AVX2,...,BASELINE based on CMakeLists.txt content
#undef HAVE_IPP
#undef CV_IPP_RUN_FAST
#define CV_IPP_RUN_FAST(f, ...)
#undef CV_IPP_RUN
#de... | ALGO | 0.99276 | 6.281971 |
d601b53a-48ea-4b25-865c-597f04b69dac | ebithril/Scripted-Game | DX2DEngine/source/noise/perlin_noise.cpp | #include "stdafx.h"
#include "noise/perlin_noise.h"
#include <iostream>
#include <cmath>
#include <random>
#include <algorithm>
#include <numeric>
// I ADDED AN EXTRA METHOD THAT GENERATES A NEW PERMUTATION VECTOR (THIS IS NOT PRESENT IN THE ORIGINAL IMPLEMENTATION)
// Initialize with the reference values for the pe... | ALGO | 0.999135 | 6.242449 |
7034df44-0a2e-4cc1-b166-67cd64edf56e | Jsen27/OpenCV_Study | src/OpenCV_Study71.cpp | #include <opencv2/opencv.hpp>
#include <iostream>
using namespace std;
using namespace cv;
// 고주파 성분 제거
void displayDFT(Mat& src)
{
Mat image_array[2] = { Mat::zeros(src.size(), CV_32F), Mat::zeros(src.size(), CV_32F)};
// 1 DFT 결과 영상을 2개의 영상으로 분리한다
split(src, image_array);
Mat mag_image;
// 2 푸리에 변환 계수들의 절대값... | ALGO | 0.985894 | 5.230642 |
50c546bf-1e25-423f-89db-b95075b4cfcb | Code-Practitioners/Diversified-Programming | Math/countPrime.cpp | class Solution {
public:
int countPrimes(int n) {
vector<bool> prime(n + 1, true);
prime[0] = false;
prime[1] = false;
for(int i = 2; i*i < n; i++){
if(prime[i]){
for(int j = i*i; j < n; j += i){
prime[j] = fa... | ALGO | 0.999952 | 5.843232 |
4da75b71-f535-46f9-9020-19cb9b064f2f | MrWai1818/SYSU-DataStructureAndAlgorithms-2021 | project4/code/main.cpp | #include "widget.h"
#include <QApplication>
#include <QString>
#include <iostream>
#include <cstring>
#include <cmath>
#include<string>
#include<string>
#include<vector>
#include<queue>
#include<stack>
using namespace std;
vector<int> step(1000,0);
struct Graph{
vector<vector<int>> adj; //图的邻接表
vector<string>... | ALGO | 0.99887 | 3.385774 |
bfc81e66-bb39-4763-9e9f-1b0067127125 | LOL-codes/code | recursion/letter combination of phone number.cpp | #include <iostream>
#include <vector>
using namespace std;
void rec(vector<string>&map, string str,vector<string>&res,string ch, int i){
if(i==str.length()){
res.push_back(ch);
return;
}
int dig=str[i]-'0';
if(dig<=1){
rec(map,str,res,ch,i+1);
return;
}
for(in... | ALGO | 0.999878 | 5.030411 |
f6133283-31ab-4166-ba10-c52af83e5455 | Iprime111/elfio | src/elf_loader.cpp | #include <algorithm>
#include <climits>
#include <cstdint>
#include <cstring>
#include <elfio/elf_types.hpp>
#include <fcntl.h>
#include <fmt/base.h>
#include <fmt/format.h>
#include <fmt/os.h>
#include <stdexcept>
#include <string>
#include <sys/mman.h>
#include <sys/user.h>
#include <tuple>
#include <signal.h>
#incl... | TOOL | 0.860479 | 6.732186 |
5848616e-9c5c-4360-ada8-025c849366c3 | tintin010/algorithm | 프로그래머스/1/17681. [1차] 비밀지도/[1차] 비밀지도.cpp | #include <string>
#include <vector>
using namespace std;
string treasure(int t1, int t2, int maxi){
string temp = "";
while(maxi){
if(t1 / maxi || t2 / maxi) temp += "#";
else temp += " ";
if(t1 / maxi) t1 -= maxi;
if(t2 / maxi) t2 -= maxi;
... | ALGO | 0.999933 | 4.833354 |
438d66ea-8f6d-414c-8fbc-4960b567a53e | Vikramaditya-Ghadage/Codes | C++/SDE_SHEET/Greedy/WorkerProfit.cpp | #include<bits/stdc++.h>
using namespace std;
struct wrk
{
int profit;
int dif;
};
class Solution {
public:
bool static cmp(wrk a1,wrk a2)
{
return a1.profit>a2.profit;
}
int maxProfitAssignment(vector<int>& difficulty, vector<int>& profit, vector<int>& worker) {
... | ALGO | 0.999934 | 5.293873 |
d9ae1199-19b0-452c-a038-aa7784d44b59 | 113bommy/deepmind_codecontests_refine | cpp_gold_filter_file/cpp_train_2583_6.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int x; cin >> x;
cout << (x == 7 || x == 5 || x == 3 ? "YES" : "NO");
} | ALGO | 0.999716 | 3.667496 |
cad99148-da4d-42cd-8c77-6849c694441a | thoai240699/OOP_C_Plus_Plus | Week_02/2.cpp | #include <iostream>
using namespace std;
/*
2. Xây dựng lớp biểu diễn khái niệm số phức với hai thành phần dữ liệu thực, ảo
và các hàm thành phần xuất, nhập, định giá trị cho số phức, cộng, trừ, nhân,
chia hai số phức. Viết chương trình cho phép nhập vào hai số phức, in ra kết quả
các phép toán cộng, trừ, nhân, chia h... | ALGO | 0.85599 | 4.126755 |
5d90dc92-aa85-4842-bb45-e07c5d6e8fd7 | anjalipathak13/Practice-Leetcode-Question | 0006-zigzag-conversion/0006-zigzag-conversion.cpp | class Solution {
public:
string convert(string s, int nRows) {
if (nRows <= 1)
return s;
const int len = (int)s.length();
string *str = new string[nRows];
int row = 0, step = 1;
for (int i = 0; i < len; ++i)
{
str[row].push_back(s[i]);
if (row == 0)
... | ALGO | 0.999972 | 6.477073 |
fe2c8bac-46a2-4ac9-bdb4-ff2c2c3b356a | decenomy/MONK | src/pow.cpp | #include "pow.h"
#include "chain.h"
#include "chainparams.h"
#include "main.h"
#include "primitives/block.h"
#include "uint256.h"
#include "util.h"
#include <math.h>
unsigned int GetNextWorkRequiredPOW(const CBlockIndex* pindexLast)
{
const auto& params = Params();
const auto& consensus = params.GetConsensus... | ALGO | 0.999134 | 6.785988 |
6a77b7dd-5d8e-4ea8-973a-5bec8de876ec | royun0307/baekjoonstart | 1004/1004.cpp | #include <iostream>
#include <cmath>
int CalcultePlanetInOrOut(int x, int y, int cx, int cy, int r) {
int distance_square = pow((x - cx), 2) + pow((y - cy), 2);
int r_square = pow(r, 2);
if (r_square >= distance_square) {
return 0;
}
else {
return 1;
}
}
void CountPlanetInOrOut(int x1, int y1, int x2, int y... | ALGO | 0.999917 | 4.770412 |
f69d8642-1b6e-4645-ad6b-c0abe72a3854 | minhvpham/Competitive_Programing | Hackercup/round1b2.cpp | // Onegai no bug
// Author : 13minusone
#include<bits/stdc++.h>
using namespace std;
#define task "round1b2"
#define SZ(c) (c).size()
#define getbit(x,i) (((x) >> (i)) & 1)
#define turnoff(x,i) (x)&(~(1<<(i)))
#define __builtin_popcount __builtin_popcountll
#define all(x) (x).begin(),(x).end()
#define pb(x) push_back(x... | ALGO | 0.998683 | 3.85052 |
f817df09-c045-4205-98cc-f81a9dcda54f | oysterkwok/Practice | SelfTraining/SelfTraining/Hedgedog/main.cpp | #include <iostream>
#include <vector>
#include <set>
#include <map>
using namespace std;
class board {
public:
int n;
vector<vector<int> > grid;
vector<pair<int, int> > cord;
void init(int _n) {
n = _n;
grid.resize(n);
for (int i = 0; i < n; i++) {
grid[i].resize(n, 0);
}
cord.resize(n*n+1, pair<in... | ALGO | 0.998304 | 3.759511 |
e9881c9d-9edc-4016-96b4-69c548647ad5 | Raptor-Ryu/kyoupuro | Codeforces/579/C.cpp | //未完成 謎
#include <bits/stdc++.h>
using namespace std;
long long euc(long long a, long long b){
long long r;
r = a % b;
while(r!=0){
a = b;
b = r;
r = a % b;
}
return b;
}
int main(){
int n;
cin >> n;
long long x;
cin >> x;
for(int i=0; i<n-1; i++){
long long tmp;
cin >> t... | ALGO | 0.999895 | 3.264148 |
3e9871de-1bf5-4f1c-a51d-05110e0b3036 | cyborg7459/Data_Structures_and_Algorithms | Data Structures/04 - Linked List/10-Check_Sorted.cpp | #include <bits/stdc++.h>
using namespace std;
struct Node {
int data;
struct Node *next;
};
Node *first = new Node;
void createLinkedList(int A[], int n) {
int i;
Node *t, *last;
first->data=A[0];
first->next=NULL;
last=first;
for(int i=1; i<n; i++) {
t = new Node;
t->... | ALGO | 0.999851 | 4.635688 |
a20a38c6-5dae-4ae2-be4c-c2c400f76c44 | iamshivprasad/LearningDS | LRUCache/LRUCache.cpp | #include "LRUCache.h"
LRUCache::LRUCache(int size) : m_capacity(size)
{
}
LRUCache::~LRUCache()
{
// clean up the linked list nodes
}
int LRUCache::get(int key)
{
auto itr = m_table.find(key);
if (itr == m_table.end())
return -1;
int ret = itr->second->val;
Node* prev = itr->second->prev;
Node* next = itr-... | ALGO | 0.901164 | 5.650676 |
c1212cc4-9590-4282-b423-8276b566aa5a | Slava/competitiveProgramming | more-source/2010-2011/city_2010-11/City/2-тур/Бекишев Данияр/D/D.cpp | #include <iostream>
#include <algorithm>
#include <vector>
#include <cstdio>
using namespace std;
#define pb push_back
#define mp make_pair
#define f first
#define s second
const int N = 100009;
vector < int > rebra[N], ver[N], f[N];
int len[N], used[N], c[N], p, h, o = 1, lend[N], lenc, lenf[N], uh[N];
int pr1(int k,... | ALGO | 0.999947 | 4.095803 |
2f5dd6db-6d97-4690-a216-e46aac11dbed | md-qubais/Leetcode_Accepted_Solutions | leetcode_clone_and_target.cpp | class Solution {
public:
TreeNode* cloned(TreeNode*root,TreeNode*target){
if(root==NULL){
return NULL;
}
TreeNode*left=cloned(root->left,target);
if(left){
if(left->val==target->val) return left;
}
TreeNode*right=cloned(root->right,target);
if(right){
if(right->val==target->val) return right;
... | ALGO | 0.999868 | 5.576142 |
a3e8772a-7f14-45bc-a9cd-b70cf469800d | daev681/coding-test | LEVEL2/NumberList.cpp | #include <string>
#include <vector>
#include <iostream>
#include <unordered_map>
#include <map>
#include <string>
using namespace std;
bool solution(vector<string> phone_book) {
bool answer = true;
unordered_map<string, int> map;
for (int i = 0; i < phone_book.size(); i++)
map[phone_... | ALGO | 0.999705 | 5.007813 |
a2e2855b-8229-4aa3-83fc-30754a83a114 | HekpoMaH/Olimpiads | grupa C/olimpiada/oblasten/2008/reshenija/Plovdiv/D/ANK/pets.cpp | #include<iostream>
using namespace std;
char mas[5][20];
int br[5],br1[5];
int main()
{
int i,n,j;
cin>>n;
for(i=0;i<n;i++)
{
cin>>mas[i];
for(j=0;j<20;j++)
if(mas[i][j]=='C'||mas[i][j]=='A'||mas[i][j]=='T')br[i]++;
for(j=0;j<20;j++)
if(mas[i][j]=='G'||mas[i][j]=='P'||mas[... | ALGO | 0.993196 | 3.299869 |
49de133d-b931-4553-bbee-c18a8c89e2ca | briandrawert/SPH-BVF | src/USER-OMP/pair_peri_pmb_omp.cpp | /* ----------------------------------------------------------------------
Contributing author: Axel Kohlmeyer (Temple U)
------------------------------------------------------------------------- */
#include <cmath>
#include <cfloat>
#include "pair_peri_pmb_omp.h"
#include "fix.h"
#include "fix_peri_neigh.h"
#includ... | ALGO | 0.999754 | 5.890149 |
b1be2ae4-1473-44b3-a6d4-a591baa49a8f | langningchen/Etiger | 0661.cpp | #include <bits/stdc++.h>
using namespace std;
int L, u, v;
double ans;
int main()
{
freopen("bridge.in", "r", stdin);
freopen("bridge.out", "w", stdout);
cin >> L >> u >> v;
ans = 100 - L * 1.0 / (u + v) * 2;
if (ans > 0)
cout << fixed << setprecision(2) << ans << endl;
else
cout << fixed << setprecision(2) <... | ALGO | 0.999151 | 3.843413 |
56048593-14b6-4f1e-b934-2630cba3f379 | prateekchandan/spoj | UFPR14D.cpp | // C program to show segment tree operations like construction, query
// and update
#include <iostream>
#include <cmath>
using namespace std;
// A utility function to get the middle index from corner indexes.
int getMid(int s, int e) { return s + (e -s)/2; }
/* A recursive function to get the sum of values in g... | ALGO | 0.999955 | 5.593276 |
2cba8ecd-ad0c-4e0e-bac6-d3b91d2a93ca | abhiiguptaa/DsaKaro | 0148-sort-list/0148-sort-list.cpp | /**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode() : val(0), next(nullptr) {}
* ListNode(int x) : val(x), next(nullptr) {}
* ListNode(int x, ListNode *next) : val(x), next(next) {}
* };
*/
class Solution {
public:
ListNode* sortLinked... | ALGO | 0.999987 | 5.549537 |
1185ab0d-ef72-4be1-991b-89a7b198461b | ishandutta2007/codeforces | sky3141/normal/1710/B.cpp | #include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
using namespace std;
using LL = long long;
constexpr int MAXN = 200000 + 9;
constexpr LL INF = 1000000000000000000;
int n, m;
LL a[MAXN];
LL ml[MAXN];
LL mr[MAXN];
int ans[MAXN];
struct Rain
{
int x, p, id;
bool operator<(const Rai... | ALGO | 0.999987 | 3.645534 |
9fccfe8b-a034-483c-8452-ca598d24a3c0 | vikasjiitk/Cplusplus-coding-practice | odd_cycle.cpp | #include<stdio.h>
struct list{
int node;
list *next;
};
int main(){
int n;
scanf("%d", &n);
int ne;
scanf("%d", &ne);
list *graph[n];
for(int i = 0; i < n; i++)
graph[i] = NULL;
int x,y;
for(int i = 0; i < ne; i++){
scanf("%d%d", &x, &y);
list *New = new list;
New->node = y;
New->next = graph[x];
... | ALGO | 0.999716 | 3.954682 |
84ad6126-ccea-45ba-9064-7a1ed4a5561a | Marckvdv/storm-compositional | src/storm-pomdp/analysis/WinningRegionQueryInterface.cpp | #include "storm-pomdp/analysis/WinningRegionQueryInterface.h"
#include "storm/adapters/RationalNumberAdapter.h"
#include "storm/exceptions/UnexpectedException.h"
#include "storm/storage/expressions/Expression.h"
namespace storm {
namespace pomdp {
template<typename ValueType>
WinningRegionQueryInterface<ValueType>::Wi... | ALGO | 0.995415 | 7.858018 |
4bd6cf01-1eb7-4534-a51f-ace146f21317 | hantwofish/my_leetcode | datastruct_learn/class/charP13/最大连续子序和.cpp | /*
https://blog.csdn.net/qq_21989927/article/details/107998410?spm=1001.2101.3001.6650.4&utm_medium=distribute.pc_relevant.none-task-blog-2%7Edefault%7ECTRLIST%7ERate-4-107998410-blog-91354863.235%5Ev38%5Epc_relevant_default_base&depth_1-utm_source=distribute.pc_relevant.none-task-blog-2%7Edefault%7ECTRLIST%7ERate-4-10... | ALGO | 0.999932 | 4.632248 |
a9e5517d-ff5c-49d8-ad7e-ca043a28f110 | SelfishOlex/GridMateLab | dev/Gems/Boids/Code/source/BirdsFlock.cpp | #include "StdAfx.h"
#include "BirdsFlock.h"
#include "BoidBird.h"
#include "IAIObject.h"
#include "IActorSystem.h"
#define START_LANDING_TIME 3
CBirdsFlock::CBirdsFlock(IEntity* pEntity)
: CFlock(pEntity, EFLOCK_BIRDS)
, m_bAttractOutput(false)
{
m_boidEntityName = "BirdBoid";
m_landCollisionCallback ... | ALGO | 0.993739 | 5.199643 |
8438a1f4-5c45-4e6e-b9c3-6110b4d511fa | envycointeam/envycoin | src/chainparams.cpp | #include "chainparams.h"
#include "assert.h"
#include "core.h"
#include "protocol.h"
#include "util.h"
#include <boost/assign/list_of.hpp>
using namespace boost::assign;
//
// Main network
//
unsigned int pnSeed[] =
{
};
class CMainParams : public CChainParams {
public:
CMainParams() {
// The messa... | CONFIG | 0.919109 | 6.728226 |
dcd8d7f0-4851-4abe-9b76-b3b6f0ff386b | robertwyb/Computer-graphic-assignments | computer-graphics-meshes/libigl/include/igl/per_face_normals.cpp | #define SQRT_ONE_OVER_THREE 0.57735026918962573
template <typename DerivedV, typename DerivedF, typename DerivedZ, typename DerivedN>
IGL_INLINE void igl::per_face_normals(
const Eigen::MatrixBase<DerivedV>& V,
const Eigen::MatrixBase<DerivedF>& F,
const Eigen::MatrixBase<DerivedZ> & Z,
Eigen::PlainObjectBase<D... | ALGO | 0.998814 | 5.046219 |
45e1cfd2-3877-4309-a8f9-165f2d166c50 | KizatovArman/Notes | closebinsearch.cpp | #include <iostream>
#include <cmath>
using namespace std;
int n;
int a[100002];
int getClosest(int c)
{
int l =0;
int r = n -1;
int mid = (l+r)/2;
for(int i =0;i <100;i++)
{
if(a[mid]>c)
r= mid;
else
l = mid;
}
if(l!=r)
return (abs(a[r] -c) < abs (a[l] -c) ? r: l);
return l;
}
int main()
{
in... | ALGO | 0.999993 | 3.212921 |
66475df1-c8b0-47b7-96be-514700a73e9f | piyushh-guptaa/DSA | 2807-insert-greatest-common-divisors-in-linked-list/2807-insert-greatest-common-divisors-in-linked-list.cpp | /**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode() : val(0), next(nullptr) {}
* ListNode(int x) : val(x), next(nullptr) {}
* ListNode(int x, ListNode *next) : val(x), next(next) {}
* };
*/
class Solution {
public:
ListNode* insertGreat... | ALGO | 0.999983 | 5.642202 |
eb271fbb-b0d5-40cc-bd7b-504e67c16373 | jimbob44/HoloBook | QROpenCVScanDll/zxing/pdf417/decoder/ec/ModulusPoly.cpp | // -*- mode:c++; tab-width:2; indent-tabs-mode:nil; c-basic-offset:2 -*-
#include <zxing/pdf417/decoder/ec/ModulusPoly.h>
#include <zxing/pdf417/decoder/ec/ModulusGF.h>
using zxing::Ref;
using zxing::ArrayRef;
using zxing::pdf417::decoder::ec::ModulusGF;
using zxing::pdf417::decoder::ec::ModulusPoly;
/**
* @author ... | ALGO | 0.915567 | 5.019378 |
401bc5be-8819-4028-bf91-e5d6706586db | SulavGyawali/Chess-Engine | makemove.cpp | #include<iostream>
#include"def.h"
#define HASH_PCE(pce,sq) (pos->posKey ^= PieceKeys[(pce)][(sq)])
#define HASH_CA (pos->posKey ^= CastleKeys[(pos->castlePerm)])
#define HASH_SIDE (pos->posKey ^= SideKey)
#define HASH_EP (pos->posKey ^= PieceKeys[EMPTY][(pos->enPas)])
const int CastelPerm[120] = {
15, 15, 15, 15... | ALGO | 0.99518 | 3.526627 |
2f3c7e99-6873-4324-a9fc-aef251550052 | sribhargav1345/Striver-SDE | Trees/Traversals/ZigZag.cpp | // Just one flag variable and done
class Solution {
public:
vector<vector<int>> zigzagLevelOrder(TreeNode* root) {
vector<vector<int>> ans;
if(root == NULL) return ans;
queue<pair<TreeNode*,int>> q;
q.push({root,1});
int flag = 0;
while(!q.empty())
{
... | ALGO | 0.999999 | 5.828846 |
f43a60d5-8531-4239-8fc6-1cdbf79f35cd | chltkdgns1/Algorithm_first | 다이얼.cpp | #include <iostream>
#include <string>
using namespace std;
int main() {
char alpa[8][26] ={
{ 'A','B', 'C' }, {'D', 'E', 'F'}, {'G', 'H', 'I'},
{'J','K', 'L' },{'M', 'N', 'O'}, {'P','Q', 'R', 'S'},
{'T', 'U', 'V'}, {'W','X','Y', 'Z'}
};
string array;
int number_array[16];
int temp = 0;
cin >> array;
f... | ALGO | 0.998757 | 3.502053 |
8c4b4d31-df10-4c65-b6f9-57b1de7c635e | Antecarlo/CursoC | modulo3/eclipse/eclipse/puntos/main.cpp | /*
* Punto2D.cpp
*
* Created on: 26 sept. 2019
* Author: antonio
*/
#include "Punto2D.h"
#include<iostream>
int main(){
Punto2D nube[]={Punto2D(7,2),Punto2D(4,2),Punto2D(0,3),Punto2D(9,2)};
int n=sizeof(nube)/sizeof(Punto2D);
Punto2D punto(9,1);
const Punto2D masCercano=punto.masCercano(nube, n);
//... | ALGO | 0.975678 | 4.099287 |
2ab95d8f-8a8f-4f93-bb29-c8bddcd97765 | hjiang13/LLMs-in-IR | POJ-104/70/1166.cpp | #include <iostream>
using namespace std;
int main ()
{
int n;
double point[3000][2],
ans=0;
cin >>n;
for (int i=1; i<=n; i++)
cin >>point[i][0]>>point[i][1];
for (int i=1; i<=n; i++)
{
for (int j=1; j<=n; j++)
{
if (i==j)
continue;
double f;
f=hypot(point[i][0]-point[j][0],point[i][1]-point[j][1]);
ans=max(ans,f);
}
}
... | ALGO | 0.999889 | 3.871063 |
759eb65b-6e3d-4c38-b582-18b45a47d2cf | antomcoin/Project-ANTOMCOIN | src/script/sign.cpp | #include <script/sign.h>
#include <key.h>
#include <keystore.h>
#include <policy/policy.h>
#include <primitives/transaction.h>
#include <script/standard.h>
#include <uint256.h>
typedef std::vector<unsigned char> valtype;
TransactionSignatureCreator::TransactionSignatureCreator(const CKeyStore* keystoreIn, const CTra... | ALGO | 0.956064 | 6.622148 |
c531023f-e1ff-48a1-8619-3bfce31ce4cd | sslab-gatech/juxta | llvm/lib/Analysis/BranchProbabilityInfo.cpp | #include "llvm/Analysis/BranchProbabilityInfo.h"
#include "llvm/ADT/PostOrderIterator.h"
#include "llvm/Analysis/LoopInfo.h"
#include "llvm/IR/CFG.h"
#include "llvm/IR/Constants.h"
#include "llvm/IR/Function.h"
#include "llvm/IR/Instructions.h"
#include "llvm/IR/LLVMContext.h"
#include "llvm/IR/Metadata.h"
#include "ll... | ALGO | 0.986122 | 7.751256 |
519d6cbc-faf9-4f69-bced-c8393677605d | Urvashi003/SUPREME_2.0 | min.cpp | #include<iostream>
#include<limits.h>
using namespace std;
void minArray(int arr[], int size, int index, int &mini){
if(index>=size){
return;
}
mini = min(mini, arr[index]);
minArray(arr,size,index+1,mini);
}
int main(){
int arr[]= {5,6,7,8,9};
int size =5;
int index=0;
int... | ALGO | 0.999045 | 4.036839 |
3bb78ed3-ba7e-41ee-97c0-313f857043dd | vspinu/iroll | src/iroll.cpp |
#include "iroll.hpp"
#include "Rinternals.h"
#include "cpp11/doubles.hpp"
template <typename FT>
SEXP inline roll_T2T(const FT &fn, SEXP X, cpp11::doubles ix,
SEXP left, SEXP right,
bool left_open, bool right_open,
SEXP fill) {
double left_bound = Rf_as... | TOOL | 0.992931 | 7.111258 |
5b0c5b4d-8742-4741-93bb-dccaeb2f8191 | yy2658098/YeYanwan_48102 | Lab/Gaddis_7thEd_Chap5_Prob20_GuessingGame/main.cpp |
/*
* File: main
* Author: Yanwan Ye
*
* Created on October 13, 2016, 12:23 PM
* Purpose: Guessing Game
*/
#include <iostream>
#include <ctime>
#include <cmath>
#include <cstdlib>
using namespace std;
/*
*
*/
int main(int argc, char** argv) {
srand(static_cast<unsigned int>(time(0)));
//Decl... | ALGO | 0.992753 | 3.762345 |
a9087d89-4215-4cf6-9d0a-e92c06b64ca0 | vikas-reddy/iiith-programming | placements/doubleLL.cpp | #include<iostream>
#include<stdlib.h>
using namespace std;
class node
{
public:
int info;
node *next;
node *prev;
node(int val)
{
info = val;
prev = NULL;
next = NULL;
}
};
class DoubleLL
{
public:
node *head;
node *tail;
DoubleLL()
{
head = NULL;
tail = NULL;
}
void inser... | ALGO | 0.99937 | 4.292261 |
8c6a9e97-7bb2-4712-af39-d40c9aa3b1e7 | mive93/DAG-scheduling | src/tests/Fonseca2019.cpp | #include "dagSched/tests.h"
//Fonseca et al. “Schedulability Analysis of DAG Tasks with Arbitrary Deadlines under Global Fixed-Priority Scheduling”. (Real-Time Systems 2019)
namespace dagSched{
float computeCarryWorkload_C(const DAGTask& task, const float interval, const std::vector<std::pair<float, float>>& WD_UC... | ALGO | 0.999419 | 5.949196 |
04be2677-cb39-49ca-9550-59ae1b8ad397 | sourcegraph/lsif-clang | clang-tools-extra/clangd/refactor/tweaks/SwapIfBranches.cpp | namespace clang {
namespace clangd {
namespace {
/// Swaps the 'then' and 'else' branch of the if statement.
/// Before:
/// if (foo) { return 10; } else { continue; }
/// ^^^^^^^ ^^^^
/// After:
/// if (foo) { continue; } else { return 10; }
class SwapIfBranches : public Tweak {
public:
const c... | TOOL | 0.890431 | 7.831402 |
55405251-7a06-409b-9a37-926e7e533984 | zspace/system.opencv.4.7.0 | modules/gapi/samples/face_detection_mtcnn.cpp | #include <algorithm>
#include <cctype>
#include <cmath>
#include <iostream>
#include <limits>
#include <numeric>
#include <stdexcept>
#include <string>
#include <vector>
#include <opencv2/gapi.hpp>
#include <opencv2/gapi/core.hpp>
#include <opencv2/gapi/imgproc.hpp>
#include <opencv2/gapi/cpu/gcpukernel.hpp>
#include ... | TOOL | 0.971429 | 6.637559 |
96910404-d652-47ba-8972-6772b31e5c60 | Khalidgithub2020331007/I-solved-those-problems-by-CPP | E - Task1_5.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
int t;
cin>>t;
while(t--)
{
int n,i;
cin>>n;
int a[n+1];
int b[n+1];
int suma=0;
int sumb=0;
int j=0;
int k;
for (i=0;i<n;i++)
{
cin>>k;
if (k==0)
{
... | ALGO | 0.999795 | 3.639923 |
a91c7caa-1235-4ce9-b495-06e0b83b85bd | munzir/Krang-Software | project/krang/experiments/twoHands/src/fr.cpp | /**
* @file rrt.cpp
* @author Can Erdogan
* @date May 22, 2013
* @brief The RRT implementation for the upper body of Krang which involves only the two arms, also
* ignoring the torso module. We assume that the two hands are holding an object. The idea is that
* we can perform a 8-dof RRT where we first sample the... | ALGO | 0.99982 | 5.655297 |
18432a79-e185-4775-bd47-bf2938988363 | ReyDonovan/LegacyMoP | dep/acelite/ace/Service_Config.cpp | // $Id: Service_Config.cpp 96017 2012-08-08 22:18:09Z mitza $
#include "ace/Service_Config.h"
#if !defined (__ACE_INLINE__)
#include "ace/Service_Config.inl"
#endif /* __ACE_INLINE__ */
#include "ace/Service_Types.h"
#include "ace/Reactor.h"
#include "ace/Singleton.h"
#include "ace/Service_Repository.h"
#ifndef ACE... | TOOL | 0.940179 | 4.958217 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.