uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
d8ffe302-7198-444f-91e3-940a62d8c413 | adityamittal13/Project-Euler-Problems | Problem7.cpp | #include <iostream>
#include <cmath>
#include <math.h>
using namespace std;
bool isPrime(int count1){
for (int i = 2; i < (int) sqrt(count1)+1; i++){
if (fmod(count1, i) == 0){
return false;
}
}
return true;
}
int main(){
int count = 2;
int count2 = 0;
while (c... | ALGO | 0.99951 | 4.720131 |
917b0878-05bb-477d-b9e2-561a458dd739 | Aaditya-Ghogale/DSA | pattern7.cpp | #include<iostream>
using namespace std;
int main()
{
int n;
cin>>n;
int i,j;
i=1;
while(i<=n)
{
j=1;
while(j<=i)
{
cout<<i;
j++;
}
cout<<endl;
i++;
}
} | ALGO | 0.999908 | 3.855211 |
11b4f777-34b9-480b-b606-e75b93cd41e6 | codaitya/TeamNoteBook | RangeQueryDatastructs/segtree.cpp | #include <bits/stdc++.h>
using namespace std;
// Imp: seg tree is built over a 1 indexed array
struct STree {
struct node {
int sum;
node () {} ; //default constructor
node (int v): sum(v) {};
};
vector <node> ST;
int N; // list size over which ST is built
STree ( int n ) {
N = n;
ST.resize ( 4 * n );
... | ALGO | 0.999833 | 3.936328 |
5bad0689-dbb8-418b-8933-884230bf6d7a | Etomer/structure-from-sound-python | matlab/libs/eigen/doc/examples/Tutorial_ArrayClass_addition.cpp | #include <Eigen/Dense>
#include <iostream>
using namespace Eigen;
using namespace std;
int main()
{
ArrayXXf a(3,3);
ArrayXXf b(3,3);
a << 1,2,3,
4,5,6,
7,8,9;
b << 1,2,3,
1,2,3,
1,2,3;
// Adding two arrays
cout << "a + b = " << endl << a + b << endl << endl;
// Subt... | ALGO | 0.962633 | 3.648974 |
18de42c2-e753-44f0-94e6-a6de81539460 | ZJaffee/Image23D | app/libs/opencv-3.0.0/modules/calib3d/src/posit.cpp | #include "precomp.hpp"
#include "opencv2/calib3d/calib3d_c.h"
/* POSIT structure */
struct CvPOSITObject
{
int N;
float* inv_matr;
float* obj_vecs;
float* img_vecs;
};
static void icvPseudoInverse3D( float *a, float *b, int n, int method );
static CvStatus icvCreatePOSITObject( CvPoint3D32f *points... | ALGO | 0.992224 | 4.523134 |
db7f2e48-488b-482f-8e9f-62c2224d90cf | alifalhasan/CP-code-vault | Codeforces/Others/ITMO Academy. Дерево отрезков часть 1. 3/E - Addition to Segment/90821511.cpp | #include<bits/stdc++.h>
using namespace std;
const int N=1e5;
long long node[4*N+2];
void Update(int nodeNum,int start,int end,int pos,int x)
if(start == end)
{
node[nodeNum]+=x;
return;
}
int mid=(start+end) >> 1;
if(pos <= mid)Update(2*nodeNum,start,mid,pos,x);
else Update(2*no... | ALGO | 0.999674 | 4.768735 |
598d9e2c-94f1-4295-98f6-81691e2861b8 | devsh0/fft-playground | myfft.cpp | #include "myfft.h"
#include <cmath>
#include <vector>
using u8 = unsigned char;
using u32 = unsigned int;
#define PI 3.14159265
size_t MyFFT::get_complement (size_t number, size_t width) {
size_t complement = 0;
u8 rstart = width - 1;
u8 lstart = 0;
for (int i = 0; i < width; i++)
{
u8 bit = ((... | ALGO | 0.999793 | 5.478927 |
0b0fd34a-bcd5-4910-8757-6909e1b8c578 | pitaohc/gitlfstest | List.cpp | #include"stdc++.h"
#include "List.h"
using namespace std;
std::ostream& operator<<(std::ostream& out, ListNode* head)
{
if (head == NULL)
{
out << "[]";
}
out << "[";
ListNode* ptr = head;
while (ptr != NULL)
{
out << ptr->val << "->";
ptr = ptr->next;
}
out ... | ALGO | 0.984118 | 5.352048 |
95b2c661-b049-416c-b181-73f690c629f6 | IKKO-Ohta/contest | AOJ-ALDS/ALDS1_4_B.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main(){
int n,q,a;
vector<int> S;
vector<int> T;
cin >> n;
for (int i = 0; i < n ; ++i) {
cin >> a;
S.push_back(a);
}
cin >> q;
for (int i = 0; i < q ; ++i) {
cin >> a;
T.... | ALGO | 0.99987 | 4.203706 |
150e5448-7bdd-490a-b139-1428a2ed0e24 | FrnkPsycho/C-- | dotcpp/1005.cpp | #include <iostream>
#include <iomanip>
using namespace std;
int main ()
{
double f,c;
cin >> f;
c = 5.0 * (f-32.0) / 9.0;
cout << "c=" << fixed << setprecision(2) << c << endl;
return 0;
} | ALGO | 0.994717 | 3.844533 |
87bba90f-b048-433f-8015-ccb104255012 | dzo/frameworks_base | opengl/libagl/vertex.cpp | #include <stdio.h>
#include <stdlib.h>
#include "context.h"
#include "fp.h"
#include "vertex.h"
#include "state.h"
#include "matrix.h"
namespace android {
// ----------------------------------------------------------------------------
void ogles_init_vertex(ogles_context_t* c)
{
c->cull.enable = GL_FALSE;
c-... | TOOL | 0.855865 | 6.104946 |
c135f46e-be1c-4a83-9d96-503e7f0a876d | codeplaysoftware/syclacademy | Code_Exercises/Functors/solution.cpp | #include <benchmark.h>
#include <image_conv.h>
#include <algorithm>
#include <iostream>
#include <sycl/sycl.hpp>
#include "../helpers.hpp"
enum Direction { COL, ROW };
/**
* @brief ImageConvolutionFunctor class
*
* This class represents a functor for performing image convolution. It takes
* an input accessor, ... | ALGO | 0.982255 | 7.255386 |
0cb0f992-7d64-4462-9679-a5e1de49c18f | 04megumi/leetCode | 30_findSubstring.cpp | class Solution {
public:
vector<int> findSubstring(string s, vector<string>& words) {
vector<int> ans;
const int l = s.size(), n = words[0].size(), m = words.size();
for (int i=0;i<n&&i+n*m<=l;i++) {
// 放在内层防止外层循环未清空
unordered_map<string, int> hashmap;
... | ALGO | 0.999949 | 5.972634 |
aa5a52cc-4316-43d2-bc20-80c035de67a9 | jatinderji/segmented_button_app | 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.9988 | 6.76073 |
50f0c9ce-79b0-436c-87e2-d3c4e3b91685 | WiMemory/FZUOJ | code/1909 An Equation.cpp | #include<iostream>
int num[4];
int main() {
int T, n, i;
n = 1;
bool flag;
scanf("%d", &T);
while (n <= T) {
for (i = 0; i < 4; i++) {
scanf("%d", &num[i]);
}
flag = false;
if (num[0] + num[1] == num[2] + num[3] || num[0] + num[2] == num[1] + num[3] || num[0] + num[3] == num[1] + num[2]) {
flag = tru... | ALGO | 0.999813 | 3.781296 |
5a31d9da-6299-4e72-9f57-da08647fbe0a | tanthml/meta-heuristics-1.3 | tsp/lib/tspSolution.cpp | /*
* File: tspSolution.cpp
* Author: Tieu Minh
*
* Created on March 11, 2014, 10:10 PM
*/
#include "tspSolution.h"
#include "tspGenne.h"
#include <iterator>
#include <algorithm>
tspSolution::tspSolution()
{
_fitness = NAN;
_graph = NULL;
}
tspSolution::~tspSolution()
{
easer();
}
void tsp... | ALGO | 0.999259 | 5.140717 |
ecc8e322-da0c-4bca-b10e-a15d2fea91bb | ishandutta2007/codeforces | neal/normal/986/F.cpp | #include <algorithm>
#include <cassert>
#include <iostream>
#include <queue>
#include <vector>
using namespace std;
const int T_MAX = 10005;
const int SIEVE_MAX = 32000000;
const int SMALL_MAX = 100005;
const long long LL_INF = 2e18;
struct video {
long long n, k;
int index;
bool operator<(const video &o... | ALGO | 0.999804 | 4.750888 |
bed6db5c-4193-4bdf-b8af-9f56e86c3b20 | Abhiram2312/HACKER-RANK-30-DAYS-OF-CODE | (LetsReview)Day6.cpp | #include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
using namespace std;
void index_printer(char words[]){
for(int x=0;x<strlen(words);x++){
if(x%2==0){
printf("%c",words[x]);
}
}
... | ALGO | 0.998907 | 3.88809 |
c9ee6ae4-9e67-498b-bf01-e8903a1c3d6c | C-2024-1-3/8209240302zhaojunyu | 实验1第五题.cpp | #include <iostream>
#include <iomanip>
using namespace std;
int main() {
double f, c;
cout << "请输入华氏温度:";
cin >> f;
c = (f - 32) * 5.0 / 9.0;
cout << "对应的摄氏温度是:" << fixed << setprecision(2) << c << endl;
return 0;
} | TOOL | 0.959642 | 4.335311 |
4a5e0a08-ae66-40db-b1d6-41217e8aa231 | raincross7/code-similarity | codes/train_code/problem248/problem248_52.cpp | #include <bits/stdc++.h>
using namespace std;
int steps(int x1, int y1, int x2, int y2) {
return max(x1-x2,x2-x1) + max(y1-y2,y2-y1);
}
int main() {
int N;
cin >> N;
vector<vector<int>> p(N, vector<int>(3));
for (int i = 0; i < N; i++) {
for (int j = 0; j < 3; j++) {
cin >> p.at(i).at(j);
}
... | ALGO | 0.999988 | 4.803606 |
a58cb89f-3601-4ad1-9de6-17dbb66018af | bilalkhan9/C-concepts | Float Class Overload.cpp | #include <iostream> // Include necessary header for I/O operations
using namespace std;
class Float
{
private:
float x;
public:
void setdata(float a)
{
x = a;
}
void getData()
{
cout << "\nx: " << x;
}
Float operator+(Float c)
{
Float temp;
temp.x =... | TOOL | 0.935903 | 3.748075 |
e36491a6-0cb7-450e-a664-4fe09613113d | ishandutta2007/codeforces | shadowatyy/normal/893/C.cpp | #include <bits/stdc++.h>
#include <unistd.h>
#define ll long long
#define ull unsigned long long
#define inf 1000000007
#define inf16 0x3f3f3f3f
#define INF 1000000000000000007LL
#define VI vector<int>
#define VPII vector<pair<int, int> >
#define VLL vector<ll>
#define PII pair<int, int>
#define PLL pair<ll, ll>
#defin... | ALGO | 0.999988 | 4.157016 |
af6f62bb-c779-4f91-bb5b-4683d89f1cd0 | lgds/TwoChNRG | src/QS_CalcSuscep.cpp | #include <iostream>
#include <vector>
#include <math.h>
#include "NRGclasses.hpp"
double QS_CalcSuscep(vector<double> Params, CNRGarray* pAeig){
double betabar=Params[0];
double sum=0.0;
double sum2=0.0;
for (int ibl=0;ibl < pAeig->NumBlocks();ibl++)
{
double Si=pAeig->GetQNumber(ibl,1);
f... | ALGO | 0.994748 | 3.75865 |
9665e58a-7283-404c-a47d-2c7a7eaea390 | rapidlua/barebone-c | llvmorg/libcxx/test/std/algorithms/alg.nonmodifying/mismatch/mismatch_pred.pass.cpp | // <algorithm>
// template<InputIterator Iter1, InputIterator Iter2,
// Predicate<auto, Iter1::value_type, Iter2::value_type> Pred>
// requires CopyConstructible<Pred>
// constexpr pair<Iter1, Iter2> // constexpr after c++17
// mismatch(Iter1 first1, Iter1 last1, Iter2 first2, Pred pred);
//
// templa... | TEST | 0.915594 | 6.399774 |
99680845-2d77-4e26-b437-06985040a137 | codewithajaypaswan/Preparation | 670-maximum-swap/670-maximum-swap.cpp | class Solution {
public:
int maximumSwap(int num) {
string s = to_string(num);
int leftInd = -1, rightInd = -1, mxDigit = -1, mxInd = -1;
for(int i=s.size()-1; i>=0; i--) {
if(s[i] > mxDigit) {
mxDigit = s[i];
mxInd = i;
}
e... | ALGO | 0.999942 | 6.318397 |
0fba62e1-72e0-44da-b80b-8689505c1a27 | shumbul/CP | CF/C-problems/cf700-7feb.cpp | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define int long long
#define vi vector<int>
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define inar(arr,n) for(int i=0; i<n; i++) cin>>arr[i];
#define suma(arr,n) for(int i=0; i<n; i++) sum+=arr[i];
#define for0(i,n) ... | ALGO | 0.999799 | 4.205926 |
061e22b6-405d-44b6-85ed-05c74f6618aa | a11enyang/CPP | tips/005-thread_pool/threadpoolv1.cpp | #include <atomic>
#include<cstdio>
#include <iostream>
#include <thread>
#include <vector>
#include <functional>
class ThreadPool
{
public:
ThreadPool(size_t numThreads);
~ThreadPool();
// 提交任务到线程池
template <typename F>
void enqueue(F&& f);
private:
void worker();
std::vector<std::thread> workers;
std::atom... | ALGO | 0.920635 | 4.870117 |
d7f2953a-3eb0-4216-a8f7-6bb11a6684f6 | Rudolf-Gama/Striver-A2Z_DSASheet | Graphs/Topological sort/toposort.cpp | #include <bits/stdc++.h>
using namespace std;
class Solution {
public:
void dfs(int node, vector<int> &vis, stack<int> &st, vector<int> adj[]) {
vis[node] = 1; // Mark the node as visited
for(auto it: adj[node]) {
if(!vis[it]) {
dfs(it, vis, st, adj); // Recursive call... | ALGO | 0.999999 | 6.670945 |
f32170cf-2e64-47b7-a60e-27186d8655dc | PunnyOz2/POSN-Programming | 2.00/Part 1/Homework/Ap_Bar chart.cpp | /*
TASK: Parenthesis
LANG: CPP
AUTHOR: Pun~
SCHOOL: CRU
*/
#include<bits/stdc++.h>
using namespace std;
long long a[100100],l[100100],r[100100];
int main()
{
long long q,i,ans,n;
scanf("%lld",&q);
while(q--){
scanf("%lld",&n);
for(i=1;i<=n;i++)
scanf("%lld",&a[i])... | ALGO | 0.999507 | 3.645191 |
77861d5e-51ae-439a-be66-995aa53052e2 | wanimaru47/AOJ | volume00/cpp/AOJ-0050.cpp | #include <iostream>
#include <string>
using namespace std;
int main()
{
string str;
char apple[6] = "apple", peach[6] = "peach";
getline(cin, str);
int i = 0;
while (i < str.size()) {
if (str[i] == 'a') {
string tmp;
for (int k = 0; k < 5 && k + i < str.size(); k++)
t... | ALGO | 0.999526 | 3.041123 |
b30fb6a0-495d-44af-b138-8375733706dc | mrceki/air_arm | src/ompl/demos/RigidBodyPlanningWithODESolverAndControls.cpp | /* Author: Ryan Luna */
#include <ompl/control/SpaceInformation.h>
#include <ompl/base/spaces/SE2StateSpace.h>
#include <ompl/control/ODESolver.h>
#include <ompl/control/spaces/RealVectorControlSpace.h>
#include <ompl/control/SimpleSetup.h>
#include <ompl/config.h>
#include <iostream>
#include <valarray>
#include <lim... | ALGO | 0.981535 | 6.906475 |
dee5a521-be92-4b4a-b5c9-cde5dec97e29 | byebyebryan/leetcode | 42.trapping-rain-water.cpp | /*
* @lc app=leetcode id=42 lang=cpp
*
* [42] Trapping Rain Water
*
* https://leetcode.com/problems/trapping-rain-water/description/
*
* algorithms
* Hard (42.46%)
* Total Accepted: 277.9K
* Total Submissions: 651.3K
* Testcase Example: '[0,1,0,2,1,0,1,3,2,1,2,1]'
*
* Given n non-negative integers repr... | ALGO | 0.999988 | 7.188906 |
a68b855f-324f-4ab4-b773-fc3c31ac7e51 | chimchimlin/cHW | 11003078AHW3/11003078AHW3/11003078AL1929.cpp | // 11003078A L츩 chimchimlin
#include <iostream>
#include <vector>
using namespace std;
class Solution {
public:
vector<int> getConcatenation(vector<int>& nums) {
int n=nums.size();
vector<int> ans(n+n);
for(int i=0;i<=1;i++)
{
for(int j=0;j<n;j++)
{
... | ALGO | 0.999604 | 4.092281 |
f383aab6-5f03-446d-a419-47f60162efb8 | gagata7/Competitive-programming | CP algorithms/dijkstra.cpp | //algorytm Dijkstry - znajduje najkrotsza odleglosc od 1 do dowolnego innego wierzcholka
//graf - nieskierowany
//krawedzie - wazone
//przygotowala: Agata Pokorska
#include <bits/stdc++.h>
using namespace std;
int n,m;//n - wierzcholkow, m - krawedzi
const int SIZE = 1e6, inf = 1e8;
vector<pair<int,int> > s[SIZE];
int... | ALGO | 0.999963 | 4.299897 |
3e7cc57b-e9a0-4042-8fdd-dcea98bfdfab | manikanta2901/ubuntu | .history/SRM/elab/DataStructures/Stack/ST3_20200930124616.cpp | #include<bits/stdc++.h>
#include<iostream>
using namespace std;
struct MYStack{
int data;
struct MYStack* next;
};
void push(struct MYStack**top,int data){
struct MYStack *createMyStack
}
int main(){
int size;
cin >> size;
struct MYStack *top = NULL;
while(size--){
int data;
... | ALGO | 0.999211 | 3.428785 |
5d855062-dbbd-45ae-87d7-b56de14eb7fd | JvanKatwijk/channel-scanner | support/protection.cpp | #
#include "protection.h"
protection::protection (int16_t bitRate, int16_t protLevel):
viterbiSpiral (24 * bitRate),
outSize (24 * bitRate),
indexTable (outSize * 4 + 24),
... | ALGO | 0.996029 | 3.291302 |
797d814a-0030-4066-9a63-16f22a6b2558 | Staticshashwat/DSA_assignment1 | function.cpp | ERROR: type should be string, got "https://www.hackerrank.com/challenges/c-tutorial-functions/problem?isFullScreen=true\n\n#include <iostream>\n#include <cstdio>\nusing namespace std;\n\nint max_of_four(int a, int b, int c, int d)\n{\n if(a>b && a>c && a>d)\n return a;\n else if(b>c && b>d && b>a)\n return b;\n else if(c>a && c>b && c>d)\n return c;\n else\n return d;\n}\n\nint main() {\n int a, b, c, d;\n scanf(\"%d %d %d %d\", &a, &b, &c, &d);\n int ans = max_of_four(a, b, c, d);\n printf(\"%d\", ans);\n \n return 0;\n}\n" | ALGO | 0.999139 | 4.412004 |
4619dcd3-24aa-455c-9784-7cd98ce6002c | Shrey123ansh/Placement | DSA/Array/Medium/15_Print the matrix in spiral manner.cpp | vector<int> spiralOrder(vector<vector<int>> &mat)
{
vector<int> ans;
int n = mat.size(); // no. of nows
int m = mat[0].size(); // no. of columns
// Initialize the pointers reqd for traversal.
int top = 0, left = 0, bottom = n - 1, right = m - 1;
// Loop until all elements are not traversed... | ALGO | 0.99998 | 5.922668 |
59810052-c73d-4ba1-85f5-176f79b11616 | AleksandarTulic/Codeforces | Round_306_Div2/A.cpp | #include <iostream>
#include <utility>
#include <vector>
#include <algorithm>
#include <cmath>
#include <iomanip>
using namespace std;
int main()
{
string g;
cin>>g;
int br=0;
int c1=-1,c2=-1;
for (int i=g.size()-1;i>=0;i--)
{
if (g[i]=='B' && g[i-1]=='A' && c1!=1)
{
... | ALGO | 0.999988 | 3.572033 |
dd08d10c-62c0-4278-b2b0-e1901565a8e1 | GaurishIIITNR/CP-Problems-III | C_Ticket_Hoarding.cpp | // हर हर महादेव
#include <bits/stdc++.h>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/assoc_container.hpp>
using namespace std;
using namespace __gnu_pbds;
#define F first
#define S second
#define dbl double
#define pb push_back
#define ll long long int
#define uset unordered_set
#define umap unordered_... | ALGO | 0.999788 | 3.906544 |
a26431b3-30c4-40e2-849c-eb889907facd | almostinf/EGE-C- | EGE C/26/26_abitur.cpp | #include <iostream>
#include <fstream>
#include <vector>
#include <algorithm>
#include <cmath>
using namespace std;
int main()
{
ifstream file("26_demo.txt");
int sum = 0;
int size, max;
float average;
int count = 0;
int next;
vector<int> vec;
file >> size >> max;
cout << size << ' ... | ALGO | 0.999961 | 3.810646 |
d86c46f2-8eaf-4d16-8290-ff4adabfac5e | AlexandrGraschenkov/NovosibirskCloudSegmentation | NovoCloudSegmentation/3d_visualization/SimpleMatrix.cpp | #include "SimpleMatrix.hpp"
using namespace std;
using namespace cv;
MyMatrix MyMatrix::sim3_vec(const Eigen::Matrix<double, 7, 1> &vec) {
Sophus::Sim3d sim = Sophus::Sim3d::exp(vec);
MyMatrix result;
result.m = Eigen::Affine3d(sim.matrix());
return result;
}
MyMatrix MyMatrix::rotation(double x... | ALGO | 0.979919 | 5.706942 |
98571c37-7390-4a50-a7d2-686b28690e8d | bogus/mydlp-host-win32 | libclamav/c++/llvm/lib/CodeGen/OptimizePHIs.cpp | #define DEBUG_TYPE "phi-opt"
#include "llvm/CodeGen/Passes.h"
#include "llvm/CodeGen/MachineFunctionPass.h"
#include "llvm/CodeGen/MachineInstr.h"
#include "llvm/CodeGen/MachineRegisterInfo.h"
#include "llvm/Target/TargetInstrInfo.h"
#include "llvm/Function.h"
#include "llvm/ADT/SmallPtrSet.h"
#include "llvm/ADT/Statis... | ALGO | 0.889761 | 7.658953 |
7350b4bf-fbb5-4417-86f2-a18f924fc676 | RahulBantode/c_cpp_practice | CountContetsString.cpp | /*Problem statment :-
Write a program to count the total number of alphabets,digits and special characters in string
*/
#include<iostream>
#define BASE 50
using namespace std;
void CountTheString(char str[])
{
int digits=0;
int alpha = 0;
int special = 0;
int i = 0;
while(str[i]!='\0')
{
if(str[i]>= '0' &&... | ALGO | 0.975981 | 3.519351 |
c8a8b01a-e03a-47ac-bb87-35e483b24093 | Harshsngh07/DataStructures_and_Algorithms | leetcode/Strings/DefagingIpadress.cpp | class Solution {
public:
string defangIPaddr(string address) {
string ans = "";
for(int i=0;i<address.length();i++)
{
if(address[i] == '.')
ans+="[.]";
else
ans+=address[i];
}
return ans;
}
};
| ALGO | 0.98719 | 5.93519 |
6425f137-5b02-4cc4-ac7c-caabed48ce88 | By-hoon/Daily-Learn | Algorithm/BOJ-CPP/5001~10000/BOJ-9184/9184_신나는 함수 실행.cpp | #include <iostream>
#include <vector>
#include <algorithm>
#include <cstdio>
using namespace std;
int num[21][21][21];
int w(int a, int b, int c) {
if (a <= 0 || b <= 0 || c <= 0) {
return 1;
}
if (a > 20 || b > 20 || c > 20) {
return w(20, 20, 20);
}
if (num[a][b][c] != 0) {
... | ALGO | 0.999783 | 4.15812 |
de980b5c-4293-462a-b798-3b208aefc2f0 | kobefaith/leetcode | String to Integer (atoi)/String to Integer (atoi) .cpp | class Solution {
public:
int atoi(const char *str) {
int result = 0;
int i = 0;
int flag = 1;
if (strlen(str) ==0)
return 0;
while ((str[i] > '9')||(str[i] < '0')){
if (str[i] == '-')
flag *= -1;
i++;
}
while... | ALGO | 0.999297 | 4.652017 |
780754ba-41f5-4fae-912e-582a0e7b6740 | PedroDariva36/Desktop | atCoder/abc366/d/a.cpp | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <vector>
struct custom_hash {static uint64_t splitmix64(uint64_t x) {x += 0x9e3779b97f4a7c15; x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9; x = (x ^ (x >> 27)) * 0x94d049bb133111eb; return x ^ (x >> 31); } size_t operator()(uint64_t x) const {static... | ALGO | 0.999907 | 4.182366 |
342e5a66-c50d-44fc-89c3-52e28800f5f6 | roheetraaz/DSA | 0004-median-of-two-sorted-arrays/0004-median-of-two-sorted-arrays.cpp | class Solution
{
public:
double findMedianSortedArrays(vector<int> &nums1, vector<int> &nums2)
{
int n = nums1.size();
int m = nums2.size();
if (n > m)
return findMedianSortedArrays(nums2, nums1);
int low = 0, high = n;
int ... | ALGO | 0.999991 | 5.557556 |
2960db37-f324-4c73-b0a1-376c2238611b | Astha86/Cpp-with-DSA | Recursion/Sum1toN.cpp | #include<iostream>
using namespace std;
void sum(int ans,int i){
if(i==0){
cout<<ans<<endl;
return ;
}
sum(ans+i,i-1);
}
int main(){
int n;
cout<<"Enter n: ";
cin>>n;
sum(0,n);
return 0;
} | ALGO | 0.999924 | 4.001671 |
9672f4ce-3f93-4921-b598-7b03aea58ddc | Fazle-Rakib/Project-150-2017831030 | Type 2/STRING PROCESSING/CodeForces_59A.cpp | #include <stdio.h>
#include <string.h>
int main()
{
char s[100];
int i,u=0,l=0;
scanf("%s",s);
for(i=0;s[i]!='\0';i++)
{
if(s[i]>64 &&s[i]<91)
u++;
else
l++;
}
if(u>l)
{
printf("%s",strupr(s));
}
else
{
printf("%s",strlw... | ALGO | 0.99997 | 4.079584 |
1a7338ed-2b63-40b8-88e7-bdddcfd3123b | vomit21100/Codes | LeetCode/383_Ransom_Note.cpp | //Leetcode 383
//https://leetcode.com/problems/ransom-note/
#include <iostream>
#include <string>
using namespace std;
class Solution {
public:
bool canConstruct(string ransomNote, string magazine) {
int isContain = 0;
int Msize = magazine.size();
for(int i = 0;i < ransomNote.size();i++)... | ALGO | 0.99973 | 5.711188 |
46a1b6d3-b465-4d21-a6db-20e1ff47584b | jluissandovalm/mpm | simpleMPM/src/eigen/bench/sparse_lu.cpp |
// g++ -I.. sparse_lu.cpp -O3 -g0 -I /usr/include/superlu/ -lsuperlu -lgfortran -DSIZE=1000 -DDENSITY=.05 && ./a.out
#define EIGEN_SUPERLU_SUPPORT
#define EIGEN_UMFPACK_SUPPORT
#include "../../eigen/Eigen/Sparse"
#define NOGMM
#define NOMTL
#ifndef SIZE
#define SIZE 10
#endif
#ifndef DENSITY
#define DENSITY 0.01
#... | ALGO | 0.998202 | 4.091644 |
d9c96ee6-e726-4f79-9008-e5de59b2be51 | chinglamchoi/sunflower_team | Satellite_Fire_Detection/SGAN/dsrg/CRF/src/permutohedral.cpp | #include "permutohedral.h"
#ifdef WIN32
inline int round(double X) {
return int(X+.5);
}
#endif
#ifdef __SSE__
// SSE Permutoheral lattice
# define SSE_PERMUTOHEDRAL
#endif
#if defined(SSE_PERMUTOHEDRAL)
# include <emmintrin.h>
# include <xmmintrin.h>
# ifdef __SSE4_1__
# include <smmintrin.h>
# endif
#endif
/***... | ALGO | 0.999059 | 6.67264 |
508728ea-93d9-453a-acb6-36cec2bda013 | adityanjr/code-DS-ALGO | CodeForces/misc/Primes and Multiplication.cpp | #include "bits/stdc++.h"
using namespace std;
using ll = long long int;
const ll mod = 1000000007;
/**
___ ___ ___ ___
/\ \ /\ \ /\ \ /\ \
/::\ \ /::\ \ ___ /::\ \ \:\ \
/:/\:\... | ALGO | 0.999983 | 4.71046 |
1726ed01-0e08-4619-8804-6fa0b0f276f8 | saifshaikhgithub/CSES-Problems-Set-Solution | Sorting and Searching/Playlist.cpp | #include <bits/stdc++.h>
using namespace std;
#define endl '\n'
#define REP(i, a, b) for (int i = a; i < b; i++)
#define YES cout << "YES" << endl;
#define NO cout << "NO" << endl;
#define PB push_back
#define int long long
#define vi vector<int>
#define vii vector<vector<int>>
void lesgo()
{
int n;
cin >> n;
... | ALGO | 0.999874 | 4.879866 |
e8d0b22f-0eb9-4d1d-9fa7-b9b67f4b9e2e | sarvex/leetcode-racket | solution/0000-0099/0044.Wildcard Matching/Solution.cpp | class Solution {
public:
bool isMatch(string s, string p) {
int m = s.size(), n = p.size();
vector<vector<bool>> dp(m + 1, vector<bool>(n + 1));
dp[0][0] = true;
for (int j = 1; j <= n; ++j) {
if (p[j - 1] == '*') {
dp[0][j] = dp[0][j - 1];
}
... | ALGO | 0.999959 | 5.552412 |
699b73f3-0964-42d8-99e5-151a21a38b65 | ccl1616/Othello-P2pj3 | oppo.cpp | #include <iostream>
#include <fstream>
#include <algorithm>
#include <array>
#include <vector>
#include <map>
#include <cstdlib>
#include <ctime>
const int SIZE = 8;
const int ALL = 64;
const int VALUE_MAX = 20000;
const int VALUE_MIN = -20000;
struct Point {
int x, y;
Point() : Point(0, 0) {}
Point(float x,... | ALGO | 0.996941 | 4.892019 |
1b47df82-3dda-4260-8ec6-523ac998aef7 | Rotini85/Lewis_ECOGEN | src/Models/Euler/ModEuler.cpp | #include "ModEuler.h"
const std::string ModEuler::NAME = "EULER";
//****************************************************************************
ModEuler::ModEuler(const int& numbTransports) :
Model(NAME, numbTransports)
{
fluxBuff = new FluxEuler();
fluxBuffMRF = new FluxEuler();
for (int i = 0; i < 4; i++)... | ALGO | 0.99789 | 5.028987 |
5a07f94c-e3ed-487f-8e1c-db3693b6d766 | Himars142/Codeforces-Solutions | solutions/116A.cpp | #include <iostream>
using namespace std;
int main() {
int n, a, b, max = 0, p = 0;
cin >> n;
while(n--) {
cin >> a >> b;
p -= a;
p += b;
if(max < p) {
max = p;
}
}
cout << max;
return 0;
} | ALGO | 0.999824 | 3.454854 |
66bd7ca4-e405-4e7b-a0a7-792fa9c62877 | damien-balls/hour-of-code-presentation | face/opencv/modules/cudalegacy/src/calib3d.cpp | #include "precomp.hpp"
using namespace cv;
using namespace cv::cuda;
#if !defined HAVE_CUDA || !defined HAVE_OPENCV_CALIB3D || defined(CUDA_DISABLER)
void cv::cuda::transformPoints(const GpuMat&, const Mat&, const Mat&, GpuMat&, Stream&) { throw_no_cuda(); }
void cv::cuda::projectPoints(const GpuMat&, const Mat&, c... | ALGO | 0.983187 | 6.260382 |
b1bbbad8-8224-4cba-8076-8b6f5af2c1d8 | ErdemOzgen/Cpp-Learning-Archive | Deitel/Chapter06/examples/6.11/fig06_11.cpp | /*
* =====================================================================================
*
* Filename:
*
* Description:
*
* Version: 1.0
* Created: Thanks to github you know it
* Revision: none
* Compiler: g++
*
* Author: Mahmut Erdem ÖZGEN <EMAIL>
* ... | ALGO | 0.991028 | 5.372162 |
e66c557b-83da-41ef-b5fe-5858c18148ef | PandaCodee/CPP_Course | tut71.cpp | // ********************* Virtual Functions **********************
#include<iostream>
using namespace std;
class BaseClass{
public:
int var_base = 1;
virtual void display(){
cout<<"1. Displaying Base Calss variable var_base "<<var_base<<endl;
}
};
class DerivedClass : public Bas... | TOOL | 0.892142 | 5.745918 |
f247319b-2627-4a2c-a015-7420a7eefbfa | grapereader/llvm-z80 | lib/Analysis/ScalarEvolutionNormalization.cpp | #include "llvm/Analysis/Dominators.h"
#include "llvm/Analysis/LoopInfo.h"
#include "llvm/Analysis/ScalarEvolutionExpressions.h"
#include "llvm/Analysis/ScalarEvolutionNormalization.h"
using namespace llvm;
/// IVUseShouldUsePostIncValue - We have discovered a "User" of an IV expression
/// and now we need to decide wh... | ALGO | 0.920428 | 7.877316 |
1ae761a1-0fcd-4622-aabc-a6434958c794 | gnikkoch96/CECS-326-Labs-and-Assignments | Semaphores Assignment/test.cpp | //Steven Centeno
//Nikko Chan
//related Programs:
//semaphore.h
//shipment.o
//this program is meant to:
// have a process that acts like a online store for tennis supplies.
//Customers purchase items and if its out of stock,
//it waits to fulfil the order until it is restocked.
//this works in 3 unique processes
//... | ALGO | 0.972059 | 3.932839 |
eb7b50ca-e031-47e6-9806-b7362dbf6fb9 | sunlisha/FFT | FFT.cpp | #include <iostream>
#include <fstream>
#include <cmath>
using namespace std;
typedef complex<double> dcomp;
dcomp * fft(dcomp A[], int m, dcomp omegaN) {
static dcomp * F;
F = (dcomp *)malloc(m * sizeof(dcomp));
static dcomp * Aeven;
Aeven = (dcomp *)malloc((m/2) * sizeof(dcomp));
static dcomp * Aodd;
... | ALGO | 0.999366 | 3.230915 |
4b9c1c81-104b-41db-91a9-30905df2d41c | Anna-jay950/C-tutorials | prime.cpp | #include <iostream>
using namespace std;
int main()
{
//declaring variables
int x;
bool isPrimeNumber = true;
//Asking user for input
cout << "Enter a number" <<endl;
cin >> x;
//checking whether number is prime or not
for (int i=2; i < x; i++){
if (x % i == 0){
... | ALGO | 0.998174 | 3.605465 |
82c31354-c09d-4eb3-abe1-2b98cc407df8 | cs-moushuai/leetcode | ex_89.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
class Solution
{
public:
vector<int> grayCode(int n)
{
vector<int> ret(1, 0);
for(int m = 0; m < n; m++)
{
for(int i = ret.size() - 1 ; i >= 0; i--)
{
ret.push_back(r... | ALGO | 0.999965 | 5.230828 |
188d7a83-6010-48f8-a85f-c6f35ae33781 | MAMAlgorithmStudy/Programmers | Lv1/나누어 떨어지는 숫자 배열/한수빈.cpp | #include <string>
#include <vector>
#include <algorithm>
using namespace std;
vector<int> solution(vector<int> arr, int divisor) {
vector<int> answer;
for(int i: arr)
{
if(i % divisor == 0)
answer.push_back(i);
}
if(answer.empty())
answer.push_back(-1);
sort(an... | ALGO | 0.999954 | 5.228746 |
f655ad89-59e3-4cd6-80da-8380a2fa0e7c | daniel1124/cpp_course_project | student_file_system/numerical_compute.cpp | #include <iostream>
#include <string>
using namespace std;
class A {
int n;
public:
A(int n_):n(n_){}
A & operator++(){
n ++;
return *this;
}
A & operator++(int){
A temp(*this);
n ++;
return temp;
}
friend ostream & operator<<(ostream & os, A & a){
os << a.n;
return os;
}
oper... | ALGO | 0.99113 | 4.100442 |
b72c3912-1785-4c4c-a5b6-4dcbb75ed752 | suspenss/ACM | Misc/category/zzuli/week_3/bags/2d-v-bag.cpp | #include <iostream>
const int maxn = 300 + 10;
int f[maxn][maxn];
int main () {
int N, T, M;
std::cin >> N >> T >> M;
for (int i = 1, t, m; i <= N; i++) {
std::cin >> t >> m;
for (int j = T; j >= t; j--) {
for (int k = M; k >= m; k--) {
f[j][k] = std::max(f[j][k], f[j - t][k - m] + 1);
}
}
}
std:... | ALGO | 0.999941 | 4.38833 |
3e685b75-ff67-4563-a7e6-7ea717aeffdb | coder965/UEngine | Src/ThirdParty/GeoLib/Geometry/AABB.cpp | /** @file AABB.cpp
@author Jukka Jylnki
@brief Implementation for the Axis-Aligned Bounding Box (AABB) geometry object. */
#include "AABB.h"
#include "../Math/MathFunc.h"
#ifdef MATH_ENABLE_STL_SUPPORT
#include <iostream>
#include <utility>
#endif
#include "Frustum.h"
#include "LineSegment.h"
#include "Line.h"
#inclu... | ALGO | 0.989175 | 7.40468 |
a49a9aa9-4d7f-4770-a0c8-fd6acb1fe7ee | CrBillman/LAMMPS | bond_harmonic.cpp | #include <math.h>
#include <stdlib.h>
#include "bond_harmonic.h"
#include "atom.h"
#include "neighbor.h"
#include "domain.h"
#include "comm.h"
#include "force.h"
#include "memory.h"
#include "error.h"
using namespace LAMMPS_NS;
/* ---------------------------------------------------------------------- */
BondHarmonic... | ALGO | 0.969437 | 6.060336 |
20abe5c2-3c4f-4745-8172-8ab7651240d3 | Speshal71/study | numeric methods/2_jacobi_rotation.cpp | #define _USE_MATH_DEFINES
#include <cmath>
#include <iostream>
#include <fstream>
#include <vector>
template<class T> using Matrix = std::vector<std::vector<T>>;
template<class T> using Vector = std::vector<T>;
Matrix<double> Identity(size_t N)
{
Matrix<double> ret(N, Vector<double>(N, 0));
for (size_t i = 0... | ALGO | 0.999954 | 4.064803 |
46c16a13-7468-445e-8848-3c323d6d6c68 | Sana-Fatima398/DSA-Projects | Search Engine Large/SearchEngineLargeDataSet.cpp | #include <iostream>
#include <fstream>
#include <vector>
#include <utility>
#include <unordered_map>
#include <algorithm>
#include <ctime>
using namespace std;
class BSTNode{ // BST nodes
public:
string key;
string URLs;
bool fileFlag;
BSTNode *left;
BSTNode *ri... | ALGO | 0.997257 | 4.37975 |
9eb596a9-f5ba-4a80-9eba-36b84f67edc7 | nalchaz/TP2_RO | ConsoleApplication1/Tprobleme.cpp | #include "stdafx.h"
#include "Tprobleme.h"
using namespace System;
Tprobleme::Tprobleme()
{
}
Tprobleme::Tprobleme(string nomFic):nomFic(nomFic)
{
Tvecteur vec;
vecteur = vec;
}
void Tprobleme::lireFichier() {
ifstream fichier;
fichier.open(nomFic);
if (!fichier.fail()) {
fichier >> n;
fichier >> m;
... | ALGO | 0.998921 | 3.005727 |
02366c79-5b6e-41e2-b867-acbf32eebf38 | tuanhungbuivan/PPUC | chapter 18/drill/drill2.cpp | #include <iostream>
#include <vector>
std::vector<int> gv = {1,2,4,8,16,32,64,128,256,512};
void f(std::vector<int> v)
{
std::vector<int> lv;
lv = v;
for(int i=0;i<lv.size();i++){
std::cout << lv[i] << " ";
}
std::cout << '\n';
std::vector<int> lv2(v);
for(int i=0;i<lv2.size();i+... | ALGO | 0.999186 | 3.933052 |
c1670012-0a25-42ce-9d5d-7bf35f519679 | cristicretu/ubb | Semester_02/OOP/Labs/test3/task_manager/service.cpp | #include "service.h"
#include <algorithm>
std::vector<Task> Service::getAllTasks() const {
std::vector<Task> tasks = repo.getTasks();
std::sort(tasks.begin(), tasks.end(), [](const Task &a, const Task &b) {
return a.getPriority() == b.getPriority()
? a.getDuration() < b.getDuration()
... | TOOL | 0.876941 | 6.0515 |
23233d60-b212-463c-bdd6-6a8dba074e36 | MukulCode/CodingClubIndia | Linked List Imp Coding Question for your Interview/From LeetCode/148-sort-list/148-sort-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* sortList(L... | ALGO | 0.999997 | 5.668846 |
861afbeb-c754-401d-a7ce-c4141499e31c | AbdelrahmanAbdelmogeth/Problem-Solving | 33431-6714-2-add-two-numbers/33431-6714-2-add-two-numbers.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* addTwoNumbe... | ALGO | 0.999898 | 6.394491 |
898bf672-709d-4d6c-8f2b-0f1980409949 | ThisIsLeoS/algoritmi-e-strutture-dati | Esercitazione 6 (ancora su alberi)/main.cpp | #include <iostream> // per l'input/output
#include <sstream> // per la var. istst
#include <fstream> // per la var. ist e altro
#include "albero.h" // per le chiamate a f. proprie di questo modulo
using namespace std;
int main()
{
Albero a;
string alberoStr, padre, figlio;
char c;
int numNodi = 0;
// input da fi... | ALGO | 0.968692 | 3.802926 |
cec62b10-3e6d-46ce-b5a8-01219b2b81ab | spikebarnett/cpp-euler | 42.cpp | #include <iostream>
#include <fstream>
#include <boost/algorithm/string.hpp>
#include <vector>
using namespace std;
vector<int> tri;
void generateTriNums(int n)
{
for(int i=1;i<=n;++i)
{
tri.push_back(i*(i+1)/2);
}
}
inline int toLetterVal(char l)
{
return (int)(l)-64;
}
inline int toWordVal(string w)
{
int ... | ALGO | 0.975568 | 4.67814 |
e63c1a10-59c1-440f-a0a0-bcfa5a853394 | SterbenDa/LanQiao-Linda | 算法提高/矩阵翻转/Untitled1.cpp | //˼ һҲС0 ôַ
#include "iostream"
using namespace std;
int main(){
int n;
int a[33][33];
cin>>n;
int i,j,z1,z2;
int x=(n+1)/2;
for(i=0;i<n;i++)
for(j=0;j<n;j++)
cin>>a[i][j];
for(i=0;i+x<=n;i++)
for(j=0;j+x<=n;j++){
int temp=0;
for(z1=i;z1<i+x;z1++)
for(z2=j;z2<j+x;z2++){
... | ALGO | 0.999972 | 3.291202 |
e57d1403-22a5-45cf-a97a-0d5769bff4fa | Mr-Yash-beldar/DSA-CPP | Patterns/fancy_pattern.cpp | /*
1
2*2
3*3*3
4*4*4*4
*/
#include <iostream>
using namespace std;
int main()
{
int ROWS ;
cout<<"Enter number of rows: ";
cin>>ROWS;
for (int row = 0; row < ROWS; row++)
{
for (int col = 0; col < row*2+1; col++)
{
if(col%2==0)
cout<<row+1;
... | ALGO | 0.999862 | 3.728689 |
581d6ae3-7fdc-4246-9073-4d5810145dc9 | Jiang-Fuyou/PTA | PTA-B/refer/1041-refer.cpp | #include <iostream>
using namespace std;
int main() {
string stu[1005][2], s1, s2;;
int n, m, t;
cin >> n;
for(int i = 0; i < n; i++) {
cin >> s1 >> t >> s2;
stu[t][0] = s1;
stu[t][1] = s2;
}
cin >> m;
for(int i = 0; i < m; i++) {
cin >> t;
cout << stu... | ALGO | 0.998476 | 3.39753 |
bb24df4b-3d9c-45fe-87f9-f4bd49e7da70 | hanjiang18/agent1 | cslam/src/Frame.cpp | #include <cslam/Frame.h>
namespace cslam {
long unsigned int Frame::nNextId=0;
bool Frame::mbInitialComputations=true;
float Frame::cx, Frame::cy, Frame::fx, Frame::fy, Frame::invfx, Frame::invfy;
float Frame::mnMinX, Frame::mnMinY, Frame::mnMaxX, Frame::mnMaxY;
float Frame::mfGridElementWidthInv, Frame::mfGridElemen... | TOOL | 0.871753 | 6.057043 |
28b362d1-8c81-472f-9ae6-dcb7947b0ca9 | veeresh-desai/DATA-STRUCTURES-AND-ALGORITHMS | unit 2/lectur 11/insertion at specic pos.cpp | #include <iostream>
struct Node {
char data;
Node* next;
Node(char val){
data=val;
next=NULL;
}
};
void insertAfterPosition(Node* head, int position, char value, int nu=10) {
Node* newNode = new Node(value);
if (position == 0) {
newNode->next = head->next;
... | ALGO | 0.999843 | 5.679526 |
c293d52b-572e-41a1-b4d5-eaca31da1ae7 | marmik599/Leetcode | Detect cycle in an undirected graph - GFG/detect-cycle-in-an-undirected-graph.cpp | // { Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution {
public:
bool dfscycle(int source,vector<bool> &visited,vector<int> adj[],int parent)
{
visited[source]=true;
for(auto i:adj[source])
{
if(visite... | ALGO | 0.999967 | 5.893242 |
8b25e010-0e94-4d97-8720-0eff4a3154b2 | yhimanshu22/GeekForGeeks | Difficulty: Basic/Swapping Triangles/swapping-triangles.cpp | // User function Template for C++
class Solution {
public:
vector<vector<int>> swapTriangle(int N, vector<vector<int>> A) {
// code here
for (int i = 0; i < N; i++) {
for (int j = i + 1; j < N; j++) {
swap(A[i][j], A[j][i]);
}
}
re... | ALGO | 0.999941 | 5.698122 |
89c9c725-5942-4fc5-b89b-10f5c1c16e3b | princebansal7/DSA-Sheets-Code | 180-SDE-Sheet/01.Arrays-I/06.MaximumSubarraySum_53_LC.cpp | #include<bits/stdc++.h>
using namespace std;
#define nl "\n"
#define ll long long
//___Kadane's Algorithm__________________________________
int maxSubArraySumKadane(vector<int> &arr) {
int n = arr.size();
ll maxi = INT_MIN;
ll sum = 0;
for (int i = 0; i < n; i++) {
sum += arr[i];
max... | ALGO | 0.999925 | 4.770613 |
aee24590-a0f9-4c52-a30d-47ca1af47c45 | shuntarosumita/1d_zigzag | t1-0.5_t2-1.0/PDW_monopole/zigzag.cpp | //-*- coding: utf-8; mode: c++ -*-
// Time-stamp: <2015-12-15 14:09:06 shunta>
//
// ジグザグチェーンの行列関数ライブラリ
//
#include "zigzag.h"
//
// フェルミ分布関数
//
inline double Zigzag::fermi(double e, double beta) {
return 1.0 / (exp(beta * e) + 1.0);
}
//
// 秩序パラメータを計算する
// order_o: 秩序パラメータ
// haf: 反強磁性的な分子場
// mu: 化学ポテンシャル... | ALGO | 0.999729 | 4.625017 |
a4caa392-e193-410d-820a-efe8d155ef60 | SAFRAN-LAB/Hmatrix_2D | test_ker.cpp | #include "HMAT2DTREE.hpp"
int main(int argc, char* argv[])
{
Vec x,rhs;
int nChebNodes = atoi(argv[1]); // Number of Cheb nodes in single dimension
double L = atof(argv[2]); // Half Length of domain centered at (0,0,..)
Ker::Kchoice = atoi(argv[3]); // Type of Kerne... | ALGO | 0.999395 | 4.84674 |
2e3e0156-91f7-4579-830a-140f2484f0c4 | HekpoMaH/Olimpiads | ALGO ACADEMY/nekvigrafi/1.cpp | #include<bits/stdc++.h>
using namespace std;
const int nmax=59;
int a[nmax][nmax];
int used[nmax];
int n;
void dfs(int node){
used[node]=1;
for(int i=1;i<=n;i++){
if(a[node][i]==1&&used[i]==0)dfs(i);
}
}
void solve(){
cin>>n;
string s;
for(int i=1;i<=n;i++){
cin>>s;
for(int j=0;j<n;j... | ALGO | 0.999817 | 4.203907 |
84d82d3b-6c61-4243-8011-ba8180648cb5 | StephenYang190/rangenet_lib | example/infer.cpp | // opencv stuff
#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/imgproc/imgproc.hpp>
#include <opencv2/viz.hpp>
// c++ stuff
#include <chrono>
#include <iomanip> // for setfill
#include <iostream>
#include <string>
// net stuff
#include <selector.hpp>
namespace cl = rangenet... | DATA | 0.888192 | 5.112716 |
ca19fb6c-a34a-468e-a825-814db5d2b3bd | rishabhgargdps/coding_prep | dynamic_programming/house_robber_ii.cpp | //wrong solution
class Solution
{
public:
int rob(vector<int> &nums)
{
//if we choose the first house and ignore the last house
if (nums.size() < 2)
return nums[0];
else if (nums.size() == 2)
return max(nums[0], nums[1]);
vector<int> dp(nums.size() - 1);
... | ALGO | 0.999942 | 5.580857 |
1b432a83-726e-4964-9bfc-c5b14138e47a | soura07/365-Days-of-Leetcode-Question-Solving-Challenge | 141-linked-list-cycle/linked-list-cycle.cpp | /**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode(int x) : val(x), next(NULL) {}
* };
*/
class Solution {
public:
bool hasCycle(ListNode *head) {
ListNode* slow = head;
ListNode* fast = head;
while(fast != NULL and fast->... | ALGO | 0.999727 | 5.320172 |
6131e52e-6f3c-406c-aa28-b37c6dbe2c29 | bobser223/algorithms_d_stuctures | Homeworks/HW005/e5149_cows.cpp | #include <iostream>
#include <vector>
using namespace std;
int find_min_dist(int n, int k, const vector<int>& dist){
}
int main(){
int n, k;
cin >> n >> k;
vector<int> dist(k);
for(int i = 0; i < k; i++)
cin >> dist[i];
}
| ALGO | 0.999903 | 3.04354 |
637d4161-dcce-4704-99f3-e8ba086666a7 | ishandutta2007/codeforces | ytkn/normal/1627/A.cpp | #include <iostream>
#include <algorithm>
#include <iomanip>
#include <vector>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <tuple>
#include <cmath>
#include <numeric>
#include <functional>
#include <cassert>
#define debug_value(x) cerr << "line" << __LINE__ << ":<" << __func__ << ">:" << #x... | ALGO | 0.998478 | 4.216016 |
f132cc7b-bd37-4057-8b90-db1a4fa89903 | Ginakira/Code-Archive | Leetcode/LeetCode522.cpp | // LeetCode 522 最长特殊序列II
#include <algorithm>
#include <array>
#include <numeric>
#include <queue>
#include <stack>
#include <string>
#include <tuple>
#include <unordered_map>
#include <unordered_set>
#include <vector>
using namespace std;
class Solution {
public:
int findLUSlength(vector<string> &strs) {
... | ALGO | 0.999525 | 5.697306 |
13204232-7673-4792-81d3-9ff03dc2850b | ishandutta2007/codeforces | martin53/normal/1456/C.cpp | #include<bits/stdc++.h>
using namespace std;
const int nmax=1e6+42;
int n,k,inp[nmax];
long long outp=0,bonus=0;
priority_queue<long long> pq;
int main()
{
scanf("%i%i",&n,&k);
for(int i=1;i<=n;i++)scanf("%i",&inp[i]);
sort(inp+1,inp+n+1);
for(int i=1;i<=k+1;i++)pq.push(0);
for(int i=n;i>=1;i... | ALGO | 0.999969 | 3.619985 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.