uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
19ad52a8-8569-485d-b4eb-cda80cbab1da | Rrbansal/leetcode_graphs | leetcode_1584_min_cost_to_connect_all_pairs.cpp |
struct edge
{
int src;
int dst;
int wt;
};
bool cmp(edge e1,edge e2)
{
return e1.wt<e2.wt;
}
class Solution {
public:
vector<int>par;
vector<int>r;
int find(int a)
{
if(par[a]==a) return a;
return find(par[a]);
}
void un(int a,int b)
{
a=find(a);
b=find(b);
if(a==b) return;
if(r... | ALGO | 0.999985 | 5.40611 |
2838544c-1e67-48ca-b5d9-96152702cff6 | panferovi/Matrix | main.cpp | #include "matrix.hpp"
int main()
{
size_t size{0};
std::cin >> size;
matrix::LazyMatrix<double> m(size);
matrix::Fill(std::cin, m);
std::cout << m.Determinant() << std::endl;
return 0;
} | ALGO | 0.99272 | 5.237884 |
5e6e2239-cc4e-48b2-ac6a-c6a9f09f174e | abnsl0014/Coding-Questions | CF(Code Forces)/cf9.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
int n,a;
cin>>n;
vector<pair<int,int> >v;
for(int i=1;i<=n;i++)
{
cin>>a;
v.push_back(make_pair(a,i));
}
sort(v.begin(),v.end());
for(int i=1;i<=n;i++)
{
cout<<v[i].second<<" ";
}
cout<<endl;
... | ALGO | 0.999859 | 3.286068 |
f01fe95d-213c-4011-ac21-22235e0d2460 | kisang0365/baekjoonAlgorithm | 2108.cpp | /*
* 2108.cpp
*
* Created on: 2017. 4. 19.
* Author: chokisang
*/
#include<iostream>
#include<algorithm>
#include<vector>
using namespace std;
int arr[500000];
int temp[8001] = {0, };
double one(int N){
double sum = 0;
for(int i=0; i<N; i++){
sum +=arr[i];
temp[arr[i]+4000]++;
}
sum/=N;
return s... | ALGO | 0.999763 | 3.609884 |
2e33119b-cae0-4a1e-8218-6f0c2db9650b | Babal1111/learning_dsa | PepClass/linkedlist/Traversing.cpp | #include<iostream>
using namespace std;
int couu=0;
struct Node{
public:
int data;
Node* next;
Node(int value){
data = value;
next = NULL;
}
};
void traversing(Node *head){
Node* temp = head;
while (temp!=NULL)
{
cout<<temp->data<<" ";
temp=temp->next;
}... | ALGO | 0.99981 | 3.682309 |
93369cd1-3fb2-41f8-bb2b-1c97642cb176 | ishandutta2007/codeforces | dormi/normal/1183/D.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long int lli;
int main(){
cin.tie(NULL);
ios_base::sync_with_stdio(false);
int q;
cin>>q;
while(q--){
int n;
cin>>n;
int am[n];
memset(am,0,sizeof(am));
int in;
for(int i=0;i<n;i++){
cin>>in;
am[(in-... | ALGO | 0.999902 | 3.983359 |
fa520a87-37c0-4ccc-8b33-1eaa256e7603 | HeatCrab/Compiler | HW1/input/subtask12-loop2/testcase01.cpp | int main(string argv[]) {
int counter = 0;
while( counter < 100000 ) {
counter += 1;
if( counter == 99999 ) {
break;
}
if( counter % 91 == 0 ) {
cout << "Hello World " << counter % 91 << endl;
}
cout << 998244353 % counter << endl;
}... | ALGO | 0.995111 | 3.702946 |
7cc857f6-0109-405c-8d55-b7acf6aa8413 | devjwsong/algorithm-study | leetcode/160.cpp | #include <iostream>
using namespace std;
struct ListNode {
int val;
ListNode *next;
ListNode(int x) : val(x), next(NULL) {}
};
class Solution {
public:
int get_len(ListNode *head) {
ListNode *cur = head;
int len = 0;
while(cur != nullptr) {
++len;
cur =... | ALGO | 0.999407 | 5.272048 |
0ade107f-649b-466c-a4ab-69bef5526f7f | Kyrollo/OOP-project-3 | project descrption/NimBacktracking.cpp | #include <iostream>
#define NO_GOOD_MOVE 0
#define MAX_MOVE 3
#define N_COINS 23
#define HUMAN 1
#define COMPUTER 0
using namespace std;
bool isBadPosition(int nCoins);
int findGoodMove(int nCoins) {
for (int n = 1; n <= MAX_MOVE; n++)
if (isBadPosition(nCoins - n))
return n;
return NO_GOOD_MOVE;
}
bool is... | ALGO | 0.999767 | 4.525125 |
768b743b-d8c4-4f06-8e1b-19d6220fa837 | SinnoLn/AlgorithmStudy | 프로그래머스/0/120816. 피자 나눠 먹기 (3)/피자 나눠 먹기 (3).cpp | #include <string>
#include <vector>
using namespace std;
int solution(int slice, int n) {
int answer = n/slice;
if(n%slice != 0) answer++;
return answer;
} | ALGO | 0.997706 | 3.100651 |
a4722205-ad8f-466b-872f-d87e941dcee4 | ishandutta2007/codeforces | natsugiri/normal/711/B.cpp | #include<cstdio>
#include<iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<cstring>
using namespace std;
typedef long long LL;
typedef vector<int> VI;
#define REP(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define EACH(i,c) for(__typeof((c).begin()) i=(c).begin(),i##_end=(c).end();i!=i##_e... | ALGO | 0.999985 | 3.295885 |
9cdf7002-8588-4332-b204-344f01331bd9 | Amylo-jh/baekjoon | 17000s/17496.cpp | #include <iostream>
using namespace std;
int main()
{
int n, t, c, p;
cin >> n >> t >> c >> p;
cout << (n-1)/t*c*p;
} | ALGO | 0.999383 | 3.519832 |
155a1598-08c8-4d27-8fcc-1d4e0f7411a6 | NguyenLabJHU/Tahoe-FEM | tahoe-dev/src/elements/cohesive_surface/cohesive_models/MR_NodalRP2DT.cpp | /* $Id: MR_NodalRP2DT.cpp,v 1.23 2010-03-19 14:12:01 skyu Exp $ */
#include "MR_NodalRP2DT.h"
#include "ifstreamT.h"
#include "ofstreamT.h"
#include "dArrayT.h"
#include "ParameterUtils.h"
using namespace Tahoe;
/* class parameters */
const int knumDOF = 2;
/* state variable information */
const int kNumState =
... | ALGO | 0.990666 | 5.389681 |
e3f18f9a-8b3e-4cba-8a68-fb689af9ef47 | zhumingxuan2013/learning | 学习/课上/埃式筛法.cpp | #include <iostream>
using namespace std;
long long pr[100000101],g;
bitset<100000001> ans;
void p(long long n){
for(long long i=2; i<=n; i++){
if(ans[i]==0){
pr[++g]=i;
for(long long j=2; i*j<=n; j++)
ans[i*j]=1;
}
}
return;
}
int main() {
long long n... | ALGO | 0.999898 | 3.734341 |
b95ba5e5-8c54-4ff4-959e-c38a036ed75f | MurphyBrandonGao/LeetCode | problems/206-Reverse-Linked-List/206-Reverse-Linked-List/main.cpp | #include <iostream>
using namespace std;
//Definition for singly-linked list.
struct ListNode {
int val;
ListNode *next;
ListNode(int x) : val(x), next(NULL) {}
};
ListNode* createLinkedList(int arr[], int n) {
if (n == 0)
return NULL;
ListNode* head = new ListNode(arr[0]);
ListNode* curNode = hea... | ALGO | 0.999972 | 5.650907 |
57412595-2843-4815-9402-a02e3373d29d | xNhatMinh/Data-structures-and-algorithms | Ex2.2.4.cpp | #include <iostream>
#include <algorithm>
using namespace std;
#define SIZE 10001
void insert(int* arr, int x, int k, int& size) {
if (k >= size) {
arr[size] = x;
++size;
}
else {
for (int i = 0; i < size; i++)
{
if (i == k) {
for (int j = size; j >= i; j--) {
arr[j] = arr[j - 1];
}
arr... | ALGO | 0.999733 | 3.594349 |
48510feb-ddee-4ad3-937a-a827582718a0 | raincross7/code-similarity | codes/train_code/problem021/problem021_499.cpp | #include<bits/stdc++.h>
using namespace std;
int main() {
int a,b;
cin>>a>>b;
if((a==1 && b==2)|| (a==2 &&b==1))
cout<<"3";
else if((a==1 && b==3)|| (a==3 &&b==1))
cout<<"2";
else
cout<<"1";
}
| ALGO | 0.999983 | 3.547644 |
1ef2bbfc-9bcd-4245-b7e5-dfe93c278d20 | bfeng/CryptoGRU | third_party/cryptoTools/thirdparty/linux/miracl/miracl_osmt/source/curve/modpol.cpp | //
// Program to generate Modular Polynomials mod p, as required for fast
// implementations of the Schoof-Elkies-Atkins algorithm
// for counting points on an elliptic curve Y^2=X^3 + A.X + B mod p
//
// Implemented entirely from the description provided in:
// 1. "Distributed Computation of the number of points on an... | ALGO | 0.997286 | 3.804862 |
c114aa0c-3990-4d1e-9f5b-b5575b16c439 | MaxTrgb/HW_OOP_1109 | 040923/040923/040923.cpp | #include <iostream>
#include <ctime>
#include "Node.h"
using namespace std;
// Function to add a new node with a character value to the end of the linked list
void putNodeToTail(Node*& head, char value) {
Node* n = new Node(value);
// If the linked list is empty, set the new node as the head
if (head == n... | ALGO | 0.999398 | 6.03313 |
95f02def-10ac-47e6-87ba-5d5a591db4ea | asahai17/demo_listing_247 | windows/runner/utils.cpp | #include "utils.h"
#include <flutter_windows.h>
#include <io.h>
#include <stdio.h>
#include <windows.h>
#include <iostream>
void CreateAndAttachConsole() {
if (::AllocConsole()) {
FILE *unused;
if (freopen_s(&unused, "CONOUT$", "w", stdout)) {
_dup2(_fileno(stdout), 1);
}
if (freopen_s(&unuse... | TOOL | 0.998733 | 6.76775 |
8e5115f0-5599-4d76-8e00-6bcfa4df7879 | agraham3/NerualNetworkSimulation | src/Learn.cpp | #include <cstdlib>
#include <algorithm>
#include "Learn.h"
#include "AbstractFactory.h"
#include "Exceptions.h"
#include "Config.h"
void Learn::insert(Object* r) {
if (r->id() != "robot")
throw NotARobot();
object_.push_back(r);
}
int Learn::score(Object* o) {
int points = 0;
points += o->score();
points += o... | ALGO | 0.945539 | 3.075262 |
a8b1f82f-d799-410f-9764-4cadda1b02c3 | cavallo5/cpp_scripts | src/fattoriale_funzioni_ricorsive.cpp | #include<iostream>
#include<cstdlib>
using namespace std;
int fatt(int x);
int main() {
int numero, fattoriale;
cout << "Inserire il numero: ";
cin >> numero;
fattoriale = fatt(numero);
cout << "Il fattoriale e' " << fattoriale << endl;
return 0;
}
int fatt(int x) {
if (x == 0) return 1... | ALGO | 0.998373 | 4.928326 |
5ba871ae-f264-49ea-ae25-5afc9807e9a7 | hklcf/firmware-mod-kit | src/others/squashfs-4.2/lzma-4.65/CPP/7zip/Compress/ByteSwap.cpp | // ByteSwap.cpp
#include "StdAfx.h"
#include "ByteSwap.h"
STDMETHODIMP CByteSwap2::Init() { return S_OK; }
STDMETHODIMP_(UInt32) CByteSwap2::Filter(Byte *data, UInt32 size)
{
const UInt32 kStep = 2;
UInt32 i;
for (i = 0; i + kStep <= size; i += kStep)
{
Byte b = data[i];
data[i] = data[i + 1];
d... | ALGO | 0.972843 | 5.355546 |
aec5c7a9-8142-4d28-bad5-3b1f16892923 | kalvaakhil/BYTE-TRACK | ByteTrack-main/deploy/TensorRT/cpp/src/lapjv.cpp | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "lapjv.h"
/** Column-reduction and reduction transfer for a dense cost matrix.
*/
int_t _ccrrt_dense(const uint_t n, cost_t *cost[],
int_t *free_rows, int_t *x, int_t *y, cost_t *v)
{
int_t n_free_rows;
boolean *unique;
for (uint_t i = 0; i < n... | ALGO | 0.999807 | 5.257858 |
f94869a2-5c3f-4230-8527-f2febc4f7dc7 | AYUSH-002/COMPETITVE-CODING-450 | ARRAY/alternatePosNeg.cpp | class Solution{
public:
void rearrange(int arr[], int n) {
vector<int>pos;
vector<int>neg;
for(int i=0;i<n;i++)
{
if(arr[i]>=0)
{
pos.push_back(arr[i]);
}
if(arr[i]<0)
{
neg.push_back(arr[i]);
}
}
reverse(pos.begin(),pos.e... | ALGO | 0.999974 | 4.843601 |
9b63c107-6a4e-4cf0-973a-acb2fae06ea3 | itsAMd22/Competitive_Programming | Phase 1/Part 1/Class 3/Practice/18.Toph_SubsetAND.cpp | #include<bits/stdc++.h>
using namespace std;
#define Alhamdulillah ios_base::sync_with_stdio(0), cin.tie(0);
#define ll long long
#define ull unsigned long long
#define endl '\n'
#define db(i) cout << "c -> " << i << endl;
#define pv(v) for(auto e : v) cout << e << " "; cout << endl;
#define pm(m) for(auto [x,y] :... | ALGO | 0.999922 | 4.436833 |
36eeaa8e-f1b2-437d-9c56-ec2f1b429823 | SuyashChavanOfficial/DSA | Lecture-8/Problems/Que3.cpp |
// An arithmetic array is an array that contains at least two integers and the differences
// between consecutive integers are equal. For example, [9, 10], [3, 3, 3], and [9, 7, 5, 3] are
// arithmetic arrays, while [1, 3, 3, 7], [2, 1, 2], and [1, 2, 4] are not arithmetic arrays.
// Sarasvati has an array of N non-n... | ALGO | 0.997547 | 5.238134 |
e5525b2a-eb49-45bd-868d-806a799ed681 | RitaPlusPlus/image-processing | median_filter.cpp | #include <vector>
#include "median_filter.h"
using namespace std;
MedianFilter::MedianFilter()
{
}/* MedianFilter */
QImage MedianFilter::applyMedianFilter(const unsigned char* image_bits, const int row, const int col, QImage::Format image_format)
{
QImage new_image(row ,col , image_format);
unsigned char* ... | ALGO | 0.998853 | 5.682738 |
c5f7638d-a86a-4c7b-85aa-648660aef4a6 | TRDizer/CSC417_rigid-body-collision | extern/libigl/include/igl/embree/unproject_in_mesh.cpp | template <typename Derivedobj>
IGL_INLINE int igl::embree::unproject_in_mesh(
const Eigen::Vector2f& pos,
const Eigen::Matrix4f& model,
const Eigen::Matrix4f& proj,
const Eigen::Vector4f& viewport,
const EmbreeIntersector & ei,
Eigen::PlainObjectBase<Derivedobj> & obj,
std::vector<igl::Hit > & hits)
{
u... | ALGO | 0.874079 | 6.235065 |
cc990de8-5218-4a52-a225-4e04885a7ba4 | vdevmcitylp/graphs | depthFirstSearch.cpp | #include <bits/stdc++.h>
using namespace std;
struct edge
{
int b;
int w;
edge(int _b, int _w)
{
b = _b;
w = _w;
}
};
void dfsUtil(int vertex, vector <edge> graph[], int numNodes, int numEdges, int visited[])
{
cout<<vertex<<" ";
visited[vertex] = 1;
int adjacentLength = graph[vertex].size();
for(int... | ALGO | 0.999856 | 4.413979 |
c702abf3-ddb3-418f-ad2c-0fae0c702731 | nishgpt/competitive_programming | atcoder/practice/abc174A.cpp | /*
Author : Nishant Gupta 2.0
*/
#include<bits/stdc++.h>
using namespace std;
#define LL long long int
#define getcx getchar_unlocked
#define X first
#define Y second
#define PB push_back
#define MP make_pair
#define MAX 100005
#define LOG_MAX 20
#define MOD 1000000007
#define INF 0x3f3f3f3f
#define INFL (LL(1e18)... | ALGO | 0.999521 | 3.078063 |
73c5d6b9-ea0a-410d-a3f2-711fe058cb2c | Imagine-Programming/kfclient | kfclient-cli/kfclient-cli.cpp | #include <boost/asio.hpp>
#include <kfclient.hpp>
#include <fmt/core.h>
#include <fmt/format.h>
#include <fmt/ostream.h>
#include <fort.hpp>
#include "definition.hpp"
#include <memory>
using udp = boost::asio::ip::udp;
#if defined(WIN32) || defined(WIN64)
static inline const ft_border_style* TABLE_BORDER_STYLE ... | TOOL | 0.877323 | 7.407364 |
f35f7a7b-912b-4894-99b9-5e9dcd92d7c7 | SifatSwapnil2022/Codeforces_Solution | A. Quintomania.cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
int the_test_cases;
cin>>the_test_cases;
while(the_test_cases--){
int numMelodies;
cin>>numMelodies;
int flag=1;
int arr_melodies[numMelodies];
for(int i=0;i<numMelodies;i++){
... | ALGO | 0.999741 | 4.328849 |
b97220f5-5f46-4cd0-a3f0-d30bad534d09 | alexandraback/datacollection | solutions_2464487_1/C++/pdwd/A.cpp | #include <cstdio>
#include <cstdlib>
#include <iostream>
#include <fstream>
#include <sstream>
#include <set>
#include <map>
#include <vector>
#include <list>
#include <algorithm>
#include <cstring>
#include <cmath>
#include <string>
#include <queue>
#include <bitset> //UWAGA - w czasie kompilacji musi byc znany rozmi... | ALGO | 0.999726 | 4.551073 |
87269547-8f79-4108-87ba-d66e949d07ca | tyask/procon | atcoder/abc/abc066/C/main.cpp | #include <bits/stdc++.h>
namespace {
using namespace std;
using ll = long long;
using ld = long double;
using ull = unsigned long long;
using uint = unsigned int;
template<typename T> using vec = vector<T>;
template<typename T> using vvec = vec<vec<T>>;
const ll LINF=0x1fffffffffffffff;
const ll MINF=0x7ffffffff... | ALGO | 0.999839 | 3.723039 |
3a25613f-71f7-462f-bed2-34c3587c4065 | 113bommy/deepmind_codecontests_refine | cpp_source_filter_file/cpp_train_9206_10.cpp | #include <bits/stdc++.h>
using namespace std;
vector<int> l;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
;
int n, m;
cin >> n >> m;
int a[n];
for (int i = 0; i < n; i++) cin >> a[i];
int x, y;
long long ans = 0;
while (m--) {
cin >> x >> y;
ans += min(a[x], a[y]... | ALGO | 0.999965 | 4.258465 |
125f4235-206c-4b04-a2ac-68891d7fd653 | YeKYLI/leetcode | 待整理/leetcode-0.2.0/solution/1500-1599/1537.Get the Maximum Score/Solution.cpp | class Solution {
public:
int maxSum(vector<int>& nums1, vector<int>& nums2) {
const int mod = 1e9 + 7;
int m = nums1.size(), n = nums2.size();
int i = 0, j = 0;
long long f = 0, g = 0;
while (i < m || j < n) {
if (i == m) {
g += nums2[j++];
... | ALGO | 0.99999 | 6.053882 |
f158f501-424a-49d3-b538-8bd2cbe6c5c9 | IIIIIIIIIU/TXT | QBXT20171001/D5C1/det.cpp | #include <algorithm>
#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <cmath>
using namespace std;
int x, n, m, y;
int gcd(int x, int y) {
if (!x) return y;
else return gcd(y % x, x);
}
bool solve() {
scanf("%d%d", &n, &m);
x = 0;
for (int i = 0; i < n; ++i) {
scanf("%d"... | ALGO | 0.999914 | 3.440829 |
2fe91b72-2b63-462a-bc67-20cc95f4f8c8 | ArturGC79/lista-4-cpe | QUESTÃO 3 (1).cpp | #include <iostream>
using namespace std;
int main()
{
int num, orig, reverso = 0, dig;
cin >> num;
orig = num;
while (num != 0) {
dig = num % 10;
reverso = reverso * 10 + dig;
num /= 10;
}
if (orig == reverso) {
cout << "O nmero " << orig << " um palndr... | ALGO | 0.999908 | 5.212992 |
39cc16bb-532b-4d30-81f4-38e2239ca30c | InnoFang/algo-set | LeetCode/0797. All Paths From Source to Target/solution.cpp | /**
* 30 / 30 test cases passed.
* Runtime: 12 ms
* Memory Usage: 10.4 MB
*/
class Solution {
public:
vector<vector<int>> allPathsSourceTarget(vector<vector<int>>& graph) {
vector<vector<int>> ans;
vector<int> curr { 0 };
dfs(graph, 0, ans, curr);
return ans;
}
void dfs... | ALGO | 0.999871 | 6.410263 |
a63d14d1-5a8b-4360-8d0e-632c7d52b721 | danzeng8/MultiTopo | third_party/boost_1_62_0/libs/compute/perf/perf_sort.cpp | #include <algorithm>
#include <iostream>
#include <vector>
#include <boost/program_options.hpp>
#include <boost/compute/system.hpp>
#include <boost/compute/algorithm/sort.hpp>
#include <boost/compute/algorithm/is_sorted.hpp>
#include <boost/compute/container/vector.hpp>
#include "perf.hpp"
namespace po = boost::pro... | ALGO | 0.996332 | 6.241895 |
8aff0802-5b5d-404c-a4c6-05db0496ecf0 | farhadreza/LeetCode_Solutions | judgeSquareSum.cpp | bool judgeSquareSum(int c) {
if(c<0) return false;
long low=0, high=sqrt(c);
while(low<=high){
long mid= (low*low+high*high);
if(mid==c) return true;
else if(mid>c)high=high-1;
else low=low+1;
}
return fals... | ALGO | 0.999945 | 3.89812 |
28b3ef93-013b-487f-9049-58ed0095f3ef | sarvex/leetcode-v | solution/1400-1499/1426.Counting Elements/Solution.cpp | class Solution {
public:
int countElements(vector<int>& arr) {
unordered_set<int> s(arr.begin(), arr.end());
int ans = 0;
for (int x : arr) {
ans += s.count(x + 1);
}
return ans;
}
}; | ALGO | 0.999838 | 5.588897 |
6c8bbab7-5839-4381-b5a9-3b7dec930eee | SW-H/Algorithm | codetree/산타의선물공장.cpp | // 시간 초과
// m : 벨트 개수
#include <iostream>
using namespace std;
typedef struct _Box {
int status; // 1 : 정상, -1 : 삭제/하차
long long id;
long long weight;
int belt;
_Box *next;
_Box *prev;
} Box;
typedef struct _Belt {
int status; // 1 : 정상, -1 : 고장
Box *front;
Box *back;
} Belt;
Box... | ALGO | 0.99915 | 3.701062 |
52fcc120-ac26-4360-ae96-3fae9e6f0478 | 113bommy/deepmind_codecontests_refine | cpp_source_filter_file/cpp_train_9501_12.cpp | #include <bits/stdc++.h>
using namespace std;
long long sqr(long long x) { return x * x; }
int main() {
ios_base::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
long long t;
cin >> t;
while (t--) {
long long n;
cin >> n;
string s;
cin >> s;
long long i = 1, start = 0, ans = 0;
whil... | ALGO | 0.999951 | 4.10458 |
8cbbfe58-d58e-416e-9294-f1ecf8588dd8 | BystrickyK/Algorithms-DataStructures | advanced-algorithms/LinProg_Week2/energy_values/energy_values.cpp | #include <cmath>
#include <iostream>
#include <vector>
const double EPS = 1e-6;
const int PRECISION = 4;
typedef std::vector<double> Column;
typedef std::vector<double> Row;
typedef std::vector<Row> Matrix;
struct LinearSystem {
LinearSystem(const Matrix &a, const Column &b):
a(a),
b(b)
{}
... | ALGO | 0.999548 | 4.299517 |
5a991484-98f1-4562-a86a-603ce68d751e | namanmahajan2020/COFFEE-APP-UI | windows/runner/utils.cpp | #include "utils.h"
#include <flutter_windows.h>
#include <io.h>
#include <stdio.h>
#include <windows.h>
#include <iostream>
void CreateAndAttachConsole() {
if (::AllocConsole()) {
FILE *unused;
if (freopen_s(&unused, "CONOUT$", "w", stdout)) {
_dup2(_fileno(stdout), 1);
}
if (freopen_s(&unuse... | TOOL | 0.998733 | 6.76775 |
ca117006-4f22-4298-9581-f86f9e7bebd7 | JieY02/Computer-Graphics-CWK1 | triangles-test/helpers.cpp | #include "helpers.hpp"
#include "../draw2d/color.hpp"
#include "../draw2d/surface.hpp"
ColorU8_sRGB find_most_red_pixel( Surface const& aSurface )
{
ColorU8_sRGB ret{ 0, 0, 0 };
auto const stride = aSurface.get_width() << 2;
for( std::uint32_t x = 0; x < aSurface.get_width(); ++x )
{
for( std::uint32_t y = 0; ... | ALGO | 0.893218 | 5.870235 |
04a27581-f981-4af9-aa20-1f0d1d59b1b7 | zhumake1993/physx | d3d12-physx/PhysXSDK/source/geomutils/src/pcm/GuPCMContactPlaneConvex.cpp | #include "geomutils/GuContactBuffer.h"
#include "GuVecConvexHull.h"
#include "GuGeometryUnion.h"
#include "GuContactMethodImpl.h"
#include "GuPersistentContactManifold.h"
namespace physx
{
namespace Gu
{
bool pcmContactPlaneConvex(GU_CONTACT_METHOD_ARGS)
{
PX_UNUSED(shape0);
PX_UNUSED(renderOutput);
using namespac... | ALGO | 0.979691 | 7.056293 |
bd38a810-7ec4-4a49-a2c6-9ee853c0a219 | ganeshpawar09/Data-Structures-and-Algorithms | 3_Binary_Search/5_Allocate_Book.cpp | // max no of pages
// alloted is minimum
#include<iostream>
using namespace std;
bool is_max(int *arr,int mid, int size, int student)
{
int pages=0;
int s1=1;
for (int i = 0; i < size; i++)
{
if(arr[i]>mid) return false;
if(pages+arr[i]>mid)
{
pages=arr[i];
... | ALGO | 0.999829 | 3.956953 |
b4cd4968-4a72-4ea7-84dd-f2ce72ed63a7 | LeavesLin/category | 模板/fhqtreap.cpp | #include <bits/stdc++.h>
const int kN = 1e5+10;
struct Node {
Node *ch[2];
int val, pri, size;
void maintain() {
size = 1;
if (ch[0]) size += ch[0]->size;
if (ch[1]) size += ch[1]->size;
}
}pool[kN];
int cnt = 0;
class FhqTreap {
public:
Node *root, *x, *y, *z;
void insert(int val) {
split(... | ALGO | 0.999882 | 4.385285 |
06bcac4c-e329-4b32-9097-1d3abdd6607a | SwapnanilHalder/CodingFiles | CodeChef/April_Lunchtime_2021/SPTREE.cpp | #include <iostream>
#include <string>
#include <sstream>
#include <vector>
#include <algorithm>
#include <iterator>
#include <list>
#include <map>
#include <set>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <numeric>
#define pi 3.1415926535897932384626
#define MOD 1000000007
#define... | ALGO | 0.999239 | 4.170549 |
6f6344d0-e3fd-4c82-be0f-e9f35a443447 | Sasanka-GRS/Concepts-of-Multi-Threading-and-Networking | q3/server.cpp | #include <bits/stdc++.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/stat.h>
#include <netinet/in.h>
#include <unistd.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <fcntl.h>
using namespace std;
int adjacency[1000][1000];
int shortestDistances[1000];
vector<int> path;
vector<vector<int>>... | ALGO | 0.999971 | 4.443098 |
f5a408f8-aa34-4a25-9ca5-d0fdb86d67d8 | Kanishk-byte/100-Days-Code | Module 5 (Arrays)/Arrays - 2 (2)/Assingment/2.cpp | #include <bits/stdc++.h>
#include <cmath>
#include <algorithm>
#include <vector>
#include <string>
using namespace std;
// * Ques : WAP to find the largest three elements in the array.
int main()
{
vector<int> v;
int size = v.size();
cout << "Enter size : ";
cin >> size;
cout << "Enter element... | ALGO | 0.999909 | 3.738449 |
eb2a3d9a-8d4b-4aac-948c-1e124c145c59 | yfuka86/pc | atcoder/abcold/abc237/g/abc237_gol.cpp | #pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
#define rep(i,n) for(ll i=0;i<(ll)(n);i++)
#define rep_r(i,n) for(ll i=(ll)(n)-1;i>=0;i--)
#define rep2(i,sta,n) for(ll i=sta;i<(ll)(n);i++)
#define rep2_r(i,sta,n) for(ll i=(ll)(n)-1;i>=sta;i--)
#define all(v) (v).begin(),(v).end()
#define rall(v) (v).rbegin(),(v)... | ALGO | 0.999855 | 3.869313 |
92efa74f-fed1-41f7-b463-a459eb4b6c65 | BahaaElMekkawy/Leetcode | 2843-count-symmetric-integers/2843-count-symmetric-integers.cpp | class Solution {
public:
int countSymmetricIntegers(int low, int high) {
int count = 0;
for (int num = low; num <= high; ++num) {
int temp = num;
int digits = 0;
// Count number of digits
while (temp > 0) {
digits++;
t... | ALGO | 0.999903 | 6.431305 |
8d3f1222-4c8b-4e8c-b432-20577fb20c18 | bollig/viennacl | tests/src/generator_matrix_vector_product.cpp | //
// *** Boost
//
#include <boost/numeric/ublas/io.hpp>
#include <boost/numeric/ublas/triangular.hpp>
#include <boost/numeric/ublas/matrix_sparse.hpp>
#include <boost/numeric/ublas/matrix.hpp>
//
// *** ViennaCL
//
// #define VIENNACL_DEBUG_ALL
// #define VIENNACL_HAVE_UBLAS 1
// #define VIENNACL_DEBUG_CUSTOM_OPERA... | TEST | 0.937784 | 6.083077 |
7e1be340-ebbb-4f80-8406-e97578a54a16 | linux-wang/jobdu-onlinejudge | 1369.cpp | /*
http://ac.jobdu.com/problem.php?pid=1369
治 ==˽
ݹ
*/
/*
* Author: Corey Huang
* Created Time: 2014?06?07? ??? 16?33?41?
* File Name: 1369_1.cpp
*/
#include <iostream>
#include <cmath>
#include <algorithm>
#include <string>
#include <vector>
using namespace std;
vector<string> svec;
vector<string>::iterator it... | ALGO | 0.999958 | 4.34269 |
83c453c8-5f5d-4824-98ae-df2475cc70de | vfolunin/archives-solutions | LeetCode/2524.cpp | struct Counter {
inline static const long long MOD = 1e9 + 7;
unordered_map<int, int> count;
long long sum = 0;
long long binPow(long long x, long long p, long long mod) {
if (!p)
return 1;
if (p % 2)
return binPow(x, p - 1, mod) * x % mod;
long long r = ... | ALGO | 0.999995 | 5.780737 |
0fe28668-7e8f-44e5-8364-c0c4d034016c | victoryAshe/Algorithm | cppAlgorithm/DataStructure15_2017110060 강수연.cpp | // 22-1 자료구조 과제물 #15 DFS 탐색 프로그램 완성
#include <iostream>
#include <vector>
using namespace std;
bool visited[9];
vector<int> graph[9];
void dfs(int x)
{
visited[x] = true;
cout << x << " ";
for (int i = 0; i < graph[x].size(); i++) // 인접한 노드 사이즈만큼 탐색
{
int y = graph[x][i];
if (!visited[... | ALGO | 0.999891 | 5.219881 |
a8b30476-acc1-47e2-8c89-270c77b28d70 | Chunting/LeetCode_Chunting | LeetCode/preorderTraversal.cpp | /****************************************************************************
Given a binary tree, return the preorder traversal of its nodes' values.
For example:
Given binary tree {1,#,2,3},
1
\
2
/
3
return [1,2,3].
Note: Recursive solution is trivial, could you do it iteratively?
@Author ... | ALGO | 0.999978 | 5.766685 |
deddc577-7bbe-4fd0-9fe0-8fb9ee935ee5 | facebookarchive/BOLT | llvm/lib/CodeGen/GlobalISel/Localizer.cpp | #include "llvm/CodeGen/GlobalISel/Localizer.h"
#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/Analysis/TargetTransformInfo.h"
#include "llvm/CodeGen/MachineRegisterInfo.h"
#include "llvm/CodeGen/TargetLowering.h"
#include "llvm/InitializePasses.h"
#include "llvm/Support/Debug.h"
#define ... | TOOL | 0.906796 | 7.941084 |
b03df5e2-c6bf-4bb4-a38c-dd121dc5558b | Data1-Pirates/6Companies30DaysChallenge | Adobe/15_Check_Library_Version.cpp | /*
Your task:
Given two library versions of an executable: for example, “<IP_ADDRESS>” and “<IP_ADDRESS>” or “10” and “10.1”.
Find out which one is more recent?
*/
#include <bits/stdc++.h>
using namespace std;
bool checkVersion(string str1, string str2)
{
int n1 = str1.length();
int n2 = str2.length();
i... | ALGO | 0.961795 | 3.886343 |
b1fc0ddf-0e80-4a7d-bf67-ce09c0ab016d | Alexmnzlms/MH | Practicas/Practica1/src/cc.cpp | #include "cc.h"
CCP::CCP(const int n, const std::string p, const std::string r){
n_cluster = n;
desv_gen = 0;
infactibilidad = 0;
lambda = 0;
f_objetivo = 0;
cargar_posiciones(p);
cargar_restricciones(r);
centroides.resize(n_cluster);
clusters.resize(n_cluster);
double max = posiciones[0... | ALGO | 0.999863 | 3.895585 |
ea61bce1-7ea1-4d7b-b704-3f8cd4775097 | paulvortex/RwgTex | libs/crunch/crnlib/lzma_7zCrc.cpp | /* 7zCrc.c -- CRC32 calculation
2008-08-05
Igor Pavlov
Public domain */
#include "crn_core.h"
#include "lzma_7zCrc.h"
namespace crnlib {
#define kCrcPoly 0xEDB88320
UInt32 g_CrcTable[256];
void MY_FAST_CALL CrcGenerateTable(void)
{
UInt32 i;
for (i = 0; i < 256; i++)
{
UInt32 r = i;
int j;
for (j ... | ALGO | 0.997028 | 6.197269 |
1c2994bd-287a-48f9-812c-6747ed6fbc24 | NakulAeran/leetcode_solution | 1008.construct-binary-search-tree-from-preorder-traversal.cpp | /*
* @lc app=leetcode id=1008 lang=cpp
*
* [1008] Construct Binary Search Tree from Preorder Traversal
*/
// @lc code=start
/**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode() : val(0), left(nullptr), right(nullptr) {}
* ... | ALGO | 0.999992 | 6.809628 |
2ae08f42-5910-4371-bed3-ec67d2391f3a | Lee148305/24.1 | 자유주제_가위바위보/main소스.cpp | #include <stdio.h>
#include <stdlib.h>
#include <time.h>
#define SCISSORS 1
#define ROCK 2
#define PAPER 3
void print_menu(void)
{
printf("< >\n");
printf("1: , 2: , 3: \n");
}
const char* get_choice_name(int choice)
{
switch (choice)
{
case SCISSORS: return "";
case ROCK: return "";
ca... | ALGO | 0.989764 | 3.403989 |
4d7184ce-ad7d-402a-ae96-c3bd2fc93282 | ishandutta2007/codeforces | mango_lassi/normal/1074/B.cpp | #include <iostream>
#include <vector>
using namespace std;
typedef long long ll;
const int N = 1000;
vector<int> conns[N];
bool mark[N];
int dfs(int i, int p) {
if (mark[i]) return i;
for (auto t : conns[i]) {
if (t == p) continue;
int sub = dfs(t, i);
if (sub != -1) return sub;
}
return -1;
}
void solve()... | ALGO | 0.999887 | 4.11556 |
9c1553f4-0934-4cad-baad-aa1692f335a7 | mishrraG/DaysOfCP | Codeforces/65A.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
int t;
cin >> t;
while(t--){
string s;
cin >> s;
if(s.size()>10)
cout << s[0]<<s.size()-2<<s[s.size()-1]<<'\n';
else
cout << s << '... | ALGO | 0.999449 | 4.383997 |
970d7255-c02d-4811-8980-1276cdda831c | gabrieloakz/Projects-10ano | Modulo 3 - Progamação Estruturada/Projeto Final Mod 3/Trabalho.cpp | #include <iostream>
#include <locale>
using namespace std;
// Declaração de Variáveis
int MenuEscolhido;
int valorIntoduzido1, valorIntoduzido2, valorIntoduzido3, valorIntoduzido4;
int valorCodificado1, valorCodificado2, valorCodificado3, valorCodificado4;
int valorD1, valorD2, valorD3, valorD4;
// Declaração de Fun... | ALGO | 0.991502 | 3.319378 |
65b69337-7c01-4a05-85fa-18c4cb91370b | jbush001/NyuziToolchain | tools/lldb/packages/Python/lldbsuite/test/functionalities/postmortem/minidump/fizzbuzz.cpp | // A sample program for getting minidumps on Windows.
#include <iostream>
bool
fizz(int x)
{
return x % 3 == 0;
}
bool
buzz(int x)
{
return x % 5 == 0;
}
int
main()
{
int *buggy = 0;
for (int i = 1; i <= 100; ++i)
{
if (fizz(i)) std::cout << "fizz";
if (buzz(i)) std::cout << "bu... | ALGO | 0.97517 | 5.203869 |
428ca82c-7366-4c89-8fd6-874dc50cbec5 | dpariag/leetcode | valid_sudoku.cpp | // Leetcode: https://leetcode.com/problems/valid-sudoku/description/
// Determine if a 9x9 sudoku board is valid (None of 1-9 can be reused in any row, col, or sub-grid).
// Brute Force: Three passes, checking rows, then cols, then sub-grids
// Better: One pass with state to track the use of 1-9 in each row, col, and ... | ALGO | 0.998294 | 7.404437 |
394ee01e-1480-4f91-828e-f0f294c5c09f | kt-to/kto_tor | bigInt_ope.cpp | #include "bigInt.h"
bigInt bigInt::operator+(bigInt other) {
bigInt ans = *this;
ans.data_.push_back(0);
other.data_.push_back(0);
ans.fix_size(other.data_.size());
other.fix_size(ans.data_.size());
int last = 0;
for (int i = 0; i < ans.data_.size(); ++i) {
ans.data_[i] += other.dat... | ALGO | 0.998974 | 4.351368 |
7827efc6-c6ea-4a1c-9bc0-f1ea7896b595 | vfolunin/archives-solutions | LeetCode/2073.cpp | class Solution {
public:
int timeRequiredToBuy(vector<int> &a, int k) {
int res = 0;
for (int i = 0; i <= k; i++)
res += min(a[i], a[k]);
for (int i = k + 1; i < a.size(); i++)
res += min(a[i], a[k] - 1);
return res;
}
}; | ALGO | 0.999882 | 5.554748 |
1b41c42d-8fe3-4008-ae1b-be487e5c695d | facebookincubator/spectrum | cpp/spectrum/core/proc/legacy/Sharpener.cpp | /** ===========================================================================
* @file Sharpener.cpp
* @brief 2D Image Sharpener (3x3 kernel, seperable)
* ============================================================================
*/
// ============= include files =============
#include "Sharpener.h... | ALGO | 0.974353 | 5.522977 |
3f02d6a4-8128-4ae5-8f76-526ba516119e | KellyFrog/OI-sources | luogu-main/P3853/P3853.cpp | #include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <queue>
#include <set>
#include <map>
using namespace std;
#define vc vector
#define pq priority_queue
#define grt greater
#define pb push_back
#define mp make_pair
#define rg register
#define fi first
#define se second
typedef long... | ALGO | 0.999975 | 3.47392 |
2eff232c-ce5b-4edb-bc07-ab8d79d7e0e6 | raincross7/code-similarity | codes/train_code/problem449/problem449_232.cpp | #include <iostream>
using namespace std;
int main() {
int x1, y1, x2, y2;
cin >> x1 >> y1 >> x2 >> y2;
int x3 = y1 - y2 + x2, y3 = x2 - x1 + y2;
int x4 = y2 - y3 + x3, y4 = x3 - x2 + y3;
printf("%d %d %d %d", x3, y3, x4, y4);
}
| ALGO | 0.999359 | 3.091763 |
ab7f38ec-a7cb-482e-bd51-a87ffe7036d0 | archanabadagi/APS-2021 | APS_Code_Library/61_sort_a_stack.cpp | #include <iostream>
using namespace std;
struct stack {
int data;
struct stack* next;
};
void initStack(struct stack** s) { *s = NULL; }
int isEmpty(struct stack* s)
{
if (s == NULL)
return 1;
return 0;
}
void push(struct stack** s, int x)
{
struct stack* p = (struct stack*)malloc(sizeof(*p));
if (p == NUL... | ALGO | 0.999873 | 4.872388 |
9d36c04c-2b2c-4316-9d22-332f68f25fb7 | ashrutarora/DSE | Semester_4/(DAA)-Design_And_Analysis_Of_Algorithms_Lab/WEEK_02/2.1_EuclidsRec.cpp | // RECURSIVE METHOD
/*
Write an algorithm for finding the Greatest Common Divisor (GCD) of two numbers using Euclid’s algorithm. Write a program to implement the Euclid’s algorithm.
*/
#include <iostream>
using namespace std;
int gcd(int a, int b){
if(a == 0){
return b;
}
if(b == 0){
return a;
}
retur... | ALGO | 0.999963 | 6.154834 |
ce445389-0a71-4e26-9fc7-df64abcdee41 | 1119-2916/competitive-programming | topcoder/srm/600/634/e.cpp | #include <bits/stdc++.h>
using namespace std;
#define INF 1010001000
#define MOD 1000000007
#define ll long long
#define rep(i, N) for (int i = 0; i < N; i++)
#define Rep(i, N) for (int i = 1; i < N; i++)
#define pb push_back
#define eb emplece_back
#define mp make_pair
#define i_i pair<int, int>
#define vi vector<in... | ALGO | 0.999936 | 3.546029 |
22b9be56-2af7-46be-a636-209de08a2df1 | mburaozkan/CPP-Examples | Section9/ConditionalOperator/main.cpp | // Section 9
// Conditional Operator
#include <iostream>
using namespace std;
int main() {
// int num {};
//
// cout << "Enter an integer: ";
// cin >> num;
//
// if (num % 2 == 0)
// cout << num << " is even" << endl;
// else
// cout << num << " is odd" << endl;
// ... | ALGO | 0.990078 | 3.364977 |
9a31a1a3-56b0-4e5b-a305-f656b4db071d | velicof/Programming-Cpp | solved/Matrici_exercitii/Smaxpar.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int n,m,v[105][105],pos = 0;
cin >> n >> m;
for (int i = 1; i <= n; i++) {
for (int j = 1; j <=m; j++){
cin >> v[i][j];
}
}
int max = -1e9;
for (int i = 1; i <= n; i++) {
int S = 0;
for (int j ... | ALGO | 0.999984 | 4.270669 |
8d589334-0a07-4c97-a0c9-1573f9f95a1c | callor/Biz-Android-505-2023-09 | flutter-012-book-api/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.998064 | 6.76073 |
f2454041-c684-4a45-aa63-8d19384ea995 | BaoVStorm/CTDL-GT | vinh..cpp | #include<iostream>
#include<fstream>
using namespace std;
int x[20],n,k;
ofstream gg("abc.out");
void doc()
{
ifstream ff("abc.inp");
ff>>n>>k;
ff.close();
}
void xkq()
{
for(int i=1;i<=k;i++)
{
if(i==1) gg<<"{";
gg<<x[i];
if(i!=k) gg<<";";
}
gg<<"}";
gg<<endl;
}
void truy(int i)
{
for(int j=x[i-1]+1;j<=... | ALGO | 0.999061 | 3.115878 |
c9d24861-2281-4442-95da-ab2ab2f62c92 | Abtg08/DSA_Practice_Update | Trees/5_bfs.cpp | #include <iostream>
#include<vector>
#include<queue>
using namespace std;
struct Node
{
int data;
struct Node *left;
struct Node *right;
Node(int val)
{
data = val;
left = right = NULL;
}
};
/**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* T... | ALGO | 0.999941 | 5.487433 |
dfa9fe98-149e-4ac6-8492-56b2bdb49b2f | mrinalini1404/450questions | LinkedList/14_middleofll.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* middleNode(... | ALGO | 0.999584 | 5.912651 |
6c6b4de7-54bf-48c6-aef0-b3d97afce05b | Ritwik1999/CPP-DSA | 7.Linked List/AppendLastNToFirstLL.cpp | Node *appendLastNToFirst(Node *head, int n)
{
if (n == 0 || head == nullptr)
{
return head;
}
Node *temp = head;
int len = length(head), i = 1;
while (temp->next != nullptr)
{
temp = temp->next;
}
temp->next = head;
temp = head;
while (i < (len - n))
{... | ALGO | 0.99975 | 4.501058 |
b2baae7c-ceab-4259-83f0-1fe29e321e9f | saladibhaskar/gfg | Medium/Check if Linked List is Palindrome/check-if-linked-list-is-palindrome.cpp | //{ Driver Code Starts
#include <stdio.h>
#include <stdlib.h>
#include <iostream>
#include <stack>
using namespace std;
/* Link list Node */
struct Node {
int data;
struct Node *next;
Node(int x) {
data = x;
next = NULL;
}
};
// } Driver Code Ends
/*
struct Node {
int data;
struct Node *next;
Nod... | ALGO | 0.999444 | 5.202063 |
4df7027c-7db5-4b6f-8337-b08bb4f97f95 | kovid-sharma/LeetCode | 200-number-of-islands/200-number-of-islands.cpp | class Solution {
public:
int cnt=0;
void dfs(int i,int j,vector<vector<char>>&grid)
{
if(i<0 or j<0 or i>=grid.size() or j>=grid[0].size() or grid[i][j]=='0')
return;
grid[i][j]='0';
dfs(i-1,j,grid);
dfs(i+1,j,grid);
dfs(i,j-1,grid);
dfs(i,j+1,grid... | ALGO | 0.999982 | 6.662586 |
e131cee3-3bc4-493e-b17e-a248233d38a3 | krozv/codetree-TILs | 240616/등급 매기기/ranking.cpp | #include <iostream>
using namespace std;
int main() {
int n;
cin >> n;
if (n >= 90){
cout << "A";
} else if (n >= 80){
cout << "B";
} else if (n >= 70){
cout << "C";
} else if (n >= 60){
cout << "D";
} else {
cout << "F";
}
return 0;
} | ALGO | 0.994391 | 3.913845 |
01273c07-ff74-421c-af25-10feecfd2e6c | IronDumpling/computer-graphics-algos | meshes/libigl/include/igl/in_element.cpp | template <typename DerivedV, typename DerivedQ, int DIM>
IGL_INLINE void igl::in_element(
const Eigen::MatrixBase<DerivedV> & V,
const Eigen::MatrixXi & Ele,
const Eigen::MatrixBase<DerivedQ> & Q,
const AABB<DerivedV,DIM> & aabb,
Eigen::VectorXi & I)
{
using namespace std;
using namespace Eigen;
const i... | ALGO | 0.990348 | 5.316398 |
7be589f7-2d6c-4724-88aa-fe103ed328c8 | ishandutta2007/codeforces | yyljkydr/normal/1569/F.cpp | #include<bits/stdc++.h>
using namespace std;
#define int long long
const int N=13;
int n,m,k;
int f[1<<N][N];
vector<int>p[2];
int g[N][N];
int dp()
{
int all=(1<<(n/2))-1;
for(int S=0;S<=all;S++)
for(int i=0;i<n/2;i++)
f[S][i]=0;
for(int i=0;i<n/2;i++)
f[1<<i][i]=1;
for(int S=0;S<=all;S++)
for(int ... | ALGO | 0.999923 | 4.12747 |
e88d1cce-4d83-4779-9454-6d87c2165d9f | Shohagh019/Ph_XPSC_Problem_Solving | Weak_3/Day_1/C_X_Sum.cpp | #include<bits/stdc++.h>
using namespace std;
int mx[202][202];
int find_ans(int n,int m, int i, int j)
{
int ans=0;
int idx=0;
while(i-idx>-1 && j-idx>-1)
{
ans+=mx[i-idx][j-idx];
idx++;
}
idx=0;
while(i-idx>-1 && j+idx<m)
{
ans+=mx[i-idx][j+idx];
idx++;
... | ALGO | 0.999935 | 4.530724 |
7cf798b0-f117-47a5-9f49-2c7426a9df38 | BandhiyaHardik/Leetcode_Solutions | daily_problems/624_Maximum_Distance_in_Arrays.cpp | class Solution {
public:
int maxDistance(vector<vector<int>>& arrays) {
int MIN = arrays[0].front();
int MAX = arrays[0].back();
int result = 0;
for(int i = 1; i < arrays.size(); i++) {
int currMin = arrays[i].front();
int currMax = arrays[i].back();
... | ALGO | 0.999784 | 5.857615 |
bba48e1c-676d-4171-ab04-5875bd198e57 | YunshiuanOAO/CP | Codeforce/Codeforces Round #784 (Div. 4)/hack.cpp | #include<iostream>
#include<iomanip>
#include<math.h>
#include<vector>
#include<algorithm>
#include<map>
#include<set>
#include<queue>
#include<bitset>
#include<cctype>
#include<deque>
#include<string>
#include<stack>
#include<string.h>
#define int long long int
#define IOS ios::sync_with_stdio(false);cin.tie(0);cout.t... | ALGO | 0.99679 | 3.196472 |
0c35cd6e-fd4e-45fb-89d7-95f23f66e91e | qingguang/lammps-sph | src/USER-REAXC/reaxc_vector.cpp | #include "pair_reax_c.h"
#if defined(PURE_REAX)
#include "vector.h"
#include "random.h"
#elif defined(LAMMPS_REAX)
#include "reaxc_vector.h"
#endif
int Vector_isZero( real* v, int k )
{
for( --k; k>=0; --k )
if( fabs( v[k] ) > ALMOST_ZERO )
return 0;
return 1;
}
void Vector_MakeZero( real *v, int k )... | TOOL | 0.955246 | 4.981545 |
d13b0884-abba-454e-a5e5-8b05ed2f38fc | zqw-hooper/apollo_and_-autoware_path_planner | Apollo_PiecewiseJerk_algorithm/src/math.cpp | //
// Created by ljn on 20-5-26.
//
#include <cmath>
#include "PathPoint.hpp"
#include "math.hpp"
constexpr double kMathEpsilon = 1e-10;
double NormalizeAngle(const double angle) {
double a = std::fmod(angle + M_PI, 2.0 * M_PI);
if (a < 0.0) {
a += (2.0 * M_PI);
}
return a - M_PI;
}
double sl... | ALGO | 0.998827 | 5.841526 |
02790e9e-b711-4173-957b-75c3762ff616 | madman1851/rpcore335 | dep/recastnavigation/Detour/Source/DetourNavMeshBuilder.cpp | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <float.h>
#include "DetourNavMesh.h"
#include "DetourCommon.h"
#include "DetourMath.h"
#include "DetourNavMeshBuilder.h"
#include "DetourAlloc.h"
#include "DetourAssert.h"
static unsigned short MESH_NULL_IDX = 0xffff;
struct BVItem
{
unsigned short ... | ALGO | 0.987807 | 7.015553 |
c8ecf623-46da-43ca-9c2f-a11d0759b4a4 | neha629/CODENOTE | TREES/Serialize_Deserialize_BT.cpp | // Encodes a tree to a single string.
string serialize(TreeNode* root)
{
string str = "";
queue<TreeNode*> q;
q.push(root);
while(!q.empty())
{
TreeNode* temp = q.front();
q.pop();
if(temp == NULL)
str+="#,";
else
{
str+=(to_string... | ALGO | 0.999773 | 5.352157 |
74b76c81-9eae-47d0-bec8-19770d2752e3 | argon17/Topic-Wise-Problems | Stacks/DailyTemperatures.cpp | #include<bits/stdc++.h>
using namespace std;
vector<int> dailyTemperatures(vector<int>& temperatures) {
int n = temperatures.size();
stack<int> st;
vector<int> ans(n);
for(int i=n-1; i>=0; --i){
while(st.size() && temperatures[i]>=temperatures[st.top()]) st.pop();
if(st.empty()) ans[i] ... | ALGO | 0.999918 | 5.944417 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.