uuid stringlengths 36 36 | repo_name stringlengths 5 133 | relative_path stringlengths 3 3.76k | content stringlengths 282 4.03M | category stringclasses 6
values | algo_rel_score float32 0.9 1 | quality_score float32 3 8.13 | source_meta dict |
|---|---|---|---|---|---|---|---|
a9532b6c-2774-4247-85f0-fc703fcc213a | ilCodeChef/webserver | srcs/config/serverParser.cpp | #include "config.hpp"
#include "serverParser.hpp"
#include "locationParser.hpp"
#include "baseParser.cpp"
#include <iostream>
#include "colours.hpp"
serverMap serverParser::_initServerFunctions() {
serverMap newMap;
newMap["listen"] = &serverParser::parseListen;
newMap["cgi_ext"] = &serverParser::parseCgiExt;
new... | WEB | 0.98933 | 3.689646 | {
"github_metadata": {
"branch": "master",
"commit_count": 161,
"repo_created_at": "2024-07-22T13:45:57.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1df93a3c... |
72819c6f-2c33-479a-8426-26e28920d2af | cmuparlay/PAM | examples/segment/seg_utils_horizontal.h | int random_hash(int seed, int a, int rangeL, int rangeR) {
if (rangeL == rangeR) return rangeL;
a = (a+seed) + (seed<<7);
a = (a+0x7ed55d16) + (a<<12);
a = (a^0xc761c23c) ^ (a>>19);
a = (a+0x165667b1) + (a<<5);
a = ((a+seed)>>5) ^ (a<<9);
a = (a+0xfd7046c5) + (a<<3);
a = (a^0xb55a4f09) ^ (a>>16);
a = ... | ALGO | 0.987879 | 3.548394 | {
"github_metadata": {
"branch": "master",
"commit_count": 70,
"repo_created_at": "2018-09-10T20:38:18.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 117,
"forks": 22,
"issues": 5,
"pull_requests": 1
},
"file_meta": {
"content_id": "226e4ce... |
f2380535-ddd1-45d5-84ba-2a4c924ced91 | makio93/competitive-atcoder | abc309/abc309_c/main0.cpp | // 本番AC
#include <bits/stdc++.h>
#include <atcoder/all>
using namespace std;
using namespace atcoder;
using ll = long long;
#define rep(i, n) for (int i=0; i<(int)(n); ++(i))
#define rep3(i, m, n) for (int i=(m); (i)<(int)(n); ++(i))
#define repr(i, n) for (int i=(int)(n)-1; (i)>=0; --(i))
#define rep3r(i, m, n) for... | ALGO | 0.999995 | 3.774686 | {
"github_metadata": {
"branch": "main",
"commit_count": 925,
"repo_created_at": "2021-04-23T16:25:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8d4bb788dc... |
f5d1c3de-843d-4eca-8a60-ba874bcd14aa | MostafaAE/LeetCode | 2816-double-a-number-represented-as-a-linked-list/2816-double-a-number-represented-as-a-linked-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:
/*
* Approach:
... | ALGO | 0.999969 | 6.283628 | {
"github_metadata": {
"branch": "master",
"commit_count": 3923,
"repo_created_at": "2022-09-06T16:24:47.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e8fee04... |
8bff8b18-84d3-4164-ba65-7a36f7d39b25 | ermig1979/Simd | src/Simd/SimdAvx512bwReorder.cpp | /*
* Simd Library (http://ermig1979.github.io/Simd).
*
* Copyright (c) 2011-2023 <NAME>.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation th... | ALGO | 0.960916 | 6.294204 | {
"github_metadata": {
"branch": "master",
"commit_count": 4063,
"repo_created_at": "2015-03-25T15:24:55.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2179,
"forks": 437,
"issues": 30,
"pull_requests": 1
},
"file_meta": {
"content_id": "e... |
ef8dce85-f2f7-4977-9860-7ff9102f3f6d | taichunmin/poj | AC/2262.cpp | #include<iostream>
#include<cstdio>
#include<cstdlib>
#include<cstring>
using namespace std;
int arr1[1000001];
int p[100000] = {2,3,5,7}, p_cnt =4;
bool is_prime( int ia )
{
for(int i=0;i<p_cnt && p[i]*p[i]<=ia;i++)
if( ia % p[i] == 0 )
return false;
return true;
}
void build_prime()
{
... | ALGO | 0.999576 | 3.469366 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2014-01-26T01:44:22.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "85b1e9eff9... |
bfa792e5-ebc1-4c44-ad17-675950d74fe3 | gzgreg/ACM | 2018-06-23/C.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;
typedef vector<int> vi;
#define MOD 1000000007
long long mod_pow(long long base, long long exp) {
long long val = 1;
base = base % MOD;
while(exp > 0) {
if(exp % 2 == 1) {
val *= base;
... | ALGO | 0.999997 | 4.446987 | {
"github_metadata": {
"branch": "master",
"commit_count": 130,
"repo_created_at": "2016-07-09T17:21:44.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f3ae9565... |
077bbc4c-b324-4388-ad02-0f7bf87a5160 | onaeonae1/ProblemSolving-Winter | WEEK03/SUNMON/sorting game.cpp | /**
* RESULT: CORRECT, 972ms
* NAME: SORTGAME
* LINK: https://algospot.com/judge/problem/read/SORTGAME
* DATE: 2020-02-20
* AUTHOR: sunmon
* TIP:
* 1. 상태벡터 이용
* 2. bfs
**/
#include <iostream>
#include <vector>
#include <queue>
#include <map>
#include <algorithm>
using namespace std;
vector<int> numbers;
map<ve... | ALGO | 0.999923 | 4.478598 | {
"github_metadata": {
"branch": "master",
"commit_count": 61,
"repo_created_at": "2020-01-06T06:40:17.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4f6c9bfc9... |
0b5ee21b-996e-4e03-ad97-97b423ff57e7 | tensorflow/tensorflow | tensorflow/core/kernels/sparse_tensor_dense_matmul_op.h | /* Copyright 2015 The TensorFlow Authors. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or a... | ALGO | 0.997281 | 7.618178 | {
"github_metadata": {
"branch": "master",
"commit_count": 182413,
"repo_created_at": "2015-11-07T01:19:20.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 190773,
"forks": 74758,
"issues": 873,
"pull_requests": 553
},
"file_meta": {
"content... |
b3b11da8-dac8-4879-973b-aead459be9d3 | linjiafengyang/c-and-cpp | sicily2016/9th-week/1002.cpp | #include <iostream>
using namespace std;
class Complex
{
double re; //real part of a complex number
double im; //imaginary part of a complex number
public:
Complex(double x = 0, double y = 0) {
re = x;
im = y;
}
double real() const { return re; }
double imag() const { return im; }
Complex operator+(const Co... | ALGO | 0.911163 | 4.181788 | {
"github_metadata": {
"branch": "master",
"commit_count": 223,
"repo_created_at": "2016-09-04T14:15:18.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b64538db... |
235bf729-6139-40a1-8a8d-d2eca282bbd8 | Duva-01/Ingenieria-Informatica-ADE | 1 curso/1 semestre/Fundamentos de Programacion/Practicas/FP_sesion14/VI_SumaFilas_TablaDentadaReales.cpp | /***************************************************************************/
// FUNDAMENTOS DE PROGRAMACIÓN
//
// <NAME>
//
/*
Escribir un programa que escriba en la salida estándar la suma de los
valores de cada grupo.
Por ejemplo, en el caso anterior, debería escribir: 3.5, 5.0 y 9.9
Implementar la clase Ta... | ALGO | 0.985484 | 3.932082 | {
"github_metadata": {
"branch": "main",
"commit_count": 38,
"repo_created_at": "2023-07-01T15:58:43.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a96d5d24194... |
6331f3c0-8a2d-4f02-a11c-b9e9282e92df | merdadkh/PokerAI | src/ProbEval.cpp |
#include "ProbEval.h"
bool FlushSymmType::operator< (const FlushSymmType& rhs) const {
if (drawType[0] < rhs.drawType[0]) return true;
else if (drawType[0] == rhs.drawType[0]) {
if (drawType[1] < rhs.drawType[1]) return true;
else if (drawType[1] == rhs.drawType[1]){
if ((SameSuit == false) ... | ALGO | 0.98711 | 4.091757 | {
"github_metadata": {
"branch": "master",
"commit_count": 8,
"repo_created_at": "2017-08-26T19:43:21.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7e6cb7b895... |
119dc3d4-77e7-466a-afc8-b715362068dd | theshubhamsoni/leetcode | 21_Merge_Two_Sorted_Array.cpp | #include <iostream>
#include <vector>
#include <climits>
#include <algorithm>
using namespace std;
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 ... | ALGO | 0.999892 | 5.546388 | {
"github_metadata": {
"branch": "main",
"commit_count": 56,
"repo_created_at": "2023-09-10T10:59:49.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5c351b8dac9... |
18ac2a18-7f46-4446-82b5-3de117b34771 | angeltears/algorithm | algo/Fibonacci.cpp | #include<cstdio>
#include<iostream>
#include<algorithm>
#include<math.h>
using namespace std;
#define N 56
// int main()
// {
// int n[N];
// n[1] = 1;
// n[2] = 2;
// n[3] = 3;
// n[4] = 4;
// int x;
// for (int i = 5; i < N; i++)
// n[i] = n[i - 1] + n[i - 3];
// while (cin >> x)
// {
// if (x > 0 &&... | ALGO | 0.999838 | 3.36758 | {
"github_metadata": {
"branch": "master",
"commit_count": 12,
"repo_created_at": "2017-11-09T10:10:14.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e760b7492... |
73843e3d-3684-45aa-a5a8-ac80d115c395 | princeramkot/DSA- | SparceTableMinQ.cpp | #include<bits/stdc++.h>
#define pb push_back
#define fr(a,b) for(int i = a; i < b; i++)
#define rep(i,a,b) for(int i = a; i < b; i++)
#define modi 1000000007
#define inf (1LL<<60)
#define all(x) (x).begin(), (x).end()
#define fast_io ios_base::sync_with_stdio(false);cin.tie(NULL)
#define read(x) long long x; cin >> x
... | ALGO | 0.999989 | 5.263183 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2022-07-05T10:47:05.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "52a1efa05d07... |
590ac03d-403c-4428-ace3-36fb37c240f5 | Acp-Pradhyuman/Least-Squares-Algorithm | leastSquaresAlgo.cpp | #include <iostream>
#include <omp.h>
#include <cmath>
using namespace std;
const double LsEpsilon = 1.0e-12;
//y = mx + b
bool calcLeastSquaresCPP(const double* x, const double* y,
int n, double* m, double* b);
// const int n = 1024 * 1024;
const int n = 5000 * 5000;
// alignas(64) double x[n];
// alignas(64) d... | ALGO | 0.999279 | 5.166392 | {
"github_metadata": {
"branch": "master",
"commit_count": 8,
"repo_created_at": "2024-12-08T12:36:29.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6b9b454086... |
8385464e-6c1b-4420-8ac1-6af1ede68378 | dilkas/national-exams | 2011/U1.cpp | #include <fstream>
#define IVESTIS "U1.txt"
#define ISVESTIS "U1rez.txt"
#define VYRISKA 3
#define MOTERISKA 4
#define KAIRE 1
#define DESINE 2
#define MAX_N 100
using namespace std;
void paskirk(int puse, int dydis, int kaire[], int desine[], int &ik, int &id) {
if (puse == KAIRE) kaire[ik++] = dydis;
else desi... | ALGO | 0.998736 | 4.010475 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2014-11-07T19:11:20.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1f42d424c5... |
1683079c-593d-4db8-afc7-7a3ad4ed0124 | gagandeepahuja09/Competitive-Programming-Contests | AtCoder/ABC 147/D.cpp | #include<bits/stdc++.h>
using namespace std;
#define int long long int
signed main() {
int n;
cin >> n;
int MOD = 1e9 + 7;
vector<int> a(n);
for(int i = 0; i < n; i++) {
cin >> a[i];
}
int ans = 0ll, p = 1ll;
for(int i = 0; i < 60; i++) {
int ones = 0ll, zero = 0ll;
... | ALGO | 0.99995 | 4.535354 | {
"github_metadata": {
"branch": "master",
"commit_count": 214,
"repo_created_at": "2019-04-22T05:25:43.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d0699a70... |
fa7a9b9f-4bc1-4eb9-bb48-bb0f1cac7f86 | Rainmaker2627/cp-solutions | boi/2014/three_friends.cpp | #include<bits/stdc++.h>
using namespace std;
int n;
string s;
bool ok(string a, string b) {
int j=0, v=0;
for (int i = 0; i < a.size(); i++) {
if (a[i]!=b[j] && v==0) { v++; i--; }
else if (a[i] != b[j]) return false;
j++;
} return true;
}
int main() {
cin.tie(0)->sync_with_std... | ALGO | 0.99999 | 4.064178 | {
"github_metadata": {
"branch": "main",
"commit_count": 40,
"repo_created_at": "2023-11-14T18:09:26.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "33f68bc7ee3... |
aa001d4e-d526-4644-8ab8-480b62529f3e | ishandutta2007/codeforces-p | pranjal.ssh/normal/796/D.cpp | #include <bits/stdc++.h>
using namespace std;
#define F first
#define S second
#define FOR(i,a,b) for (int i = (a); i <= (b); ++i)
#define NFOR(i,a,b) for(int i = (a); i >= (b); --i)
#define all(x) (x).begin(), (x).end()
#define sz(x) int(x.size())
typedef long long ll; typedef pair <int, int> ii; typedef vector <int>... | ALGO | 0.999954 | 3.928033 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-10-30T15:49:24.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "55f16701aac7... |
a19d2515-4cec-4542-9b90-ffd53ce080f8 | saramoorthy/Codeforces-solutions | 339.cpp | //Helpful Maths
//
//
//https://codeforces.com/problemset/problem/339/A
//
//Xenia the beginner mathematician is a third year student at elementary school. She is now learning the addition operation.
//
//The teacher has written down the sum of multiple numbers. Pupils should calculate the sum. To make the calculation ... | ALGO | 0.999984 | 4.845445 | {
"github_metadata": {
"branch": "master",
"commit_count": 155,
"repo_created_at": "2019-09-10T21:25:45.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a44dcb64... |
bba81053-412b-47d9-bf98-c2f8d866da74 | Vishu-Kaushik/Striver-DSA | Striver Dp/8_griduniquePaths.cpp | #include <iostream>
#include <vector>
using namespace std;
// Given a ‘N’ * ’M’ maze with obstacles, count and return the number of unique paths to reach the right-bottom cell from the top-left cell. A cell in the given
// maze has a value '-1' if it is a blockage or dead-end, else 0. From a given cell, we are allowed... | ALGO | 0.999998 | 5.090308 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-05-22T09:59:46.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7497addeb3bd... |
28e250cb-cec2-4884-8d44-11827cb7c18b | zjsxzy/algo | USACO/Training/Section 4.3/Letter Game/main.cpp | /*
ID: frankzh1
TASK: lgame
LANG: C++
*/
#include <bits/stdc++.h>
using namespace std;
#define PB push_back
#define SZ(v) ((int)(v).size())
#define abs(x) ((x) > 0 ? (x) : -(x))
typedef long long LL;
const int maxn = 40005;
int value[27] = {2,5,4,4,1,6,5,5,1,7,6,3,5,2,3,5,7,2,1,2,4,6,6,7,5,7};
string dword[maxn];
int... | ALGO | 0.999868 | 3.299816 | {
"github_metadata": {
"branch": "master",
"commit_count": 1296,
"repo_created_at": "2013-05-18T10:52:16.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3681fe7... |
9935beb1-9182-4e09-bff9-041f5be931a8 | tanejamohit/CodepathIBit | ArraysVectors/RotateMatrix.cpp | /*
You are given an n x n 2D matrix representing an image.
Rotate the image by 90 degrees (clockwise).
You need to do this in place.
Note that if you end up using an additional array, you will only receive partial score.
**Example:**
If the array is
```
[
[1, 2],
[3, 4]
]
```
Then the rotated array b... | ALGO | 0.999914 | 5.772846 | {
"github_metadata": {
"branch": "master",
"commit_count": 9,
"repo_created_at": "2018-01-11T02:00:28.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "deb56f1c80... |
f333bf5d-530e-431f-8ef9-9dabba9be1af | cfloresm/co-digos-expo | fpc/c++/fpc.cpp | #include <stdlib.h>
#include <iostream>
#include <string>
#include <stdio.h>
using std::cout;
using std::cin;
using std::string;
using std::endl;
double suma(double a, double b) {
return a + b;
}
double resta(double a, double b) {
return a - b;
}
double multiplica(double a, double b) {
return a * b;
}
... | TOOL | 0.959295 | 3.566254 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2016-06-15T23:12:46.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5a13549ec0... |
865e5fdf-5e69-4c33-b7ab-a8c53b8d9e55 | dsogari/cp | codeforces/1980/e/main.cc | /**
* https://codeforces.com/contest/1980/submission/273047007
*
* (c) 2024 <NAME>
*/
#include <bits/stdc++.h>
using namespace std;
#ifdef ONLINE_JUDGE
#define debug(...)
#else
#include "debug.h"
init();
#endif
void println(auto &&...args) { ((cout << args << ' '), ...) << endl; }
template <typename T> struct N... | ALGO | 0.999692 | 4.502005 | {
"github_metadata": {
"branch": "main",
"commit_count": 393,
"repo_created_at": "2023-10-25T10:06:14.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b55e086a56... |
9d50ca74-0fad-4422-84f1-ceba1bb036ff | caseygrun/cs289-final-project | CA.cpp | # include <cstdlib>
# include <iostream>
# include <ctime>
using namespace std;
// Cellular Automata
// <NAME> and <NAME>
// CS289 April 2014
// GNU GPL
// some code borrowed from
// http://people.sc.fsu.edu/~jburkardt/cpp_src/cellular_automaton/cellular_automaton.html
// Ref: http://en.wikibooks.org/wiki/Algorithm... | ALGO | 0.999942 | 4.252936 | {
"github_metadata": {
"branch": "master",
"commit_count": 35,
"repo_created_at": "2014-04-03T00:05:55.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "920297432... |
57d602d4-d26d-42a5-813c-44fc11fd7bce | tachyonGZ/C-homework | 动态多态性-抽象基类/main.cpp | /*
【问题描述】 定义抽象基类Shape,由它派生出3个派生类:Circle(圆形)、Square(正方形)、Rectangle(矩形)。
利用指针、虚函数printLength()、printArea()分别输出以上三者的面积和周长,三个图形的数据在定义对象时给定。
另外实现一个通用的函数输出面积和周长,而不需要考虑是何种图形。
要求:在main()中,利用构造函数初始化三个派生类对象cir(4)、squa(5)、rect(2,5), 设计程序,依次测试三个派生类中printLength()、printArea()的功能。
提示:圆... | ALGO | 0.99148 | 4.090141 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2024-05-24T14:18:48.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "945cb495d8ca... |
c00d5d44-c661-40e0-aed2-8094d9306119 | Anant2410/Striver-dsa | Stack and Queue/learning/implement stack using queue.cpp | // using single queue //
class MyStack {
public:
MyStack() {
}
queue<int> q;
void push(int x) {
q.push(x);
for(int i=0;i<q.size()-1;i++)
{
int x = q.front();
q.pop();
q.push(x);
}
}
int pop() {
int x = q.f... | ALGO | 0.99975 | 5.274322 | {
"github_metadata": {
"branch": "main",
"commit_count": 410,
"repo_created_at": "2022-09-06T18:09:23.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "001d84b7e3... |
af569541-6412-40ce-b4ea-31d2d2c0ec08 | umangja/CompetitiveProgrammingSolution | codeforces/1029/F.cpp | /*input
*/
// assic value of ('0'-'9') is(48 - 57) and (a-z) is (97-122) and (A-Z) is(65-90) and 32 for space
// #pragma GCC target ("avx2")
// #pragma GCC optimization ("O3")
// #pragma GCC optimization ("unroll-loops")
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy... | ALGO | 0.999622 | 3.641291 | {
"github_metadata": {
"branch": "master",
"commit_count": 1167,
"repo_created_at": "2021-02-22T18:28:02.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "fa47257... |
35b95cd3-75f2-46b6-88dd-fb6b9a389336 | akash-podder/Job-Stuffs | Akash-Job-Stuffs/Leetcode-Solve/DP/1D DP/322. Coin Change.cpp | class Solution {
public:
int solve(vector<int>& coins, int amount, vector<int>& cache) {
if(amount==0) {
return 0;
}
// if cache exists, we Return the cache
if(cache[amount]!=-1) {
return cache[amount];
}
int Min=INT_MAX; // Min is set to INT... | ALGO | 0.999977 | 5.533629 | {
"github_metadata": {
"branch": "master",
"commit_count": 139,
"repo_created_at": "2021-10-21T20:19:22.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "238ed72d... |
703996c7-4db8-42f2-a6eb-e05416fda684 | ilksh/Algorithm-template | C++/Data Structue/Queue/Deque.cpp | #include<bits/stdc++.h>
using namespace std;
const int MAX_SIZE = 5;
typedef int element;
typedef struct{
element array[MAX_SIZE];
int front, rear;
} Deque;
void init(Deque *dq)
{
dq->front = dq->rear = 0;
}
bool empty(Deque *dq)
{
if (dq->front == dq->rear)
return true;
return false;
}
... | ALGO | 0.995912 | 4.232691 | {
"github_metadata": {
"branch": "main",
"commit_count": 318,
"repo_created_at": "2022-04-30T13:19:52.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c298c68531... |
1c40c876-4643-4e6d-921b-973135baff87 | Pokemon1025/LeetCode-cplusplus | algorithms/DP/509. Fibonacci_Number/FibonacciNumber.h | //
// Created by 朱玥 on 2022/6/12.
//
#pragma once
//1.动态规划 + 降维 - 状态数组空间压缩【推荐】
//时间复杂度:O(n) 空间复杂度:O(1)
class Solution01 {
public:
int fib(int n) {
if (n <= 1) return n;
int prev = 0, cur = 1;
for (int i = 2; i <= n; ++i) {
cur += prev;
prev = cur - prev;
}
return cur;
}
};
//2.状态转移方... | ALGO | 0.999988 | 5.62851 | {
"github_metadata": {
"branch": "master",
"commit_count": 40,
"repo_created_at": "2019-08-13T16:35:53.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2f14b3310... |
68563bfe-8959-49ef-9487-d71574d5aa9a | convict-git/sport_coding | online_contest/www.codechef.com/CodeChef_June_Challenge_2020_Division_1/Danya_and_Different_Values/main3.cpp | #include <bits/stdc++.h>
using namespace std;
#define IOS ios_base::sync_with_stdio(false); cin.tie (nullptr)
#define PREC cout.precision (10); cout << fixed
#ifdef CONVICTION
#include "/home/convict/Dropbox/myfiles/sport_coding/cplib/snippets/debug.h"
#else
#define debug(x...)
#endif
//Don’t practice u... | ALGO | 0.999942 | 4.119635 | {
"github_metadata": {
"branch": "master",
"commit_count": 46,
"repo_created_at": "2019-10-15T14:17:44.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "968317a21... |
45da2687-8710-4e46-83bf-e7f23f7eeb48 | llvm/llvm-project | libcxx/include/__numeric/ranges_iota.h | // -*- C++ -*-
//===----------------------------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===------------... | ALGO | 0.98849 | 7.371867 | {
"github_metadata": {
"branch": "main",
"commit_count": 545188,
"repo_created_at": "2016-12-07T09:39:33.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 33545,
"forks": 14484,
"issues": 5000,
"pull_requests": 5000
},
"file_meta": {
"content_... |
12f941f9-b1db-4fea-a0dc-d461759c4084 | brayano/MultivarTV | cpp-code/solvers.cpp | #include <iostream>
#include <armadillo>
#include <cmath>
#include <string>
#include <cstdlib>
#include <array>
#include <stdexcept>
#include "solvers.hpp"
#define EPS 0.01
using namespace arma;
typedef std::vector<int> VEC;
typedef fmat MAT;
vec pointmax(vec a, double b){
int i;
vec amax(a.size());
for (i=0; i<a... | ALGO | 0.999296 | 5.205424 | {
"github_metadata": {
"branch": "master",
"commit_count": 39,
"repo_created_at": "2018-02-08T04:44:14.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "55b7d6c10... |
5e0ba738-db1c-469c-b91d-b6c0a5e75b65 | bensocar/CS478 | Lab 2/merkle-tree.cpp | #include <iostream>
#include <vector>
#include <string>
using namespace std;
class MerkleTree{
vector<string> v;
string root;
public:
MerkleTree(){
}
string Form(vector<string> v){
int i = 0;
int j;
sha sh;
Big h;
char hash[20];
char hashStr[200];
while(v.size() > 1){
i... | ALGO | 0.999858 | 5.084166 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2018-05-16T02:55:20.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7b8e1c16bb... |
cb13bacc-873f-472e-a01c-6db60a5cdffd | AllegriM/utn_c-_practice | corte-control/ejercicio06.cpp | // Una casa de ventas de libros con varias sucursales registró las ventas
// durante el mes anterior en un lote de registros.
// Para cada venta se registraron los siguientes datos:
// Sucursal de la venta (1 a 20)
// Número del vendedor que efectuó la venta (1 a 150)
// Día de la venta (1 a 31)
// Importe de la venta... | DATA | 0.958951 | 4.764929 | {
"github_metadata": {
"branch": "master",
"commit_count": 26,
"repo_created_at": "2023-03-30T04:05:45.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5162656e1... |
275fb359-09d3-4ddf-97e7-fdead835bd37 | OPM/opm-material | opm/material/eos/PengRobinsonMixture.hpp | // -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
// vi: set et ts=4 sw=4 sts=4:
/*
This file is part of the Open Porous Media project (OPM).
OPM is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Soft... | ALGO | 0.970371 | 7.039546 | {
"github_metadata": {
"branch": "master",
"commit_count": 2441,
"repo_created_at": "2013-06-03T12:19:04.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 15,
"forks": 50,
"issues": 4,
"pull_requests": 4
},
"file_meta": {
"content_id": "c0b9b8... |
988e6126-34de-4c55-868b-acb28e7cf2ea | kohler/click | bsdmodule/config.cc | // -*- c-basic-offset: 4 -*-
/*
* config.cc -- parsing and installing configurations
* <NAME>, <NAME>
*
* Copyright (c) 1999-2001 Massachusetts Institute of Technology
* Copyright (c) 2000-2002 Mazu Networks, Inc.
* Copyright (c) 2001-2002 International Computer Science Institute
*
* Permission is hereby grante... | CONFIG | 0.933958 | 6.281075 | {
"github_metadata": {
"branch": "master",
"commit_count": 10856,
"repo_created_at": "2010-09-21T22:45:25.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 762,
"forks": 324,
"issues": 115,
"pull_requests": 25
},
"file_meta": {
"content_id": ... |
313a8d75-5cf0-48c5-a067-6ef2dd2e758e | p-Cipriano/beecrowd | 1485.cpp | #include <bits/stdc++.h>
#define _ ios_base::sync_with_stdio(0);cin.tie(0);
#define endl '\n'
#define f first
#define s second
#define pb push_back
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> ii;
const int inf=0x3f3f3f3f;
const long long linf=0x3f3f3f3f3f3f3f3fll... | ALGO | 0.999068 | 3.125248 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2023-07-14T18:56:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2ab7fff7742a... |
94dc1a5b-52ba-459c-8687-e912102b67b1 | luoshunchong/Cplusplus-Leetcode | algorithm_extension/cn/C++/question/___Offer_33______________LCOF.cpp | // @algorithm @lc id=100315 lang=cpp
// @title er-cha-sou-suo-shu-de-hou-xu-bian-li-xu-lie-lcof
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include "algm/algm.h"
using namespace std;
// @test([1,6,3,2,5])=false
// @test([1,3,2,6,5])=true
class Solution {
public:
bool verifyPosto... | ALGO | 0.999965 | 6.189632 | {
"github_metadata": {
"branch": "main",
"commit_count": 152,
"repo_created_at": "2021-06-17T02:48:45.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e1db27ed55... |
7383031f-e46b-408a-b16a-b357ea6b1f96 | frdmu/Coding | Divide_and_Conquer/169_Majority_Element.cc | // https://leetcode-cn.com/problems/majority-element/
// solution: recursive
class Solution {
public:
int majorityElement(vector<int>& nums) {
return findMajorityElement(nums, 0, nums.size()-1);
}
int findMajorityElement(vector<int>& nums, int start, int end) {
if (start == end)
... | ALGO | 0.999972 | 5.541017 | {
"github_metadata": {
"branch": "master",
"commit_count": 331,
"repo_created_at": "2021-03-08T02:54:23.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 104,
"pull_requests": 0
},
"file_meta": {
"content_id": "056e00... |
2b13c865-3128-46ac-9802-91f55889edad | danielhO9/PS | ATCODER/dpJ.cpp | #include <bits/stdc++.h>
using namespace std;
int N;
int a[300];
double cache[300 * 301 * 301 + 1];
double matchCache(int x) {
// cout << x << '\n';
if (x == 0) return 0.0;
double& ret = cache[x];
if (ret > -0.5) return ret;
int nx = x;
int cnt[4];
cnt[3] = x / (301 * 301); x %= (301 * 301);
cnt[2] = x / 30... | ALGO | 0.999436 | 3.293552 | {
"github_metadata": {
"branch": "main",
"commit_count": 336,
"repo_created_at": "2024-02-08T11:38:11.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7c3d1f666d... |
0a733693-84d3-4173-a0d9-8ebf5bb8b24b | uLoyd/file-dump | file-dump/C++/Apriori.cpp | #include <vector>
#include <iostream>
#include <time.h>
#include <conio.h>
#include <stdlib.h>
#include <algorithm>
using namespace std;
int get_rand(int start, int end){
return start + rand() % ((end - start ) + 1);
}
class pojProd{
public:
vector < string > nazwa;
vector < float > prodProb;
vector < int > ... | ALGO | 0.949365 | 3.306343 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2021-04-01T09:17:35.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ead8cafcd59c... |
578cfd62-7e35-4343-a807-1f89eed6cba7 | sandra-chavdarova/Structural-Programming | Labs/First Partial Exam/28.cpp | /*
Марта и нејзините 3 другарки сакаат да одат на кино и купуваат билети.
Иницијалната цена на еден билет за сите филмови е 200 денари, но
доколку филмот комедија се доплаќа 20 денари,
доколку филмот е акција се доплаќа 40 денари,
доколку филмот е романса се доплаќа 30 денари.
Освен картите кои сакаат да ги купа... | ALGO | 0.988691 | 4.925575 | {
"github_metadata": {
"branch": "master",
"commit_count": 41,
"repo_created_at": "2024-10-27T21:46:59.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "38361f0cf... |
084453b4-263e-47fb-9fe3-13b6e43a0e61 | LutzGross/esys-escript.github.io | trilinos_source15/packages/muelu/src/Utils/MueLu_VisualizationHelpers_decl.hpp | // @HEADER
//
// ***********************************************************************
//
// MueLu: A package for multigrid based preconditioning
// Copyright 2012 Sandia Corporation
//
// Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
// the U.S. Government retains cer... | TOOL | 0.941067 | 4.470184 | {
"github_metadata": {
"branch": "master",
"commit_count": 5724,
"repo_created_at": "2020-08-10T02:31:18.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 34,
"forks": 15,
"issues": 63,
"pull_requests": 0
},
"file_meta": {
"content_id": "b7e7... |
640f13c8-302f-465e-a603-44b168617b58 | Louislar/DS_HW5 | hw5_temp.cpp | #include<iostream>
#include<fstream>
using namespace std;
class chainNode
{
public:
chainNode(){}
chainNode(int e, chainNode* l=0)
{
data=e;
link=l;
}
int data;
chainNode* link;
};
int main()
{
//file input
cout<<"Input file name: ";
ifstream ifs;
char filenam... | ALGO | 0.998393 | 3.647911 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2017-10-28T17:45:36.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "bd90c98818... |
e37ea02a-7f19-4909-9a58-d3c6f2c36776 | mirek26/cobra | cobra/src/strategy.h | /*
* Copyright (c) 2014, <NAME> <<EMAIL>>
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#include <map>
#include <utility>
#include <string>
#include "./formula.h"
#include "./game.h"
#include "./experiment.h"
#include "./common.h"
#include "./parser.h"
#i... | TOOL | 0.953014 | 6.258537 | {
"github_metadata": {
"branch": "master",
"commit_count": 219,
"repo_created_at": "2013-06-14T07:11:35.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9a11cd81... |
9418d8b3-a492-40aa-be61-2d3b6a351814 | echoruiko/NetworkFinal | main.cpp | //
// main.cpp
// Network
//
// Host with initial timeOUt to be 300 ms, if 1 is lost, then the timeOut will be
// computed by ack.
// Assume that the front in wnd must be the lost one.
//
// Router with timeout to be 200ms, router's ACK's ID is the portNo
//
// Created by RuijiaSun on 11/1/15.
// Copyright © 2015 R... | ALGO | 0.995507 | 3.81327 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2015-12-13T21:54:14.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "fdb45c92e8... |
60864ee1-df96-4838-ba04-06457671172f | acharalampous/crypto-recommend | src/rService.cpp | /*******************************/
/* rService.cpp */
/* Recommendation service */
/* Name: <NAME>
* A.M : 1115201500195
* e-mail: <EMAIL>
*/
/********************************/
#include <iostream>
#include <string>
#include <map>
#include <random>
#include <ctime>
#include "rService.h"
#include "lsh.h"
usin... | WEB | 0.932631 | 5.609257 | {
"github_metadata": {
"branch": "master",
"commit_count": 20,
"repo_created_at": "2019-01-09T16:18:50.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a25244b1c... |
282ef86c-a7a1-4ee2-be74-90bc96b67557 | mindspore-ai/mindspore | mindspore/ccsrc/frontend/parallel/pass/matmul_add_comm_reduction.cc | /**
* Copyright 2024 Huawei Technologies Co., Ltd
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law... | ALGO | 0.98983 | 6.715948 | {
"github_metadata": {
"branch": "master",
"commit_count": 83896,
"repo_created_at": "2020-02-11T08:43:48.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 4559,
"forks": 740,
"issues": 181,
"pull_requests": 20
},
"file_meta": {
"content_id": ... |
c318f130-187f-4f73-99a3-70b26a2a90e7 | Golangltd/codeclass | interface{}/src/opencv-master/opencv110/cvaux/src/vs/blobtrackingkalman.cpp | /*M///////////////////////////////////////////////////////////////////////////////////////
//
// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
//
// By downloading, copying, installing or using the software you agree to this license.
// If you do not agree to this license, do not download, instal... | ALGO | 0.958428 | 6.290794 | {
"github_metadata": {
"branch": "master",
"commit_count": 206,
"repo_created_at": "2018-08-14T03:58:28.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 615,
"forks": 195,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "ab61d... |
541306c6-af61-43bb-9992-c89d372d8f42 | AlexDechart/prog | practice3/task3/main.cpp | #include <iostream>
#include "rational.h"
using namespace std;
int main(){
setlocale(LC_ALL, "Russian");
int n;
cout << "количество дробей " << endl;
cin >> n;
rational* mas = new rational[n];
int a, b;
for (int i = 0; i < n; i++){
cout << "значения дроби " << i + 1 << endl;
cin >> a >> b;
mas[i].set(a, b... | ALGO | 0.969945 | 4.12203 | {
"github_metadata": {
"branch": "main",
"commit_count": 38,
"repo_created_at": "2023-02-10T10:29:52.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e006214dd61... |
5f88effb-d3ed-4212-990a-8dac78192d14 | Shikhar-S/Analysis-of-Competitive-Codebase | Data/Contest1236/all/29091547_62813067.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int L = 1e5+10;
vector<int> onRow[L];
vector<int> onCol[L];
int primeiroMenor(vector<int> &v, int x){
int l = 0, m, r = v.size()-1;
while(l<=r){
m = (l+r)>>1;
if(v[m] < x) l = m+1;
else r = m-1;
}
return v[r];
}
int primeiroMaior(ve... | ALGO | 0.999976 | 4.499587 | {
"github_metadata": {
"branch": "master",
"commit_count": 74,
"repo_created_at": "2019-11-22T14:40:44.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "55066d0cd... |
dba2d0a5-8288-4fa3-82c7-6f781602e9fa | PriyaSharma3/Basics-of-Cpp | pushzeroes.cpp | #include <iostream>
using namespace std;
int main()
{
int arr[12], n;
cout << "Enter size of an array :";
cin >> n;
cout << "Enter elements of an array :" << endl;
for (int i = 0; i < n; i++)
{
cin >> arr[i];
}
int count0 = 0;
int k = n - 1;
for (int j = 0; j < n - 2; j+... | ALGO | 0.99988 | 3.947246 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2022-05-04T11:33:12.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e03cfe2787... |
acc2aea3-c10f-4561-867b-fa781a617591 | MrIceCreamMan/EC327 | PA2_Assignments/MyWork/Q1/pa2Functions.cpp | #include <iostream>
#include <typeinfo>
#include <fstream>
#include <cmath>
#include <iomanip>
#include "pa2Functions.h"
using namespace std;
extern const int ENTRIES;
extern ofstream* mystream;
void initiallize()
{
cout << "EC327: Introduction to Software Engineering" << endl;
cout << "Fall 2015" << endl;
cout... | TOOL | 0.940675 | 3.012494 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2015-10-12T13:45:36.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d22fe2c8a0... |
8126c6cc-e1de-4f00-aa72-e0ac4108e489 | siyaoxu/Self-Driving-Cars | CarND-Kidnapped-Vehicle-Project/src/particle_filter.cpp | /*
* particle_filter.cpp
*
* Created on: Dec 12, 2016
* Author: <NAME>
*/
#include <random>
#include <algorithm>
#include <iostream>
#include <numeric>
#include <math.h>
#include <iostream>
#include <sstream>
#include <string>
#include <iterator>
#include <map>
#include "particle_filter.h"
using namespace ... | ALGO | 0.994798 | 5.875372 | {
"github_metadata": {
"branch": "master",
"commit_count": 92,
"repo_created_at": "2017-06-22T03:23:21.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b01e537d6... |
440c6f8d-99f0-4464-b758-957cc58f9629 | PranavVyas20/4-Months-DSA | Graphs/surrounded_regions_bfs.cpp | #include<iostream>
#include<bits/stdc++.h>
using namespace std;
void solve(vector<vector<int>> & board) {
vector<vector<bool>> visited(board.size(), vector<bool>(board[0].size(), false));
int totalRows = board.size();
int totalCols = board[0].size();
vector<int> rowDir = {-1, 0, 1, 0};
vector<int>... | ALGO | 0.999795 | 5.373593 | {
"github_metadata": {
"branch": "main",
"commit_count": 48,
"repo_created_at": "2022-09-03T08:15:17.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "eed0a3f9c36... |
4b66459c-3b23-4274-9507-79a4fa4d0099 | dle8/Competitive-Programming | DSU_on_tree2.cpp | #include <bits/stdc++.h>
#define FOR(i, l, r) for (int i=l; i<=r; i++)
#define REP(i, r, l) for (int i=r; i>=l; i--)
#define maxn 10000+10
#define oo 1000000000
using namespace std;
struct e {
long u, v;
};
e edge[maxn];
long ands, n, lab[maxn];
bool check[maxn];
long max(long a, long b) {
if (a>=b) return a;
els... | ALGO | 0.999647 | 3.948059 | {
"github_metadata": {
"branch": "master",
"commit_count": 85,
"repo_created_at": "2018-12-14T04:26:30.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7ee4ccc48... |
09efec9d-3529-45e4-af7d-2c322cb85501 | alok-96/Code-Bank | MathematicalProblems/Easy/happy-number.cpp | // https://leetcode.com/problems/happy-number
// T.C. - O(n), S.C. - O(n)
// in each iteration put that number into the set and if any iteration this number founds in stack of n becomes 1,
// then terminate the loop and check that if n == 1 then return true else false
class Solution
{
public:
int sum(int n)
... | ALGO | 0.999881 | 5.722833 | {
"github_metadata": {
"branch": "main",
"commit_count": 22,
"repo_created_at": "2023-10-09T06:46:11.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "fff20bc4784... |
5c1d0cc7-2b8e-454e-a85b-cedda7a84782 | Franco1010/Leones000 | math/bairsow.cpp | // Needs a const ITER
typedef double tp; // type of polynomial
template<class T=tp>
struct poly { // poly<> : 1 variable, poly<poly<>>: 2 variables, etc.
vector<T> c;
T& operator[](int k){return c[k];}
poly(vector<T>& c):c(c){}
poly(initializer_list<T> c):c(c){}
poly(int k):c(k){}
poly(){}
poly operator+(poly<T... | ALGO | 0.999799 | 3.840082 | {
"github_metadata": {
"branch": "main",
"commit_count": 74,
"repo_created_at": "2020-10-20T05:23:42.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 11,
"forks": 4,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "58cb7b75a2... |
df9f452e-2587-4c7f-8776-c285187bb8a7 | diantaowang/cocoding | 95_generate_trees.cc | #include <ios>
#include <sched.h>
#include <vector>
#include <algorithm>
#include <string>
#include <map>
#include <set>
#include <iostream>
#include <tuple>
#include <queue>
#include <stack>
using namespace::std;
struct TreeNode {
int val;
TreeNode *left;
TreeNode *right;
TreeNode() : val(0), left(nu... | ALGO | 0.999973 | 5.787958 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2021-01-23T02:46:13.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "30844d4b8a... |
82557231-5a1d-488f-8dce-33dddb9a7884 | ngthanhtrung23/CompetitiveProgramming | codeforces/100497/E.cpp | #include <set>
#include <map>
#include <list>
#include <cmath>
#include <queue>
#include <stack>
#include <cstdio>
#include <string>
#include <vector>
#include <cstdlib>
#include <cstring>
#include <sstream>
#include <iomanip>
#include <complex>
#include <iostream>
#include <algorithm>
#include <ctime>
#include <deque... | ALGO | 0.999885 | 3.74461 | {
"github_metadata": {
"branch": "master",
"commit_count": 4554,
"repo_created_at": "2019-04-04T14:21:40.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 90,
"forks": 17,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0780b... |
747dfa90-7db5-4565-b04d-02a27d5899e9 | ram19966p/DSA | array.cpp | # include <iostream>
using namespace std ;
// void inputArray{
// int size = 5 ;
// int marks[size] ;
// for(int i =0 ; i<size; i++){
// cin>>marks[i];
// }
// cout<<sizeof(marks)/sizeof(int) <<endl;
// for(int i = 0 ; i<=__SIZEOF_INT__; i++){
// cout<<marks[i]<<en... | ALGO | 0.996287 | 3.146683 | {
"github_metadata": {
"branch": "main",
"commit_count": 9,
"repo_created_at": "2024-10-06T16:04:57.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "19eda17bd190... |
89026103-7745-4972-b577-cc37b1c9b171 | jsk41755/Algorithm | 백준/Silver/2805. 나무 자르기/나무 자르기.cc | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int arr[1000001];
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
int n, m;
cin >> n >> m;
int mx = -1;
int mi = 2000000001;
for (int i = 0; i < n; i++) {
cin >> arr[i];
mx = max(mx, arr[i]);
mi = min(mi, arr[i]);
}
... | ALGO | 0.999996 | 3.690945 | {
"github_metadata": {
"branch": "main",
"commit_count": 527,
"repo_created_at": "2023-02-09T15:35:03.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "aa32ac659d... |
a26f7504-f775-4268-a4b5-c869e2ed0508 | yosupo06/library-checker-problems | tree/dynamic_tree_vertex_add_subtree_sum/gen/toptree.hpp | #include <array>
#include <cassert>
#include "random.h"
namespace niu {
using i64 = long long;
struct vertex_weight {
int id;
int weight;
vertex_weight(): id(-1), weight(0) {}
vertex_weight(int id, int weight): id(id), weight(weight) {}
};
struct cluster {
int sum;
using V = vertex_... | ALGO | 0.998577 | 4.097857 | {
"github_metadata": {
"branch": "master",
"commit_count": 3115,
"repo_created_at": "2019-05-30T20:49:42.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 589,
"forks": 137,
"issues": 98,
"pull_requests": 3
},
"file_meta": {
"content_id": "88... |
6c055ba9-fc91-4905-bc17-985c9799225e | tsunghuanghsieh/leetcode | problems/shortest-path-in-a-grid-with-obstacles-elimination/Solution2.cpp | #include <iomanip>
#include <iostream>
#include <queue>
#include <unordered_set>
#include <vector>
using namespace std;
class Solution2 {
public:
// LC soln #1: bfs
// LC soln #2: A* algorithm
//
// This approach uses bfs with iterative approach and separate grid to maintain available k at each
//... | ALGO | 0.999987 | 6.010628 | {
"github_metadata": {
"branch": "master",
"commit_count": 758,
"repo_created_at": "2019-02-08T05:36:48.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b34d8a3f... |
acd54585-7a63-4ee3-8d73-cfd573d3b8d7 | Seymour-Lee/leetcode-solutions | unclassfied/837. New 21 Game.cpp | class Solution {
public:
double new21Game(int N, int K, int W) {
vector<double> dp(N+W+1, 0.0);
for(int k = K; k <= N; k++) dp[k] = 1.0;
double s = min(N-K+1, W);
for(int k = K-1 ; k >= 0; k--){
dp[k] = s / W;
s += dp[k] - dp[k+W];
}
return dp[... | ALGO | 0.999869 | 4.469255 | {
"github_metadata": {
"branch": "master",
"commit_count": 718,
"repo_created_at": "2018-06-21T10:48:08.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9f7a9528... |
453a5475-cda9-449b-a5c5-275c9c65a8d7 | akoolarni/DSA | BM2043 (LAB)/3/Q3.cpp | #include <iostream>
#include <cstdlib>
#include <string>
using namespace std;
struct TreeNode {
int data;
TreeNode* left;
TreeNode* right;
TreeNode(int val) : data(val), left(nullptr), right(nullptr) {} // tree declaration
};
TreeNode* insert(TreeNode* root, int val) {
if (root == nullptr) {
... | ALGO | 0.999976 | 5.952199 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2023-12-30T14:28:23.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7c52cab516df... |
214c4330-b297-4731-975f-735365bee892 | imicola/Questions-and-Impressions | main/codeforces/Codeforces Round 1026 (Div. 2)(vp)/B_Down_with_Brackets.cpp | //#pragma GCC optimize(3)
#include <bits/stdc++.h>
#define int LL
#define endl '\n'
// #define size_t int
#define all(v) v.begin(), v.end()
using namespace std;
typedef long long LL;
typedef vector<int> vint;
typedef vector<vint> vvint;
typedef vector<string> vstr;
typedef pair<int, int> pii;
typedef vector<pii> vpii;
... | ALGO | 0.999701 | 4.251009 | {
"github_metadata": {
"branch": "LuoGutest/main",
"commit_count": 160,
"repo_created_at": "2024-09-08T11:43:50.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "... |
b2e15bd4-d71d-4efc-970d-fb886a1f1272 | TranHuyHiep/CTDL-GT | B15/Bubble_Sort.cpp | // sắp xếp nổi bọt - Bubble sort
// độ phức tạp: O(n^2)
// input: a1, a2,.., an; output: a1 <= a2 <=...<= an
/*
Ý tưởng:
Bước 1: Đi từ cuỗi dãy về vị trí thứ 1 nếu cứ phần tử đứng trước lớn hơn phần tử đứng sau thì đổi chỗ, do đó đưa được phần tử nhỏ nhất về vị trí thứ 1
Bươc 2: Đi từ cuỗi dãy về vị trí thứ 2 nếu cứ ph... | ALGO | 0.999638 | 3.936749 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2022-11-07T14:57:48.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "703c6ab63e... |
140ffce9-0227-4206-99f2-54d340aebd15 | ishandutta2007/codeforces-c | compute/normal/1447/B.cpp | #include<bits/stdc++.h>
using namespace std;
#ifndef ONLINE_JUDGE
#define dbg(x...) do { cout << "\033[32;1m " << #x << " -> "; err(x); } while (0)
void err() { cout << "\033[39;0m" << endl; }
template<template<typename...> class T, typename t, typename... A>
void err(T<t> a, A... x) { for (auto v: a) cout << v << ' ';... | ALGO | 0.999967 | 4.354804 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T01:17:48.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "108f5eb13cae... |
787b5acc-d7ea-4739-970d-b6397979b7ba | PauNyth-eng/MazePathFinder | MazePathFinder/Maze.cpp | #include "Maze.h"
Maze::Maze()
{
}
/// <summary>
/// Recursive function internalFindPath, Algorithm used for this problem was A* -> Moving to every possible directions (Up, Down, Right, Left)
/// </summary>
/// <param name="x">Position x</param>
/// <param name="y">Position y</param>
/// <param name="dir">Direction<... | ALGO | 0.981236 | 3.977657 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2022-04-23T15:52:09.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8caadcdac5... |
4e144d86-216a-49e5-9bc5-9876ad4f4b72 | o-todorov/SoftUni | C++ Fundamentals/Additional Exercises/JA1/JA1-Roxets Not Checked In Judge Vector with eraze member used.cpp |
#include <iostream>
#include <vector>
#include<math.h>
#include<iomanip>
using namespace std;
int hexToDec(char arr[5])
{
int result = 0;
int tmp;
for (int i = 0; i < 5; i++)
{
char chTmp = arr[i];
if (chTmp >= 'a') {
tmp = 10 + (c... | ALGO | 0.998833 | 3.429363 | {
"github_metadata": {
"branch": "master",
"commit_count": 420,
"repo_created_at": "2020-07-12T20:16:05.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6d719f14... |
1e0c3fa8-d7f8-44f7-a262-386a16a08d2a | KakeruKitahara/kyopuro | atcoder/abc259/c/m.cpp | #include <bits/stdc++.h>
#include <atcoder/all>
using namespace std;
using namespace atcoder;
/* macro */
#define REP(i, n) for (int i = 0; i < n; i++)
#define REP2(i, a, n) for (int i = a; i < n; i++)
#define REPR(i, n) for (int i = n - 1; 0 <= i; i--)
using V = vector<int>;
using VV = vector<vector<int>>;
using VVV ... | ALGO | 0.999989 | 3.864033 | {
"github_metadata": {
"branch": "master",
"commit_count": 212,
"repo_created_at": "2022-02-02T07:17:30.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f37f8695... |
fa2f9e02-2364-434f-bb61-c8f931b0036a | Ra1nWarden/Online-Judges | Codeforces/350/d.cpp | #include <cstdio>
#include <algorithm>
using namespace std;
const int maxn = 100000;
int a[maxn+5];
int b[maxn+5];
int n, k;
bool ok(int num) {
long long kk = k;
for(int i = 0; i < n; i++) {
kk += min((long long)b[i] - a[i] * 1LL * num, 0LL);
if(kk < 0)
break;
}
return kk >= 0;
}
int main() {
... | ALGO | 0.999971 | 3.650485 | {
"github_metadata": {
"branch": "master",
"commit_count": 208,
"repo_created_at": "2014-04-02T05:35:32.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 38,
"pull_requests": 0
},
"file_meta": {
"content_id": "a8253b4... |
ee234f69-b237-45fd-8a7f-467dd801a313 | SlicedPotatoes/Advent_of_code | 2023/Day09/main.cpp | /*
L'entrée représente une liste de séquences.
Dans la première partie, l'objectif est de prédire le nombre suivant dans la séquence. Le résultat attendu est la
somme des nombres prédits.
Dans la deuxième partie, l'objectif est de prédire le nombre précédant le premier nombre de la séquence. Le résultat
at... | ALGO | 0.999836 | 5.595264 | {
"github_metadata": {
"branch": "main",
"commit_count": 77,
"repo_created_at": "2023-04-22T21:44:40.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "54386040eef... |
b060bd59-bf41-4507-aadb-1e647ec1baea | coderark/Algo-DS | A & D/C4/Week 3-4/kmp.cpp | #include <cstdio>
#include <iostream>
#include <string>
#include <vector>
using namespace std;
// Find all occurrences of the pattern in the text and return a
// vector with all positions in the text (starting from 0) where
// the pattern starts in the text.
vector<int> compute_prefix(const string& text){
int l=t... | ALGO | 0.998177 | 4.635308 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2016-09-19T14:56:34.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0200c40b91... |
9900e956-4957-4752-ad1d-f12186c27b44 | pratikunterwegs/pathomove | inst/include/agent_dyn.h | // Copyright 2022 <NAME>. See repository licence in LICENSE.md.
#ifndef INST_INCLUDE_AGENT_DYN_H_
#define INST_INCLUDE_AGENT_DYN_H_
#define _USE_MATH_DEFINES
/// code to make agents do things
// [[Rcpp::depends(BH)]]
// [[Rcpp::depends(RcppParallel)]]
// clang-format off
#include <algorithm>
#include <cassert>
#incl... | ALGO | 0.999589 | 6.780371 | {
"github_metadata": {
"branch": "main",
"commit_count": 1020,
"repo_created_at": "2021-01-17T17:10:43.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5eeb941b2... |
a9bbd932-f5d1-4390-912d-6a6da7d3551f | belsouza/backupexercises | antigos/questao5.7.0.cpp | /*
QUESTÃO 07: Faça um programa que leia 150 números reais e, ao final, exiba:
a) A soma dos 50 primeiros;
b) menor número do 50° ao 100° valores fornecidos;
c) A média entre os últimos 50 valores.
*/
#include <stdio.h>
int main(void)
{
int i, n;
int num = 150; //Original: 150
int cont = 0;
int soma = 0;
int ma... | ALGO | 0.996513 | 3.306731 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2020-08-30T00:50:07.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e692e7ede1... |
0d05d8a6-66e9-4954-a2e4-d3d6305e1f3e | ishandutta2007/codeforces-o | orzdevinwang/normal/521/E.cpp | #include<bits/stdc++.h>
#define L(i, j, k) for(int i = j, i##E = k; i <= i##E; i++)
#define R(i, j, k) for(int i = j, i##E = k; i >= i##E; i--)
#define ll long long
#define ull unsigned long long
#define db long double
#define pii pair<int, int>
#define mkp make_pair
#define sz(x) ((int) x.size())
#define be(x) x.begin... | ALGO | 0.999942 | 3.666835 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-10-30T15:45:49.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "62a4978370ce... |
5e750ecd-d868-4e3c-8c77-a9abea5210b9 | kazi-nayeem/Programming-Problems-Solutions | csacademy/round-82/B/B/main.cpp | //
// main.cpp
// B
//
// Created by <NAME> on 20/6/18.
// Copyright © 2018 <NAME>. All rights reserved.
//
//#include <bits/stdc++.h>
#include<cstdio>
#include<cstring>
#include<cctype>
#include<cmath>
#include<cstdlib>
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<stack>
#in... | ALGO | 0.999955 | 4.108373 | {
"github_metadata": {
"branch": "master",
"commit_count": 11,
"repo_created_at": "2020-07-13T19:00:54.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "dc3a51df5... |
317d04a9-3014-4c2e-9653-c110bc7bcf52 | CalebeRRdev/Laboratorio-de-Programacao | ativ-pratica-6-parte2.cpp | #include <iostream>
#include <stdio.h>
#include <math.h>
#include <locale.h>
using namespace std;
void operacao(int a, int b, char simbolo) {
int resultado;
if (simbolo == '+') {
resultado = a + b;
} else if (simbolo == '*') {
resultado = a * b;
} else {
cout << "\n\tSimbolo i... | ALGO | 0.99638 | 4.566843 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2023-04-11T22:43:46.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2aced3671835... |
51c768d5-cc1e-460c-abfa-1c52b94619fc | maikel/FiniteVolumeSolver | examples/AMReX/EB/2D/CoupledLinearShock2d.cpp | // Copyright (c) 2019 <NAME>
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distri... | ALGO | 0.994994 | 5.231763 | {
"github_metadata": {
"branch": "develop",
"commit_count": 1917,
"repo_created_at": "2019-12-04T16:42:13.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 7,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ae6c69... |
7733e957-ad58-4f69-9fa5-940251791657 | a-dev1/CP-Repo | challenges/801 (Div 2)/C_Zero_Path.cpp | #include <bits/stdc++.h>
#define code_brains \
; \
ios_base::sync_with_stdio(false); \
cin.tie(NULL); \
cout.tie(0);
using namespace std;
typedef unsigned long long ull;
typedef long long ll;
typedef long double lld;
const int MAX_N = 1e5 + 1... | ALGO | 0.999975 | 5.055401 | {
"github_metadata": {
"branch": "main",
"commit_count": 174,
"repo_created_at": "2021-06-14T18:35:55.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6e1cce219c... |
cf7f5d9b-141c-4ee9-8f66-39cf4bc3c9ac | Wentao2017/PSI-Boil | Src/Equation/Centered/Enthalpy/enthalpy.h | #ifndef ENTHALPY_H
#define ENTHALPY_H
#include <cmath>
#include "../centered.h"
#include "../../../Parallel/communicator.h"
#include "../../../Solver/Gauss/gauss.h"
#include "../../../Timer/timer.h"
/***************************************************************************//**
* \brief Discretizes and solves entha... | ALGO | 0.999379 | 5.347934 | {
"github_metadata": {
"branch": "master",
"commit_count": 31,
"repo_created_at": "2018-09-26T13:44:13.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 4,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f3d1c631c... |
59462624-9bea-428d-be49-222f444654a8 | FreeCAD/FreeCAD | src/Mod/Part/App/BSplineCurveBiArcs.h | // This file is released under the BSD license
//
// Copyright (c) 2009, <NAME>
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met:
//
// * Redistributions of source code must retain the above ... | TOOL | 0.962255 | 6.880035 | {
"github_metadata": {
"branch": "main",
"commit_count": 42594,
"repo_created_at": "2012-09-09T08:25:02.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 25389,
"forks": 4671,
"issues": 2906,
"pull_requests": 250
},
"file_meta": {
"content_id"... |
25f459d3-abdd-4af7-a181-57c21e78eb28 | howardon951/DS_project1_tetris | game_run.cpp | #include <iostream>
#include <fstream>
using namespace std;
int M, N;
int checkblocks(char input[]);
void moveline(int line, int **map);
void set_init_position(int startpoint);
bool check(int **map);
void check_line(int **map, int line);
struct Point
{
int x, y;
} a[4], b[4];
bool gameover = 0;
int figure[19][4] ... | ALGO | 0.99909 | 3.614344 | {
"github_metadata": {
"branch": "master",
"commit_count": 10,
"repo_created_at": "2019-10-08T18:28:14.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "179805402... |
0d17196c-7d95-4361-8dbd-0cbf3a9e783b | lkic1625/PS | BOJ/1967/1967.cpp | #include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
const int MAX_N = 10000 + 1;
int n, u, v, w, visited[MAX_N], dist[MAX_N];
vector<pair<int, int>> adj[MAX_N];
void dfs(int u, int length, int dist[])
{
//visit u
visited[u] = 1;
for (auto iter : adj[u]) {
int v = iter.first, weight = it... | ALGO | 0.99989 | 4.04799 | {
"github_metadata": {
"branch": "master",
"commit_count": 7,
"repo_created_at": "2020-10-17T17:35:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "bee6cfb111... |
37083cd1-11c9-44a8-a7db-ad1b372aaf8b | JimmyCarter5417/leetcode | cpp/0304. Range Sum Query 2D - Immutable.cpp | // Given a 2D matrix matrix, find the sum of the elements inside the rectangle defined by its upper left corner (row1, col1) and lower right corner (row2, col2).
// Range Sum Query 2D
// The above rectangle (with the red border) is defined by (row1, col1) = (2, 1) and (row2, col2) = (4, 3), which contains sum = 8.
//... | ALGO | 0.999926 | 6.559572 | {
"github_metadata": {
"branch": "master",
"commit_count": 617,
"repo_created_at": "2017-10-04T16:00:13.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ed013738... |
3b7dd5c4-ac90-460f-bc77-17a97b6e9c11 | prathamesh-1128/Work | Program_67/Main.cpp | /*
Accept N numbers from user and return the difference between largest
and smallest number.
Input : N : 6
Elements : 85 66 3 66 93 88
Output : 90 (93 -3)
*/
using namespace std;
#include<iostream>
class Difference
{
public:
int Diff(int array[], int iNo)
{
int iMax=array[0];
int iMin=array[iNo-1];
... | ALGO | 0.999569 | 3.800589 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2020-09-25T07:55:45.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "fb07f237a4... |
441fa5cb-8d0a-4b3c-a78f-1d36ca3a9b77 | MohammadMahdi-Abdolhosseini/Advanced-Programming-Course | Assignments/A3-1/codes/C1.cpp | #include<iostream>
#include<vector>
#include<string>
#include <fstream>
#include<sstream>
using namespace std;
vector<int>open_times;
vector<int>close_times;
struct locations {
int number;
string name;
int opening_time;
int closing_time;
int rank;
};
string getfirstline(string file_name) {
ifstream file(fi... | ALGO | 0.995221 | 3.818492 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2023-10-22T05:47:10.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "13c70a731b41... |
4e1dcd74-72db-4c23-896b-193c6a318ba0 | koro1106/GomokuNarabe.2025.personal | Source/AI.cpp | #include "AI.h"
#include "Player.h"
#include "Stage.h"
#include <iostream>
int AImap[AI_HEIGHT][AI_WIDTH];
AI::AI()
{
AIWin = false;
}
AI::~AI()
{
}
void AI::Update()
{
Stage* st = FindGameObject<Stage>();
Player* pl = FindGameObject<Player>();
if (st->isGameOver) return;
if (AITurn){
ResetAIScores();//初期化... | ALGO | 0.998332 | 3.419859 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2025-06-10T01:28:57.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a3eac2029b2f... |
61b827cf-241e-4aeb-8420-900595f55ee8 | InsightSoftwareConsortium/ITKMinimalPathExtraction | src/itkIterateNeighborhoodOptimizer.cxx | /*=========================================================================
*
* Copyright NumFOCUS
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.o... | ALGO | 0.999521 | 7.194418 | {
"github_metadata": {
"branch": "main",
"commit_count": 219,
"repo_created_at": "2014-12-04T09:22:50.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 33,
"forks": 23,
"issues": 5,
"pull_requests": 1
},
"file_meta": {
"content_id": "71deed675... |
c3261aba-488c-4a0d-b546-7d3b54345a3c | bioc/flowType | src/flowType.cpp | #include <vector>
#include <math.h>
#include "countsAndMeans.h"
#include "flowType.h"
#include <iostream>
#include <R_ext/Print.h>
using namespace Rcpp ;
/*****************************************************************************
* Knuth's ancient algorithm for calculating combinations
***********************... | DATA | 0.942941 | 6.682223 | {
"github_metadata": {
"branch": "devel",
"commit_count": 75,
"repo_created_at": "2023-07-12T09:16:40.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d28c8b8c103... |
b4c11aaf-a9b0-4ac7-a723-f7462d093ae0 | ns-vasilev/challenges | LeetCode/443. String Compression/solution.cpp | /*
443. String Compression
Given an array of characters chars, compress it using the following algorithm:
Begin with an empty string s. For each group of consecutive repeating characters in chars:
If the group's length is 1, append the character to s.
Otherwise, append the character followed by the group's length.
... | ALGO | 0.999987 | 6.111294 | {
"github_metadata": {
"branch": "master",
"commit_count": 865,
"repo_created_at": "2018-07-30T11:30:38.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2738d645... |
0ab74d36-73a3-446c-85f9-59d8289fd244 | ishandutta2007/codeforces-m | mnaeraxr/normal/1195/F.cpp | #include <bits/stdc++.h>
using namespace std;
#define endl '\n'
typedef long long int64;
typedef pair<int64,int64> pii;
typedef vector<int> vi;
const double eps = 1e-9;
const int oo = 0x3f3f3f3f;
const int mod = 1000000007;
const int maxn = 100100;
int64 bit[maxn];
void update(int ix, int64 v){
while (ix < ma... | ALGO | 0.999959 | 4.448044 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-06-06T01:03:30.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "afd4d5d6ee49... |
1acbe963-f8ce-4ba2-af40-0ce3fd764bd5 | ishandutta2007/codeforces-a | aid/normal/1028/A.cpp | #ifdef DEBUG
#define _GLIBCXX_DEBUG
#endif
#include <bits/stdc++.h>
using namespace std;
typedef long double ld;
#ifdef DEBUG
#define eprintf(...) fprintf(stderr, __VA_ARGS__), fflush(stderr)
#else
#define eprintf(...) ;
#endif
#define sz(x) ((int) (x).size())
#define TASK "text"
const int inf = (int) 1.01e9;
con... | ALGO | 0.999722 | 3.74104 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2024-04-11T00:51:41.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4c18c75f532b... |
503f0992-ca70-49d2-a6f9-492fa2604cf9 | iYaphetS/CPP | 算法/集合/集合算法.cpp | #include <iostream>
using namespace std;
#include <vector>
#include <functional>
#include <algorithm>
#include <numeric>
//set_intersection(iterator beg1, iterator end1, iterator beg2, iterator end2, iterator dest)
//set_union(iterator beg1, iterator end1, iterator beg2, iterator end2, iterator dest)
//set_difference(... | ALGO | 0.973309 | 4.827342 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2017-08-17T08:56:05.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3eb1eec5f0... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.