uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
98115ae0-b93d-4e1a-abc3-94ab823bd748 | const-dominik/university-courses | mia2/4_c.cpp | #include <bits/stdc++.h>
#include <vector>
const int MAX_NODES = 200010;
int parent[MAX_NODES], res, root, visited[MAX_NODES];
std::vector<int> g[MAX_NODES];
void dfs(int node)
{
visited[node] = 1;
for (int i = 0; i < g[node].size(); i++)
{
int next = g[node][i];
if (node == next)
... | ALGO | 0.999951 | 5.10854 |
18793f84-b8c9-4080-800d-906a672a9c28 | turajred/algorithm | module 10.5/bfsdfson2dgrid.cpp | #include<bits/stdc++.h>
using namespace std;
typedef pair<int,int> pii;
const int N=1e3+10;
vector<string>g;
vector<pii>direc={{0,-1},{0,1},{-1,0},{1,0}};
int n,m;
bool isValid(int i,int j){
return (i>=0&&i<n && j>=0&&j<m);
}
bool visited[N][N];
int depth[N][N];
int level[N][N];
void dfs(int i,int j){
if(!isVal... | ALGO | 0.999866 | 3.725198 |
0253a3ac-a119-49a3-95af-296a59a2f62c | Arunjagan12/-ReviseWithArsh-6Companies30Days-Challenge | Goldman Sachs /EmployeePrioritySystems.cpp | class Solution {
public:
int cal(string a,string b){
if(a[0]==b[0]&&a[1]==b[1]){
string s1 = a.substr(2, 2);
string s2 = b.substr(2, 2);
int a1=stoi(s1);
int b1=stoi(s2);
return (abs(a1-b1));
}
else{
string s1=a.substr(0,2);
st... | ALGO | 0.999949 | 5.587299 |
227481ea-613e-4e89-8e50-575a5f01f76f | Smoria/RayTracer | Code/Projects/RayTracer/sources/RayTracer/VectorOperations.cpp | #include "RayTracer/VectorOperations.h"
namespace RayTracer
{
Vector3f Reflect(const Vector3f& target, const Vector3f& normal)
{
const Vector3f normalized = normal.normalized();
Vector3f res = target - 2 * normalized * (target.dot(normalized));
res.normalize();
return res;
}... | ALGO | 0.860591 | 6.437934 |
cd3b7783-1e41-400c-9a8a-f1552c010a33 | stefdasca/CompetitiveProgramming | Infoarena/2sec.cpp | #include<bits/stdc++.h>
using namespace std;
ifstream f("2sec.in");
ofstream g("2sec.out");
int n,v[1000002];
int smin[1000002],smax[1000002];
int main()
{
f>>n;
for(int i=1;i<=n;++i)
f>>v[i],smin[i]=v[i],smax[i]=v[i];
for(int i=2;i<=n;++i)
smin[i]=min(smin[i],smin[i-1]+v[i]);
for(int i=... | ALGO | 0.999905 | 3.771188 |
2440f767-c1a8-4038-b1fd-3d0a0d6c27bf | lcnzg/lammps-pi | src/USER-INTEL/pppm_disp_intel.cpp | /* ----------------------------------------------------------------------
Contributing authors: William McDoniel (RWTH Aachen University)
------------------------------------------------------------------------- */
#include "pppm_disp_intel.h"
#include "atom.h"
#include "comm.h"
#include "domain.h"
#include "error... | ALGO | 0.973699 | 3.703557 |
1c7548bc-edc2-4ede-b5a4-76d1963dded7 | leedohun/baekjoon | Brute Force/2116.cpp | #define _CRT_SECURE_NO_WARNINGS
#include <bits/stdc++.h>
#define rep(i, n) for(int i = 0; i < (n); i++)
typedef long long ll;
using namespace std;
const ll _INF = 1e18;
const ll INF = 1e9;
int N;
int s[10005][6] = { 0, };
map <int, int> m;
int ret = 0;
void dfs(int f, int down, int up, int cnt) {
int tmp = ... | ALGO | 0.999892 | 4.232431 |
41c57982-f289-4151-979d-104c75dd1ff3 | AllenAndrew01123/Competitve-Programming | Codeforces/Marathon.cpp | #include<bits/stdc++.h>
using namespace std;
main()
{
int t;cin>>t;
while(t--)
{
int a[4];cin>>a[0]>>a[1]>>a[2]>>a[3];
int c=0;
if(a[1]>a[0])
c++;
if(a[2]>a[0])
c++;
if(a[3]>a[0])
c++;
cout<<c<<endl;
}
} | ALGO | 0.998806 | 3.800374 |
b9e42d43-c894-47da-83c1-190370a59e1a | ros2cuda/cupoch-fat | third_party/eigen/bench/dense_solvers.cpp | #include <iostream>
#include "BenchTimer.h"
#include <Eigen/Dense>
#include <map>
#include <vector>
#include <string>
#include <sstream>
using namespace Eigen;
std::map<std::string,Array<float,1,8,DontAlign|RowMajor> > results;
std::vector<std::string> labels;
std::vector<Array2i> sizes;
template<typename Solver,type... | TOOL | 0.998362 | 6.326138 |
e9e56e45-f155-48ba-b261-9896d9de020a | Siya8een/gfg | Difficulty: Easy/Binary Tree Representation/binary-tree-representation.cpp | //{ Driver Code Starts
//Initial Template for C++
#include<bits/stdc++.h>
using namespace std;
struct node {
int data;
struct node *left;
struct node *right;
};
struct node *newNode(int data) {
struct node *node = (struct node *)malloc(sizeof(struct node));
node->data = data;
node->left = NULL;
node->... | ALGO | 0.999215 | 5.042707 |
e74470f5-1cd8-472c-b60c-404f562967a1 | AnirudhAgnihotri2902/LeetCode-Problems | 79-word-search/79-word-search.cpp | class Solution {
public:
bool solve(int i, int j, int ind, string str, vector<vector<char>>&board, vector<vector<bool>>&vis){
//cout<<i<<" "<<j<<" "<<ind<<endl;
if(ind == str.size()){
return true;
}
if(i<0||j<0||i>=board.size()||j>=board[0].size()||str[ind]!=board[i][j]||... | ALGO | 0.999815 | 5.974039 |
f3331feb-9e40-4f79-8b15-2ffc233968ba | ragibKhandoker/University-CSE-Coding-Assignments- | CSE-221/Lab-assignment-new2/count2.cpp | #include <bits/stdc++.h>
using namespace std;
int lower_value_index(vector<int>& arr,int target_1){
int left_1 = 0;
int right_1 = arr.size();
while(left_1 < right_1){
int mid_1 = left_1 + (right_1-left_1) / 2;
if(arr[mid_1] < target_1){
left_1 = mid_1+1;
}
else{
... | ALGO | 0.999947 | 4.315907 |
959ed762-b18b-4320-a9d5-80c31e9db2c2 | yeguetta557/android_frameworks_av | media/libstagefright/codecs/amrnb/common/src/inv_sqrt.cpp | /*
Pathname: ./audio/gsm-amr/c/src/inv_sqrt.c
------------------------------------------------------------------------------
REVISION HISTORY
Description: Put file into template.
Description: Synchronized file with UMTS version 3.2.0. Updated coding
template. Removed unnecessary include files.
De... | ALGO | 0.999901 | 5.671657 |
8fb4ceca-5db0-4de8-9a95-e8dab89ceb42 | ggml1/Competitive-Programming | UVa/12503.cpp | #include <bits/stdc++.h>
#include <locale>
#define fast_io ios::sync_with_stdio(0);cin.tie(0)
using namespace std;
string get(string instructions[], string k){
string b, c; int x;
stringstream a(k);
a >> b >> c >> x;
return instructions[x];
}
int main(){
fast_io; cout << fixed << setprecision(5);
int t; c... | ALGO | 0.999281 | 3.773058 |
f36d036f-3edb-4b8c-9eb7-0341724533d2 | snckkund/Cpp | _HomeWork/flattenLL.cpp | #include <iostream>
using namespace std;
// @Code360: Flatten A Linked List
class Node {
public:
int data;
Node *next;
Node *child;
Node() : data(0), next(nullptr), child(nullptr){};
Node(int x) : data(x), next(nullptr), child(nullptr) {}
Node(int x, Node *next, Node *child) : data(x), next(ne... | ALGO | 0.999896 | 5.439991 |
745195d9-a869-4a0c-bdf0-60cd9cd9ec2f | fengqiao18/vscode | 2023/01/0102/P2814.cpp | #include <bits/stdc++.h>
using namespace std;
map<string, string> fa;
inline string find(string x) { return fa[x] == x ? x : fa[x] = find(fa[x]); };
inline void unionn(string x, string y) {
x = find(x), y = find(y);
if (x != y) {
fa[x] = y;
}
return;
}
int main() {
char opt;
string s, cur;
while (cin ... | ALGO | 0.999879 | 4.047057 |
ea83c67c-a496-4ff5-867f-954487a274c4 | zimmjoshua/Linked-Lists- | PE1/node1imp.cpp | // Implementation file for Singly linked list functions
// Author: Joshua Zimmerman
// Date: 03/03/17
#include "node1.h"
#include <cassert> // Provides assert
#include <cstdlib> // Provides NULL and size_t
#include <iostream> // For file I/O
using namespace std;
namespace main_savitch_5
{
size_t list_length(... | ALGO | 0.994146 | 4.766132 |
c5ee948c-d335-477f-87af-7e4ea043ace7 | mayankdrvr/leetcode_cpp_solutions_collection_leethub | 14-longest-common-prefix/14-longest-common-prefix.cpp | class Solution {
public:
string longestCommonPrefix(vector<string>& strs) {
string res="";
int count=0;
int str_len=strs.size(), min=INT_MAX, min_i=0,dummy=0;
if(str_len==1)
return strs[0];
for(int i=0;i<str_len;i++){
min_i=strs[i].length();
... | ALGO | 0.99974 | 5.351181 |
115d14f5-4d83-4caa-9ba8-6cd79859624c | DavideD96/Esercizi-di-LSN | lezione 2/esercizio02_2/cubicRW.cpp | #include "cubicRW.h"
#include <iomanip>
using namespace std;
cubicRW::cubicRW(const int start[], unsigned int dim, unsigned int npassi){
_dim = dim;
_nStep = npassi;
_journey = new int*[_dim];
_startingPosition = new int[_dim];
for(int j=0; j<_dim; j++){
_startingPosition[j] = start[j];
_journey[j] = new i... | ALGO | 0.999252 | 3.097534 |
0f0d13ad-9867-42e1-bfd0-8f26b216aedc | dowiyogo/FNAL_FEE | Macro_unprocessed_files/MACRO_SquarePulseSigmoidMultipleFit.cpp | int nevents = 500;
double sigmoid(double* x, double* par){
double ind = *x;
return par[0]/(1+TMath::Exp(-ind*par[1])) + par[2];
}
void MACRO_SquarePulseSigmoidMultipleFit()
{
TFile* f = new TFile("../data/signal-diff-risetime/converted_run100000.root","READ");
TTree* pulse = (TTree*) f->Get("pulse");
... | ALGO | 0.967453 | 4.690869 |
f06326b7-cf3e-4a81-8678-3f2132aae6ca | jw2528783/WatermanJustin_CSC5_40717 | Class_Lab/Partially Filled Arrays/main.cpp | /*
* File: main.cpp
* Author: Justin Waterman
* Created on January 29, 2015, 9:17 AM
* Purpose: Partially Filled Arrays
*/
#include <cstdlib>
#include <iostream>
#include <ctime>
#include <vector>
using namespace std;
//Global Constants
const int COL=200;
//Function Prototypes
void filAray(int [],int);
... | TOOL | 0.919605 | 4.322541 |
307054b1-a41c-4ad8-aebf-7865690720a6 | sunyongjie1984/cs_to_be_delete | DSAA/背包问题/背包问题/main.cpp | #include <stdio.h>
#define W 1000
#define N 1000
typedef struct data
{
int vaule;
int weight;
}goods;
int returnmax(int a, int b)
{
return (a > b ? a : b);
}
int KNAPSACK(goods *P, int a, int s)
{
int V[N][W];
int i,j,mv;
for(i = 0; i < a; i++)
V[i][0] = 0;
for(j = 0; j < s; j++)
... | ALGO | 0.99985 | 3.231211 |
f9f8969e-a777-4a59-9716-1b01a036b236 | KhanhKitin/spoj_ptit | sothuannghich_ptit138c.cpp | #include<stdio.h>
#include<conio.h>
#include<stdlib.h>
#include<string.h>
int dao(char a[]){
char b[225];
strcpy(b,a);
strrev(b);
if(strcmp(a,b)==0) return 1;
return 0;
}
int main(){
char s[225];
int n;
scanf("%d",&n);
while(n--){
scanf("%s",s);
for(int i=0;i<strlen(s);i++){
if(s[i]>=97&&s[i]<=122)... | ALGO | 0.999853 | 3.821319 |
6b5786b5-8f34-42f9-bb37-cf11ddf190e5 | CheRongtian/Data-Structure-in-Cpp | HeapFunction.cpp | #include <iostream>
using namespace std;
void swap(int A[], int i, int j){
int temp = A[i];
A[i] = A[j];
A[j] = temp;
}
int Delete(int A[], int n){
int x = A[0]; // Max element
A[0] = A[n-1];
int i = 0;
int j = 2 * i + 1;
while (j < n-1){
// Compare left and right child... | ALGO | 0.999926 | 4.198371 |
4033766c-04be-4e38-9abc-45fdb644dce1 | Young-Cody/CSC2021-NKU-TEDA | src/basicblock.cpp | #include "basicblock.h"
#include "function.h"
#include <algorithm>
void BasicBlock::insert(Instruction *i)
{
if (begin_inst == nullptr){
begin_inst = i;
}
end_inst = i;
parent->insertInst(i);
}
// insert the instruction to the front of the basicblock.
void BasicBlock::insertFront(Instruction *... | TOOL | 0.899432 | 5.01927 |
ac4c285a-ef2d-4057-ab6a-b5408bb03fbb | jwleesnu/ws_livox | src/mrpt/libs/nav/src/holonomic/ClearanceDiagram.cpp | #include "nav-precomp.h" // Precomp header
//
#include <mrpt/core/round.h>
#include <mrpt/nav/holonomic/ClearanceDiagram.h>
#include <mrpt/nav/tpspace/CParameterizedTrajectoryGenerator.h>
#include <mrpt/opengl/CMesh.h>
#include <mrpt/serialization/CArchive.h>
#include <mrpt/serialization/stl_serialization.h>
#include... | TOOL | 0.928577 | 6.523214 |
fa05ddf0-49da-4a50-9a7c-0368eec32fe7 | NoiseProject/android_frameworks_av-1 | media/libstagefright/codecs/amrnb/enc/src/inter_36.cpp | /*
------------------------------------------------------------------------------
Pathname: ./audio/gsm-amr/c/src/inter_36.c
Date: 01/31/2002
------------------------------------------------------------------------------
REVISION HISTORY
Description:
1. Eliminated unused include files.
... | ALGO | 0.999472 | 5.616278 |
3497f597-b1bd-4888-bb83-ff1cc08907f1 | ironmerc/frameworks_av | media/libstagefright/codecs/amrnb/common/src/q_plsf_3.cpp | /*----------------------------------------------------------------------------
; INCLUDES
----------------------------------------------------------------------------*/
#include <string.h>
#include "q_plsf.h"
#include "typedef.h"
#include "lsp_lsf.h"
#include "reorder.h"
#include "lsfwt.h"
/*------------------------... | ALGO | 0.999484 | 5.832959 |
ee45fe68-2781-499d-b44f-b13cca1d2a49 | saurbh264/CP_Archives | TLE Eliminators Sheet/Rated 800/DoremyPaint.cpp | #include <iostream>
#include <vector>
#include <algorithm>
#include<unordered_map>
using namespace std;
void mainCode(){
int n=0;
cin >> n;
vector<int> v(n);
for(int i=0;i<n;i++){
int t=0;
cin >> t;
v[i] = t;
}
if (n==2){
cout << "YES\n";
return;
}
... | ALGO | 0.999893 | 4.275421 |
e225142d-8163-49b4-8a48-a29a3628ddeb | OmarKhaledm21/365Days_LeetCode | Design HashSet.cpp |
class MyHashSet {
private:
const int SIZE = 100001;
int *bucket;
public:
MyHashSet() {
bucket = new int[this->SIZE];
for (int i = 0; i < this->SIZE; i++) {
bucket[i] = -1;
}
}
int hash(int key) {
return key % this->SIZE;
}
void add(int key) {
... | ALGO | 0.999215 | 5.656145 |
1ef27ff3-1859-40e5-8835-d0a49b909750 | milmillin/comp-prog | IPST/Archive/19Oct/DelList.cpp | #include <cstdio>
#include <vector>
#include <algorithm>
#include <iostream>
#include <unordered_map>
using namespace std;
struct ei{
int val,idx;
//int del;
//vector<int> del;
};
unordered_map<int,int> mp;
bool operator< (const ei &a, const ei &b) {
return a.val<b.val;
}
bool cmp (const ei &a, const ei &b) {
... | ALGO | 0.999962 | 3.38204 |
7843074e-e735-4ff5-aacc-1eaefa699ce8 | bose045/lammps | USER-MESODPD/pair_tdpd.cpp | /* ----------------------------------------------------------------------
Contributing author: Zhen Li (Brown University)
Email: <EMAIL>
------------------------------------------------------------------------- */
#include "pair_tdpd.h"
#include <cmath>
#include <ctime>
#include "atom.h"
#include "comm.h"
#inclu... | ALGO | 0.997931 | 6.213651 |
293d21a9-a7a2-489a-ab14-a7544a88b498 | proteus-core/libra | libra-llvm/llvm/lib/CodeGen/MachineRegionInfo.cpp | #include "llvm/CodeGen/MachineRegionInfo.h"
#include "llvm/ADT/Statistic.h"
#include "llvm/Analysis/RegionInfoImpl.h"
#include "llvm/CodeGen/MachinePostDominators.h"
#include "llvm/Config/llvm-config.h"
#include "llvm/InitializePasses.h"
#include "llvm/Pass.h"
#include "llvm/Support/Compiler.h"
#include "llvm/Support/D... | TOOL | 0.913432 | 7.854792 |
d5bb3c63-2732-4646-aa05-c2b09038d2d7 | aribshan/CSES | twoSets.cpp | #include <bits/stdc++.h>
#define int long long
using namespace std;
void solve(){
int n;
cin >> n;
int sum = (n*(n+1))/2;
if(sum%2){
cout << "NO" << '\n';
return;
}
cout << "YES" << '\n';
vector<int> a, b;
int target = sum/2;
int i = n;
while(target){
... | ALGO | 0.999921 | 3.788518 |
c013258b-b5a1-4726-92cb-980620c7a716 | subhamengine/Leetcode | 820-short-encoding-of-words/820-short-encoding-of-words.cpp | class Solution {
public:
int minimumLengthEncoding(vector<string>& words) {
for(auto &it:words){
reverse(it.begin(),it.end());
}
sort(words.begin(),words.end());
int res = 0;
for(int i = 0 ; i < words.size() - 1 ; i++){
res += words[i] == words[i+1].su... | ALGO | 0.999994 | 6.020722 |
fdd13e9f-5a8d-4845-969f-dad6f769fee3 | abughalib/pdf-reader | 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.998859 | 6.785645 |
150c23aa-6ff6-49a0-a20c-58172656eea3 | ginnyching/GPE_prep | 10415 Eb Alto Saxophone Player/10415 Eb Alto Saxophone Player.cpp | #include <iostream>
#include <string>
#include <vector>
using namespace std;
void press(string s, vector<pair<int,bool>> &finger){
for(int i=0;i<10;i++){
if(s[i]=='1' && finger[i].second==0){
finger[i].first++;
finger[i].second=1;
}
else if(s[i]=='0' && finger[i].second==1)
finger[i].se... | ALGO | 0.999688 | 3.787885 |
01d5df43-4eae-4a14-ab3e-73bed5bc8471 | ngoyal2707/SPOJ-solutions | SAMER08C.cpp | #include<iostream>
#include<vector>
using namespace std;
// long int getRowValue(int *array,long int i){
// if(i<0)
// return 0;
// if(i==0)
// return array[i];
// long int result=max(array[i]+getRowValue(array,i-2),getRowValue(array,i-1));
// return result;
// }
long int solve(int **a,long int M,long int N){... | ALGO | 0.99994 | 4.052717 |
ad2f53fe-6ccf-4060-8090-f7d26a69a0ea | vishalamin200/Data-Structures-And-Algorithms | 1 Array & Vector/Classroom/Array-2/8_sort-0-1.cpp | // sort 0 and 1 with linear time complexity and inplace ;
#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
// brut force - sort the array using sort funtion or any other sorting algo : O(nlogn)
void print(vector<int>&arr){
for(auto value : arr){
cout<<value<<" ";
}
cou... | ALGO | 0.999956 | 5.005821 |
8616daf1-a5e1-46a0-9737-ffb7bf191fd1 | lcsmuller/CI1058_ComputerNetworking-I | Trabalho3/game.cpp | #include <bits/stdc++.h>
#include <sys/socket.h>
#include "player.h"
using namespace std;
using die = pair<int, bool>;
#define NUMDICE 5
#define PROMPT_YES(c) (c == 'y' || c == 'Y')
#define PROMPT_NO(c) (c == 'n' || c == 'N')
#define PROMPT_VALID(c) (PROMPT_YES(c) || PROMPT_NO(c))
class game
{
private:
... | ALGO | 0.898472 | 3.612243 |
271a84f6-cec8-4ef2-8903-6110064b4b4b | DilicalFlame/cpp-playground | 100_The_Foundation/110_Basic_IO_and_Syntax/008_floating_pt_multiplier.cpp | // Prompt the user for two floating point numbers and calculate their product
#include <iostream>
using namespace std;
int main()
{
float num1, num2;
cout << "Enter two floating point numbers: ";
cin >> num1 >> num2;
const float product = num1 * num2;
cout << product << endl;
return 0;
}
| TOOL | 0.97653 | 4.759258 |
608c91ff-ee32-4af9-b5cf-d499ec93ec2a | sai3097ganesh/Physically-based-modelling | RigidBodySimulation/RigidBodySimulation/include/eigen-eigen-323c052e1731/doc/examples/TutorialLinAlgExSolveColPivHouseholderQR.cpp | #include <iostream>
#include <Eigen/Dense>
using namespace std;
using namespace Eigen;
int main()
{
Matrix3f A;
Vector3f b;
A << 1,2,3, 4,5,6, 7,8,10;
b << 3, 3, 4;
cout << "Here is the matrix A:\n" << A << endl;
cout << "Here is the vector b:\n" << b << endl;
Vector3f x = A.colPivHouseholderQr... | ALGO | 0.999932 | 3.356631 |
5f5e0ec8-b787-4baf-8bf1-8be6ca929246 | infiniflow/finity | src/storage/invertedindex/search/early_terminate_iterator/blockmax_term_doc_iterator.cpp | module;
#include <cassert>
#include <cmath>
#include <iostream>
#include <tuple>
#include <string>
module blockmax_term_doc_iterator;
import stl;
import index_defines;
import internal_types;
import segment_posting;
import posting_iterator;
import column_length_io;
import infinity_exception;
import logger;
namespace... | ALGO | 0.96461 | 7.302096 |
fa29c0e3-0359-4245-8cff-403a68ac8084 | drliebe/cpp_primer_5th_ed | 12/ex_12_24.cpp | #include <iostream>
#include <string>
using std::string;
using std::cin;
int main()
{
char *pc = new char[10];
int n = 0;
char c;
string input;
while(cin >> input)
{
for(int k=0; k<input.size(); ++k)
{
*(pc+n) = input.at(k);
++n;
}
}
for(int i=0; i<n; ++i)
{
std::cout << *(pc+i);
}
std::... | TOOL | 0.993714 | 3.840551 |
4478e4ec-cef5-4684-a1fa-52d550ce6eee | thou05/dsa | algorithm/backtracking/dat-hau.cpp | #include <bits/stdc++.h>
using namespace std;
const int MAX = 100;
int n, a[MAX], dem = 0;
bool antoan(int k, int i){
for(int j = 1; j < k; j++){
if(a[j] == i || a[j] + j == k + i || a[j] - j == i - k){
return false; //không an toàn
}
}
return true; //an toàn
}
void print(){
... | ALGO | 0.999932 | 4.137568 |
eb28a438-f757-4cad-93ea-521044100975 | xuxinyang/daneijl | L12/demo06.cpp | #include <bits/stdc++.h>
using namespace std;
const int maxn = 25;
int n, m, sx, sy, ex, ey, ans;
char a[maxn][maxn];
bool vis[maxn][maxn];
const int dx[4] = {0, 1, 0, -1};
const int dy[4] = {-1, 0, 1, 0};
void dfs(int x, int y)
{
if (x == ex && y == ey)
{
ans++;
return;
}
for (int i = 0... | ALGO | 0.99989 | 4.02207 |
590cdbfc-a1c0-4f52-9899-7597b16501be | ChuanSWT/Codeforces_codes | D_For_Wizards_the_Exam_Is_Easy_but_I_Couldn_t_Handle_It.cpp | #include <iostream>
#include <vector>
#include <string>
#include <map>
#include <cmath>
#include <algorithm>
#include <set>
#include <tuple>
#include <queue>
#include <iomanip>
#include <numeric>
#define int long long
using namespace std;
void compete_solution();
signed main()
{
ios_base::sync_with_stdio(false);
... | ALGO | 0.999973 | 4.176573 |
4dd2ff68-5a9d-4733-a731-d8421540ceae | fedeaar/metnum-tp02 | implementacion/src/impl/matriz/matriz_alt.cpp | #include "../../matriz/matriz_alt.h"
//
// ALT PRIVATE
//
size_t alt::search(size_t row, size_t col) const {
assert(0 <= row && row < _n && 0 <= col && col < _m);
if(_last[row].from <= col && col <= _last[row].to) return _last[row].pos;
if(_last[row].to+1 <= col && col <= _last[row].next) return _last[r... | ALGO | 0.97583 | 5.200657 |
30d5bc56-34d7-4c53-b1d6-37985487becd | 3k5m/Competitive-Programming | cpp/ccc01s3 fail.cpp | #include <bits/stdc++.h>
using namespace std;
typedef unsigned long long ull;
const int MAX = 26;
const int endgoal = 1;
bool roadgraph[MAX][MAX];
stack<int> st;
bool visited[MAX][MAX] = {{0}};
bool bomb[MAX][MAX] = {{0}};
void clearvisits(){
memset(visited, 0, sizeof(visited));
while(!st.empty())st.pop();
... | ALGO | 0.999603 | 3.648513 |
41168d77-2deb-4064-935b-39a999c01cd3 | dailycrypto-me/daily-vdf | src/VerifierWesolowski.cpp | #include "../include/VerifierWesolowski.h"
namespace vdf
{
VerifierWesolowski::VerifierWesolowski(
const unsigned long _lambda,
const unsigned long _t,
const bytevec &_x,
const unsigned long _lambdaRSW) : hash(_lambda),
durations(4),
... | ALGO | 0.998259 | 6.439047 |
9d423f2f-251f-4d3e-b06b-a95516dcd27f | dompolak/UkladRownan_szablon | src/Uklad_def.cpp | #include "Uklad.hh"
template<class T, int size>
const macierz<T, size> & uklad_rownan<T, size> ::get_arg1() const
{
return this->arg1;
}
template<class T, int size>
const Wektor<T, size> & uklad_rownan<T, size> ::get_arg2() const
{
return this->arg2;
}
template<class T, int size>
void uklad_rownan<T, size> ... | ALGO | 0.969151 | 3.901152 |
ecf5ab1f-1d44-49ca-8d16-b1f15c566232 | anarchydevs/aoia | ThirdParty/Boost/libs/spirit/example/fundamental/stuff_vector.cpp | ///////////////////////////////////////////////////////////////////////////////
//
// This sample demontrates a parser for a comma separated list of numbers
// This is the phoenix version of number_list.cpp.
// This is discussed in the "Phoenix" chapter in the Spirit User's Guide.
//
// [ JDG 1/12/2004 ]
//
///////... | TOOL | 0.987626 | 7.099579 |
42dd98b2-cae4-4046-8092-f6f750c9240b | PlatinumTeam/MBExtender | MBExtender/src/TorqueLib/math/mQuat.cpp | #include "../platform/platform.h"
#include "mQuat.h"
#include "mAngAxis.h"
#include "mMatrix.h"
const QuatF QuatF::Identity(0.0f,0.0f,0.0f,1.0f);
QuatF& QuatF::set( const EulerF & e )
{
F32 cx, sx;
F32 cy, sy;
F32 cz, sz;
mSinCos( -e.x * 0.5f, sx, cx );
mSinCos( -e.y * 0.5f, sy, cy );
mSinCos( -e.z... | ALGO | 0.859699 | 6.471827 |
80951306-ba65-4b13-9054-5a09ec75153e | jonathannzt/maze_runner | src/main.cpp | #include <iostream>
#include "Maze.h"
#include "MazeGenerator.h"
#include "MazeSolver.h"
int main() {
int width = 20;
int height = 10;
Maze maze(width, height);
MazeGenerator generator;
generator.generateMaze(maze, 0, 0);
MazeSolver solver;
bool found = solver.solveAStar(maze, 0, 0, width... | ALGO | 0.994415 | 5.593939 |
02b7598e-47c9-406a-befc-9858d055cc98 | rakeshcusat/Code4Reference | Algorithm/CPP/char_combination.cpp | #include <iostream>
#include <memory>
#include <cstdlib>
#include <vector>
#include <string>
using namespace std;
#define DEST_SIZE 2
void rec_combination(char* src, char * dest, int level, int len)
{
if(level==DEST_SIZE)
{
dest[level]='\0';
cout<<dest<<endl;
return ;
}
for(int index=0;index<len;index++)... | ALGO | 0.99938 | 3.893206 |
f0e4e1ca-156c-4c1d-b56a-bc320c2f8140 | dxhisboy/lammps-sunway | pppm_stagger.cpp | /* ----------------------------------------------------------------------
Contributing author: Stan Moore (Sandia)
------------------------------------------------------------------------- */
#include <mpi.h>
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include "pppm_stagger.h"
#inc... | ALGO | 0.996847 | 5.473081 |
fc678996-b9f1-4e67-8997-27ca39e9ee05 | ericisma/mongoDB | src/mongo/s/write_ops/write_op.cpp | #include "mongo/s/write_ops/write_op.h"
#include "mongo/db/stats/counters.h"
#include "mongo/s/write_ops/batch_write_op.h"
#include "mongo/s/write_ops/batched_command_request.h"
#include <absl/container/flat_hash_set.h>
#include <algorithm>
#include <boost/none.hpp>
#include <ostream>
#include <string>
#include <boos... | TOOL | 0.872231 | 7.962015 |
f40de067-f25d-4dc4-8b48-0c0c29239041 | krzysiekbienias/clicker-plus-plus | src/strings/first_non_repeating_character.cpp | #include <string>
#include <unordered_map>
#include "utils/print_utils_templates.hpp"
// Implement your first_non_repeating_character logic here.
int firstNonRepeatingCharacter(std::string str){
std::unordered_map<char, int> letterFrequency;
for (char ch:str){
letterFrequency[ch]++;
}
for ... | ALGO | 0.998422 | 6.119136 |
8637c753-3ad9-4e71-8b25-cf96fb3c6966 | SakshamArora07/Data-Structures-and-Algorithms | cpp/basic maths codes/hcf_and_lcm.cpp | // GCD/HCF - greatest common divisor or highest common factor
// find the minimum and maximum no from an array and find their gcd/hcf and their LCM.
#include<iostream>
#include<vector>
using namespace std;
void find_max_min_no(vector<int>& nums,int &min, int &max){
max = nums[0];
min = nums[0];
for(i... | ALGO | 0.998969 | 4.537732 |
1f1cf1c5-d70c-4410-840c-c14f216fca2b | HongyuHe/basic-algorithms | DFS/dfs.cpp | #include <iostream>
#include <vector>
#include <list>
using namespace std;
// This class represents a directed graph using
// adjacency list representation;
class Graph {
public:
Graph(int V);
~Graph();
void set_adj_(int src, int dest);
void DFS(int source); // Recursivly prints DFS traversal from a given so... | ALGO | 0.99983 | 5.940803 |
3772de27-b17d-4ae2-bfa0-14839ace7fcb | mihailovy/ads-12 | graph/graph-representation/neibhourhood-matrix-2.cpp | #include <stdio.h>
#define MAX 200
int matrix[MAX][MAX]; // Двумерен масив
int n;
void init(void) {
int i,j;
for (i = 0; i < n; i++) {
for (j = 0; j < n; j++) {
matrix[i][j] = 0;
}
}
}
int main(void) {
// Елементарен насочен граф, който използва двумерен масив.
// +---------+... | ALGO | 0.999814 | 3.657412 |
9d1aeff2-d06d-47ee-b73b-9375428c7796 | SmagliukJulia/contest | C.cpp | #include <iostream>
#include <cstdint>
#include <algorithm>
class Fraction final {
private:
// Do NOT rename
int64_t numerator;
uint64_t denominator;
// Do NOT delete
template <class T>
friend bool operator==(const Fraction& lhs, const T& rhs);
public:
uint64_t gcd(uint64_t a, uint64_t b)... | TOOL | 0.981714 | 5.946089 |
d24a210d-0ed3-4866-8b8c-10f150a1a304 | jmarshall23/Duke2002 | source/cm/CollisionModel_files.cpp | /*
===============================================================================
Trace model vs. polygonal model collision detection.
===============================================================================
*/
#include "precompiled.h"
#include "CollisionModel_local.h"
#define CM_FILE_EXT "cm"
#define CM... | TOOL | 0.91383 | 4.484496 |
7f2bd002-c6a2-4b3c-afc0-2a406ac03775 | old-yan/leetcode-solutions | leetcode_solutions/weekly_contest/weekly_contest_s252/1.cpp | #include "utils.h"
class Solution {
public:
//简单模拟
bool isThree(int n) {
int ans=0;
for(int i=1;i<=n;i++)
if(n%i==0)ans++;
return ans==3;
}
};
int main()
{
cout<<boolalpha;
Solution sol;
int n=2;
auto ans=sol.isThree(n);
DBG(ans);
system("pause... | ALGO | 0.999479 | 4.987373 |
618db37f-9d34-4d75-8319-feaf4c0648f9 | ROCm/MISA | driver/perf/gmap.cpp | #include "perf.h"
#include <sys/stat.h>
#include <sys/types.h>
#include <errno.h>
#include <stdio.h>
#include <string>
#include <vector>
#include <initializer_list>
#include <cstdint>
#include <tuple>
#include <algorithm>
#include <iterator>
#include <functional>
#include <thread>
#include <sstream>
#include <unordere... | TOOL | 0.880974 | 4.732313 |
3324c014-ed76-4d6a-af75-1a0f6e625c51 | ishandutta2007/codeforces | lomk/normal/1338/B.cpp | /*input
6
1 3
2 3
3 4
4 5
5 6
*/
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define sp ' '
#define endl '\n'
#define fi first
#define se second
#define bit(x,y) ((x>>y)&1)
#define loop(i,l,r) for(int i=(int)l; i<=(int)r; i++)
#define rloop(i,l,r) for(int i=(int)l; i>=(int)r; i--)
#ifdef UncleGr... | ALGO | 0.999853 | 4.473359 |
d5e44dac-ef01-4129-b47f-24e5f2a2e1b5 | HananiJia/bit | 领扣--合并了两个有序链表 2/领扣--合并了两个有序链表 2/源.cpp | #define _CRT_SECURE_NO_WARNINGS 1
#include<iostream>
using namespace std;
struct ListNode {
int val;
ListNode *next;
ListNode(int x) : val(x), next(NULL) {}
};
class Solution {
public:
ListNode* mergeTwoLists(ListNode* l1, ListNode* l2) {
if (l1 == NULL)
return l2;
if (l2 == NULL)
return l1... | ALGO | 0.999918 | 4.95841 |
9e6c4b61-6f49-4c9f-b392-17960113e6dc | ishandutta2007/codeforces | martin53/normal/1535/C.cpp | #include<bits/stdc++.h>
using namespace std;
long long solve()
{
string inp;
cin>>inp;
int prv[2][2];
prv[0][0]=-1;
prv[0][1]=-1;
prv[1][0]=-1;
prv[1][1]=-1;
int mx=0;
long long outp=0;
for(int i=0;i<inp.size();i++)
{
if(inp[i]!='?')
{
int c... | ALGO | 0.999862 | 3.839012 |
2258b69a-b99b-4926-b288-05df6e1cf6fb | vaibhavnirmal2001/DSA-problems | Find Nth root of M - GFG/find-nth-root-of-m.cpp | // { Driver Code Starts
#include<bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution{
public:
int NthRoot(int n, int m)
{
int low = 1;
int high = m;
while(low<=high)
{
int mid = low + (high-low)/2;
if(pow(mid,n) == m )
return mid;
els... | ALGO | 0.999984 | 6.182704 |
0ff53e66-b27d-4396-b36e-366db1f8adfb | rishabh-in/DSA | Lecture 3 (Patterns)/pattern9.cpp | // 1
// 2 1
// 3 2 1
// 4 3 2 1
#include<iostream>
using namespace std;
int main() {
int i=1, n;
cin>>n;
while(i <= n) {
int value = i;
int j = 1;
while(j <= i) {
cout<<value<<" ";
value--;
j++;
}
cout<<endl;
i++;
}
// Another way without using an extra variable... | ALGO | 0.99991 | 4.624791 |
dd070309-0e61-465a-8f55-37c7d0415b4f | ShimuGuyue/AlgorithmPractice-Codes | NowCoder/题库/NC297385.cpp | /*
/$$$$$$\ $$\ $$\ $$\ $$$$$$\ $$$$$$\ $$$$$$\
$$ __$$\ $$ | \$$\ $$ |$$ __$$\ \_$$ _|$$ __$$\
$$ / $$ |$$ | \$$\ $$ / $$ / \__| $$ | $$ / $$ |
$$$$$$$$ |$$ | \$$$$ / \$$$$$$\ $$ | $$$$$$$$ |
$$ __$$ |$$ | \$$ / \____$$\ $$ | $$ __$$ |
$$ | $$ |$$ | $$ | $$\ ... | ALGO | 0.996048 | 4.079231 |
49ac262c-37c4-4ba6-9244-b7715977e2b1 | paolo-torres/interview-prep | leetcode/blind_75/categories/arrays/top_k_frequent_elements.cpp | /*
Given an integer array nums & an integer k, return the k most frequent elements
Ex. nums = [1,1,1,2,2,3] k = 2 -> [1,2], nums = [1] k = 1 -> [1]
Heap -> optimize w/ freq map & bucket sort (no freq can be > n), get results from end
Time: O(n log k) -> optimize to O(n)
Space: O(n + k) -> ... | ALGO | 0.999987 | 6.211449 |
fbab00d6-f0a0-43c4-841a-a7e365ab03d7 | enaSo97/IFC_import_testing | ifc_lib/boost_1_68_0/libs/graph/example/fr_layout.cpp | // Authors: Douglas Gregor
// Andrew Lumsdaine
#include <boost/graph/fruchterman_reingold.hpp>
#include <boost/graph/random_layout.hpp>
#include <boost/graph/adjacency_list.hpp>
#include <boost/graph/topology.hpp>
#include <boost/lexical_cast.hpp>
#include <string>
#include <iostream>
#include <map>
#include... | ALGO | 0.998927 | 5.374009 |
8cc46b59-545c-4e66-af68-c1b28d8aab6a | squaresLab/BatFix | results/transcoder/translations/py/CHECK_IF_ALL_THE_ELEMENTS_CAN_BE_MADE_OF_SAME_PARITY_BY_INVERTING_ADJACENT_ELEMENTS.cpp | bool flipsPossible ( int a [ ] , int n ) {
int count_odd = 0 ;
;
int count_even = 0 ;
;
for ( int i = 0 ;
i < n ;
i ++ ) {
if ( ( a [ i ] & 1 ) != 0 ) count_odd ++ ;
else count_even ++ ;
}
if ( ( count_odd % 2 && count_even % 2 ) != 0 ) return false ;
else return true ;
}
| ALGO | 0.991907 | 3.900075 |
62f07d24-fc8f-44db-9238-ead93e985860 | lizardwizardd/yandex-algorithm-training-3 | theme-5/26-lowest-price.cpp | #include <fstream>
#include <iostream>
#include <algorithm>
#include <vector>
int main()
{
std::ifstream file;
file.open("input.txt");
int height, width;
file >> height >> width;
std::vector<std::vector<int>> priceMatrix (height, std::vector<int> (width));
std::vector<std::vector<int>> currentM... | ALGO | 0.99987 | 4.677319 |
0401d59d-c3d0-4a31-a5a3-a2f316c8a2a9 | king258436/algorithm | baekjoon/2470 두 용액.cpp | #include<iostream>
#include <algorithm>
#include<cmath>
#include<vector>
using namespace std;
vector<int> vec;
int arr[2];
int result=2e9;
bool comp(int a, int b){
int abs_a=abs(a);
int abs_b=abs(b);
return abs_b>abs_a;
}
void solve(){
int sum=0;
for(int i=0;i<vec.size()-1;i++){
sum = vec... | ALGO | 0.999997 | 4.210282 |
520f8d6e-a692-4407-9b67-772ca30a8731 | mcpca/marlin | bench/bench.cpp | #include <algorithm>
#include <cmath>
#include <cstdio>
#include "bench.hpp"
int compute_n_runs(bench_stats const& first_run, int min_time)
{
int n_runs =
static_cast<int>(std::floor((double)min_time / (first_run.solve)));
// Round to next multiple of 10
return n_runs + 10 - (n_runs % 10);
}
str... | ALGO | 0.977747 | 6.519206 |
d27e7daf-85e4-4212-8701-00e0b05582a6 | arthurpham/quantlib-full | QuantLib/ql/pricingengines/vanilla/analytichestonengine.cpp | /* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*! \file hestonmodel.hpp
\brief analytic pricing engine for a heston option
based on fourier transformation
*/
#include <ql/math/functional.hpp>
#include <ql/math/integrals/simpsonintegral.hpp>
#include <ql/math/integrals/kronrodinte... | ALGO | 0.999706 | 7.38489 |
15f619c8-46f2-489b-93bd-e9d789094cfe | 2002Yashdeeppanchal/DSA | Trees/Binary Search Trees/valid bst or not.cpp | bool helper(TreeNode* root,long long int minrange,long long int maxrange){
if(root==nullptr){
return true;
}
if(root->val<=minrange or root->val>=maxrange){
return false;
}
return (helper(root->left,minrange,root->val) and helper(root->right,root->val,maxr... | ALGO | 0.999952 | 5.887284 |
28fd3bbf-44f7-4a5c-a125-522ec6850f52 | deepti-iiitr/LeetCode_Practice | 2221-find-triangular-sum-of-an-array/2221-find-triangular-sum-of-an-array.cpp | class Solution {
public:
int triangularSum(vector<int>& nums) {
int n=nums.size();
vector<int>temp=nums;
if(n==1)
return nums[0];
int sze=n, ans;
while(sze>1){
vector<int>curr;
for(int i=0;i<temp.size()-1;i++)
curr.push_back... | ALGO | 0.999975 | 6.407557 |
760ade18-88f0-49ab-95e7-28e9c0e6e4be | weizhouUMICH/SAIGE | thirdParty/bgen/3rd_party/boost_1_55_0/libs/bimap/example/tagged_simple_bimap.cpp | // VC++ 8.0 warns on usage of certain Standard Library and API functions that
// can be cause buffer overruns or other possible security issues if misused.
// See http://msdn.microsoft.com/msdnmag/issues/05/05/SafeCandC/default.aspx
// But the wording of the warning is misleading and unsettling, there are no
// po... | TOOL | 0.954384 | 5.957211 |
158a028c-99a3-4bb1-9a9c-ef937f94bc53 | TohsakaZ/OJ | Uva_12325.cpp | #include <iostream>
#include <fstream>
using namespace std;
int main(){
ifstream fin("input.txt");
cin.rdbuf(fin.rdbuf());
int64_t ans;
int case_n;
cin >> case_n;
for (int case_i = 0; case_i < case_n;case_i++){
ans = 0;
int64_t n, s1, v1, s2, v2;
cin >> n >> s1 >> v1 ... | ALGO | 0.999672 | 3.614186 |
c9dbab63-d95f-433b-982a-d00e4f3cdf88 | openjdk/jdk24u | src/hotspot/share/compiler/methodLiveness.cpp | #include "precompiled.hpp"
#include "ci/ciMethod.hpp"
#include "ci/ciMethodBlocks.hpp"
#include "ci/ciStreams.hpp"
#include "classfile/vmIntrinsics.hpp"
#include "compiler/methodLiveness.hpp"
#include "interpreter/bytecode.hpp"
#include "interpreter/bytecodes.hpp"
#include "memory/allocation.inline.hpp"
#include "memor... | ALGO | 0.974604 | 7.940759 |
4ff43810-f343-4380-8e36-e547b87d0afb | Ashugee2825/ips-college-practice- | Winter_colloge_training/factorial_recursion.cpp | // WAP to calculate facorial of given number using recursion
#include<iostream>
using namespace std;
long int factorial(int a)
{
if(a<=0)
{
return 1;
}
return a*factorial(a-1);
}
int main()
{
int n;
cout << "enter number to calculate factorial";
cin>>n;
cout<< "factor... | ALGO | 0.999619 | 4.159659 |
54e00dd0-1ae8-4630-8298-1127d31b9643 | kulaizki/Codeforces | Contests/Codeforces Round 889 (Div. 2)/A.cpp | #include <bits/stdc++.h>
using namespace std;
#define kulaizki {ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);}
#define poof(a) {for (const auto& x : a) cout << x << ' ';}
#define pb push_back
typedef long long ll;
typedef long double lld;
typedef unsigned long long ull;
const ll template_array_si... | ALGO | 0.999929 | 4.804188 |
11c3d7fa-382f-43b1-9225-2470a2feb024 | rayhan50001/Code_Library | Codeforces & Codechef/cf-1038D-Slime.cpp | #include<bits/stdc++.h>
using namespace std;
#define ll long long
int main()
{
int n;
cin>>n;
vector<ll>v;
ll sum=0;
for(int i=0; i<n; i++)
{
ll x;
cin>>x;
v.push_back(x);
}
sort(v.begin(),v.end());
if(n==1)cout<<v[0]<<endl;
else
{
for(int i=0;... | ALGO | 0.99999 | 4.087208 |
77e5a46a-2ea5-4ec7-b0b8-6d2258af9b6a | lexababashev/OP_labs | lab3/lab3.cpp |
#include <iostream>
#include <math.h>
using namespace std;
int main()
{
double a;
cout << "enter a " << endl;
cin >> a;
while (a <= 0 || a > 2) {
cout << "incorrect value of a" << endl; /* */
cout << "try to enter a again" << endl;
cin >> a;
}
double... | ALGO | 0.999601 | 3.352343 |
9ba384f2-6a80-4b7e-b1a8-6729de5725fd | Jiyarathore/Leetcode | 0518-coin-change-ii/0518-coin-change-ii.cpp | class Solution {
public:
// memorization
// int changeUtil(vector<int>&arr, int ind, int T, vector<vector<long>>&dp){
// if(ind==0) return (T%arr[0]==0);
// if(dp[ind][T]!=-1) return dp[ind][T];
// long notTaken=changeUtil(arr,ind-1,T,dp);
// long taken... | ALGO | 0.999876 | 5.953164 |
f50d0c6f-98bd-482e-be1d-9ce7e43c49f0 | weihao306/Lexical_Analysis | lexical_analysis.cpp | #include <algorithm>
#include "judge.h"
#include "statistics.h"
#include "process.h"
using namespace std;
map<string, int> Id; //标识符集
map<string, int> Number; //常数集
const vector<string> Keyword = { "auto", "break", "case", "char", "const", "continue",
"default", "do", "double", "else", "enum", "exter... | ALGO | 0.927064 | 3.213994 |
dee0f844-fd4e-465c-bd18-f029cb801f56 | briac-lr/Projet_CPP_LE_ROMANCER_BORGES | ImpliedVolatilitySurface/ImpliedVolatilitySurface.cpp | #include "ImpliedVolatilitySurface.h"
#include "ThomasSolver.h"
#include <algorithm>
#include <cmath>
ImpliedVolatilitySurface::ImpliedVolatilitySurface(
const Vector& maturities,
const Vector& strikes,
const Matrix& market_implied_vols,
const double& risk_free_rate)
: _maturities(maturities),
_strikes(stri... | ALGO | 0.998579 | 6.656824 |
dd283ed4-34c6-4163-a7e3-9f63f8d86188 | GustavoAC/UVa-Online-Judge | 11044.cpp | #include <stdio.h>
#include <cmath>
int main(int argc, char const *argv[]) {
int num, sidex, sidey, mehx, mehy;
scanf("%i", &num);
for (int i = 0; i < num; ++i) {
scanf("%i %i", &sidex, &sidey);
sidex = ceil((sidex - 2)/3.0);
sidey = ceil((sidey - 2)/3.0);
printf("%i\n", sidex*sidey);
}
return 0;
} | ALGO | 0.998922 | 3.333678 |
4e772747-30fb-48d4-8468-c54c3a14e665 | ishandutta2007/codeforces | numbering/normal/1696/B.cpp | #include <bits/stdc++.h>
#define int long long
using namespace std;
int A[500005];
signed main() {
cin.sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
int t;
cin >> t;
while(t--) {
int N;
cin >> N;
int i, j;
for(i=0;i<N;i++) cin >> A[i];
bool isCut = true... | ALGO | 0.999713 | 4.846476 |
33d6282a-3804-49bc-b419-309f367cd14f | blackbeardONE/CheggHero | coursehero_auto_reg/account_registered_on_20180324/txtsource/718c.cpp | //motivated by code from swastik1996
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef pair<int,int> ii;
#define fill(a,x) memset(a,x,sizeof(a))
#define pb push_back
#define sz(x) (int)x.size()
#define F first
#define S second
#define FOR(i,a,b) for(int i = a; i<=b;... | ALGO | 0.999962 | 4.40844 |
fb726681-960f-43ca-9451-4309c8190a1b | hbd-red/5-MP2 | Original/BubbleSort.cpp | #include <iostream>
using namespace std;
int bubbleSort(int intArray[], int intSize){
int intTemp = 0;
int intPassCounter = 0;
for(int i = 0; i < intSize - 1; i++){
intPassCounter++; // Increments for each pass done by the algorithm
for(int j = 0; j < intSize - i - 1; j++){
if(intArray[j] > intArray[j + 1]... | ALGO | 0.999738 | 5.286441 |
ca5bf39f-2252-4636-9dd0-e1626bc38a04 | PritomKumar/Back-From-The-Past | Insomnia cure.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int a,b,c,d,e;
cin>>a>>b>>c>>d>>e;
int counter=0;
for (int i = 1; i <= e; i++)
{
if(i%a == 0 || i%b == 0 || i%c == 0 || i%d == 0){
counter++;
}
}
cout << counter <<endl;
return 0;
} | ALGO | 0.999699 | 3.688688 |
2f00420f-5be4-4b12-ab8b-2908d1351e19 | hamzaa-ali/lpc | sorting/library_sort.cpp | #include <algorithm>
#include <iostream>
void librarySort(int *index, int n) {
int lib_size, index_pos,
*gaps, // gaps
*library[2]; // libraries
bool target_lib, *numbered;
for (int i = 0; i < 2; i++) library[i] = new int[n];
gaps = new int[n + 1];
numbered = new bool[n +... | ALGO | 0.999998 | 5.319849 |
62b16729-5c3f-4001-b85b-e80d6fdd6163 | amansinghbisht029/apnacollege_courseyt | pair.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
bool myCompare(pair<int, int> p1, pair<int, int> p2)
{
return p1.first < p2.first;
}
int main()
{
// pair <int,char> p;
// p.first=3;
// p.second='f';
int arr[] = {10, 16, 7, 14, 5, 3, 12, 9};
vector<pair<int, int>> ... | ALGO | 0.99993 | 3.896608 |
bf5d284c-df53-4498-ac01-fc7dd07d1bed | mertturkmenoglu/cpp | src/practice/P012_MexicanWave/main.cpp | #include <algorithm>
#include <iostream>
#include <iterator>
#include <vector>
std::vector<std::string> mexicanWave(const std::string& input);
int main() {
std::string input = "emily";
std::vector<std::string> result = mexicanWave(input);
std::copy(result.begin(), result.end(), std::ostream_iterator<std:... | ALGO | 0.9993 | 5.923552 |
003a8c1f-88d9-4074-9a0f-56d0f2d20531 | raincross7/code-similarity | codes/train_code/problem080/problem080_72.cpp | //////////////////////////
/* _ ____ */
/* U /"\ u U /"___| */
/* \/ _ \/ \| | u */
/* / ___ \ | |/__ */
/* /_/ \_\ \____| */
/* \\ >> _// \\ */
/* (__) (__)(__)(__) */
/* Compro by NULL_CT© */
//////////////////////////
/*STL Libs*/
#include <algorithm>
#include <array>... | ALGO | 0.999926 | 3.667034 |
8467cf05-bfc0-4599-9657-47ca2b35af51 | HassnHamada/CP-Solutions | 25D.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N = 2e5 + 10, M = 11, MOD = 1e9 + 7, HV = 151, INF = 0x3f3f3f3f;
vector<int> adj[N];
bool vis[N], stk[N];
vector<pair<int, int>> rm;
vector<int> dsu;
void dfs(int n, int p)
{
vis[n] = stk[n] = true;
for (auto &&i : adj[n])
{
... | ALGO | 0.999721 | 4.177429 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.