uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
79ad6531-a90b-4c1f-9a23-ef8eca572f88 | Yawn-Sean/Daily_CF_Problems | daily_problems/2024/07/0729/personal_submission/cf513b2_1zhao.cpp | void solve() {
long long n, m;
cin >> n >> m;
m --;
vector<int> ans(n);
int l=0, r=n-1;
long long cnt = 1ll << (n-2);
for(int i=1; i<=n; i++) {
if(m < cnt) {
ans[l] = i;
l ++;
} else {
ans[r] = i;
r --;
m -= cnt;
... | ALGO | 0.99999 | 3.660137 |
4096780b-1f7e-4afa-98a5-512c3d97c4f0 | TonChan0828/AtCoder | ABC/ABC010/C.cpp | #include <bits/stdc++.h>
#include <atcoder/all>
using namespace std;
using namespace atcoder;
using ll = long long;
template <typename T>
bool chmax(T &a, const T &b) {
if (a < b) {
a = b; // aをbで更新
return true;
}
return false;
}
template <typename T>
bool chmin(T &a, const T &b) {
if (a > b) {
a... | ALGO | 0.999949 | 4.758229 |
9145aad6-b6a2-4e57-8da0-d8382714fc56 | skyqnaqna/algorithm_study | boj/Implementation/BOJ_16235.cpp | /*
백준 16235 나무 재테크
22.01.08
https://github.com/skyqnaqna/algorithm_study
*/
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using dd = double;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
#define INF (int)2e9
#define endl "\n"
void input() {
freopen("input.txt", "r", stdin);
}
vo... | ALGO | 0.999884 | 4.033763 |
59f0b2bd-e76b-4216-992b-627a3b539383 | starliteSeeker/advent_of_code | 2024/cpp/src/day8.cpp | #include <cctype>
#include <fstream>
#include <iostream>
#include <map>
#include <set>
typedef std::pair<int, int> coord;
bool InRange(coord& c, int width, int height) {
return c.first >= 0 && c.second >= 0 && c.first < width &&
c.second < height;
}
// for each type of antennas, loop through pairs and... | ALGO | 0.998609 | 5.463954 |
dac05a2a-be57-45f4-8249-d05d449627d3 | cliffszz/Leetcode | Cpp/HOT 100/200_numIsland.cpp | //https://leetcode-cn.com/problems/number-of-islands/
#include <vector>
#include <queue>
#include <algorithm>
using namespace std;
//DFS
class Solution {
public:
int row, col;
void dfs(vector<vector<char>>& grid, int i, int j) {
grid[i][j] = '0';
if (i - 1 >= 0 && grid[i - 1][j] == '1') dfs(gri... | ALGO | 0.999945 | 6.359146 |
0ac2dcdf-c2c8-43ce-b32b-abc81ff91111 | trilinos/Trilinos | packages/anasazi/epetra/example/BlockDavidson/BlockDavidsonEpetraExGen.cpp | #ifdef EPETRA_MPI
#include "Epetra_MpiComm.h"
#include <mpi.h>
#else
#include "Epetra_SerialComm.h"
#endif
#include "Epetra_Map.h"
#include "ModeLaplace2DQ2.h"
int main(int argc, char *argv[]) {
#ifdef EPETRA_MPI
// Initialize MPI
//
MPI_Init(&argc,&argv);
#endif
// Create an Epetra communicator
//
#ifdef... | ALGO | 0.999729 | 4.815003 |
a678f29c-fcf4-4fc7-8644-a10b378e43d4 | iblea/iblea_leetcode | 1769-minimum-number-of-operations-to-move-all-balls-to-each-box/1769-minimum-number-of-operations-to-move-all-balls-to-each-box.cpp | class Solution {
public:
vector<int> minOperations(string boxes) {
vector<int> answer;
for (int i = 0; i < boxes.size(); i++) {
int sum = 0;
for (int j = 0; j < boxes.size(); j++) {
if (boxes[j] == '0') {
continue;
}
... | ALGO | 0.999983 | 5.83852 |
15ba38ac-75b9-4091-81df-b894acdc6c13 | Rounak10/order_of_log_n | src/Tree/topview.cpp | #include<bits/stdc++.h>
using namespace std;
class TreeNode
{
public :
int data;
TreeNode *left, *right;
TreeNode(int x){
data = x;
left = right = NULL;
}
};
class Tree{
public:
TreeNode* root;
Tree()
{
root = NULL;
}
Tree(TreeNode* n)
{
root ... | ALGO | 0.999977 | 5.066252 |
02c9167a-b041-4ce8-95ee-bc368c1b8466 | tnakaicode/jburkardt-cpp | valgrind_test/test01.cpp | # include <cstdlib>
# include <iostream>
using namespace std;
int main ( );
void f ( int n );
//****************************************************************************80
int main ( )
{
int n = 10;
cout << "\n";
cout << "TEST01\n";
cout << " C++ version.\n";
cout << " A sample code for analysis by... | ALGO | 0.991362 | 4.738617 |
c9ee1a64-bf4f-4f63-8e5c-f2c0b2f2b1b7 | GuruDevCoder/Snoring_Guardian | snoring_detection_inferencing/src/edge-impulse-sdk/tensorflow/lite/micro/kernels/round.cpp | #include "edge-impulse-sdk/tensorflow/lite/kernels/internal/reference/round.h"
#include "edge-impulse-sdk/tensorflow/lite/c/common.h"
#include "edge-impulse-sdk/tensorflow/lite/kernels/internal/tensor_ctypes.h"
#include "edge-impulse-sdk/tensorflow/lite/kernels/kernel_util.h"
namespace tflite {
namespace ops {
namesp... | ALGO | 0.901856 | 7.844066 |
7d78baf9-a89d-49a8-b7e1-de3dac62f8f1 | i-s0nic/Code_It_Out | Codeforces/Little Elephant and Numbers.cpp | //SAURABHSAHAB
#include<bits/stdc++.h>
//#include <boost/math/common_factor.hpp>
//#include <boost/multiprecision/cpp_int.hpp>
//using namespace boost::multiprecision;
using namespace std;
#define lll cpp_int
#define ull unsigned long long
#define ll long long
#define ui unsigned int
#define ldb long double
//#de... | ALGO | 0.99987 | 4.723957 |
bb25c47d-ccc6-49ce-ae01-61797b9c8c13 | Aashnan12/GeeksforGeeks | Easy/BFS of graph/bfs-of-graph.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution {
public:
// Function to return Breadth First Traversal of given graph.
vector<int> bfsOfGraph(int V, vector<int> adj[]) {
// Code here
int visited[V] = {0};
queue<int> q;
... | ALGO | 0.99996 | 6.30406 |
c59a0f0d-8c04-488f-9c6d-001238dfcfe4 | GautamAggarwal-05/-CrackYourPlacement | 0794-swim-in-rising-water/0794-swim-in-rising-water.cpp | class Solution {
public:
int swimInWater(vector<vector<int>>& grid) {
priority_queue<pair<int, pair<int, int>>, vector<pair<int, pair<int, int>>>, greater<pair<int, pair<int, int>>>> pq;
int n = grid.size(), m = grid[0].size();
int dirx[4] = {1, -1, 0, 0};
int diry[4] = {0, 0, -1, 1}... | ALGO | 0.999981 | 6.066028 |
dccc14d6-f6dc-43b2-8a93-6054a1480e95 | mahabub5090/Various_Online_Judge_Problem_Solutions | TLE_Eliminators_CP_31_Sheet/900/A_Make_It_Zero.cpp | // Problem Link: https://codeforces.com/problemset/problem/1869/A
/*
**************************************************************
*Bis'Millah Hir Rah'Manir Rahim == start with the name of \n *
* ALLAH Subhana Tayala *
* Author: Md. Mahabubar Rahman ... | ALGO | 0.998884 | 3.384957 |
a3231268-be16-4432-b764-9d59b6a4f50e | agavrel/leetcode | bit_manipulation/1400_Construct_K_Palindrome_Strings/solution.cpp | static int lambda_0 = []() { std::ios::sync_with_stdio(false); cin.tie(NULL); return 0; }();class
Solution {
public:
bool canConstruct(string s, int k) {
__int128 l = 0;
for (char c : s) l ^= (__int128)1 << c;
return __builtin_popcount(l >> 96) <= k && (s.size() >= k);
}
}; | ALGO | 0.999992 | 5.949178 |
ed2dc0b6-75aa-439d-87f2-597311b20a5a | amoudgl/leetcode-solutions | src/k-diff-pairs-in-an-array.cpp | // Author: Abhinav Moudgil [ https://leetcode.com/amoudgl/ ]
class Solution {
public:
int findPairs(vector<int>& nums, int k) {
if (k < 0) return 0;
unordered_map<long long int, int> m;
int count = 0;
long long int K = k;
for (int i = 0; i < nums.size(); i++)
{
... | ALGO | 0.999755 | 6.057539 |
676e02ae-99b4-44b9-a666-ba05bdea59dc | olegshnitko/libboost | libs/ptr_container/test/view_example.cpp | //
// This example is intended to show you how to
// use the 'view_clone_manager'. The idea
// is that we have a container of non-polymorphic
// objects and want to keep then sorted by different
// criteria at the same time.
//
//
// We'll go for 'ptr_vector' here. Using a node-based
// container would be a waste of... | TOOL | 0.942978 | 6.078863 |
22285c5d-678e-4d02-9371-ffd69a17e33e | Tiangfuu23/Leetcode-and-GFG---T23 | 0392-is-subsequence/0392-is-subsequence.cpp | class Solution {
public:
bool isSubsequence(string s, string t) {
int n = s.size(), m = t.size();
if(n==0) return true;
if( n > m ) return false;
int j = 0;
for(int i = 0; i<m; i++){
if(t[i] == s[j]) j++;
if(j==n) return true;
}
return ... | ALGO | 0.999924 | 6.180315 |
a2dd4260-8fea-4727-acb7-330e99035e1b | yuvraj0502/DSA | GFG/Queue/Ticket Counter.cpp | //{ Driver Code Starts
#include<bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution {
public:
int distributeTicket(int N, int K) {
// code here
int left=1;
int right=N;
while(true){
left=left+K;
if(left>=right){
return ... | ALGO | 0.999777 | 5.013118 |
5510400e-1f9c-4481-95be-214c42cf8720 | killer-abhi/Geeks-For-Geeks---DSA | 8 Hashing/count_distinct.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
int n;
cin>>n;
unordered_set<int> mySet;
for(int i=0;i<n;i++){
int x;
cin>>x;
mySet.insert(x);
}
cout<<"\n \nDistinct Elements = "<<mySet.size();
return(0);
} | ALGO | 0.999415 | 3.911384 |
1acd8a41-08c3-44d0-922c-90000b7facb9 | woohyunjng/Coding-Practice | PS/Baekjoon/22000/22023.cpp | #include "candies.h"
#include <bits/stdc++.h>
#define int long long
using namespace std;
typedef array<int, 4> pr;
const int MAX = 200001;
const int INF = 0x3f3f3f3f3f3f3f3f;
int N, lazy[MAX * 4];
vector<int> in[MAX], out[MAX];
pr tree[MAX * 4];
pr merge(pr X, pr Y) {
pr res = {min(X[0], Y[0]), 0, max(X[2], Y... | ALGO | 0.999992 | 4.206962 |
bbfc0dae-7c90-4c3a-8e88-3f6344de402a | ranaldmiao/noiref | misc/cpp/iterator.cpp | for (vector<pair<int, int> >::iterator it = adjList[x].begin(); it != adjList[x].end(); ++it) {
//Ensures the first number of the pair is always <= than the second
if (it->first > it->second) {
int t = it->first;
it->first = it->second;
it->second = t;
}
} | ALGO | 0.999812 | 3.836186 |
7fc64d4b-ce88-44bf-9524-3a8eae37b478 | cs-au-dk/Artemis | contrib/Z3/lib/recover_01_tactic.cpp | #include"tactical.h"
#include"th_rewriter.h"
#include"extension_model_converter.h"
#include"filter_model_converter.h"
#include"arith_decl_plugin.h"
#include"expr_substitution.h"
#include"dec_ref_util.h"
#include"ast_smt2_pp.h"
class recover_01_tactic : public tactic {
struct imp {
typedef obj_map<func_decl... | ALGO | 0.990755 | 5.44894 |
b706eb45-6395-40dc-a03d-a01c42223689 | chuncheyang1130/Leetcode_Practice | 112-path-sum/112-path-sum.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.999974 | 6.288864 |
dac6ae0b-177e-4e62-a11a-8fbd12c0345e | jason5122/leetcode-cpp | debugging/attempt1/0392_is_subsequence.cpp | #include "debugging.h"
#include <iostream>
using namespace std;
// m == s.length()
// n == t.length()
// runtime: O(n)
// space: O(1)
bool is_subsequence(string s, string t) {
if (s.empty()) return true;
int i = 0;
for (char c : t) {
if (s[i] == c) i++;
if (i == s.length()) return true;
... | ALGO | 0.999783 | 5.847067 |
16c851e3-1913-4f70-b0e5-f809a44b163b | tarekalmowafy/Compatetive_Programming | codeforces/a/00513_game.cpp | #include <stdio.h>
#include <string>
#include <iostream>
#include <vector>
#define rep(i, n) for (int i = 0; i < n; i++)
using namespace std;
int main(void) {
int n1, n2, k1, k2, player1steps, player2steps;
cin >> n1 >> n2 >> k1 >> k2;
if (n1 == n2)
cout << "Second" << endl;
else if (n1 > n2)
cout << "... | ALGO | 0.999777 | 3.543521 |
f6867b58-1ae6-4c38-98c5-86048141031d | Vishal35198/Data-Structures-And-Algorithms | STL/competitive.cpp | #include <bits/stdc++.h>
#include <vector>
#define M 1000000007
using namespace std;
void solve()
{
long long int n;
cin>>n;
long long int A[n];
set<int> s;
for(auto it:A)
{
if(s.find(it)==s.end()) s.insert(it);
}
if(s.size()==1)
{
cout<<"YES<<"<<endl;
retur... | ALGO | 0.999443 | 4.878182 |
6b790ede-e26c-4b08-9b3e-d9e7bdcf3ec5 | MatSciTools/HFCalc | boost_1_79_0/libs/geometry/index/example/benchmark3.cpp | // Boost.Geometry Index
// Additional tests
#include <iostream>
#include <boost/geometry.hpp>
#include <boost/geometry/index/rtree.hpp>
#include <boost/chrono.hpp>
#include <boost/foreach.hpp>
#include <boost/random.hpp>
#include <set>
int main()
{
namespace bg = boost::geometry;
namespace bgi = bg::index;
... | TEST | 0.891734 | 6.063844 |
cccdf561-25ae-4858-9203-a4334522c1b0 | Debashish-hub/INTERVIEW-KIT | DSA/450 DSA BY LOVE BABAR BHAIYA/ARRAY/21.SubarrayWithSum0.cpp | bool subArrayExists(int arr[], int n)
{
//Your code here
unordered_set <int> s;
int pre_sum = 0;
for(int i=0; i<n ;i++){
pre_sum += arr[i];
if(s.find(pre_sum) != s.end()){
return true;
}
if(pre_sum == 0){
... | ALGO | 0.999528 | 4.843609 |
04170a71-7818-49b1-bf57-1c30f307f432 | macyapp/Data-Structures-Algorithms | z_DSA_One/08_Searching/01_Binary Search.cpp | #include<iostream>
#include<vector>
using namespace std;
#define pb push_back
#define endl "\n"
void initialize(vector<int>& a,int n) {
int i,ip;
for(i=0;i<n;i++) {
cin>>ip;
a.pb(ip);
}
}
void print(vector<int> a,int n) {
int i;
for(i=0;i<n;i++) {
cout<<a[i]<<" ";
}
... | ALGO | 0.999917 | 5.335804 |
8f5c9ed6-7fa7-4e31-a417-7c552f16e557 | amritessh/LeetCodeSolutions | 2206-detonate-the-maximum-bombs/detonate-the-maximum-bombs.cpp | class Solution {
public:
int maximumDetonation(vector<vector<int>>& bombs) {
int n = bombs.size();
vector<vector<int>> adj(n);
for (int i = 0; i < n; i++) {
for (int j = i + 1; j < n; j++) {
long long x1 = bombs[i][0], y1 = bombs[i][1], r1 = bombs[i][2];
l... | ALGO | 0.999836 | 5.768845 |
889742ec-ce6f-44bc-949f-d33729932c8a | ishandutta2007/codeforces | chen_zexing/normal/1650/D.cpp | #include <cstdio>
#include <iostream>
#include <unordered_map>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <climits>
#include <algorithm>
#include <complex>
#include <string.h>
#include <iomanip>
#include <assert.h>
using namespace std;
int a[2005],ans[2005],nxt[2005];
int main() {
int ... | ALGO | 0.99999 | 3.687346 |
1670c0d7-81a0-4376-8d17-b95676864072 | svn2github/vbox | src/VBox/Runtime/common/checksum/alt-md2.cpp | /* $Id$ */
/** @file
* IPRT - Message-Digest Algorithm 2, Alternative Implementation.
*/
/*******************************************************************************
* Defined Constants And Macros *
******************************************************************... | ALGO | 0.995693 | 6.91984 |
5a4560ad-8453-44f8-b37f-bd6d196d591d | Syed-Bakhtawar-Fahim/DSA_Algorithm_Code | assignments/linkedlist.cpp | #include<stdlib.h>
#include<stdio.h>
struct node
{
int data;
struct node*next;
};
struct node*start=NULL;
int insert()
{
struct node*temp=(struct node*)malloc(sizeof(struct node));
int n;
printf("insert the data");
scanf("%d",&n);
temp->data=n;
temp->next=NULL;
if(start==NULL)
{
start=temp;
}
else
{
st... | ALGO | 0.996442 | 3.131427 |
10e4cd3c-f32a-46d0-a138-686cc51450db | ThatDNS/UVa-solutions | UVA/Ch 1. Introduction/10812 - Beat the Spread!.cpp | // Problem: 10812 - Beat the Spread!
/**
* Author: DNS-404
**/
#include <bits/stdc++.h>
using namespace std;
int main(){
long long n, s, d, x, y;
cin >> n;
while(n-- > 0){
x=0; y=0;
cin >> s >> d;
x = (s+d)/2;
y = s-x;
if(x>=0 && y>=0 && ((x+y == s) && (abs(x-y) == d)))
if(x>y)
... | ALGO | 0.999744 | 4.032788 |
46e36730-7427-4c79-ad49-c2b89fdc31f1 | AdhamHammoda/Competitive-Programming | CODEFORCES_RATING/900/B- Getting an A.cpp | /// ______ __________ _____ _____ _____
/// /// \\\ ||__|| \\\ ||| ||| || || |||\\\ ///|||
/// /// \\\ ||__|| \\\ |||_____||| || || ||| \\\ /// |||
/// ///______\\\ ||__|| \\\ |||_____||| || || ||| \\\ /// ... | ALGO | 0.999569 | 3.561996 |
b2675c1b-a648-43cb-8864-1841e1e30446 | Lacho18/Problems-on-c- | Problems-on-c++/Swap_Nodes_in_Pairs/Swap_Nodes_in_Pairs.cpp | #include <iostream>
/*
Given a linked list, swap every two adjacent nodes and return its head.
You must solve the problem without modifying the values in the list's
nodes (i.e., only nodes themselves may be changed.)
*/
struct List {
int value;
List* next;
};
void sign(struct List** begining, i... | ALGO | 0.999975 | 5.909318 |
e3f32be9-8589-4852-ba4d-e5b3a5302d2a | WilmaraRuizD/ejemplosc- | ejercicio27.cpp | /*hacer un programa que simule un cajero automatico con un saldo inicial de 1000
dolares*/
#include <iostream>
using namespace std;
int main(){
int saldoInicial=1000;
int opciones;
float extra,saldo=0,retiro;
cout<<"\tBienvenido a su CajeroVirtual"<<endl;
cout<<"1.Ingrese dinero en su cuenta"<<endl;
cout<<"2.Ret... | TOOL | 0.897507 | 3.49542 |
ac099b72-4b05-44b6-975a-0959f359c72b | JinnyWanna/cpp_practice | Graph/shortest_path/Bellman_Ford/1219_gomin.cpp | #include <iostream>
#include <vector>
#include <queue>
typedef long long lint;
const lint INF = 1000000000;
struct pair {
lint cur;
lint next;
lint cost;
pair(lint _cur, lint _next, lint _cost) : cur(_cur), next(_next), cost(_cost) {}
pair(const pair &p) {
this->cur = p.cur;
this->next = p.next;
this->co... | ALGO | 0.999811 | 3.940888 |
076051d5-90a1-474c-be77-a4fa457e0376 | hiranoo/atcoder | contests/abc214/d.cpp | #include <bits/stdc++.h>
#include <atcoder/all>
#include <time.h>
#define rep(i, s, t) for(int i = (s); i <= (t); i++)
#define repd(i, s, t) for(int i = (s); i >= (t); i--)
#define all(v) v.begin(), v.end()
typedef long long ll;
typedef unsigned long long ull;
using namespace std;
template<class T> inline bool chmax(T ... | ALGO | 0.999984 | 4.558442 |
f959bc92-0d5e-47a6-ab35-b4a724b242eb | Rajdeep7/LeetcodeSolutions | Tree/MaxPathSum.cpp | /**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode(int x) : val(x), left(NULL), right(NULL) {}
* };
*/
class Solution {
public:
int helper(TreeNode* root, int &result) {
if(!root)
return 0;
... | ALGO | 0.999972 | 6.407044 |
fb4c3035-2fd6-4e10-bc74-40f2f495b3e2 | upple/BOJ | src/1000/1944.cpp17.cpp | #include <bits/stdc++.h>
using namespace std;
bool v[50][50];
char arr[50][51];
int dx[]={0, 0, 1, -1};
int dy[]={1, -1, 0, 0};
struct edge
{
int cost, to, from;
};
inline bool operator < (const edge a, const edge b)
{
return a.cost>b.cost;
}
int p[2500];
int Find(int a)
{
if(p[a]==a) return a;
re... | ALGO | 0.999495 | 3.713287 |
3edc5ac8-cc9c-40a1-8f4d-0cecc582ae01 | atodor/ProbGraphsExperiments | align_big_det.cpp | #include "ProbGraphs/Graph.h"
//#include "ProbGraphs/RandomGraph.h"
#include "ProbGraphs/DeterministicGraph.h"
#include "files2.h"
#include <iostream>
#include <sstream>
#include <fstream>
#include "ProbGraphs/match.h"
#include "time/timer.h"
using namespace std;
int main(int argc, char *argv[])
{
if(argc<4)
{
c... | ALGO | 0.98611 | 3.977064 |
fbc1f313-b930-487d-ac08-bbc76613ce4c | levi178u/Codeforces-codes | D_Kousuke_s_Assignment.cpp |
// Action Beeeeeaammmmm...... beep beep beep beep beep beep beep....
#include <bits/stdc++.h>
using namespace std;
#define lli long long int
#define ll long long
#define vi vector<lli>
#define vvi vector<vi>
#define gv(v,n) vi v; for (int i = 0; i < n; i++) { ll xx; cin>>xx; v.push_back(xx); }
#define mod 1e9 +7
#... | ALGO | 0.999069 | 4.111431 |
13d6c09a-5321-4a7c-b6e8-e561f161be69 | ImportMengjie/Leetcode | 171.excel表列序号.cpp | /*
* @lc app=leetcode.cn id=171 lang=cpp
*
* [171] Excel表列序号
*
* https://leetcode-cn.com/problems/excel-sheet-column-number/description/
*
* algorithms
* Easy (66.92%)
* Likes: 134
* Dislikes: 0
* Total Accepted: 38.9K
* Total Submissions: 57.9K
* Testcase Example: '"A"'
*
* 给定一个Excel表格中的列名称,返回其相应... | ALGO | 0.998702 | 6.130977 |
eb2dd7af-93f2-4629-bf15-bde0cfdc64e6 | 113bommy/deepmind_codecontests_refine | cpp_source_filter_file/cpp_train_9448_6.cpp | #include <bits/stdc++.h>
using namespace std;
const double EPS = 1e-9;
signed main() {
ios::sync_with_stdio(false);
cin.tie(0);
long long n, x;
cin >> n >> x;
vector<long long> a(n);
for (long long i = (0); i < ((n)); ++i) cin >> a[i];
vector<long long> sum(n + 1, 0);
for (long long i = (0); i < ((n)); ... | ALGO | 0.999971 | 4.216444 |
9932317f-c462-490e-9a8c-6007b277b6b6 | HSarham/Open3D-0.9.0 | 3rdparty/Eigen/doc/examples/tut_arithmetic_matrix_mul.cpp | #include <iostream>
#include <Eigen/Dense>
using namespace Eigen;
int main()
{
Matrix2d mat;
mat << 1, 2,
3, 4;
Vector2d u(-1,1), v(2,0);
std::cout << "Here is mat*mat:\n" << mat*mat << std::endl;
std::cout << "Here is mat*u:\n" << mat*u << std::endl;
std::cout << "Here is u^T*mat:\n" << u.transpo... | ALGO | 0.999447 | 3.818773 |
9cd54dbf-1f0c-454e-b6e7-0fadfce07f79 | OmarAlSeddik/competitive-programming-codeforces | 800/dislike-of-threes.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int t, sequence[1000];
cin >> t;
int ans[t];
for (int i = 0; i < 1000; i++) {
if (i) {
int prev = sequence[i-1];
int x = 1;
while ((prev+x) % 3 == 0 || (prev+x) % 10 == 3) {
x++;
... | ALGO | 0.999795 | 3.783404 |
6befc740-f6c9-4760-a3a0-e1444670be0e | gkeksd/studyCPP | 챕터5/챕터5_Lab7.cpp | #include <iostream>
using namespace std;
int main() {
int n, m;
cout << "N M Էּ: ";
cin >> n >> m;
int mea = 1;
for (int i = 1; i < n; i++) {
for (int j = 1; j < m; j++) {
if (n % i == 0 && m % i == 0) mea = i;
}
}
cout << n << ", " << m << " ִ: " << mea;
} | ALGO | 0.999868 | 4.197518 |
39952899-5c84-4f9c-886b-49c3a9a0c457 | dudugi/NewForTortoise | QL/Common/cryptopp-CRYPTOPP_7_0_0/blowfish.cpp | // blowfish.cpp - originally written and placed in the public domain by Wei Dai
#include "pch.h"
#include "blowfish.h"
#include "misc.h"
NAMESPACE_BEGIN(CryptoPP)
void Blowfish::Base::UncheckedSetKey(const byte *key_string, unsigned int keylength, const NameValuePairs &)
{
AssertValidKeyLength(keylength);
unsigne... | ALGO | 0.998801 | 7.388385 |
5a472cf9-a439-46b4-b36b-027e708fe73e | Shiveshdixit07/LeetCode_Problem_Solutions | LeetcodePotdSolutions/3375. Minimum Operations to Make Array Values Equal to K.cpp | class Solution
{
public:
int minOperations(vector<int> &nums, int k)
{
sort(nums.begin(), nums.end());
if (nums[0] < k)
return -1;
int x = k;
int ans = 0;
for (int i = nums.size() - 1; i >= 0; i--)
{
if (nums[i] == x)
break;... | ALGO | 0.999839 | 5.509724 |
d17754ee-baa8-4d58-a101-999ed56a15ae | borussiam/baekjoon | baekjoon1158/main.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
queue<int> j;
int n,k;
cin >> n >> k;
for(int i=1;i<=n;i++) j.push(i);
cout << "<";
while(true){
for(int i=1;i<k;i++){
j.push(j.front());
j.pop(... | ALGO | 0.999954 | 3.700108 |
b87e3910-f4e1-46c6-8dde-0eaff5fd8281 | jinxiaoye1987/RyzomCore | nel/tools/3d/ig_lighter_lib/ig_lighter_lib.cpp | #include "ig_lighter_lib.h"
#include "nel/misc/path.h"
#include "nel/pacs/retriever_bank.h"
#include "nel/pacs/global_retriever.h"
#include "nel/3d/scene_group.h"
using namespace std;
using namespace NLMISC;
using namespace NL3D;
using namespace NLPACS;
// *************************************************************... | ALGO | 0.85969 | 4.054205 |
e979f05a-a1bb-42fd-ab4f-f8ded00b422a | 92Rehan794/REHAN-92 | modulus.cpp | #include<iostream>
using namespace std;
main()
{
cout << "Enter a 4-digit number: ";
int digit;
cin >> digit;
int rem1;
rem1=digit%10;
int num1;
num1=digit/10;
int rem2;
rem2=num1%10;
int num2;
num2=num1/10;
int rem3;
rem3=num2%10;
int num3;
num3=num2/10;
int rem4;
rem4=num3%10;
int result;
result=re... | ALGO | 0.999256 | 4.250247 |
3f49fdef-dff0-40ab-b854-54a6e7ae8934 | atharvakej/Repo_of_Codes | Practice/1100/D_Strong_Vertices.cpp | #include <bits/stdc++.h>
using namespace std;
#define POP pop_back
#define MOD 1e7+10
#define PI 3.1415926535897932
#define PB push_back
#define MP make_pair
#define pb push_back
#define ppb pop_back
int power(int a, int b){
int r=1;
while(b){
if(b&1)r=(r*a);
a=(a*a); b/=2;
}
return r;
}
typedef long long ... | ALGO | 0.999959 | 3.75232 |
952c100c-1be2-4cab-9848-b20f8bcebe0a | abhinav2823/Data-Structures-and-Algorithms | Graphs/Floyd Warshall Algorithm/floydWarshall.cpp | // User function template for C++
class Solution {
public:
void floydWarshall(vector<vector<int>> &dist) {
int n = dist.size();
for(int i = 0; i < n; i++){
dist[i][i] = 0;
}
for(int k = 0; k < n; k++){
for(int i = 0; i < n; i++){
fo... | ALGO | 0.999834 | 4.788517 |
9c38519b-0d1b-4b91-bab2-081ee1d4fe0a | gokusleeping/problem-code | Two pointer/1. Two Sum.cpp | class Solution {
public:
vector<int> twoSum(vector<int>& nums, int target) {
unordered_map<int, int> mp;
for (int i = 0; i < nums.size(); i++)
{
if (mp.find(target - nums[i]) != mp.end()) {
return {mp[target - nums[i]], i};
}
mp[nums[i]] =... | ALGO | 0.999839 | 6.37283 |
4a25b44f-2e8b-4c50-bbba-baad1e40a95a | Vill21/cipher-util | third_party/boost_1_70_0/libs/random/test/histogram.cpp | #include <iostream>
#include <iomanip>
#include <vector>
#include <algorithm>
#include <cmath>
#include <string>
#include <boost/random.hpp>
void plot_histogram(const std::vector<int>& slots, int samples,
double from, double to)
{
int m = *std::max_element(slots.begin(), slots.end());
const int... | ALGO | 0.851181 | 5.671612 |
eaf6e77f-d319-4c5f-ac2a-539c45fabce4 | tjones879/lora-linux | src/utils.cpp | #include "inc/utils.hpp"
#include <vector>
namespace utils
{
int print_hex(const void *bin, const size_t bin_len, std::ostream &out)
{
char *hex;
size_t hex_size;
if (bin_len >= SIZE_MAX / 2)
return -1;
hex_size = bin_len * 2 + 1;
hex = static_cast<char *>(malloc(hex_size));
if (hex =... | TOOL | 0.862509 | 6.501529 |
7257f214-ba45-4764-907e-e80fe8bc6761 | BINMINUSER/Package | code/apps/Camera2/jni/feature_stab/db_vlvm/db_utilities_poly.cpp | /* $Id: db_utilities_poly.cpp,v 1.2 2010/09/03 12:00:10 bsouthall Exp $ */
#include "db_utilities_poly.h"
#include "db_utilities.h"
/*****************************************************************
* Lean and mean begins here *
****************************************************... | ALGO | 0.999626 | 5.195219 |
a0f076df-5946-4437-8ed6-e592e31606ce | karmazio/cpp-programming-course | homework-04/ThreadPool.cpp | #define _CRT_SECURE_NO_WARNINGS
#include "ThreadPool.hpp"
ThreadPool::ThreadPool(size_t numThreads) {
threads.reserve(numThreads);
}
void ThreadPool::waitAll() {
for (auto& t : threads) {
if (t.joinable()) {
t.join();
}
}
threads.clear();
}
// T1
unsigned long long ThreadPool::factorial(int n) {
unsigned... | ALGO | 0.962268 | 5.032883 |
03212cff-1fee-48c5-850c-549dad5d4c90 | alexandraback/datacollection | solutions_6377668744314880_0/C++/haxxpop/C.cpp | #include<stdio.h>
#include<algorithm>
using namespace std;
int tabx[100000];
int taby[100000];
int xx[10000];
int yy[10000];
int tx[10000];
int ty[10000];
int num;
int ind[1000];
int st[1000];
int top;
int base;
int crossL(int xb,int yb,int x1,int y1,int x2,int y2){
return (x1-xb)*(y2-yb)-(x2-xb)*(y1-yb);
}
int cmp(i... | ALGO | 0.999952 | 3.907308 |
df9ad20d-83ad-4971-a6dc-cf20cd3f00f1 | NaMooJoon/problem-solve | baekjoon/gold/1655/prob.cpp | #include <bits/stdc++.h>
using namespace std;
priority_queue<int, vector<int>, less<int>> pqGreater;
priority_queue<int, vector<int>, greater<int>> pqLess;
int main (void)
{
int N, num;
ios_base::sync_with_stdio(false);
cin.tie(nullptr); cout.tie(nullptr);
cin >> N;
for (int i = 0; i < N; i++) {... | ALGO | 0.999995 | 4.641857 |
4b71d0c7-35b8-486a-aa05-d53c3cb0c177 | S-u-m-e-e-t-1/CPP | prime.cpp | #include<iostream>
using namespace std;
int main()
{
int n,c=0;
cout<<"enter number";
cin>>n;
for(int i=2;i<n;i++)
{
if(n%i==0)
c++;
}
if(c==0)
cout<<n<<" is prime";
else
cout<<n<<" is not prime";
} | ALGO | 0.999754 | 3.400665 |
ee3e960a-7316-4fd1-816a-65aaf89893f6 | liuxueyang/cpp | uva/12627.cpp | // Date: Wed Sep 27 16:57:10 2023
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include ... | ALGO | 0.999163 | 4.061459 |
712ab0b2-cfc1-4f69-a4ed-ca24752bc1cd | aossama00/OpenMP_Project | OpenMP_Project/OpenMP_Project.cpp | #include <iostream>
#include <opencv2/opencv.hpp>
#include <omp.h>
using namespace cv;
using namespace std;
int main(int argc, char** argv)
{
double start_time, end_time; //variables to calculate time of each method
//Upload image using CV Mat class
cv::Mat image = cv::imread("..\\Lena.png", cv::IMREAD_CO... | ALGO | 0.929652 | 5.067798 |
e236c96a-c538-4cce-a043-58d37ef63835 | Sumit1911/4th-sem-ds-code | Week12/Week12_4.cpp | #include <iostream>
#include <string>
using namespace std;
class MaxHeap {
public:
pair<char, int> heap[256];
int size;
MaxHeap() {
size = 0;
}
void insert(pair<char, int> p) {
size++;
int index = size;
heap[index] = p;
while (index > 1 && heap[index].seco... | ALGO | 0.999989 | 6.174087 |
613dfa6c-ca76-449d-b291-8ea5582bbf91 | harsh-narayan-nishad/DSA-2.0-Codes | Arrays Spac complexeties and Time Complexities/array class 3.cpp | #include <iostream>
#include<limits.h>
#include<vector>
using namespace std;
void printArray(int arr[][4], int row, int col) {
for(int i=0; i<row; i++ ) {
for(int j=0; j<col; j++) {
cout << arr[i][j] << " ";
}
cout << endl;
}
}
void colWisePrint(int arr[][4], int row, int col ){
for(int i=0; ... | ALGO | 0.999666 | 3.809015 |
a7876be1-ff27-41ab-aef7-ce1d53f191d9 | dhanujtomar/DSA | Linked List/reverse_Doubly_LinkedList.cpp | #include <iostream>
using namespace std;
class Node
{
public:
int data;
Node *next;
Node *prev;
Node(int val) : data(val), next(nullptr), prev(nullptr) {}
};
void push_back(Node *&tail, int val)
{
Node *temp = new Node(val);
tail->next = temp;
temp->prev = tail;
tail = temp;
}
void p... | ALGO | 0.999966 | 5.32975 |
92822534-fa9e-4321-8e75-48297cd1c8eb | sima17/Leetcode_Solutions | 2131-longest-palindrome-by-concatenating-two-letter-words/2131-longest-palindrome-by-concatenating-two-letter-words.cpp | class Solution {
public:
int longestPalindrome(vector<string>& words) {
unordered_map<string, int> map;
bool hascenter = false;
for (const string& word : words) {
map[word]++;
}
int equal = 0; // count of same-letter word pairs
int rev = 0; // count o... | ALGO | 0.999965 | 6.410047 |
7f94c2f4-b0c1-40a0-a2d5-58892f7382c9 | markoleptic/LeetCode-Practice | number-of-islands-200/main.cpp | #ifdef LC_LOCAL
#include "../parser.hpp"
#else
#define dbg(...)
#endif
/**
Given an m x n 2D binary grid grid which represents a map of '1's (land) and '0's (water), return the number of islands.
An island is surrounded by water and is formed by connecting adjacent lands horizontally or vertically. You may assume
all... | ALGO | 0.999961 | 6.378097 |
258493d5-93c3-4ce6-a7fb-e330fc736d33 | DaiyaCodes/CodeGalaxy | Prateek/DSA/Trees/Tree/minTimeToBurn.cpp | #include<bits/stdc++.h> // TREES
using namespace std;
using ll = long long;
class TreeNode{
public:
int data;
TreeNode* left;
TreeNode* right;
TreeNode(int data){
this->data = data;
left=right=NULL;
}
};
int minTimeToBurn(TreeNode* root,TreeNode* node){
if(!root)return 0... | ALGO | 0.999903 | 5.199815 |
035a58f6-e30a-499d-b53c-caf08fbd92c0 | jiho5993/solving_algorithm | BOJ/20437.cpp | #include <bits/stdc++.h>
using namespace std;
#define FASTIO ios_base::sync_with_stdio(false);cin.tie(0)
#define mp make_pair
#define pb push_back
#define all(x) (x).begin(),(x).end()
#define ll long long
#define sc(x) cin>>x;
#define sc2(x,y) cin>>x>>y
#define sc3(x,y,z) cin>>x>>y>>z
#define sc4(x,y,z,w) cin>>x>>y>>z... | ALGO | 0.999798 | 4.249454 |
9af1692e-5991-4c5e-b23c-bb8b3a0cd974 | SIEMENSIXONE/RISCV_Trace | riscv-trace/Juce/modules/juce_gui_basics/layout/juce_Grid.cpp | namespace juce
{
template <typename Item>
static Array<Item> operator+ (const Array<Item>& a, const Array<Item>& b)
{
auto copy = a;
copy.addArray (b);
return copy;
}
struct Grid::Helpers
{
struct AllTracksIncludingImplicit
{
Array<TrackInfo> items;
int numImplicitLeading; // The ... | TOOL | 0.8531 | 7.39216 |
e626c956-eeff-4241-95bb-bf86b796a120 | babyyu0/Programmers-BOJHub | C++/프로그래머스/0/181872. 특정 문자열로 끝나는 가장 긴 부분 문자열 찾기/특정 문자열로 끝나는 가장 긴 부분 문자열 찾기.cpp | #include <string>
#include <vector>
using namespace std;
string solution(string myString, string pat) {
return myString.substr(0, myString.rfind(pat) + pat.size());
} | ALGO | 0.998932 | 5.226416 |
6a07cfbf-600d-4e3b-a492-5256412d5a9b | keremerolce/C-Programin-Samples | C ile Bilgisayar Programlamaya Giriş/KarakterDizileriUygulamaları6/KarakterDizileriUygulamaları6/Source.cpp | #include <stdio.h>
#include <string.h>
#define uzunluk 5
int main()
{
char isim[uzunluk][8]={"Semra","Mustafa","Ceyhun","Asli","Leyla"};
char gecici[8];
int i,j,k;
puts("Isimleri Siralamadan Once: ");
for (i = 0; i < uzunluk; i++)
{
printf("%s\n",isim[i]);
}
for (k = 0; k < uzunluk-1; k++)
{
for (j = 0; j... | ALGO | 0.999896 | 3.715196 |
d38c8e35-80a9-4740-bfa5-ab8a83af3479 | divyanshgaba/Competitive-Coding | Find substring/main.cpp | /************************************
* AUTHOR: Divyansh Gaba *
* INSTITUTION: ASET, BIJWASAN *
************************************/
#include<bits/stdc++.h>
#define fast ios_base::sync_with_stdio(0); cin.tie(0);
#define F first
#define S second
#define PB push_back
#define MP make_pair
#define REP(i,a,b) for (in... | ALGO | 0.999934 | 3.568293 |
b7d68155-3130-4128-9765-24905b9757c1 | km-git007/DSA | 59-spiral-matrix-ii/spiral-matrix-ii.cpp | class Solution {
public:
vector<vector<int>> generateMatrix(int n)
{
vector<vector<int>> ans(n,vector<int>(n));
int top=0;
int bottom=n-1;
int left=0;
int right=n-1;
int a=1;
while(top<=bottom and left<=right)
{
for(int j=left;j<=righ... | ALGO | 0.999954 | 5.77491 |
d7315b4d-7298-4095-a436-a9b428cded55 | deepinsight230/LeetCode | 0872-leaf-similar-trees/0872-leaf-similar-trees.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.999934 | 6.345783 |
51ebce4c-84ef-4db7-b6a3-dc983d92186c | iRobot42/Codewars | 6 kyu/SNAP.cpp | #include <deque>
int snap( std::vector< std::string > flash_pile,
std::vector< std::string > turtle_pile ) {
std::deque< std::string > middle,
flash( flash_pile.cbegin(), flash_pile.cend() ),
turtle( turtle_pile.cbegin(), turtle_pile.cend() );
int turn{}, snaps{};
while ( !turtle.empty() ) {
... | ALGO | 0.986015 | 5.860174 |
44e7447b-8c33-4dd6-827e-f922c887e69d | SanjayM-2002/codeforces | Level800/A_Plus_or_Minus.cpp | #include <bits/stdc++.h>
using namespace std;
/*
Link: https://codeforces.com/problemset/problem/1807/A
Name: Plus or Minus
TC: O(t)
SC: O(1)
*/
int main () {
int t;
cin >> t;
while (t--) {
int a, b, c;
cin >> a >> b >> c;
if(a+b == c) cout << "+" << endl;
else if(a-b == c) ... | ALGO | 0.999973 | 5.204349 |
b9570aa7-9b33-46fc-8bc9-c215a8da2f24 | koparasy/openmp-rr | bolt/lib/Passes/Instrumentation.cpp | #include "bolt/Passes/Instrumentation.h"
#include "bolt/Core/ParallelUtilities.h"
#include "bolt/RuntimeLibs/InstrumentationRuntimeLibrary.h"
#include "bolt/Utils/Utils.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/RWMutex.h"
#include <stack>
#define DEBUG_TYPE "bolt-instrumentation"
using namespace... | TOOL | 0.870257 | 7.602157 |
c9eea260-f06e-49c8-bad7-cf718a7fe171 | boennecd/mssm | src/smoother.cpp | #include "smoother.h"
#include "fast-kernel-approx.h"
#ifdef MSSM_PROF
#include "profile.h"
#endif
using std::to_string;
inline void check_smoother_input
(problem_data &data, const std::vector<const arma::mat *> &particles,
const std::vector<const arma::vec *> &weights){
const unsigned n_periods = data.n_perio... | ALGO | 0.999932 | 6.064425 |
6a113622-c8e3-4117-93ec-f4dda2709631 | rishiiiidha/algo-haven | Codeforces/B_Seating_in_a_Bus.cpp | #include<bits/stdc++.h>
using namespace std;
#define all(x) (x).begin(),(x).end()
#define endl '\n'
#define int long long
const int MOD = 1e9+7;
const int INF = LONG_MAX >> 1;
bool compare(pair<int,int>p1,pair<int,int>p2){
return p1.second > p2.second;
}
void solve(){
int n;
cin >> n;
vector<int>v(n);
... | ALGO | 0.999977 | 4.975385 |
7290331f-af57-4aad-9178-e6cd5bc1f365 | utah-reilly/CMOS | cmos.cpp | //*****************************************************************************************
// Filename: cmos.cpp
// Authors: Hunter Smith and Johnathan Reilly
// Brief: A c++ program that uses the Winnowing algorithm to detect plagarism in
// pre-tokenized student sumbission files.
// **************************... | ALGO | 0.998886 | 5.854346 |
a354bc04-e7ec-4c0e-b5ec-3f4605df9811 | ngochahh2005/PTIT-code | CodePTIT-TRR/CT001 - Chu trình Euler 01.cpp | #include <bits/stdc++.h>
#define ll long long
#define pii pair<int, int>
#define mod 1000000007
#define lmt 1000000
using namespace std;
int n, m;
vector<set<int>> adj;
vector<int> deg, dd;
vector<int> rs;
void bfs(int x) {
queue<int> q;
q.push(x);
dd[x] = true;
while (q.size()) {
int u = q... | ALGO | 0.999962 | 4.6319 |
ff76613c-d7fa-458d-84bc-1a82e874fc4f | YJK0805/FCU_program_homework | 3rd/week5/D1109070_01.cpp | #include <bits/stdc++.h>
using namespace std;
long long find(long long cnt,long long n,long long a){
long long i = 1;
while(cnt * i % n != a){
i++;
}
return cnt * i;
}
int main(){
ios::sync_with_stdio(0);
cin.tie(0);
long long a[3],n[3];
for(int i = 0;i < 3;i++){
cin >> n[i] >> a[i]... | ALGO | 0.999923 | 3.826405 |
846b4b58-c62a-4c23-8f9c-ebfebdd67812 | smiz/sparse_fmi | test/Linsys2_check.cpp | #include <iostream>
#include <fstream>
#include <cmath>
#include <sstream>
using namespace std;
int main()
{
double e1max = 0.0, e2max = 0.0;
string line;
double t, x1, x2, dx1, dx2, A11, A12, A21, A22;
ifstream fin("Linsys2.dat");
int count = -1;
while (getline(fin,line))
{
count++;
stringstream ss( line ... | ALGO | 0.970396 | 3.422804 |
fd658be8-35b2-481a-9250-1ed37308a878 | xjhsafeguards/mit | eigen-eigen-323c052e1731/unsupported/doc/examples/MatrixLogarithm.cpp | #include <unsupported/Eigen/MatrixFunctions>
#include <iostream>
using namespace Eigen;
int main()
{
using std::sqrt;
MatrixXd A(3,3);
A << 0.5*sqrt(2), -0.5*sqrt(2), 0,
0.5*sqrt(2), 0.5*sqrt(2), 0,
0, 0, 1;
std::cout << "The matrix A is:\n" << A << "\n\n";
std::cout << "... | ALGO | 0.999247 | 3.621207 |
4420b6ac-0412-4801-adb3-1535c3240026 | TanbinHasan/UVa-Solutions | 10819 - Trouble of 13-Dots.cpp | #include <bits/stdc++.h>
#define int long long
using namespace std;
vector<pair<int,int>> ar(101);
vector<vector<int>> val;
int MaxVal(int n, int w, int sum) {
if (sum > w + 200) return INT_MIN;
if (n == 0) {
if ((sum <= w) || (sum > 2000 && sum <= w + 200)) return 0;
else return INT_MIN;
}
int &ret... | ALGO | 0.999927 | 4.185076 |
9fc16e44-72ec-4284-b4a8-d27caeed1c7d | LuxRender/Lux | core/reflection/fresnel/fresnelslick.cpp | // fresnelslick.cpp*
#include "fresnelslick.h"
#include "luxrays/core/color/swcspectrum.h"
using namespace lux;
void FresnelSlick::Evaluate(const SpectrumWavelengths &sw, float cosi,
SWCSpectrum *const f) const
{
*f = normalIncidence + (SWCSpectrum(1.f) - normalIncidence) *
powf(1.f - cosi, 5.f);
}
| ALGO | 0.952958 | 4.7674 |
1513e0f7-5529-4492-b489-bf83d4cc4389 | classicnerd/android_external_skia | gpu/src/GrRectanizer.cpp | #include "GrRectanizer.h"
#include "GrTBSearch.h"
#define MIN_HEIGHT_POW2 2
class GrRectanizerPow2 : public GrRectanizer {
public:
GrRectanizerPow2(int w, int h) : GrRectanizer(w, h) {
fNextStripY = 0;
fAreaSoFar = 0;
Gr_bzero(fRows, sizeof(fRows));
}
virtual ~GrRectanizerPow2... | TOOL | 0.892619 | 5.784253 |
fd27035f-557e-4cc5-8d94-352798d0cb63 | koksneo/MaNgOs | src/bindings/ScriptDev2/scripts/outland/tempest_keep/botanica/boss_laj.cpp | /* ScriptData
SDName: Boss_Laj
SD%Complete: 90
SDComment: Immunities are wrong, must be adjusted to use resistance from creature_templates. Most spells require database support.
SDCategory: Tempest Keep, The Botanica
EndScriptData */
#include "precompiled.h"
#define EMOTE_SUMMON -1553006
#define SPELL... | TOOL | 0.882465 | 4.301589 |
0220e9a4-405f-40f9-8773-1807d5ecbd6d | AhsanSabeeh/Metro_Application | pro_copy.cpp | #include <iostream>
#include <vector>
#include <unordered_map>
#include <algorithm>
#include <queue>
#include <stack>
#include <cmath>
#include<bits/stdc++.h>
#include <cstring>
using namespace std;
class Graph_M
{
public:
class Vertex
{
public:
unordered_map<string, int> nbrs;
};
static u... | ALGO | 0.986982 | 4.77708 |
1fe686a2-2fa7-4d9e-9b07-f572da19d132 | asu-crypto/mpsica | thirdparty/win/miracl/miracl_osmt/source/curve/pairing/zzn2.cpp | /*
* MIRACL C++ Implementation file zzn2.cpp
*
* AUTHOR : M. Scott
*
* PURPOSE : Implementation of class ZZn2 (Arithmetic over n^2)
*
* Note: This code assumes that
* p=5 mod 8
* OR p=3 mod 4
*/
#include "zzn2.h"
using namespace std;
zzn2* ZZn2::getzzn2(void) const ... | ALGO | 0.96866 | 5.362185 |
bdccb2f3-4633-4d0d-854c-dcbe74d6efa7 | Agarkova/Kate-gargar | LineMatrix.cpp | #include <iostream>
using namespace std;
int main()
{
setlocale(LC_ALL, "rus");
cout<<("\n\tОбъеденяем две таблицы в одну A+B=C\n");
int n = 10;
int A[10];
int B[10];
int C[20];
int k = 0;
for (int i = 0; i <n; i++) {
A[i] = (int)(rand()%10);
B[i] = (int)(rand() % 10);
C[k] = A[i]; C[k... | ALGO | 0.922124 | 3.200231 |
ec902421-c819-42ac-ae1f-4881904b57cd | MADHUSHUDHAN1/DSA-Questions. | powx-n/powx-n.cpp | class Solution {
public:
double pow_until(double x, long n)
{
if(n==0)
return 1.0;
if(n == 1)
return x;
if(n < 0)
return pow_until(1/x,-n);
double res=pow_until(x*x, n/2);
if(n%2)
res *= x;
return res;
}
dou... | ALGO | 0.999668 | 5.387219 |
920d38aa-5fbb-4ba0-a4bc-cf4dc7892a20 | MrCabbageStick/UNI-Parallel-Programming-Project | src/matrix_sum_1d.cpp | #include <iostream>
#include <ctime>
#include <cstdlib>
#include <omp.h>
#include "common.cpp"
using namespace std;
// ARRAY ALLOC //
const size_t small_matrix_size = 2'000;
const size_t large_matrix_size = 100'000;
float *small_matrix_1 = new float[small_matrix_size * small_matrix_size];
float *small_matrix_2 = n... | ALGO | 0.968836 | 4.783633 |
90a2795a-cf3c-4e98-9dcc-d9459464be70 | Mephisto1024/MFST_Engine | Engine/Source/Runtime/SignalProcessing/Private/ConstantQ.cpp | #include "DSP/ConstantQ.h"
#include "CoreMinimal.h"
#include "DSP/FloatArrayMath.h"
namespace Audio
{
namespace PseudoConstantQIntrinsics
{
void FillArrayWithTruncatedGaussian(const float InCenterFreq, const float InBandWidth, const int32 InFFTSize, const float InSampleRate, FAlignedFloatBuffer& OutOffsetArray, in... | ALGO | 0.993094 | 6.006944 |
fa849107-44df-4b88-a8c5-30cb0c418af7 | 113bommy/deepmind_codecontests_refine | cpp_source_filter_file/cpp_valid_69_17.cpp | #include <bits/stdc++.h>
using namespace std;
string pow2[70];
void precalc() {
int i = 1;
int cur = 0;
while (cur < 61) {
pow2[cur] = to_string(i);
i *= 2;
cur++;
}
}
long long calc(string a, string b) {
int i = 0, j = 0;
while (i < a.length() && j < b.length()) {
if (a[i] == b[j]) {
... | ALGO | 0.999633 | 4.795484 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.