uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
6a8a0e0a-ea8b-4084-af13-5d79f80d7bd9 | Kaileshwaran13/CodeChef | 500 difficulty rating/Credit score.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int num;
cin >> num;
if(num >= 750){
cout << "YES" << '\n';
}
else{
cout << "NO" << '\n';
}
}
| ALGO | 0.999702 | 3.548627 |
00d84b7c-d285-47f3-b7c0-97e09718d426 | ellamaerie/hw1 | ulliststr.cpp | #include <cstddef>
#include <stdexcept>
#include "ulliststr.h"
ULListStr::ULListStr()
{
head_ = NULL;
tail_ = NULL;
size_ = 0;
}
ULListStr::~ULListStr()
{
clear();
}
bool ULListStr::empty() const
{
return size_ == 0;
}
size_t ULListStr::size() const
{
return size_;
}
// WRITE YOUR CODE HERE
void ULLis... | TOOL | 0.864619 | 5.35475 |
b11cda2f-2170-4816-8bba-2c6b918f24d8 | foss-for-synopsys-dwc-arc-processors/opencv-for-synopsys | 2.4.9/samples/cpp/logpolar_bsm.cpp | /*Authors
* Manuela Chessa, Fabio Solari, Fabio Tatti, Silvio P. Sabatini
*
* <EMAIL>, <EMAIL>
*
* PSPC-lab - University of Genoa
*/
#include "opencv2/opencv.hpp"
#include <iostream>
#include <cmath>
using namespace cv;
using namespace std;
static void help()
{
cout << "LogPolar Blind Spot Model sample.\nShortcu... | ALGO | 0.97135 | 5.344037 |
cd9b04c1-8cfd-4596-b876-f0b6a2de43c7 | juhanak/Analytics | Analytics/ChannelDeltaEstimator.cpp | #include "pch.h"
#include "ChannelDeltaEstimator.h"
ChannelDeltaEstimator::ChannelDeltaEstimator()
{
}
ChannelDeltaEstimator::~ChannelDeltaEstimator()
{
}
INT16 ChannelDeltaEstimator::CalculateCrossCorrelation(std::vector<RingBuffer::Window> &windows, UINT uiWindowSize)
{
const UINT uMaxDelay = 15;
std::vector<IN... | ALGO | 0.936721 | 5.919133 |
b8786288-99cf-4b83-beb8-958e281f060c | maxime-poulain/frameworks_av | media/libstagefright/codecs/mp3dec/src/pvmp3_reorder.cpp | /*
------------------------------------------------------------------------------
PacketVideo Corp.
MP3 Decoder Library
Filename: pvmp3_reorder.cpp
Date: 09/21/2007
------------------------------------------------------------------------------
REVISION HISTORY
Description:
------------------------... | ALGO | 0.998207 | 5.55651 |
726fb97f-45e5-4bc0-8df7-93754662e779 | Harsh23Kashyap/LeetCode | 82-remove-duplicates-from-sorted-list-ii/82-remove-duplicates-from-sorted-list-ii.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* deleteDupli... | ALGO | 0.999963 | 5.329237 |
7b575256-7934-42dd-b024-3c7842bfd6ee | arnab7070/BeyondCoding | C++ Programs/CodeChef/The_Mango_Truck.cpp | #include<iostream>
using namespace std;
int main()
{
int t;
cin>>t;
while(t--){
int x,y,z;
cin>>x>>y>>z;
int rest = z-y;
int ans = rest/x;
cout<<ans<<endl;
}
return 0;
} | ALGO | 0.999881 | 3.453604 |
a181c61f-5d94-4415-afed-cbf0a249cf97 | alifrommars/Introduction-to-programming | Sem_14/SortWithComparator.cpp | #include <iostream>
void swap(int* arr, const int i, const int j)
{
int temp = arr[i];
arr[i] = arr[j];
arr[j] = temp;
}
void selectionSort(int* arr, const size_t len, bool(*comp)(int x, int y) = [](int x, int y) { return x < y; })
{
for (size_t i = 0; i < len - 1; i++)
{
int minIndex = i;
for (size_t j = mi... | ALGO | 0.999886 | 5.466909 |
bff2a28c-91ac-47b4-b191-733a209f3deb | Joajy/Algorithm_Idea | Dijkstra(1753).cpp | #include<iostream>
#include<algorithm>
#include<vector>
#include<queue>
using namespace std;
#define MAX 20000
#define INF 2'147'483'647
#define DIST first
#define NODE second
vector<pair<int, int>> v[MAX + 1]; //dist, destination
int V, E, K;
int dist[MAX + 1];
/*
DIJKSTRA Algorithm
ͽƮ ˰ ̿ ִ Ÿ
Prio... | ALGO | 0.999878 | 4.218069 |
28954cb1-8692-4619-87ad-2d61b0b9b2f7 | Esheta10/LeetCode-Solutions | 0054-spiral-matrix/0054-spiral-matrix.cpp | class Solution {
public:
vector<int> spiralOrder(vector<vector<int>>& matrix) {
vector<int> result;
int m = matrix.size();
int n = matrix[0].size();
int top = 0;
int down = m-1;
int left = 0;
int right = n-1;
int dir=0;
while(top<=down && lef... | ALGO | 0.999998 | 6.244604 |
abcae4e4-76ac-4781-9252-4f6107529158 | orijoon98/Algorithm_Study | C++/baekjoon/보물_1026.cpp | #include <bits/stdc++.h>
#define endl '\n'
#define MAX 50
using namespace std;
int N;
int A[MAX], B[MAX];
void Input(){
cin>>N;
for(int i=0;i<N;i++) cin>>A[i];
for(int i=0;i<N;i++) cin>>B[i];
}
void Solution(){
sort(A, A+N);
sort(B, B+N);
int ans = 0;
for(int i=0;i<N;i++){
ans += ... | ALGO | 0.999985 | 3.735981 |
c0ee3488-9f99-420a-8dac-12b63486c43a | LLNL/psuade-lite | Src/Analysis/MomentAnalyzer.cpp | // ************************************************************************
// constructor
// ------------------------------------------------------------------------
MomentAnalyzer::MomentAnalyzer() : Analyzer(), nSamples_(0), nGroups_(0),
nInputs_(0), nOutputs_(0), moments_(0)
{
set... | ALGO | 0.989392 | 3.902107 |
34d16129-b3c3-4767-bdd7-d6eb834db114 | rosekamallove/problem-solving | dsa/concepts/4-STL/10-printStrings.cpp | #include<bits/stdc++.h>
using namespace std;
/*
* Given N strings, print unique strings
* in lexiographical order
* n<=1e5
* |s| <= 1e5
*/
int main()
{
set<string> s;
int n; cin>>n;
for(int i=0; i<n; i++)
{
string temp; cin>>temp;
s.insert(temp);
}
for(string temp : s)
... | ALGO | 0.999633 | 4.675797 |
952a5fef-96ed-4310-8cd3-2ebeb20c20ba | ishandutta2007/codeforces | everule/normal/1381/A1.cpp | #include <iostream>
#include <bits/stdc++.h>
#define mp make_pair
#define pb push_back
using namespace std;
using ll = long long int;
template<typename T>
ostream& operator+(ostream& out, const vector<T> &vec){
for(const auto &x : vec){
out<<x<<" ";
}
out<<"\n";
return out;
}
template<typename T... | ALGO | 0.999978 | 4.144927 |
414155e0-78b8-4ca4-bfdd-8b82fb01cd83 | bprithiraj/DSA-CPsolvedproblemscode | new folder/codejamrobot.cpp |
#include<iostream>
#include<string>
#include<algorithm>
#include<set>
void test_case()
{
int n;
cin>>n;
vector<string>they(n);
for(int i=0;i<n;i++)
{
cin>>they(i);
string moves;
for(int pos=0;true;pos++)
{
set<int>chars;
for(string s:they)
{
chars.insert[s[pos%s.length()]];
}
If(... | ALGO | 0.999478 | 4.133106 |
0673fc82-385f-4adc-85ba-218b8bc15c58 | whu-huangyue/droidslam_0118 | thirdparty/eigen/doc/examples/DenseBase_middleRows_int.cpp | #include <Eigen/Core>
#include <iostream>
using namespace Eigen;
using namespace std;
int main(void)
{
int const N = 5;
MatrixXi A(N,N);
A.setRandom();
cout << "A =\n" << A << '\n' << endl;
cout << "A(2..3,:) =\n" << A.middleRows(2,2) << endl;
return 0;
}
| ALGO | 0.970208 | 3.307581 |
976ef164-0ae6-448e-9bea-2e96b140b71e | styceplug/Urban_GateX | 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 |
3acd5012-1268-47ec-b68b-39d6d5e4698e | EliGwz/leetcode | top-interview-questions-easy-collection/math/326.3-的幂.cpp | /*
* @lc app=leetcode.cn id=326 lang=cpp
*
* [326] 3的幂
*/
// @lc code=start
#include <cfloat>
#include <cmath>
using namespace std;
class Solution {
public:
bool isPowerOfThree(int n) {
if (n < 1)
return false;
double res = log10(n) / log10(3);
// cout << res << " " << (in... | ALGO | 0.995956 | 5.544286 |
46f3ab5b-27c2-468b-b318-17666cf16c5f | ael-bekk/leetcode | 1323-maximum-69-number/1323-maximum-69-number.cpp | class Solution {
public:
int maximum69Number (int num)
{
for (int i = 0, l = 1000; i < 4; i++, l /= 10)
if ((num % (l * 10)) / l == 6)
return (num + 3 * l);
return (num);
}
}; | ALGO | 0.999571 | 6.135936 |
8c44d7d1-e11d-4de0-b1bd-a496f5b5234a | anas2002-developer/C1 | SinglyLinkedList.cpp | #include<iostream>
using namespace std;
class Node{
public:
int data;
Node* next;
Node(int data){
this->data=data;
this->next=NULL;
}
};
void InsertionF( Node* &head , int data ){
Node* newNode=new Node(data);
if(head==NULL){
head=newNode;
}
else{
newNode->next=head;
head=newNode;
}
}... | ALGO | 0.999931 | 3.736193 |
a42cd24b-8d10-4f02-a34d-ae4599f8df35 | saaadaliii/pf-lab | inv tri num.cpp | #include <iostream>
using namespace std;
int main() {
int n =5;
for (int i = 1; i <= n; i++) {
for (int j = i; j >= 1; j--) {
cout << j;
}
cout << endl;
}
return 0;
}
| ALGO | 0.999705 | 4.001437 |
6a2b3d54-81c9-4a4d-956b-34923cf356b3 | DiscreteTom/algorithm-design-and-analyze | Chapter2/MinWeightTriangulation/mainwindow.cpp | #include "mainwindow.h"
#include "ui_mainwindow.h"
#include <QVector>
#include <QFile>
#include <QTextStream>
#include <QDebug>
#include <QPainter>
#include <QStack>
MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::MainWindow)
{
ui->setupUi(this);
showMaximized();
//input
// QFile file1... | TOOL | 0.858348 | 4.424207 |
e629a740-7e84-4172-9645-43f7835af2d4 | djadjaa/AISP22 | petlja/8 backtracking/brpodnizovadatogzbira.cpp | #include <iostream>
#include <vector>
using namespace std;
const double EPS = 0.00001;
/*
int brPodnizova(vector<double>& a, vector<double>& aSub, int n, double sum, int tempPos){
if(n==0){
double sumTemp=0.0;
for(int i=0; i<tempPos; i++)
sumTemp += aSub[i];
if(sumTemp==sum)
... | ALGO | 0.999815 | 3.779065 |
beb381b1-8646-461a-a91a-724e44ebc614 | gagandeepahuja09/Strings | LeetCode/String Compression.cpp | class Solution {
public:
int compress(vector<char>& chars) {
int pos = 0;
for(int i = 0; i < chars.size();) {
char c = chars[i], cnt = 0;
while(i < chars.size() && chars[i] == c) {
cnt++;
i++;
}
if(cnt == 1) {
... | ALGO | 0.99998 | 6.357549 |
15670ae9-2ba6-4afa-aa0a-ed3d01eb52ed | ishandutta2007/codeforces | ehnryx/normal/1167/F.cpp | #include <bits/stdc++.h>
using namespace std;
#define _USE_MATH_DEFINES
#define For(i,n) for (int i=0; i<n; i++)
#define FOR(i,a,b) for (int i=a; i<=b; i++)
#define Down(i,n) for (int i=n-1; i>=0; i--)
#define DOWN(i,a,b) for (int i=b; i>=a; i--)
typedef long long ll;
typedef long double ld;
typedef pair<int,int> pii... | ALGO | 0.99989 | 4.013812 |
dd1c6ea1-5d48-462b-ab12-bbe822ddd83b | illuz/WayToACM | ACM_CODE/Templates/Data_Structure/BIT.cpp | /*
* Author: illuz <iilluzen[at]gmail.com>
* Blog: http://blog.csdn.net/hcbbt
* File: BIT.cpp
* Create Date: 2014-08-26 09:37:09
* Descripton: binary indexed tree, nlog(n)
*/
#include <bits/stdc++.h>
using namespace std;
#define repf(i,a,b) for(int i=(a);i<=(b);i++)
typedef long long ll;
cons... | ALGO | 0.999657 | 3.64669 |
1a47b36a-cf38-49ae-8e4e-0cc5a8a0d57f | Kecheng-Ye/My_Leetcode | Problem/By section/Dynamic Programing/Problem 813/problem_813.cpp | #include <bits/stdc++.h>
using namespace std;
class Solution {
public:
// dp[k][n] = argmax_j(dp[k - 1][j - 1], avg(nums[j : n]))
// Time: O(kn^2), Space: O(n)
double largestSumOfAverages(vector<int>& nums, int k) {
vector<int> prefixSum = prefixArray(nums);
int n = nums.size();
v... | ALGO | 0.99984 | 6.555608 |
3ee8c80e-da4c-4571-8259-f1589b0292d7 | alifalhasan/CP-code-vault | CodeChef/Practice/EOEO - The Tom and Jerry Game!/34456978.cpp | #include<bits/stdc++.h>
using namespace std;
#define LL long long
#define FAST() ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
int main()
{
FAST();
int t;
LL m,n,x;
cin >> t;
while(t--)
{
cin >> n;
m=n,x=1;
while(m%2 == 0)m/=2,++x;
x=((LL)1 << x);
... | ALGO | 0.999973 | 4.310013 |
2b617bca-8b29-4137-8712-869d5fc172c6 | smadi0x86/Hallucina | obfuscator-llvm/libc/src/math/generic/scalbn.cpp | #include "src/math/scalbn.h"
#include "src/__support/FPUtil/ManipulationFunctions.h"
#include "src/__support/common.h"
namespace __llvm_libc {
LLVM_LIBC_FUNCTION(double, scalbn, (double x, int n)) {
#if !defined(__FLT_RADIX__)
#error __FLT_RADIX__ undefined.
#elif __FLT_RADIX__ != 2
#error __FLT_RADIX__!=2, unimpleme... | TOOL | 0.911607 | 6.11093 |
3e51edcb-8ebb-4893-bc89-997006462a27 | Mujanov3737/Data-Structures-and-Algorithms | DSA_2/HashTable.cpp | // Hash Table Assignment
#include <algorithm>
#include <climits>
#include <iostream>
#include <string> // atoi
#include <time.h>
#include "CSVparser.hpp"
using namespace std;
const unsigned int DEFAULT_SIZE = 179;
// forward declarations
double strToDouble(string str, char ch);
// define a structure to hold bid i... | TOOL | 0.981939 | 5.944422 |
d6e239f8-2f06-49fb-98e4-64f35cb98715 | saphiooo/cpp_projects | binary_search_tree/main.cpp | #include <iostream>
#include <fstream>
#include <string>
#include <vector>
#include "Node.h"
using namespace std;
vector<int> parseInput ();
void add (Node* &root, vector<int> nums);
void insert (Node* cur, int n);
void remove (Node* &root);
void search (Node* root);
void display (Node* cur, int indent);
int main ()... | ALGO | 0.991894 | 4.730524 |
2ee00979-84bd-44a4-ba27-3c069b45afc4 | sontungexpt/UIT-Workspaces | C_C++/HocKi2_Nam1/UIT-Together/21522772_HienThucHam/Bai090/Source.cpp | #include <iostream>
#include <math.h>
using namespace std;
// initialize method
void Input(double&, int&);
int FactorialOf(int);
double Pow(double, int);
double Sum(double, int);
int main()
{
double x;
int n;
Input(x, n);
double result = Sum(x, n);
cout << "Tong la: " << result;
return 0;
}
//method
void In... | ALGO | 0.999358 | 3.77036 |
75edee60-cbd4-419a-a5b2-649c5b6ce641 | HanaAboauf/Sheet_STLs | P - Sereja and Dima .cpp | #include <bits/stdc++.h>
using namespace std;
int main(){
int size,ser=0,dima=0,turn=0;
cin>>size;
vector<int>v(size);
for(int i=0;i<size;++i)
cin>>v[i];
int right=0,left=size-1,mx=INT_MIN;
while(right<=left){
if(v[right]>v[left]){
mx=v[right];
right++;
... | ALGO | 0.99994 | 3.363014 |
657f71f1-60e0-4bdd-984d-9f2b2805fbec | mabdullahsoyturk/gem5 | src/systemc/tests/systemc/misc/unit/data/datawidth_bool_to_unsigned/lost_carry/datawidth.cpp | /*****************************************************************************
datawidth.cpp --
Original Author: Martin Janssen, Synopsys, Inc., 2002-02-15
*****************************************************************************/
/**************************************************************************... | ALGO | 0.941546 | 5.599051 |
c9877e44-55ba-4d55-bffb-cc386dc9f62c | aadi-1456/Leetcode | Graphs/Lec 1: Problems_on_BFS_and_DFS/BFS/Q6_Number_Of_Enclaves.cpp | #include <bits/stdc++.h>
using namespace std;
class Solution {
public:
int numEnclaves(vector<vector<int>>& grid) {
int n=grid.size();
int m=grid[0].size();
vector<vector<int>> visited(n,vector<int>(m,0));
queue<pair<int,int>> q;
for(int i=0;i<n;i++){
for(int j=... | ALGO | 0.999904 | 6.039594 |
6bf9c7d0-6def-4f5c-a185-56a73a8b3d81 | msrishu65/codes | codes/dfs1.cpp | #include<iostream>
#include<vector>
#include<queue>
using namespace std;
void dfsvisit(vector<int>graph[],int i,int visited[])
{
cout<<i<<"->";
visited[i]=1;
for(int j=0;j<graph[i].size();j++)
{
if(visited[graph[i][j]]==0)
dfsvisit(graph,graph[i][j],visited);
}
}
void dfs(vector<... | ALGO | 0.999962 | 3.847295 |
46921416-18a6-41cf-b7be-999262b99729 | vngelrojas/CBS_401 | include/ECBS_distributed/ECBSNode.cpp | //
// Created by YIMIN TANG on 3/20/23.
//
#include "ECBSNode.hpp"
#include "ECBS.hpp"
ECBSNode::ECBSNode(shared_ptr<ECBSNode> curnode) {
cost = curnode->cost;
constraint_sets = curnode->constraint_sets;
cost_matrix = curnode->cost_matrix;
LB = curnode->LB;
fmin = curnode->fmin;
}
ECBSNode::ECBSNo... | ALGO | 0.999681 | 4.25235 |
0eb01ce1-b77f-463f-89ea-c3453a57d242 | ishandutta2007/codeforces | hibye1217/normal/1472/D.cpp | #include <bits/stdc++.h>
#define endl '\n'
#define fr first
#define sc second
#define all(v) v.begin(),v.end()
#define bout(x) cout << bitset<sizeof(x)*8>(x) << endl;
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
const int dx[4] = {0, 1, 0, -1},... | ALGO | 0.999988 | 4.710719 |
15891025-5bc4-435e-b881-82f18ca2392d | filipeabelha/gym-solutions | spoj/PT07Z.cpp | #include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define mp make_pair
#define cl(x, v) memset((x), (v), sizeof(x))
typedef vector <int> vi;
typedef vector <vi> vii;
const int N = 1e5+10; // Maximum number of nodes
int vis[N], dis[N], nodes, maxdis, xdis, ans;
vector <vector <int> > adj(N);
queue <i... | ALGO | 0.997957 | 4.231991 |
e88a7547-9619-48f3-a44b-a436b6aaa971 | arjun828207/Ds-algo_practice | stringrotate.cpp | // C++ program to check if two given strings
// are rotations of each other
# include <bits/stdc++.h>
using namespace std;
bool areRotations(string str1, string str2)
{
if (str1.length() != str2.length())
return false;
string temp = str1 + str1;
if(temp.find(str2)==1);
return true;
}
int main()
{
... | ALGO | 0.99933 | 6.226824 |
c5aabeed-fd94-40ab-b1c9-9fe60110c5d4 | mayankAgg06/Leetcode-Solutions | 0054-spiral-matrix/0054-spiral-matrix.cpp | class Solution {
public:
vector<int> spiralOrder(vector<vector<int>>& matrix) {
vector<int> ans;
if (matrix.empty() || matrix[0].empty()) {
return ans;
}
int row_start = 0, row_end = matrix.size() - 1;
int col_start = 0, col_end = matrix[0].size() - 1;
... | ALGO | 0.999997 | 6.77252 |
4f91787f-dccf-4273-a0aa-ed173a9e8427 | kayus3/Joshua-opoola | servers/physics_2d/godot_collision_solver_2d.cpp | /**************************************************************************/
/* godot_collision_solver_2d.cpp */
/**************************************************************************/
/* This file is part of: */
/* ... | ALGO | 0.999799 | 7.542344 |
c2658dcb-5a1b-40c1-aaf9-ba24c6db8002 | flpdsc/basic_algorithm | cpp/30.cpp | //3의 개수는? (large)
#include <iostream>
using namespace std;
int main()
{
int n, lt, cur, rt, k=1, res=0;
cin >> n;
while(lt != 0){
lt = n/(k*10);
cur = n/k%10;
rt = n%k;
if(cur > 3){
res += (lt+1)*k;
}
else if(cur < 3){
res += lt*k;
... | ALGO | 0.999596 | 3.596041 |
307389a6-7d08-4309-9b91-2bb6fb41e2da | nicolasmontenegro/sed2 | main_one.cpp | #include <iostream>
#include <vector>
#include <stdio.h> /* printf, scanf, puts, NULL */
#include <stdlib.h> /* srand, rand */
#include <time.h>
#include <pthread.h>
#include <math.h> /* cos */
#include <unistd.h>
#include <uC++.h>
#include <GL/gl.h>
#include <GL/glu.h>
#include <GL/glut.h>
#include <uB... | ALGO | 0.995331 | 3.810165 |
14fc4c38-1dfa-4d5c-9a2a-268af20f6376 | Khairusshalih/Pratikum_Mobile | Pertemuan 2/latihandrawer/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.996856 | 6.76775 |
7dd369a1-12b7-4150-8b93-273a3c42e194 | Andwerpz/Competitive-Programming-Practice | - cpp -/election.cpp | #include <bits/stdc++.h>
typedef long long ll;
typedef __int128 lll;
typedef long double ld;
using namespace std;
//Rocky Mountain Regional 2016 B
void solve() {
int n; cin >> n;
int v1, v2; cin >> v1 >> v2;
int w; cin >> w;
int rem = n - v1 - v2;
int need = (n) / 2 + 1;
// cerr << "... | ALGO | 0.999965 | 4.499678 |
1b1caf3c-3e13-46e8-94ea-0cfbecdaaa24 | KartavyaKothari/lpu_cpp_22 | Lec1/rec.cpp | #include<bits/stdc++.h>
using namespace std;
void func(int a){
if(a == 0) return;
cout<<a<<" ";
func(a-1);
cout<<a<<" ";
}
int main(){
func(3);
return 0;
} | ALGO | 0.99997 | 4.361278 |
f038d41d-9807-492d-a961-a295ebdeaec7 | Hwa-ning/ALGORITHM_STUDY | X2174.cpp | #include <iostream>
#include <vector>
#include <string>
#include <cstring>
using namespace std;
vector<pair<pair<int, int>, int> >v;
int map[102][102];
int w, h;
string s = "";
bool first = true;
int dx[4] = { 1,0,-1,0 }; // ESWN
int dy[4] = { 0,-1,0,1 };
void robot(int nth, char com, int re) {
int temp;
for (int ... | ALGO | 0.999873 | 4.166017 |
b8f7ca06-15ff-4fac-95c1-0887608c0970 | arjun619/ACF_DSA_Preparation1 | wordbreak/sol.cpp | #include <bits/stdc++.h>
#include<string.h>
#include<string>
using namespace std;
unordered_map<string,int>dp;
int wordbreak(vector<string>arr,string s)
{
int n=s.length();
int flag=0;
if (n==0)return 1;
else if (dp[s]!=0)
return dp[s];
else
{
for(int i=1;i<n;i++)
{
... | ALGO | 0.999657 | 3.946971 |
1edbf4f5-efb7-4f38-8f3a-e46cbca643ee | ishandutta2007/codeforces | w0nsh/normal/1325/A.cpp | #include <bits/stdc++.h>
#define FOR(i, n) for(int i = 0; i < (n); ++i)
#define REP(i, a, b) for(int i = (a); i < (b); ++i)
#define TRAV(i, a) for(auto & i : (a))
#define SZ(x) ((int)(x).size())
#define PR std::pair
#define MP std::make_pair
#define X first
#define Y second
typedef long long ll;
typedef std::pair<int, ... | ALGO | 0.999655 | 3.800663 |
cbce4d07-1ac9-49e7-9068-3315e5d722a1 | 113bommy/deepmind_codecontests_refine | cpp_gold_filter_file/cpp_train_4369_0.cpp | #include <iostream>
#include <sstream>
#include <cstdio>
#include <cstring>
#include <queue>
#include <algorithm>
using namespace std;
#define MAX_H 100
#define MAX_W 100
#define INF (1<<28)
bool isdigit(string s) {
for (int i = 0; i < s.size(); i++)
if (!isdigit(s[i]))
return false;
ret... | ALGO | 0.998505 | 3.631676 |
1595f4af-7b01-466e-8624-ec4c33ba3cd3 | Bilguun118/Algorithms | Codeforces/horse_shoe.cpp | #include<iostream>
#include<vector>
using namespace std;
int main() {
vector<long long>a(5);
int n = 4, ans = 0;
for(int i = 0; i < n; i++) cin >> a[i];
sort(a.begin(), a.end());
for(int i = 0; i < n; i++) {
if(i+1 < 5 && a[i] == a[i+1]) {
ans++;
}
}
cout << ans... | ALGO | 0.99967 | 3.920419 |
6b71870b-c39d-4534-b5c1-18fd7df8d6cb | shutterberg/CodeForces | 155A.cpp | #include <bits/stdc++.h>
#define ull unsigned long long
#define ll long long
#define init \
ios_base::sync_with_stdio(false); \
cin.tie(NULL); \
cout.tie(NULL);
#define fori(i, a, b) for (ll i = a; i <= (ll)b; i++)
using namespace std;
const ll mod = 1e9 + 7;
int ... | ALGO | 0.999949 | 3.958663 |
32c0f860-007b-4933-8b91-22f122882ad4 | Shree987/Year-of-CP | Days 201-210/Day 209/Search in Rotated Sorted Array.cpp | /*
Author : Shreeraksha R Aithal
Problem name : Search in Rotated Sorted Array
Problem link : https://leetcode.com/problems/search-in-rotated-sorted-array/
Difficulty : Medium
Tags : Array, Binary Search
*/
class Solution {
public:
int search(vector<int>& nums, int target) {
int left = 0, right = nums.size... | ALGO | 0.999974 | 6.328488 |
694a042d-8430-4652-b99e-651be8386014 | vick-254/DSAlgo_Practice | Phase 2/Graph/18_Bipartite_DFS.cpp | #include <bits/stdc++.h>
using namespace std;
class Solution
{
private:
bool check(int start, int color, vector<int> adj[], vector<int> &vis)
{
vis[start] = color;
for (auto it : adj[start])
{
if (vis[it] == -1)
{
if (check(it, !color, adj, vis) =... | ALGO | 0.999922 | 5.759496 |
15a6fe6d-7e3b-4a08-bc70-107d56bc5ce2 | parthh1112/leetcode- | 120-triangle/triangle.cpp | #define ll long long int
#define pb push_back
#define vi vector<int>
#define vvi vector<vi>
class Solution {
public:
int minimumTotal(vvi &v)
{
vvi dp(v.size(), vi(v[v.size() - 1].size(), 0));
dp[v.size() - 1] = v[v.size() - 1];
for (int i = v.size() - 2; i >= 0; i--)
{
for (int j = 0; j < v[i]... | ALGO | 0.99999 | 4.995539 |
36070b95-51b7-4175-8681-2a842f9c24e7 | AyushAg06/coding | BinarySearch/binary_10.cpp | // find the minimum element in a rotated sorted array using binary search
#include<bits/stdc++.h>
using namespace std;
vector<int>Search(vector<int>&nums)
{
int n=nums.size();
int low=0,high=n-1;
int ans=INT_MAX;
while(low<=high)
{
int mid=(low+high)/2;
if(nums[low]<=nums[mid])
... | ALGO | 0.999998 | 5.494655 |
def11f01-5603-4ac7-8535-210eb2dec6b5 | arclab-hku/DEIO | thirdparty/gtsam/gtsam/3rdparty/Eigen/unsupported/test/BVH.cpp | #include "main.h"
#include <Eigen/StdVector>
#include <Eigen/Geometry>
#include <unsupported/Eigen/BVH>
namespace Eigen {
template<typename Scalar, int Dim> AlignedBox<Scalar, Dim> bounding_box(const Matrix<Scalar, Dim, 1> &v) { return AlignedBox<Scalar, Dim>(v); }
}
template<int Dim>
struct Ball
{
EIGEN_MAKE_ALIGN... | TEST | 0.997145 | 6.629425 |
f8f38349-df37-4e62-b014-b7f82d312191 | Leejeongbin01/Baekjoon | 구현/22860.cpp | #include <iostream>
#include <set>
#include <map>
#include <vector>
#include <sstream>
using namespace std;
// 못풀었음. gpt 참고
map<string, vector<pair<string, int>>> node;
void dfs(string current, int& file_cnt, set<string>& file_types)
{
for(auto& [name, type] : node[current]){
if(type==0){
fil... | ALGO | 0.999791 | 4.798621 |
99443bb2-a870-403a-8918-64cf8a645766 | mahmoudgalal/ZeeArchiver-Android | p7zip_16.02/CPP/Common/Wildcard.cpp | // Common/Wildcard.cpp
#include "StdAfx.h"
#include "Wildcard.h"
bool g_CaseSensitive =
#ifdef _WIN32
false;
#else
true;
#endif
bool IsPath1PrefixedByPath2(const wchar_t *s1, const wchar_t *s2)
{
if (g_CaseSensitive)
return IsString1PrefixedByString2(s1, s2);
return IsString1PrefixedByString2_... | TOOL | 0.874654 | 5.407783 |
1bab68a2-c086-4f97-9584-6d8101dbbfb9 | sarvex/leetcode-lua | solution/0900-0999/0938.Range Sum of BST/Solution.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.999994 | 6.733048 |
9779f4f5-3804-4f63-b354-724c67aa7359 | kushmandinigupta/DSA | ifstatements/ifg.cpp | #include<iostream>
using namespace std;
//Take 3 int values from user and print greatest among them.
int main(){
int a,b,c;
cout<<"enter values that you want to compare\n";
cin>>a>>b>>c;
if(a>b)
{
if (a>c)
{
cout<<a<<endl;
}
else{
cout<<c<<en... | ALGO | 0.999355 | 3.713592 |
e77ba30e-e8f4-4e7e-8e80-ec6d9954bfd1 | Kawser-nerd/CLCDSA | Source Codes/AtCoder/abc070/B/4391067.cpp | #include<iostream>
#include<vector>
#include<cmath>
#include<algorithm>
#include<utility>
#include<map>
#include<set>
#include<string>
using namespace std;
#define ll long long
int main(){
int N,tmp,a;
int s,g;
int A, B, C, D;
cin >> A >> B >> C >> D;
s = max(A,C);
g = min(B,D);
if(s < g)... | ALGO | 0.99997 | 3.719357 |
4f6ca759-ecfc-4d6b-bcd7-e6960a852729 | miguel-mota-gonzalez/leetcode-ArraysAndStrings | container.cpp | /*
Container With Most Water
Solution
Given n non-negative integers a1, a2, ..., an , where each represents a point at coordinate (i, ai). n vertical lines are drawn such that the two endpoints of the line i is at (i, ai) and (i, 0). Find two lines, which, together with the x-axis forms a container, such that the cont... | ALGO | 0.999926 | 6.700119 |
286eb77d-739d-449c-a2b3-bbc48f662f35 | vanyaKov/AISD-3SEM | лаб5/task1/ConsoleApplication7/ConsoleApplication7.cpp | #include <vector>
#include <algorithm>
#include <iostream>
#define V 8
int matrix[V][V] = { { INT_MAX, 2, INT_MAX, 8, 2, INT_MAX, INT_MAX, INT_MAX },
{ 2, INT_MAX, 3, 10, 5, INT_MAX, INT_MAX, INT_MAX },
{ INT_MAX, 3, INT_MAX, INT_MAX, 12, INT_MAX, INT_MAX, 7 },
{ 8, 10, INT_MAX, ... | ALGO | 0.999973 | 4.255363 |
030dac8a-fda1-4c66-a425-f8bfcb109e1a | Pillin/runnelProyect | drainageAlgorithms/gradientdrainagecallaghanmark.cpp | #include "gradientdrainagecallaghanmark.h"
#include <iostream>
#include <algorithm>
#include "primitives/point.h"
struct customLess{
inline bool operator()(runnel::Point* p1, runnel::Point* p2){
return p1->coord.z > p2->coord.z;
}
};
GradientDrainageCallaghanMark::GradientDrainageCallaghanMark():
D... | ALGO | 0.93359 | 4.131411 |
47aefbdc-acbf-49e8-a9a7-bfacdc12e0e4 | zhzh2001/Learning-public | c++实用代码/string/Suffix Tree+Suffix Array O(N)_da.cpp | #include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<time.h>
#include<algorithm>
using namespace std;
#define ll long long
#define N 1000005
int A[N],B[N],s[N],v[N],rank[N],sa[N],h[N],a[N];
char str[N]; int belong[N],n,m;
bool cmp(int *r,int a,int b,int l){return r[a]==r[b]&&r[a+l]==r[b+l];}
void da(int *a,... | ALGO | 0.999882 | 3.395959 |
bbb63f76-3ca2-431b-ba42-dc60e0d0d83b | csl-iisc/SUV-MICRO24 | llvm/libc/src/math/generic/llround.cpp | #include "src/math/llround.h"
#include "src/__support/FPUtil/NearestIntegerOperations.h"
#include "src/__support/common.h"
namespace __llvm_libc {
LLVM_LIBC_FUNCTION(long long, llround, (double x)) {
return fputil::round_to_signed_integer<double, long long>(x);
}
} // namespace __llvm_libc
| TOOL | 0.997868 | 6.425124 |
e81e1e37-83b0-4ddd-b581-35b8f38c5b63 | rekhav55/LeetcodeSolutions | 818-race-car/818-race-car.cpp | class Solution {
public:
int racecar(int tar) {
queue<pair<int,int>> qu;
//Initially car at position 0 with speed 1
qu.push({0,1});
//Creating Hash Map for storing visited position and speed
unordered_map<string,bool> mp;
mp[to_string(0)+","+to_string(1)]=true;
int ans... | ALGO | 0.999979 | 5.441254 |
19200bdc-1803-48b1-945c-f292232c6737 | arif-z04/Competitive-Programming | Recursion/code/p1.cpp | #include <bits/stdc++.h>
using namespace std;
int sum(int n){
if(n==0) return 0;
else return n + sum(n - 1);
}
int main(){
int n;
cin >> n;
cout << sum(n) << endl;
return 0;
} | ALGO | 0.999972 | 4.518859 |
0f14de4d-1012-4554-a6d2-9d79d271dcc7 | Ankit-chaubey1/placemet_codingproblems | cogni5.cpp | #include<iostream>
#include<iomanip>
using namespace std;
int main() {
int tickets;
char refreshment, coupon, circle;
// Input: Number of tickets
cout << "Enter the no of ticket:" << endl;
cin >> tickets;
// Ticket range check
if (tickets < 5 || tickets > 40) {
cout << "Minimum of... | TOOL | 0.98867 | 6.145955 |
5ec5ef86-728e-4608-ad8c-5a83ec1a351f | Charbel-11/Competitive-Programming | Problems by Topics/DP/5-LCS.cpp | #include <iostream>
#include <string>
#include <algorithm>
using namespace std;
int DP[1002][1002];
string A, B;
int LCS(int i, int j) {
if (i >= A.size() || j >= B.size()) { return 0; }
if (DP[i][j] != -1) { return DP[i][j]; }
int res;
if (A[i] == B[j]) { res = 1 + LCS(i + 1, j + 1); }
else {
int c1 = LCS(i ... | ALGO | 0.999892 | 4.869779 |
a9c69d8f-e4d4-49b9-8516-e26c9676cc14 | Dan13llljws/CP-Solutions | CCC/ccc08s2.cpp | #include <bits/stdc++.h>
using namespace std;
int n;
int main(){
cin.sync_with_stdio(0); cin.tie(0);
cin >> n;
while(n){
int counter = 0;
for (int i = 1; i < n; i++){
counter += floor(sqrt(n * n - i * i));
}
counter += n;
cout << 4 * counter + 1 << '\n';
... | ALGO | 0.999876 | 3.635003 |
f5371aa3-7a8f-40bb-874b-b17f7e15e8cf | Pratyushkyadav/Competetive-Programming | Codeforces/2111A - Energy Crystals.cpp | //<---------- Author - Pratyushdumdumb ----------->
#pragma GCC optimize("O3,inline,unroll-loops,fast-math")
#pragma GCC optimize("Ofast,unroll-loops")
// #pragma GCC target("avx2,popcnt")
#pragma GCC optimize("aggressive-loop-optimizations")
#pragma GCC optimize("Ofast,no-stack-protector,unroll-loops,no-stack-protecto... | ALGO | 0.999709 | 5.24236 |
87a18d3c-082e-4a75-bc91-f37d26cfeb46 | LuvKobe/StudyCode-2023 | Code_01_19/AVLTree2.cpp | #pragma once
#include <assert.h>
#include <vector>
#include <queue>
#include <time.h>
#include <map>
#include <iostream>
using namespace std;
template<class K, class V>
struct AVLTreeNode
{
// 洢ļֵ
pair<K, V> _kv;
//
AVLTreeNode<K, V>* _left;
AVLTreeNode<K, V>* _right;
AVLTreeNode<K, V>* _parent;
// ƽ(balanc... | ALGO | 0.997256 | 4.189 |
5e37d7d8-1659-4d61-9833-33c095f0df96 | qiaozishun4/CSP2024_BJ | BJ-Junior/answers/BJ-J00038/explore/explore.cpp | #include<bits/stdc++.h>
using namespace std;
int T,n,m,cnt,x,y,k,f;
int t[2010][2010];
char a[2010][2010];
int dx[100]={0,1,0,-1};
int dy[100]={1,0,-1,0};
void dfs(int x,int y,int f,int b){
if(t[x][y]==0){
cnt++;
}
t[x][y]++;
if(b>=k){
return ;
}
if(x+dx[f]<=n&&y+dy[f]<=m&&x+dx[f]>=1&&y+dy[f]>=1&&a[x+dx[f]][... | ALGO | 0.999699 | 3.879105 |
11223eee-d61b-4963-ae90-58016210fa73 | Sabil667/Programacion | EJ3/main2.cpp | #include <iostream>
#include "circunferencia.cpp"
#include "decagono.cpp"
#include "pentagono.cpp"
using namespace std;
int main(){
Geometria::Circulo c(7);
cout<< "El area del circulo es: "<< c.calcularArea()<< endl;
cout<< "El perimetro del circulo es: "<< c.calcularPerimetro()<< endl;
Geometria::De... | ALGO | 0.958419 | 3.333927 |
878e6953-2728-4fa2-869c-e4dde47f25d0 | ishandutta2007/codeforces | internetperson10/normal/1512/G.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int BIG = 10000000;
ll best[BIG+1], ans[BIG+1], geet[BIG+1];
vector<int> primes;
bool is_prime(int n) {
if(n == 1) return false;
int x = sqrt(n) + 1;
for(int i = 2; i < x; i++) {
if(!(n%i)) return false;
}
return true;
}
int main() {
... | ALGO | 0.999677 | 4.290006 |
e2b39054-50bf-4fc2-a615-23fcf554efd2 | victorswan/LeetCode17 | src/0151.cpp | class Solution {
public:
string reverseWords(string s) {
trim(s);
reverse(begin(s), end(s));
int l = 0;
int r = 0;
while (l < size(s)) {
while (l < size(s) && s[l] == ' ') {
++l;
}
r = l + 1;
while (r < size(s) && s[r] != ' ') {
++r;
}
reverse(b... | ALGO | 0.999893 | 6.628422 |
861c7b3a-3524-400a-82d2-c1179bc637e0 | senapk/fup_2014_2 | aulas/aula20_11.09/rules.cpp | //#include "rules.h"
#include <vector>
#include <functional>
using namespace std;
bool naipes_iguais(vector<int> vet, int inicio, int fim){
return true;
}
bool eh_sequencia(vector<int> vet, int inicio, int fim){
return true;
}
bool eh_igual(vector<int> vet, int inicio, int fim){
return true;
}
int contar_... | ALGO | 0.997599 | 4.804711 |
f5cd21a2-fa2a-42cb-9257-32f9b9e17223 | ishandutta2007/codeforces | bench0310/normal/1666/L.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main()
{
ios::sync_with_stdio(0);
cin.tie(0);
int n,m,s;
cin >> n >> m >> s;
vector<int> v[n+1];
for(int i=1;i<=m;i++)
{
int a,b;
cin >> a >> b;
if(b!=s) v[a].push_back(b);
}
vector<int>... | ALGO | 0.999812 | 3.732001 |
b1aeb83d-9b1a-439f-8ce7-a14fb4dda8c5 | geekZZJ/algorithm | lanqiao/十进制转十六进制/main.cpp | #include <iostream>
#include<stack>
using namespace std;
/* run this program using the console pauser or add your own getch, system("pause") or input loop */
int main(int argc, char** argv) {
int a;
char c[16]={'0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F'};
cin>>a;
stack<char> s;
do{
s.push(... | ALGO | 0.999273 | 3.808959 |
9c50240d-c74a-4408-a8bd-1177c5b3d457 | junaidjesan2/cpp | final-exam/find_jesika.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
string s;
getline(cin, s);
string word = "";
int flag = 0;
for (int i = 0; i < s.size(); i++)
{
if (s[i] != ' ')
{
word += s[i];
}
else
{
if (word == "Jessica")
... | ALGO | 0.999798 | 3.592534 |
9f96a0d8-baf2-42df-b99a-3f1ffbb6fef2 | YILINQ/biharmonic_distance | libigl/include/igl/copyleft/cgal/peel_winding_number_layers.cpp | #include "peel_winding_number_layers.h"
#include <cassert>
#include "propagate_winding_numbers.h"
template<
typename DerivedV,
typename DerivedF,
typename DerivedW >
IGL_INLINE size_t igl::copyleft::cgal::peel_winding_number_layers(
const Eigen::PlainObjectBase<DerivedV > & V,
const Eigen::PlainObjec... | ALGO | 0.996115 | 5.931994 |
9fd25867-f6c6-493b-b9a7-24a352fb168b | Tanirika-2005/leetcode | 0142-linked-list-cycle-ii/0142-linked-list-cycle-ii.cpp | /**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode(int x) : val(x), next(NULL) {}
* };
*/
class Solution {
public:
ListNode *detectCycle(ListNode *head)
{
ListNode *cur = head;
std::unordered_map<ListNode*, int> frequencyMap;... | ALGO | 0.999947 | 5.414173 |
4639d1a3-bc18-44b0-bec8-2f8aacb238ce | lucianmot/codechef-problems | 410 - C++ - ATM.cpp | // C++ - ATM
// Rating - 410
// https://www.codechef.com/problems/HS08TEST
#include <bits/stdc++.h>
using namespace std;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(0);
cout.precision(2);
int a;
float b;
cin >> a >> b;
if (( a % 5 == 0 ) && ( b - a -0.5 >= 0)) {
co... | ALGO | 0.993445 | 3.454382 |
23e4366b-3559-4647-87f8-3dce8fa3277d | raincross7/code-similarity | codes/train_code/problem487/problem487_44.cpp | #define _USE_MATH_DEFINES
#pragma region include
#include <iostream>
#include <iomanip>
#include <stdio.h>
#include <sstream>
#include <algorithm>
#include <iterator>
#include <cmath>
#include <complex>
#include <string>
#include <cstring>
#include <vector>
#include <bitset>
#include <queue>
#include <set>
#include... | ALGO | 0.999686 | 4.322572 |
a907588e-b7a4-4dba-8253-e7117423eaed | kiutao/suitesparse_android_lib | suitesparse/SuiteSparse/SPQR/Source/spqr_maxcolnorm.cpp | // =============================================================================
// === spqr_maxcolnorm =========================================================
// =============================================================================
// Given an m-by-n sparse matrix A, compute the max 2-norm of its columns.
... | ALGO | 0.991976 | 5.372514 |
16bf9bdd-449d-4a82-a0e2-be7da0abe6e6 | Kawser-nerd/CLCDSA | Source Codes/AtCoder/arc089/A/1999261.cpp | #include <array>
#include <bitset>
#include <deque>
#include <map>
#include <queue>
#include <set>
#include <unordered_set>
#include <unordered_map>
#include <vector>
#include <algorithm>
#include <functional>
#include <string>
#include <iostream>
#include <sstream>
#include <cmath>
#include <cstdio>
#include <cstring>... | ALGO | 0.999987 | 4.127779 |
8e385d16-778b-4062-991c-3aa5bc13828a | Nitdroid-Reborn/slaweks-platform_frameworks_base | media/libstagefright/codecs/amrwb/src/dec_gain2_amr_wb.cpp | /*
------------------------------------------------------------------------------
Filename: dec_gain2_amr_wb.cpp
Date: 05/08/2004
------------------------------------------------------------------------------
REVISION HISTORY
Description:
--------------------------------------------------------------------... | ALGO | 0.999291 | 4.721158 |
8c7c8e52-c90b-4f31-b55c-c75ac2d6482f | git-aditya-star/6Companies30days | Goldman Sachs/14.cpp | class Solution {
public:
int minSubArrayLen(int target, vector<int>& nums) {
int min = INT_MAX;
long long int sum =0;
int start= 0;
for(int i=0;i<nums.size();i++){
sum += nums[i];
if(sum >= target){
int len = i- start+1;
... | ALGO | 0.999994 | 6.199978 |
82befc0c-7310-4848-813a-005062d5a456 | bioc/dpeak | src/score.cpp | // Calculate score function to obtain updated mu (Rcpp)
#include <Rcpp.h>
RcppExport SEXP cpp_score( SEXP grid, SEXP S, SEXP E, SEXP L, SEXP Zg, SEXP R, SEXP gamma ) {
using namespace Rcpp;
Rcpp::NumericVector gridVec(grid), SVec(S), EVec(E), LVec(L), ZgVec(Zg);
Rcpp::NumericVector out( gridVec.size() );
... | ALGO | 0.999426 | 6.061719 |
e91d2390-0593-4a65-8b0e-720697144584 | OmarSalamaDev/IEEE-CS-25 | Rookies/Task4/A_Minimum_Knight_moves.cpp | #include <iostream>
#include <vector>
#include <algorithm>
#include <queue>
using namespace std;
typedef long long ll;
void BFS(vector<vector<ll>> &v, ll x1, ll y1, ll x2, ll y2);
int main() {
ll t;
cin >> t;
vector<ll> ans;
while (t--) {
string a, b;
cin >> a >> b;
ll x1 = a[0] - 'a';
ll y1 ... | ALGO | 0.99998 | 4.755843 |
e449dafb-5f80-4ae8-8d20-58c2ffec199e | adarsh1pandey/leetcode | 19-remove-nth-node-from-end-of-list/19-remove-nth-node-from-end-of-list.cpp | /**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode() : val(0), next(nullptr) {}
* ListNode(int x) : val(x), next(nullptr) {}
* ListNode(int x, ListNode *next) : val(x), next(next) {}
* };
*/
class Solution {
public:
ListNode* removeNthFr... | ALGO | 0.999959 | 6.02472 |
aadbb75e-f044-4db8-9335-441346793867 | MAKIYAMA-ma/AtCoder | AntsBook/2-5-2_最短経路/ABC035D.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define all(vec) vec.begin(), vec.end()
/**
* @brief
*
* @param graph i番目の要素は、{jまでコストcの経路がある}という経路の配列
* @param start 最短経路検索の始点
* @param cost 最短経路の結果を格納する配列
*/
void dijkstra(vector<vector<pai... | ALGO | 0.999849 | 5.038102 |
df5a8263-8036-4e59-8603-f13719301e8b | AmberGTP5/MOFTransformer_Reproduction | libs/GRIDAY/LennardJones.cpp | #include "LennardJones.hpp"
#include <iostream>
#include <iomanip>
#include <limits>
#include <cmath>
#include "GridayException.hpp"
LennardJones::LennardJones(GReal eps, GReal sig, GReal rcut) :
PairEnergy {},
mEps {eps},
mSig {sig},
mSigSq {sig * sig},
mRcut {rcut},
mRcutSq {rcut * rcut}
... | ALGO | 0.999317 | 5.758667 |
e8a4c856-1d1e-45d6-9eae-9507987efa87 | ygtxr1997/AlgorithmLearningTraining | Training/LeetCode/ProblemSet/m0805/yuangem0805.cpp | class Solution {
public:
int multiply(int A, int B) {
if (B == 0) return 0;
if (B == 1) return A;
if (B == 2) return A + A;
if (B & 1) return A + (multiply(A, B >> 1) << 1);
else return multiply(A, B >> 1) << 1;
}
}; | ALGO | 0.999944 | 5.637001 |
41e6bc7c-fd36-4b72-a54d-881a4c2e888f | gotliebel/algorithms_3 | contest2/q.cpp | #include <algorithm>
#include <iostream>
#include <vector>
#include <set>
class Graph {
public:
Graph(int, int);
void AddEdge(int, int, int, int);
std::set<int> FindDotsArticulation();
int GetSkyScrapersSize() const;
private:
enum class Color { WHITE, GRAY };
void Dfs(int, int);
int size_skyscrapers_... | ALGO | 0.999972 | 5.084311 |
79039a8c-3847-424c-9bd3-46c6335c6e93 | bogdaniura/Programming | Liceu/C⁄C++/#124/main.cpp | #include <fstream>
using namespace std;
int n, a[10];
ifstream fin("permutari1.in");
ofstream fout("permutari1.out");
void tip()
{
int i;
for (i = 1; i <= n; i++)
fout << a[i] << ' ';
fout << endl;
}
bool valid(int k1)
{
for (int i = 1; i <= k1 - 1; i++) // pentru toate elem situate in stg
... | ALGO | 0.999924 | 4.144688 |
3160b8f9-5cda-487d-acd6-5ac12e169a45 | RobJames44035/StarshipOS | openjdk/src/jdk.jpackage/share/native/applauncher/AppLauncher.cpp | #include <algorithm>
#include "AppLauncher.h"
#include "JvmLauncher.h"
#include "CfgFile.h"
#include "Log.h"
#include "Dll.h"
#include "Toolbox.h"
#include "SysInfo.h"
#include "FileUtils.h"
AppLauncher::AppLauncher() {
setInitJvmFromCmdlineOnly(false);
launcherPath = SysInfo::getProcessModulePath();
args ... | TOOL | 0.882296 | 6.540908 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.