uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
aa2d09a3-cb97-4acb-bf20-85433ed8fd80 | shruti1421/Data-Structures-and-Algorithms | Dynamic Programming/SPOJ/AdjacentBitCount.cpp | //Problem : https://www.spoj.com/problems/GNYR09F/
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define fo(i,k,n) for(i=k;k<n?i<n:i>n;k<n?i+=1:i-=1)
#define clr(x) memset(x, 0, sizeof(x))
#define PI 3.1415926535897932384626
#define F first
#define S second
#define pb push_back
#define mp make_pai... | ALGO | 0.99989 | 3.626748 |
efe9256b-801f-42f8-b378-63d1195bc56f | whispr-dev/patentable_LLM_idea | src/analog_code/1.cpp | #include <immintrin.h>
#include <vector>
#include <memory>
#include <random>
#include <cmath>
#include <iostream>
#include <thread>
#include <mutex>
#include <atomic>
// Constants for the simulation
constexpr size_t BITS_PER_VECTOR = 512;
constexpr size_t NUM_GATES_PER_LAYER = 128;
constexpr size_t DEFAULT_NUM_LAYERS ... | ALGO | 0.994223 | 7.177731 |
6925cfa0-268b-406c-803a-17b2e16e5238 | RapDoodle/LeetCode-Solutions | cpp/0001-0099/10. Regular Expression Matching/solution1.cpp | class Solution {
public:
/* Dynamic Programming */
bool isMatch(string s, string p) {
// Initialize an array of size
// (s.length() + 1) * (p.length() + 1)
int m = s.length() + 1, n = p.length() + 1;
vector<vector<bool>> dp(m, vector<bool>(n, false));
dp[0][0] = true;
... | ALGO | 0.999658 | 5.791518 |
46d61a92-b174-490d-8b3d-ef452fd11e2a | rahulprasad2000/DS-A-ASSIGNMENTS | Day-7/K-WEAKEST-ROW-IN-MATRIX.cpp | class Solution {
public:
static bool sortbysec(pair<int,int> &a,pair<int,int> &b)
{
if(a.second==b.second)
return a.first<b.first;
return a.second<b.second;
}
vector<int> kWeakestRows(vector<vector<int>>& mat, int k) {
vector<pair<int,int>> arr;
... | ALGO | 0.999969 | 5.478197 |
503af82e-4d63-4351-b857-e133e63ac981 | BeatHubmann/18H-ICP | ex02/task1.cpp | #include "latticeview.h"
#include <stdio.h> // for sprintf()
#include <iostream>
#include <random>
#define N 100 //Lateral number of cells
#define ImageWidth 1000 //image width
#define ImageHeight 1000 //image height
#define SEED 42
void PopulateLattice(int lattice[], const int size, const double treshol... | TOOL | 0.95377 | 4.114821 |
cbeb1a43-a71e-4557-bdc4-cc90da2a99a7 | lzh12139/MySolutions | codeforces/1291/f/f.cpp | /**
* Author: lzh12139
* Time: 2020-02-03 00:06:09
**/
#include <bits/stdc++.h>
using namespace std;
#define ff first
#define ss second
#define mp(x, y) make_pair(x, y)
#define pb(x) emplace_back(x)
#define _yes printf("Yes\n")
#define _no printf("No\n")
#define _YES printf("YES\n");
#define _NO printf("NO\n");
typ... | ALGO | 0.999768 | 3.214115 |
f00a0597-5318-43cc-912d-9d458d946497 | unhappy1030/development | PPS/B006.cpp | #include<iostream>
#include<algorithm>
#include<queue>
#include<vector>
using namespace std;
vector<int> graph[1001];
bool v[1001];
queue<int> q;
int node_num, branch_num, start_node;
void reset(){
int i;
for(i = 0; i <= node_num; i++){
v[i] = false;
}
}
void dfs(int s){
int i;
cout << s ... | ALGO | 0.999982 | 4.554048 |
362b6a15-606d-4cdb-971a-df8c401d8a18 | deepak-ky/cpp-codes | cpp-codes/2do.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
int a[3][3];
int i,g,j,k,l,m,n;
int flag=0;
cout<<"Enter the elements(only 0 and 1) : \n";
for(i=0;i<3;i++)
{
for(j=0;j<3;j++)
{
cout<<"Enter the element ["<<i+1<<"] ["<<j+1<< "] : ";
cin>>a[i][j];
}
}
for(i=0;i<3;i++)
{
for(j=0;j<3;j++)
{
if(a[i][j]==0)
{
c... | ALGO | 0.993022 | 3.012861 |
b95205c0-91c9-4206-b12e-c1524411cc33 | 0Ayanami/Wangdao | acwing/ac1.cpp | //
// Created by muyou on 2024/9/6.
//
#include "iostream"
using namespace std;
int main() {
long long a, b;
cin >> a >> b;
cout << a + b << endl;
return 0;
} | ALGO | 0.97791 | 4.297039 |
97143f68-9059-4525-9f47-60e2e23216f7 | ishandutta2007/codeforces | jiangly/normal/1242/D.cpp | #include <bits/stdc++.h>
using namespace std;
using LL = long long;
LL n;
int k;
LL f(LL n) {
if (n == 0)
return 1LL * k * (k + 1) / 2;
LL i = n / k;
LL x = f(i);
int t = n % k;
LL r = i * (1LL * k * k + 1) + 1LL * (t + 1) * k;
return (1LL * k * i + t) * (1LL * k * k + 1) + 1LL * k * (k ... | ALGO | 0.999931 | 4.351318 |
cee92672-0f59-42e2-a5d4-56dd80b6358a | bearl27/SportProgramming | AtCoder/ABC/210s/217/b.cpp |
#include<iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<map>
#define _USE_MATH_DEFINES
#include<math.h>
#include<queue>
#include<deque>
#include<stack>
#include<cstdio>
#include<utility>
#include<set>
#include<list>
#include<cmath>
#include<stdio.h>
#include<string.h>
#include<iomanip>
#inclu... | ALGO | 0.999743 | 3.100841 |
0fe5fe99-37e9-4a07-941a-4e922da85b54 | RHJihan/problem-solving | HackerRank/the-birthday-bar_vector.cpp | // https://www.hackerrank.com/challenges/the-birthday-bar/problem
#include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
vector<int> arr(n);
for (int i = 0; i < n; i++) {
cin >> arr[i];
}
int d, m;
cin >> d >> m;
int count = 0;
for (int i = 0; i <= n - m; i++) {
int ... | ALGO | 0.999945 | 5.159562 |
2ade78b4-e7a0-4213-8d0f-d8936786c092 | gksaksdma1/Study | Simple/Simple/RefArrElem.cpp | #include "stdafx.h"
#include <iostream>
using namespace std;
int main()
{
//迭 ҵ ֵǾ ϴ.
int arr[3] = { 1, 3, 5 };
int &ref1 = arr[0];
int &ref2 = arr[1];
int &ref3 = arr[2];
cout << ref1 << endl;
cout << ref2 << endl;
cout << ref3 << endl;
return 0;
} | TOOL | 0.927072 | 3.113567 |
fa9fc1f5-36f4-4120-8914-d8dba2d266e4 | minglu10/tedukuri_rust | 配套光盘/习题/0x18 基本数据结构 总结与练习/表达式计算4/std_中缀转后缀+栈.cpp | //Author:XuHt
#include <cstring>
#include <iostream>
using namespace std;
const int N = 106;
char s[N], st[N], ans[N];
int top, t[600], cnt, stt[N], num;
int mul(int x, int k) {
int m = 1;
while (k--) m *= x;
return m;
}
int main() {
t[int('^')] = 4;
t[int('*')] = t[int('/')] = 3;
t[int('+')] = t[int('-')] = 1;... | ALGO | 0.999977 | 3.773636 |
830e85ad-a706-45f5-97e5-d284a39c0171 | webturing/NIOP | 1170IntegerPrimerComposition.cpp | #include <bits/stdc++.h>
using namespace std;
int main(int argc, char const *argv[]) {
int n;
cin >> n;
vector<int> v;
while (n > 1 && (n & 1) == 0) {
v.push_back(2);
n >>= 1;
}
for (int c = 3; n > 1; c += 2) {
while (n % c == 0) {
v.push_back(c);
... | ALGO | 0.999983 | 4.604692 |
1e46ca45-e992-4245-8662-9401e7c2e1b7 | Yaro2709/AlgoProblems | 6/1781A.cpp | #include <iostream>
using namespace std;
int main() {
int t;
cin >> t;
while (t--) {
int w, d, h, a, b, f, g;
cin >> w >> d >> h;
cin >> a >> b >> f >> g;
int t1 = min(b + g + abs(a - f), (2 * d - b - g + abs(a - f)));
int t2 = min(a + f + abs(b - g), (2 * w - a - f... | ALGO | 0.99916 | 3.677378 |
b7ae097c-51a2-4f72-9826-aebc74cff49c | byterom/android_frameworks_av | media/libstagefright/codecs/amrnb/enc/src/set_sign.cpp | /*----------------------------------------------------------------------------
; INCLUDES
----------------------------------------------------------------------------*/
#include "set_sign.h"
#include "basic_op.h"
#include "inv_sqrt.h"
#include "cnst.h"
/*----------------------------------------------------------------... | ALGO | 0.999933 | 5.850667 |
9f943aaf-3c6f-4803-9faa-eef68a0abe4b | Buttiyeeppp/Code | Luogu/P6657.cpp | #include <bits/stdc++.h>
using namespace std;
#define clo 1000.*clock()/CLOCKS_PER_SEC
#ifndef xxzx
#define endl '\n'
#endif
using ll=long long;
using PII=pair<int,int>;
const int M=1e2+10;
const int N=2e6+10;
const ll Mod=998244353;
bool mem1;
int n,m,a[N],b[N];
ll fac[N],inv[N];
ll Pow(ll x,ll y) {
ll res=1;
... | ALGO | 0.999985 | 4.742218 |
5e19974b-a1c6-44ec-9622-4464de22812e | jazzsterq/programs | CPP/D_Souvenirs.cpp | /**
* author : jazzsterq
*/
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define be begin()
#define en end()
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define pyes cout << "YES\n"
#define pno cout << "NO\n"
#define print(x) cout<<x<<endl
#define prints(x) cout<<... | ALGO | 0.999972 | 3.176401 |
4207e1f6-9720-41c7-b734-83a81f82b81b | bakachanbaby/CODE_C- | Order Statistics 3.cpp | #include <bits/stdc++.h>
using namespace std;
int t, n, k, a[1000001];
void nhap()
{
cin>>n>>k;
for(int i = 0; i < n*n; i++)
cin>>a[i];
}
void in(){
n*=n;
sort(a, a+n);
k--;
cout<<a[k]<<endl;
}
int main(){
cin>>t;
while (t--)
{
nhap();
in();
}
} | ALGO | 0.999863 | 3.276355 |
9bde2c80-cc1c-4679-afa1-fdeff3fc2461 | yysskk/Training | AtCoder/abc167_b.cpp | // SeeAlso:
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
#define MAX 100000
#define NIL -1
#define MOD 1000000007
typedef int _loop_int;
#define rep(i,n) for(int i = 0; i < n; i++)
#define FOR... | ALGO | 0.99989 | 3.159733 |
6f2b50ee-db77-4582-a2e3-c860e6f2c12a | strejda/tegra | contrib/llvm-project/llvm/lib/Transforms/Scalar/SpeculativeExecution.cpp | #include "llvm/Transforms/Scalar/SpeculativeExecution.h"
#include "llvm/ADT/SmallPtrSet.h"
#include "llvm/Analysis/GlobalsModRef.h"
#include "llvm/Analysis/TargetTransformInfo.h"
#include "llvm/Analysis/ValueTracking.h"
#include "llvm/IR/Instructions.h"
#include "llvm/IR/IntrinsicInst.h"
#include "llvm/IR/Operator.h"
#... | ALGO | 0.901086 | 7.967913 |
c83248ed-0bbf-43a5-95ae-ba1e9ba6c9da | plumzero/querecord | 01_Cpp/ch03/04_List/03_list_remove.cpp |
#include <iostream>
#include <list>
#include <algorithm>
#include <iterator>
int main()
{
{
std::list<int> numbers { 2, 5, 2, 3, 6, 7, 8, 2, 9 };
numbers.remove(2);
std::cout << numbers.size() << std::endl;
std::ostream_iterator<int> oit(std::cout, " ");
s... | ALGO | 0.992335 | 6.011824 |
cd11ab44-ffcd-4660-9793-bcfe8fce0fde | sanjughasal/Codes-cpp | SumOfDigitsInaArray.cpp | #include<iostream>
using namespace std;
int getSum(int *arr , int size){
if(size==0){
return 0 ;
}
if (size==1){
return arr[0];
}
int remainingPart = getSum(arr+1 , size-1);
int sum = arr[0] + remainingPart;
return sum;
}
int main(){
int arr[5] = {3,2,5 ,16 ,6};
... | ALGO | 0.99995 | 4.831502 |
43d48d65-f109-4a52-a11e-c03db3f77dce | Dev-Luigy/AdvancedDataStructures-UFC | structures/Trees/utils/treeUtils.cpp | #ifndef TREE_UTILS_HPP
#define TREE_UTILS_HPP
#include "../../../interfaces/core/Node.hpp"
#include <iostream>
#include <stack>
#include <vector>
template <typename T> int greater_children_height(Node<T> *node) {
return std::max(node->left ? node->left->height : 0,
node->right ? node->right->heigh... | ALGO | 0.998668 | 6.468602 |
1b279642-c39d-46af-8f47-758c9f60534a | old-yan/leetcode-solutions | leetcode_solutions/leetcode_550/530/530.cpp | #include "TreeNode.h"
#include "utils.h"
class Solution {
ll pre=INT_MIN;
ll ans=INT_MAX;
void fun(TreeNode*root){
if(root->left)fun(root->left);
chmin(ans,root->val-pre);
pre=root->val;
if(root->right)fun(root->right);
}
public:
int getMinimumDifference(TreeNode* ro... | ALGO | 0.999897 | 6.240214 |
1a5a1498-1f9c-4c8f-b2f4-5c233dfb5755 | PipeNitch/VS_Backup | Code/Walking.cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
int n;cin>>n;
vector<int> a;
for(int i=0;i<n;i++){
int x,y;
cin>>x>>y;
a.push_back((x*60+y)-1020);
}
sort(a.begin(),a.end(),greater<int>());
cout<<a[1]/60<<" "<<a[1]%60;
return 0;
} | ALGO | 0.999719 | 4.423227 |
0cb3784a-b517-4579-a0c7-44261543c95f | rootid/fft | dp/increasing-triplet-subsequence.cpp | //Increasing Triplet Subsequence
//Given an unsorted array return whether an increasing subsequence of length 3
//exists or not in the array.
//Formally the function should:
//Return true if there exists i, j, k
//such that arr[i] < arr[j] < arr[k] given 0 ≤ i < j < k ≤ n-1 else return
//false.
//Your algorithm should ... | ALGO | 0.999622 | 5.298928 |
6cbf2895-1f16-4063-8d04-98644f7eb83b | PiperBetle/MyCode | P5960 【模板】差分约束算法.cpp | #include<iostream>
#include<cstring>
#include<cstdio>
#include<algorithm>
#include<vector>
#include<queue>
#define int long long
using std::cin;using std::cout;
struct edge{int go,data;};
std::vector<edge>s[10007];
int dis[10007],cnt[10007];
bool visit[10007];
std::queue<int>q;
signed main()
{
// freopen(".in","r",stdi... | ALGO | 0.999988 | 3.335402 |
1a64a08b-3866-4af4-b650-1d6e6c3d735e | scarsty/lammps_m | src/MOLECULE/bond_quartic.cpp | /* ----------------------------------------------------------------------
Contributing authors: Chris Lorenz and Mark Stevens (SNL)
------------------------------------------------------------------------- */
#include "math.h"
#include "stdlib.h"
#include "bond_quartic.h"
#include "atom.h"
#include "neighbor.h"
#in... | ALGO | 0.996745 | 5.969163 |
b8fef500-f278-4655-accd-fcd6d5809b43 | cj1ne/Algorithm | Algorithm/삼성 기출 문제/17142_연구소3.cpp | #include <iostream>
#include <vector>
#include <utility>
#include <queue>
#include <algorithm>
using namespace std;
vector<vector<int>> a;
vector<pair<int, int>> virus;
vector<int> order;
int result = -1;
int n, m;
int dx[4] = { 0 ,0, -1, 1 };
int dy[4] = { -1, 1, 0, 0 };
int getTime(vector<vector<int>> &d) {
int t... | ALGO | 0.999946 | 4.735445 |
e57c42e1-5827-4864-9bcd-d9725f668379 | yln0114/Cpp-Dashark-homework | B_韩信点兵.cpp | #include<iostream>
class HanXin{
public:
int z,a,b,c;
void line3(int n1){
a=n1;
} //3һ
void line5(int n2){
b=n2;
} //5һ
void line7(int n3){
c=n3;
}//7һ
void showMany();
};
void HanXin::showMany(){
int z=0;
for (int i=10;i<100;i++){
if (i%3==a&&i%5==b&&i%7==c){
z=i;
br... | ALGO | 0.999608 | 3.380885 |
796cfb47-6a70-430c-83ba-0553a02173a7 | manikanta2901/ubuntu | .history/codingChallenges/cpp/Codechef/longChallenges/Year2021/January/BlackJack_20210109165212.cpp | #include<bits/stdc++.h>
#include<vector>
#include<iostream>
#include<cmath>
#include<algorithm>
#include<iterator>
#include<string>
#include<map>
#define vv vector
#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 printM... | ALGO | 0.999982 | 3.716829 |
22aeb994-e63c-452e-9941-ff6c6824162d | Rocky111245/Algorithm-Hub | NeetCode 150/Two-Integer Sum.cpp | //#include <iostream>
//#include <vector>
//#include <unordered_map>
//
//using namespace std;
//
//class Solution {
//public:
// vector<int> twoSum(vector<int>& nums, int target) {
// unordered_map<int, int> map;
// vector<int> result(2);
//
// // Populate the map with the indices of the elemen... | ALGO | 0.999938 | 6.614295 |
eec9612f-16ca-4967-9a7a-c545eb3a7096 | danny-wang/leetcode | 344. Reverse String .cpp | /**
344. Reverse String
Write a function that takes a string as input and returns the string reversed.
Example:
Given s = "hello", return "olleh".
思路:classic方法头尾交换
16ns
**/
class Solution {
public:
string reverseString(string s) {
if(s.empty())
return s;
string temp(s);
auto ite... | ALGO | 0.999781 | 5.185692 |
569e5836-ea23-423d-9bbf-d151a34ff85d | Frankwyd/ReleasedProjects | backend/src/main/cpp/FXOptionJNI.cpp | #include "com_quantlib_FXOption.h"
#include <ql/quantlib.hpp>
using namespace QuantLib;
JNIEXPORT jdouble JNICALL Java_com_quantlib_FXOption_calculateFXOption
(JNIEnv* env, jobject obj, jint optionType, jdouble spot, jdouble strike,
jdouble domesticRate, jdouble foreignRate, jdouble volatility, jint daysToMaturi... | ALGO | 0.994382 | 6.794953 |
a738dd67-a3d2-4129-8bae-97e0dc2f06e2 | Utkarsh0uchiha/Codeforces-sol | 71A.cpp | #include <iostream>
using namespace std;
int main(){
int n;
cin>>n;
while(n--){
string s;
cin>>s;
int len = s.length();
if(len > 10){
cout<<s[0]<<len - 2<<s[len - 1]<<endl;
}
else{
cout<<s<<endl;
}
}
}
| ALGO | 0.999602 | 3.497884 |
ac1e0474-ae9e-4381-b499-516ab4b186a0 | erik123567/SubliminalAudioApp | ios/boost-local/boost/libs/sort/example/generalizedstruct.cpp | // See http://www.boost.org/libs/sort for library home page.
#include <boost/sort/spreadsort/string_sort.hpp>
#include <boost/sort/spreadsort/float_sort.hpp>
#include <time.h>
#include <stdio.h>
#include <stdlib.h>
#include <algorithm>
#include <vector>
#include <iostream>
#include <fstream>
#include <string>
using s... | ALGO | 0.999011 | 4.788182 |
437cc846-b04b-4ac9-a428-492be69218a6 | DreamHust13/ProgrameStudy | C++/stl_fiborand.cpp | /*
stl学习之发生器函数对象
*/
#include "stdafx.h"
#include <iostream>
#include <algorithm>
#include <vector>
#include <iterator>
#include <functional>
using namespace std;
//Data to randomize
int iarray[10] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
vector<int> v(iarray, iarray+10);//vector初始化!!
void Display(vector<int> &vr, const c... | ALGO | 0.955943 | 4.784377 |
29b7db8c-e989-4ccc-9ecc-04a2f622651a | ProdriveTechnologies/pd_cpu_compiler | libcxx/test/std/algorithms/alg.sorting/alg.min.max/max_element_comp.pass.cpp | // <algorithm>
// template<ForwardIterator Iter, StrictWeakOrder<auto, Iter::value_type> Compare>
// requires CopyConstructible<Compare>
// Iter
// max_element(Iter first, Iter last, Compare comp);
#include <algorithm>
#include <functional>
#include <random>
#include <cassert>
#include "test_macros.h"
#include... | TEST | 0.884765 | 6.044187 |
cc363910-ca95-47a5-a722-c5e067ba5d06 | sania51/Data-Structure-and-Algorithm | String Processing/Pattern Matching/Brute Force.cpp | #include <bits/stdc++.h>
using namespace std;
bool match(string main_str, string pattern)
{
int lm = main_str.length();
int lp = pattern.length();
int i, j, limit;
bool flag;
limit = lm-lp+1;
for(i=1; i<=limit; i++){
flag = true;
for(j=0; j<lp && flag == true; j++){
... | ALGO | 0.99995 | 5.325615 |
87604cf7-0009-41cf-ba07-a3fd837962de | vbonnici/grafe-sim | analysis/data/p02271/s352185912.cpp | #include <algorithm>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cstring>
#include <queue>
#include <stack>
#include <iostream>
#include <set>
#include <map>
typedef long long ll;
using namespace std;
int n,q,x;
int a[30];
int f(int i,int x)
{
if(x==0)
return 1;
if(i>n)
return 0;
int res=f(i+1,... | ALGO | 0.999927 | 4.048233 |
30cac9a0-cc28-497a-b496-6a268785232b | PerfectLifeG/Algorithm-Competition | Nowcoder/W33/a.cpp | #include<bits/stdc++.h>
using namespace std;
#define int long long
#define all(x) x.begin(),x.end()
#define no cout<<"No"<<endl
#define yes cout<<"Yes"<<endl
#define endl '\n'
// #define x first
// #define y second
typedef pair<int,int> PII;
const int N=200010;
const int mod=998244353;
const int INF=0x3f3f3f3f3f3f3f3f;... | ALGO | 0.999901 | 4.604774 |
574bbdfa-2a98-4d5f-8af8-46432d3aff30 | mortie/llvm | llvm/lib/Transforms/Scalar/ConstantProp.cpp | #include "llvm/ADT/SmallPtrSet.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/Statistic.h"
#include "llvm/Analysis/ConstantFolding.h"
#include "llvm/Analysis/TargetLibraryInfo.h"
#include "llvm/IR/Constant.h"
#include "llvm/IR/InstIterator.h"
#include "llvm/IR/Instruction.h"
#include "llvm/InitializePasses.h"
... | TOOL | 0.949198 | 7.830992 |
2de8db09-3450-43a8-b4ad-71a27abed9d0 | rbcarlos/GEM5 | src/systemc/tests/systemc/misc/cae_test/general/arith/subtract/decrement/decrement.cpp | /*****************************************************************************
decrement.cpp --
Original Author: Rocco Jonack, Synopsys, Inc., 1999-07-14
*****************************************************************************/
/****************************************************************************... | ALGO | 0.996582 | 4.54326 |
f95d4d8b-b473-4411-91e2-d43ac4960a46 | ishandutta2007/codeforces | dreamoon_love_aa/normal/1253/A.cpp | /*{{{*/
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<algorithm>
#include<string>
#include<iostream>
#include<sstream>
#include<set>
#include<map>
#include<queue>
#include<bitset>
#include<vector>
#include<limits.h>
#include<assert.h>
#define SZ(X) ((int)(X).size())
#define ALL(X) (X).be... | ALGO | 0.999746 | 3.082398 |
2ee38e76-6ed8-4645-a4bf-6d635f925299 | billamiable/ORB-SLAM2-Annotation | src/LocalMapping.cpp | #include "LocalMapping.h"
#include "LoopClosing.h"
#include "ORBmatcher.h"
#include "Optimizer.h"
#include<mutex>
namespace ORB_SLAM2
{
LocalMapping::LocalMapping(Map *pMap, const float bMonocular):
mbMonocular(bMonocular), mbResetRequested(false), mbFinishRequested(false), mbFinished(true), mpMap(pMap),
mbA... | ALGO | 0.996138 | 3.989513 |
a4781fc5-c52f-4ae7-bbb2-acc663fc02f5 | clay-arras/leetcode-submissions | max-consecutive-ones-iii/Wrong Answer/3-27-2024, 12:03:20 PM/Solution.cpp | // https://leetcode.com/problems/max-consecutive-ones-iii
class Solution {
public:
int longestOnes(vector<int>& nums, int k) {
int N = (int)nums.size();
nums.push_back(0);
int l=0, r;
for (r=0; r<N && k>0; r++) {
if (nums[r+1] == 0) k--;
}
int ans = r -... | ALGO | 0.999945 | 6.370569 |
cc83bed0-915d-477e-b1ba-cfe574dfae79 | ishandutta2007/codeforces | emiso/normal/1467/A.cpp | #include <bits/stdc++.h>
#define MN 1001000
using namespace std;
typedef long long ll;
ll t, n, ans, a[MN];
int main() {
scanf("%lld", &t);
st:
scanf("%lld", &n);
if(n == 1) puts("9");
else if(n == 2) puts("98");
else {
printf("98");
for(int i = 2, d = 9; i < n; i++, d = (d ... | ALGO | 0.999757 | 4.063227 |
fabec311-f4e7-4550-a320-bb5d7579e806 | AndanteKim/LeetCode_Practice | 2115-find-all-possible-recipes-from-given-supplies/2115-find-all-possible-recipes-from-given-supplies.cpp | class Solution {
public:
vector<string> findAllRecipes(vector<string>& recipes, vector<vector<string>>& ingredients, vector<string>& supplies) {
// Track available ingredients and recipes
unordered_set<string> available(supplies.begin(), supplies.end());
// Queue to process recipe indices
... | ALGO | 0.99998 | 6.869404 |
11dd1386-1f85-44e3-94ec-ea34bd12263e | Davicho1407/bibliotecaUpec | 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.99887 | 6.783439 |
ccae0b6d-0970-4aa1-ba80-2a8df79f380a | chocomacaroon/baekjoon | 프로그래머스/1/12954. x만큼 간격이 있는 n개의 숫자/x만큼 간격이 있는 n개의 숫자.cpp | #include <string>
#include <vector>
using namespace std;
vector<long long> solution(int x, int n) {
vector<long long> answer;
int m = x;
for(long long i = 0; i < n; i++){
answer.push_back(m);
m += x;
}
return answer;
} | ALGO | 0.999928 | 3.791007 |
886df355-b18e-4c86-9a75-dd4366f4d73d | SeongHo5356/Data_Structure | Recursion/NumPaths/numPaths.cpp | #include <iostream>
using namespace std;
int NumPaths(int row, int col, int n) {
if (row == n || col == n) {
return 1;
}
else {
return NumPaths(row + 1, col, n) + NumPaths(row, col + 1, n);
}
}
int mat[50][50];
int NumPaths_revised(int row, int col, int n) {
if (mat[row][col] == -1) {
if (row == 1 || col ... | ALGO | 0.999768 | 5.155911 |
cb0394ab-4fa2-4264-a95a-f81bb14bd127 | geoffrey-anto/leetcode-solutions | problems/car_fleet/solution.cpp | struct Car {
int pos;
int speed;
float time;
};
typedef struct Car Car;
bool cmp(Car a, Car b) {
if(a.pos == b.pos) return a.time > b.time;
return a.pos < b.pos;
}
class Solution {
public:
int carFleet(int target, vector<int>& position, vector<int>& speed) {
vector<Car> arr;
... | ALGO | 0.999511 | 5.409108 |
f477e58e-91e6-4ec8-b894-baf99e740ee8 | juneharold/USACO | usaco_practice/silver/silv_practice/cereal2.cpp | #include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
#define f first
#define s second
const int MAX=1e5+5;
int N, M, visit[MAX]={}, degree[MAX]={}, traveled[MAX]={}, cow_take[MAX]={};
pair<int, int> want[MAX]={};
vector<pair<int, int>> graph[MAX], order;
vector<int> ans;
void dfs(int cur) {... | ALGO | 0.999982 | 3.888827 |
187810df-9285-4666-b629-654de2c1394a | raincross7/code-similarity | codes/train_code/problem148/problem148_300.cpp | #include <bits/stdc++.h>
using namespace std;
#define _overload3(_1,_2,_3,name,...) name
#define _rep(i,n) repi(i,0,n)
#define repi(i,a,b) for(int i=int(a);i<int(b);++i)
#define rep(...) _overload3(__VA_ARGS__,repi,_rep,)(__VA_ARGS__)
typedef long long ll;
typedef pair<ll, ll> P;
const ll INF = 1LL<<60;
ll gcd(ll a,... | ALGO | 0.999878 | 4.001375 |
7750242e-6223-4efe-aacb-7b1ccdb61be6 | go2scope/mmcorec | 3rdParty/boost-versions/boost_1_77_0/libs/sort/test/test_insert_sort.cpp | //----------------------------------------------------------------------------
/// @file test_insert_sort.cpp
/// @brief Test program of the insert_sort algorithm
///
/// @author Copyright (c) 2016 Francisco Jose Tapia (<EMAIL> )\n
/// Distributed under the Boost Software License, Version 1.0.\n
/// ( S... | TEST | 0.948267 | 5.899488 |
f35dc181-7af3-42f0-80fb-59fcfff8deec | ssaraf0702/DSA | Codeforces/Contest/1622B.cpp | #include<iostream>
#include<algorithm>
#include<map>
#include<vector>
#define all(v) v.begin(), v.end()
typedef long long ll;
using namespace std;
int main(){
ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
int t;
cin>>t;
while(t--)
{
int n,c;
string s;
vector<int> vec0,... | ALGO | 0.999965 | 4.401823 |
ccfbc550-dadc-42c0-a768-d40f02299d62 | vivekpradhan736/DSA-Series | Lecture023 2D arrays/linearSearchIn2DArray.cpp | #include<iostream>
using namespace std;
bool linearSearch(int arr[][3], int num){
for(int row=0; row<3; row++){
for(int col=0; col<3; col++){
if(arr[row][col] == num){
return true;
}
}
}
return false;
}
int main(){
int arr[3][3];
// taking... | ALGO | 0.999244 | 4.363832 |
f431b765-1b54-4583-9f3e-b3cb46fe8514 | owen7005/node1-bitcoin | src/merkleblock.cpp | #include <merkleblock.h>
#include <hash.h>
#include <consensus/consensus.h>
#include <utilstrencodings.h>
CMerkleBlock::CMerkleBlock(const CBlock& block, CBloomFilter* filter, const std::set<uint256>* txids)
{
header = block.GetBlockHeader();
std::vector<bool> vMatch;
std::vector<uint256> vHashes;
v... | ALGO | 0.998525 | 6.177397 |
6ceb4e48-7eb7-4832-be76-9f9633cf5c57 | raincross7/code-similarity | codes/train_code/problem459/problem459_428.cpp | #include <iostream>
#include <fstream>
#include <set>
#include <map>
#include <string>
#include <vector>
#include <queue>
#include <deque>
#include <stack>
#include <functional>
#include <algorithm>
#include <climits>
#include <cmath>
#include <iomanip>
using namespace std;
#define ll long long int
#define rep(i,n) for... | ALGO | 0.999918 | 4.813801 |
e30ebb23-9d18-4e49-9f9c-288cc83d176b | Anshu1Gupta/Leetcode_-_GFG_Solved_Problems | 547-number-of-provinces/547-number-of-provinces.cpp | class Solution {
public:
void bfs(int source,vector<int>&visited,vector<int>adj[]){
queue<int>q;
q.push(source);
visited[source]=1;
while(!q.empty()){
int node=q.front();q.pop();
for(auto v:adj[node]){
if(!visited[v]){
q.pus... | ALGO | 0.999992 | 6.198038 |
aa3bd92a-97a8-46c4-9431-d4dd6f6a36e7 | PratheekB/suv | llvm/libcxx/src/filesystem/directory_iterator.cpp | #include <__assert>
#include <__config>
#include <errno.h>
#include <filesystem>
#include <stack>
#include "filesystem_common.h"
_LIBCPP_BEGIN_NAMESPACE_FILESYSTEM
using detail::ErrorHandler;
#if defined(_LIBCPP_WIN32API)
class __dir_stream {
public:
__dir_stream() = delete;
__dir_stream& operator=(const __dir_... | TOOL | 0.869255 | 7.663528 |
1fe4bf28-aed6-473d-bf38-c6c54d156737 | hargunmujral/Competitive-Programming | plus-one.cpp | class Solution
{
public:
vector<int> plusOne(vector<int> &digits)
{
int i = digits.size() - 1;
digits[i]++;
while (i > 0 && digits[i] > 9)
{
digits[i - 1]++;
digits[i--] = 0;
}
if (digits[0] == 10)
{
digits[0] = 0;
... | ALGO | 0.999883 | 6.748446 |
56174e38-ba75-470c-b539-d269106bc006 | schmiddey/rona | rona_move/src/Controller/ParabolaTransfere.cpp | /*
* ParabolaTransfere.cpp
*
* Created on: 04.11.2014
* Author: m1ch1
*/
#include "ParabolaTransfere.h"
#include <string>
#include <iostream>
namespace controller
{
ParabolaTransfere::ParabolaTransfere(
double max_vel_lin,
double max_vel_ang,
double parabola_lin_fac,
double parabol... | TOOL | 0.964513 | 5.83499 |
b86e9d74-e57b-4312-9fba-5c8a87242590 | angshn/algorithm | plats/3397.cpp | #include <bits/stdc++.h>
#define ll long long int
#define GETA(buf,size) for(int i=0;i<size;i++) cin>>buf[i];
#define rep(i, begin, end) for (__typeof(end) i = (begin) - ((begin) > (end)); i != (end) - ((begin) > (end)); i += 1 - 2 * ((begin) > (end)))
inline int read(){int x=0,f=1;char ch=getchar();while (ch<'0'||ch>'... | ALGO | 0.999919 | 5.056119 |
b081714d-db8f-409c-81c3-0c153b29c439 | breezykermo/oak | oak/third_party/ACORN/faiss/IndexBinaryHash.cpp | // -*- c++ -*-
#include "oak/third_party/ACORN/faiss/IndexBinaryHash.h"
#include <cinttypes>
#include <cstdio>
#include <memory>
#include <unordered_set>
#include "oak/third_party/ACORN/faiss/utils/hamming.h"
#include "oak/third_party/ACORN/faiss/utils/utils.h"
#include "oak/third_party/ACORN/faiss/impl/AuxIndexStr... | ALGO | 0.997421 | 7.517521 |
6b470110-a4d4-4f45-8979-8ee8e48afc60 | Rishil96/data-structures-and-algorithms | 00-Algorithms/10-n-stacks.cpp | #include <iostream>
#include <vector>
using namespace std;
class NStack
{
int *a, *top, *next;
int n;
int size;
int freeSpot;
public:
NStack(int _n, int _s) : n(_n), size(_s) {
freeSpot = 0;
a = new int[size];
top = new int[n];
next = new int[size];
for... | ALGO | 0.998584 | 4.299389 |
79979ac3-0b69-4af5-9ebb-84fb43de0c92 | tudelft/PX4-Autopilot | src/modules/mc_att_control/mc_att_control_main.cpp | /**
* @file mc_att_control_main.cpp
* Multicopter attitude controller.
*
* @author Lorenz Meier <<EMAIL>>
* @author Anton Babushkin <<EMAIL>>
* @author Sander Smeets <<EMAIL>>
* @author Matthias Grob <<EMAIL>>
* @author Beat Küng <<EMAIL>>
*
*/
#include "mc_att_control.hpp"
#include <drivers/drv_hrt.h>
#i... | TOOL | 0.917854 | 6.261755 |
9510a3a2-177c-4b7a-a416-9b0da7719697 | Ddong-Min/militaryStudy | backjoon/class 3/14500.cpp | #include<iostream>
#include<utility>
#include<cstring>
using namespace std;
int dx[4]={0,1,0,-1};
int dy[4]={1,0,-1,0};
int map[502][502];
bool isVisit[502][502];
int answer=0;
void DFS(pair<int, int> block, int cnt, int weight){
cnt++;
weight+=map[block.first][block.second];
if(cnt==4){
if(answer <... | ALGO | 0.999972 | 4.379209 |
827fe8ac-41ec-4bcc-8d62-a4b747578a2e | Azhitlukhina96/CCourse | task1.cpp |
#include "stdafx.h"
#include <stdlib.h>
#include <stdio.h>
#include <time.h>
void quickSort(int *values, int left, int right) {
int pivot = values[left];
int left_border = left;
int right_border = right;
int tmp = 0;
while (left_border < right_border) {
while ((values[right_border] >= pivot) && (left_border... | ALGO | 0.999244 | 4.370143 |
1d78fb06-edcf-4865-b5df-c1e31a0ab46f | michaelortiz05/CPP-Threading | Chapter 2/naive_sum.cpp | #include <algorithm>
#include <cmath>
#include <iostream>
#include <numeric>
#include <thread>
#include <utility>
#include <vector>
/**
* naive implementation of a sum reduction in which
* threads independently sum assigned chunks of a vector
* and the main thread sums the chunks to get the final result
*/
struct ... | ALGO | 0.999097 | 6.57956 |
4a4a9d34-27b6-422a-8717-f91e3c78803e | sarvex/leetcode-brainfuck | solution/0500-0599/0573.Squirrel Simulation/Solution.cpp | class Solution {
public:
int minDistance(int height, int width, vector<int>& tree, vector<int>& squirrel, vector<vector<int>>& nuts) {
int ans = INT_MAX;
int s = 0;
for (auto& a : nuts) {
s += f(a, tree);
}
s *= 2;
for (auto& a : nuts) {
int c ... | ALGO | 0.999902 | 5.428566 |
a1b81ed8-2e5c-4f65-9f1d-b8e1bd8d5fb3 | adi6409/browser-src | intl/icu/source/common/umath.cpp | #include "putilimp.h"
U_CAPI int32_t U_EXPORT2
uprv_max(int32_t x, int32_t y)
{
return (x > y ? x : y);
}
U_CAPI int32_t U_EXPORT2
uprv_min(int32_t x, int32_t y)
{
return (x > y ? y : x);
}
| TOOL | 0.993989 | 5.309443 |
4a825638-3f65-4d8c-b913-3dd7f9935e86 | tyolab/antelope | source/search_engine_result.cpp | /*
SEARCH_ENGINE_RESULT.C
----------------------
*/
#include "search_engine_result.h"
#include "memory.h"
#include "maths.h"
#include "search_engine_accumulator.h"
/*
ANT_SEARCH_ENGINE_RESULT::ANT_SEARCH_ENGINE_RESULT()
----------------------------------------------------
*/
ANT_search_engine_result::ANT_search_en... | ALGO | 0.938857 | 5.183824 |
8ae82a16-0b5e-4c5d-9df8-787cf757f046 | apassi99/LeetCode | valid_square.cpp | class Solution {
public:
bool validSquare(vector<int>& p1, vector<int>& p2, vector<int>& p3, vector<int>& p4) {
vector<vector<int>> points;
points.push_back(p1);
points.push_back(p2);
points.push_back(p3);
points.push_back(p4);
map<double, bool, cmp_double> distance... | ALGO | 0.999791 | 5.429514 |
ac2cf604-95ab-43c8-8b76-3d691e33994c | nupurd23/DataStructures | tree/count_nodes.cpp | #include<iostream>
#include<math.h>
using namespace std;
struct Node{
int key;
Node *right;
Node *left;
Node(int x){
key=x;
left=right=NULL;
}
};
int countnodes(Node *root){
int lh=0,rh=0;
Node *curr=root;
while(curr != NULL){
lh++;
curr=curr->left;
... | ALGO | 0.999856 | 5.573233 |
73d58345-e828-4d71-b34c-9adf74fb80dd | sosamsony/Leetscode-solutions | 42-trapping-rain-water/42-trapping-rain-water.cpp | class Solution {
public:
int trap(vector<int>& a) {
int area = 0;
int n = a.size();
vector<int> left(n), right(n);
int maxi = INT_MIN;
for(int i=0; i<n; i++) {
maxi = max(a[i], maxi);
left[i] = maxi;
}
... | ALGO | 0.999969 | 6.251265 |
bce92dcd-11b5-4199-a613-1fd35abd70d6 | ra9hur/Coursera-Probabilistic-Graphical-Models | PA3-markov-networks-for-OCR/PGM_Programming_Assignment_3/inference/inference-src/libdai/examples/example_imagesegmentation.cpp | #include <iostream>
#include <dai/alldai.h> // Include main libDAI header file
#include <CImg.h> // This example needs CImg to be installed
using namespace dai;
using namespace std;
using namespace cimg_library;
/// Converts an image into a FactorGraph as described in section 1.1.3 of [\ref Moo08]
/** The gra... | ALGO | 0.998917 | 7.415862 |
6e091028-b6da-4ec5-a5c7-2abf9ebf2b8c | zxyDEDIRE/ACM-Code-Library | 模板/数论/MR素数测试法.cpp | #include<bits/stdc++.h>
using namespace std;
using ll=long long;
ll mul(ll a,ll b,ll mod){
a%=mod;
b%=mod;
ll c=(long double)a*b/mod;
ll ans=a*b-c*mod;
return (ans%mod+mod)%mod;
}
ll pow_mod(ll x,ll n,ll mod){
ll res=1;
while(n){
if(n&1)res=mul(res,x,mod);
x=mul(x,x,mod);
n>>=1;
}
return (res+mod)%mod;... | ALGO | 0.999458 | 4.132525 |
dadb0559-caa3-468f-96a4-ced5141bd91e | wbl/cpgb | src/nacl-20110221/crypto_sign/wrapper-sign-open.cpp | #include <string>
using std::string;
#include "crypto_sign.h"
string crypto_sign_open(const string &sm_string, const string &pk_string)
{
if (pk_string.size() != crypto_sign_PUBLICKEYBYTES) throw "incorrect public-key length";
size_t smlen = sm_string.size();
unsigned char m[smlen];
unsigned long long mlen;
... | TOOL | 0.941656 | 5.050591 |
38b34106-e4e2-4ed4-bb8b-a07b29dbb8ff | exopeng/Competitive-Programming | VTHS/2020/color.cpp | #include <bits/stdc++.h>
using namespace std;
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
template <class T> using Tree = tree<T, null_type, less<T>,
rb_tree_tag, tree_order_statistics_node_update>;
#define mp make_pair
#define pb push_back
#define lb lowe... | ALGO | 0.989178 | 4.333353 |
7d28dcc1-543a-40bc-a4a0-4aa6ca9f9b35 | m265052/si204 | hw18/hw.cpp | //Will Pitkin m265052
//hw18 29Feb24
#include <iostream>
using namespace std;
// ======================================
// Function prototypes below
// ======================================
int readN();
int* readData(int n);
void show(int* A, int n);
void... | ALGO | 0.986647 | 4.389193 |
0dfff6cb-354d-4f3c-9475-e7139c9e429b | Malkeet786/striver_dp | Array/merge_2_sorted_array.cpp | class Solution {
public:
void merge(vector<int>& nums1, int m, vector<int>& nums2, int n) {
int i = m - 1, j = n - 1, tar = m + n - 1;
while (j >= 0) {
nums1[tar--] = i >= 0 && nums1[i] > nums2[j] ? nums1[i--] : nums2[j--];
}
// vector<int>temp1;
// vector<int>te... | ALGO | 0.999968 | 5.182988 |
5611e1d1-f687-43ff-95ba-762871f4ef10 | thevishaal26/cppcodesVishal | detectCycle.cpp | #include<iostream>
#include<map>
using namespace std;
bool detectLoop(Node *head){
if(head == NULL){
return false;
}
map<Node, bool> Visited;
Node*temp = head;//Visited is a map that has the node as key and value as true or false. The boolean variable will be used to check if it's already been v... | ALGO | 0.999371 | 4.015266 |
bfc87da7-a9fc-4df8-8171-7586d5837a19 | NAGAVENIGOWDA/My_Placement_prep_DSA | stack.cpp | #include<iostream>
#include<bits/stdc++.h>
using namespace std;
#define n 100
struct Stack{
int stack[n];
int top;
};
void push(Stack *ptr,int ele){
if(ptr->top==n-1){
cout<<"stack overflow"<<endl;
return;
}
ptr->top++;
ptr->stack[ptr->top]=ele;
}
int pop(Stack *ptr){
in... | ALGO | 0.998481 | 3.584054 |
251bf1ca-e3ad-4724-a217-1354376fcf7e | icoty/LeetCode | Algorithms/212.Word_Search_II.cpp | #include "AllInclude.h"
class Node{
public:
vector<Node*> child;
string str;
Node()
:str("")
{
child.resize(26, 0);
};
~Node()
{
for(auto & ele : child)
if(ele)
delete ele;
}
... | ALGO | 0.999943 | 6.413992 |
63acc5fb-b3ff-4373-93cf-908aa5729e11 | pat0nn/leetcode | pair.cpp | #include <iostream>
#include <utility>
#include <map>
#include <vector>
#include <algorithm>
#include <unordered_map>
using namespace std;
vector<vector<int>> threeSum(vector<int>& nums) {
sort(nums.begin(), nums.end());
vector<vector<int>> result;
int i = 0;
while(i < nums.size()-3){
if(nums... | ALGO | 0.999876 | 4.84953 |
c6393a66-fc1f-4191-ad22-b91d30c003e9 | Syed-Raheem/LeetCode_Solutions | 1642-furthest-building-you-can-reach/1642-furthest-building-you-can-reach.cpp | class Solution {
public:
int furthestBuilding(vector<int>& h, int b, int l) {
priority_queue<int> p;
int i=0, diff =0;
for(i=0; i<h.size()-1; i++){
diff = h[i+1]-h[i];
if(diff <= 0){
continue;
}
b -= diff;
p.push(... | ALGO | 0.999892 | 5.781678 |
4bb681fc-a3ba-4136-963f-e471128bd200 | ishandutta2007/codeforces | kotatsugame/normal/652/D.cpp | #include<cstdio>
#include<vector>
#include<algorithm>
#include <cassert>
#include <vector>
#include <cassert>
#include <numeric>
#include <type_traits>
namespace atcoder {
namespace internal {
#ifndef _MSC_VER
template <class T>
using is_signed_int128 =
typename std::conditional<std::is_same<T, __int128_t>::va... | ALGO | 0.999931 | 4.168801 |
de9e4a5d-b3ee-4338-9157-e17547c74d61 | Sidharth70754/Data_Structure_Algorithm | 0368-largest-divisible-subset/0368-largest-divisible-subset.cpp | class Solution {
public:
vector<int> largestDivisibleSubset(vector<int>& nums) {
sort(nums.begin(), nums.end());
vector<int> dp(nums.size(), 1), prev(nums.size(), -1);
int maxi = 0;
for (int i = 1; i < nums.size(); i++) {
for (int j = 0; j < i; j++) {
if (... | ALGO | 0.999996 | 5.769601 |
bf12f3fd-867a-40c2-9b1c-1b1757f856ca | binliu717/Stock-Investment-Optimization-with-C- | MAIN.cpp | // Bin Liu
#include<iostream>
#include<vector>
#include<fstream>
#include <math.h>
#include <curl/curl.h>
# include <cmath>
# include "matrix.h"
# include "DataExtraction.h"
using namespace std;
int main(){
int size, column, i, j;
vector<vector<double>> returns, covariance, invcovariance, transreturns;
vector<s... | ALGO | 0.995846 | 5.0787 |
19bec794-1293-4270-a2c2-288d689168e3 | soonmin-kwon/Solved.ac | 1012.cpp | #include<iostream>
#include<vector>
using namespace std;
int map[51][51];
int mx[4] = { -1,0,1,0 };
int my[4] = { 0,-1,0,1 };
bool visited[51][51];
int t, m, n, k;
void fill(int x, int y) {
visited[x][y] = true;
for (int a = 0; a < 4; a++) {
int nx = x + mx[a];
int ny = y + my[a];
if (nx < 0 || nx >= n || n... | ALGO | 0.999828 | 3.8338 |
bba307d7-ae5e-484f-b86e-1d0f3ea7a1c3 | qiaozishun4/CSP2024_BJ | BJ-Junior/answers/BJ-J01898/sticks/sticks.cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
freopen("sticks.in","r",stdin);
freopen("sticks.out","w",stdout);
int t;
cin>>t;
while(t--)
{
cout<<-1;
}
return 0;
}
| ALGO | 0.997368 | 3.059231 |
b64adc70-28a7-4f5b-8a50-096b097547e7 | sunrash/freebsd_steroid | contrib/llvm/tools/clang/lib/Analysis/ThreadSafetyTIL.cpp | #include "clang/Analysis/Analyses/ThreadSafetyTIL.h"
#include "clang/Basic/LLVM.h"
#include "llvm/Support/Casting.h"
#include <cassert>
#include <cstddef>
using namespace clang;
using namespace threadSafety;
using namespace til;
StringRef til::getUnaryOpcodeString(TIL_UnaryOpcode Op) {
switch (Op) {
case UOP_Mi... | ALGO | 0.991393 | 4.371004 |
0279cb83-ee52-4bbe-a556-f5fabfa85403 | RaedAbdelkefi/Problem-Solving | B. Three Threadlets.cpp | #include <iostream>
#include <bits/stdc++.h>
#define ll long long
using namespace std;
int main()
{
ios::sync_with_stdio(0);
int t;
cin>>t;
while(t--)
{
int a,b,c;
cin>>a>>b>>c;
vector<int> v={a,b,c};
sort(v.begin(),v.end());
string ch;
if (v[0]==v[1]... | ALGO | 0.999933 | 4.108856 |
350fb787-a8cf-4d29-a84f-ca3696883ad3 | daniel692a/templates_cp | sqrt.cpp | #include <bits/stdc++.h>
#include <iostream>
using namespace std;
double sqrt(int num){
double temp=0, sqt = num/2;
while (sqt!=temp) {
temp = sqt;
sqt = (num/temp +temp)/2;
}
return sqt;
}
int main(){
cout<<sqrt(16);
return 0;
}
| ALGO | 0.999793 | 3.412863 |
bb45339a-9071-44a3-b739-7cd0404552c4 | ishandutta2007/codeforces | bmerry/normal/1053/D.cpp | //#pragma GCC optimize("O3")
//#pragma GCC target("arch=corei7-avx")
#include <bits/stdc++.h>
#ifndef ONLINE_JUDGE
# include <sys/time.h>
# include <sys/resource.h>
#endif
/*** TEMPLATE CODE STARTS HERE ***/
#ifndef M_PI
#define M_PI 3.1415926535897932384626433832795028841971693993751
#endif
using namespace std;
ty... | ALGO | 0.99998 | 5.296919 |
82a2c99f-2e5a-4205-800f-66744c618a2b | trlste/new-mega-scggm | eigen337/failtest/bdcsvd_int.cpp | #include "../Eigen/SVD"
#ifdef EIGEN_SHOULD_FAIL_TO_BUILD
#define SCALAR int
#else
#define SCALAR float
#endif
using namespace Eigen;
int main()
{
BDCSVD<Matrix<SCALAR,Dynamic,Dynamic> > qr(Matrix<SCALAR,Dynamic,Dynamic>::Random(10,10));
}
| TEST | 0.886488 | 3.254006 |
bf8e08a0-1e7a-4465-994e-6e50d80e6a0f | tommytracey/Udacity-CarND-Term3 | p11-path-planning/src/Eigen-3.3/doc/examples/class_CwiseBinaryOp.cpp | #include <Eigen/Core>
#include <iostream>
using namespace Eigen;
using namespace std;
// define a custom template binary functor
template<typename Scalar> struct MakeComplexOp {
EIGEN_EMPTY_STRUCT_CTOR(MakeComplexOp)
typedef complex<Scalar> result_type;
complex<Scalar> operator()(const Scalar& a, const Scalar& b... | ALGO | 0.914904 | 6.700232 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.