uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
6c5bae5a-5c19-4eaa-b095-6414b411d7e0 | guimello/OldSchoolBreakout | libs/Box2D/Dynamics/Contacts/b2Contact.cpp | #include <Box2D/Dynamics/Contacts/b2Contact.h>
#include <Box2D/Dynamics/Contacts/b2CircleContact.h>
#include <Box2D/Dynamics/Contacts/b2PolygonAndCircleContact.h>
#include <Box2D/Dynamics/Contacts/b2PolygonContact.h>
#include <Box2D/Dynamics/Contacts/b2ContactSolver.h>
#include <Box2D/Collision/b2Collision.h>
#include... | ALGO | 0.995322 | 7.727654 |
8dc0ce19-2a3c-490d-a2f7-eeb64a24bc41 | satsukisahi/AtCoder | 03re-examine/arc085-e.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
ll ans = 0;
const ll INF = 1LL << 60; //MAX 9223372036854775807
template <typename flow_t>
struct FordFulkerson
{
struct edge
{
ll to;
flow_t cap;
ll rev;
bool isrev;
};
vecto... | ALGO | 0.999949 | 3.866577 |
feec0230-628e-4945-b1c3-397cb2acea31 | RenovationIGuess/Algorithm | Practical/Week10/10.3.cpp | #include<stdio.h>
int checkarray(int arr1[], int arr2[], int n) {
for (int i = 0; i < n; i++) {
if (arr1[i] == arr2[i]) return 1;
}
return 0;
}
int main() {
int n, arr1[n], arr2[n]; //n presents size of array
scanf("%d", &n);
for (int i = 0; i < n; i++) {
scanf("%d", &arr1[i]);
}
for (int j = 0; j < n; j++)... | ALGO | 0.999972 | 3.321067 |
59948266-7647-4199-87a8-24ea97d2b7fa | junaidrahim/Hacktoberfest-KIIT-2021 | ROHIT KUMAR SINGH (Hacktober Contribution)/CODEFORCES Questions Solutions (CP)/HittheLottery.cpp | //CODEFORCES: Challenge 6
#include<iostream>
using namespace std;
int main()
{
int n,count=0;
cin>>n;
while(n!=0)
{
if(n>=100)
{
n-=100;
count++;
}
else if(n>=20 && n<100)
{
n-=20;
count++;
}
else if(... | ALGO | 0.999718 | 3.665792 |
248ae2cb-45e3-40d1-9594-6a06bd99d9ff | Oriburger/problem_solving_1w3solve | Programmers/GetMidChar.cpp | #include <string>
#include <vector>
using namespace std;
inline string ctostr(char &c)
{
string str;
str.push_back(c);
return str;
}
string solution(string s)
{
string ret;
if(s.size()%2) ret = s[s.size()/2];
else ret = ctostr(s[s.size()/2-1]) + ctostr(s[s.size()/2]);
return ret;... | ALGO | 0.99994 | 5.62544 |
61c71aa9-d69e-42c3-8b45-af418262b919 | 05ankit/crackyourplacement | DAY3/4Sum.cpp | class Solution {
public:
vector<vector<int>> fourSum(vector<int>& nums, int target) {
vector<vector<int>> ans;
sort(nums.begin(),nums.end());
set<vector<int>> st;
for(int i=0;i<nums.size()-1;i++)
{
for(int j=i+1;j<nums.size()-1;j++)
{
i... | ALGO | 0.999985 | 6.042066 |
9df00075-a147-45a5-a214-ec2604461fa0 | Sachindebug/LeetCode-Problems | 2265-partition-array-according-to-given-pivot/2265-partition-array-according-to-given-pivot.cpp | class Solution {
public:
vector<int> pivotArray(vector<int>& nums, int pivot) {
vector<int> res;
for(auto x:nums)
{
if(x<pivot)
res.push_back(x);
}
for(auto x:nums)
{
if(x==pivot)
res.push_back(x);
}
for(... | ALGO | 0.999955 | 6.074008 |
20d35d8b-2eec-4a15-ada1-216a8148be3a | 1Alisha/HACKTOBERFEST-22 | DSA algoriths/SelectionSort.cpp | #include <bits/stdc++.h>
using namespace std;
// Unstable
// O(n2)
void selectionSort(int arr[], int n)
{
for (int i = 0; i < n; i++)
{
int min_idx = i;
for (int j = i + 1; j < n; j++)
{
if (arr[min_idx] > arr[j])
{
min_idx = j;
}
... | ALGO | 0.99986 | 4.843782 |
10535405-ebef-4312-9eea-6ee29963a192 | PaukIsUha/optimizing_formating_code | predictions/submissions-aizu-cot-gpt35/Codenet/p00519/703659459/response_4.cpp | #include <iostream>
#include <vector>
#include <climits>
using namespace std;
vector<vector<int>> pass;
vector<int> c, r, d;
vector<bool> used;
void dfs(int v, int u, int f, int end, vector<bool>& visited) {
if (visited[u])
return;
visited[u] = true;
d[u] = min(d[u], d[v] + c[v]);
if (f >= en... | ALGO | 0.999788 | 4.331361 |
a8e2430b-d273-4da5-85fb-9066e50f3abd | ishandutta2007/codeforces | anadi/normal/673/E.cpp | #include <bits/stdc++.h>
using namespace std;
typedef double LD;
typedef long long int LL;
#define PII pair <int, int>
#define st first
#define nd second
#define mp make_pair
#define pb push_back
const LD eps = 1e-6;
const int mxn = 2e5 + 7;
const LD INF = 1e16 + 9;
const int MX = 1e9 + 9;
int n, k;
LD a[mxn];
LD ... | ALGO | 0.99991 | 3.494041 |
c09f234a-4d80-423d-a48f-517dcdb44713 | tangziyi001/LeetCode | GraphValidTree.cpp | // DFS Cycle Detection. Notice if the graph is a connected graph.
typedef vector<int> vi;
typedef vector<vi> vvi;
class Solution {
public:
vvi all;
vi mark;
int count = 0;
bool check(int now, int p){
mark[now] = 1;
count++;
int sz = all[now].size();
bool flag = true;
... | ALGO | 0.999937 | 5.978688 |
2b389c10-d77e-45d8-b3f5-ccb9ac7ba70e | romantudorofficial/Programming_Training | Source Files/Pbinfo/171.cpp | #include <iostream>
using namespace std;
unsigned short int getFirstDigit (unsigned int number);
int main ()
{
unsigned short int numberOfNumbers;
std::cin >> numberOfNumbers;
unsigned int number;
std::cin >> number;
unsigned short int smallestFirstDigit = getFirstDigit(number);
unsigned int biggestNumber = ... | ALGO | 0.99929 | 4.318315 |
a52e331d-62bf-4a6e-ad6b-42864e9afe8a | cesaro/dpu-cav18-exp | tools/maple/sctbench/pin/source/tools/SimpleExamples/topopcode.cpp | /* ===================================================================== */
/*
@ORIGINAL_AUTHOR: Robert Muth and Artur Klauser
*/
/* ===================================================================== */
/*! @file
* This file contains a real time opcode mix profiler
*/
#include "pin.H"
#include "portability.... | TOOL | 0.976003 | 6.915593 |
7d798552-b79f-480c-af3a-b66ff4bbc889 | Shahriar-Seam/Programming | CPP/Assiut ICPC/Contest 2/F.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
long long t, n, max = 0, c, i;
cin >> t;
while (t--) {
cin >> n;
c = 0;
while (n % 2 != 1) {
c++;
n /= 2;
}
if (c > max) {
max = c;
}
}
cout << max;
... | ALGO | 0.999317 | 5.061711 |
fae8cdc7-b87b-4633-abd9-088e3e47f386 | pratik9765/Complete-DSA-Practice | Stack/twoStackInOneArray.cpp | #include <iostream>
using namespace std;
class Stack{
public:
int *arr;
int size;
int top1;
int top2;
Stack(int size){
arr = new int[size];
this->size = size;
top1 = -1;
top2 = size;
}
// function
void push1(int data){
if(top2 - top1 == 1){
... | ALGO | 0.998973 | 4.298757 |
b0bd53e4-ebc2-442a-a2e6-7a7f11ba94e3 | kmung/csc351-os-ext2 | fs/bitmap.cpp | #include "bitmap.h"
#include "superblock.h"
#include <cstring>
#include <string>
using namespace std;
Bitmap::Bitmap() {
size = 0;
}
//******************************************************************************
Bitmap::Bitmap(int bitmapSize) {
size = bitmapSize;
// Calculate the number of bytes need... | TOOL | 0.889476 | 5.766202 |
09914d5f-fba8-46e7-bc49-a4310a8513e1 | JuliaTeles/ATPI | Lista Matrizes/Ex2 - Campo Minado.cpp | #include <iostream>
#include <cstdio>
#include <locale>
using namespace std;
int main(){
setlocale(LC_ALL, "Portuguese");
printf("--- CAMPO MINADO ---\n");
int n,bomb;
printf("\n1) Informe o tamanho do campo: ");
scanf("%d", &n);
printf("2) Informe o nmero de bombas: ");
scanf("%d", &bom... | ALGO | 0.984409 | 3.627956 |
b6c8dc9c-4160-4fa2-a4e2-1164864de799 | Alexjuniorislareyes/PROGRAMACION-BASICA | ejercicio41 .cpp | #include <iostream>
#include <vector>
#include <string>
using namespace std;
int main() {
vector<string> palabras;
cout << "Ingrese palabras (ingrese 'fin' para finalizar): ";
string palabra;
while (cin >> palabra && palabra != "fin") {
palabras.push_back(palabra);
}
string resultado... | ALGO | 0.984612 | 4.919098 |
c4c7d33b-2f75-4dab-8e2b-5ecc905380e7 | Distrotech/frei0r | src/filter/facedetect/facedetect.cpp | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <float.h>
#include <limits.h>
#include <time.h>
#include <ctype.h>
#include <opencv/cv.h>
#include "frei0r.hpp"
#include "frei0r_math.h"
#define USE_ROI
#define PAD (40)
#define FACEBL0R_PARAM_CLASSIFIER (0)
class FaceDetect;
frei0... | TOOL | 0.868093 | 5.983475 |
e9c96846-f9ee-4a13-9dc6-9b8856adb786 | maspypy/library | test/2_library_checker/polynomial/log_of_fps.test.cpp | #define PROBLEM "https://judge.yosupo.jp/problem/log_of_formal_power_series"
#include "my_template.hpp"
#include "other/io.hpp"
#include "mod/modint.hpp"
#include "poly/fps_log.hpp"
using mint = modint998;
void solve() {
LL(N);
VEC(mint, f, N);
auto ANS = fps_log(f);
print(ANS);
}
signed main() {
solve();... | ALGO | 0.992759 | 3.965577 |
fe7f7117-a349-4c71-bbaa-9ef62334e566 | 113bommy/deepmind_codecontests_refine | cpp_gold_filter_file/cpp_train_10243_8.cpp | #include <bits/stdc++.h>
using namespace std;
long long getOnes(const string& s) {
long long res = 0;
for (long long i = 0; i < s.size(); ++i) {
if (s[i] == '1') {
++res;
}
}
return res;
}
void solve() {
string s1;
string s2;
cin >> s1;
cin >> s2;
long long ones1 = getOnes(s1);
long lo... | ALGO | 0.999984 | 4.636271 |
9c136692-0e26-4aca-a6bc-a4b903693f67 | Denver17/Algorithms_Exercise | PAT/乙级/1078_字符串压缩与解压.cpp | #include<iostream>
#include<cstdio>
#include<vector>
#include<algorithm>
#include<string>
#include<stdlib.h>
using namespace std;
void encode(string str){
if(str.size() == 0) return ;
string asw;
int left = 0, right = 0;
while(left < str.size()){
while(right < str.size() && str[right] == str[le... | ALGO | 0.998422 | 3.447678 |
fac9dceb-5803-483a-9990-afe45577bf2a | MuveloperDev/CMD_IncounterTable | boost_1_83_0/libs/parameter/test/literate/default-expression-evaluation0.cpp |
#include <boost/parameter.hpp>
#include <iostream>
BOOST_PARAMETER_NAME(graph)
BOOST_PARAMETER_NAME(visitor)
BOOST_PARAMETER_NAME(root_vertex)
BOOST_PARAMETER_NAME(index_map)
BOOST_PARAMETER_NAME(color_map)
#include <boost/graph/depth_first_search.hpp> // for dfs_visitor
BOOST_PARAMETER_FUNCTION((bool), depth_first... | ALGO | 0.940548 | 3.99652 |
830e327b-d127-44b6-9103-6bfc19dd2af0 | nassipkali/contestsite | backend2/codes/zumahmetovajdyn@gmail.com/1/2/main.cpp | #include<fstream>
using namespace std;
int main()
{
int w,h,n,x1,x2,y1,y2,s=0;
ifstream f;
f.open("INPUT.txt");
ofstream f1;
f1.open("OUTPUT.txt");
f>>w>>h>>n;
int a[w][h];
for(int i=0;i<w;i++)
for(int j=0;j<h;j++)
a[i][j]=0;
for(int i=0;i<n;i++)
{
f>>x1>>y1>>x2>>y2;
for(int j=0;j<w;j++)
{
for(int ... | ALGO | 0.998633 | 3.896822 |
0cbf98c8-b525-4573-b336-3c0243dc5872 | sameer91/LeetcodeSolutions | archive/leetcode/old/70_climbingStairs.cpp | #include<bits/stdc++.h>
using namespace std;
int climbStairs(int n){
int dp[n+1];
for(int i=0;i<n;++i)
dp[i]=0;
//base cond.
dp[0]=0;
dp[1]=1;
dp[2]=2;
for(int i=3;i<n+1;++i){
dp[i]=dp[i-1]+dp[i-2];
}
return dp[n];
}
int main(){
int n;
cin>>n;
int res=climbStairs(n);
cout<<res<<endl;
return 0;
}
| ALGO | 0.999955 | 4.530365 |
06925df5-9128-4499-b78f-01ade20e2fee | wkasprzak/HC-TSP-ParallelProgramming | multiStartGreedy.cpp | #include "multiStartGreedy.h"
#include "utility.h"
#include <cfloat>
#include <vector>
#include <omp.h>
std::pair<double, std::vector<int>> multiStartGreedyTSP(std::vector<City>& cities, double batteryCapacity, int ecoWasteFactor, int attempts) {
double bestCost = DBL_MAX;
std::vector<int> bestPath;
#pra... | ALGO | 0.999925 | 4.684814 |
fd2b02e9-bf9a-4a63-8398-6439c1b43ae2 | sreiswig/CodingCompetitions | Google Code Jam 2022/Round 1A/Weightlifting - P3.cpp | #include <iostream>
#include <vector>
#include <stack>
int main() {
int testCases;
std::cin >> testCases;
for (int i = 0; i < testCases; i++) {
int E;
int W;
int answer = 0;
std::stack<int> bar;
std::cin >> E >> W;
std::vector<std::vector<int>> weightsP... | ALGO | 0.999968 | 4.952679 |
008d3d18-c61c-410f-9bfa-f8a706a051da | georga399/BSUIRLabs | semestr1/OAiP/firstsemestr-OAiP-lab3/task2/main.cpp | #include <iostream>
#include <cmath>
// long double mypowl(long double val, int exp)
// {
// long double res = 1;
// int i=0;
// do
// {
// i++;
// res*=val;
// }
// while (i<exp);
// return res;
// }
int main()
{ long double res = 0;
int n=0;
//std::cin>>n;
... | ALGO | 0.999902 | 3.760969 |
b4fb300c-38d6-4636-956d-eff3a7a81e57 | GehenHe/Face-Verifiction-on-Camera | caffe-master/src/caffe/solvers/nesterov_solver.cpp | #include <vector>
#include "caffe/sgd_solvers.hpp"
namespace caffe {
#ifndef CPU_ONLY
template <typename Dtype>
void nesterov_update_gpu(int N, Dtype* g, Dtype* h, Dtype momentum,
Dtype local_rate);
#endif
template <typename Dtype>
void NesterovSolver<Dtype>::ComputeUpdateValue(int param_id, Dtype rate) {
CHE... | ALGO | 0.993922 | 7.00231 |
be784158-a10f-446f-a988-95081278a3c1 | svancaj/MAPF-encodings | src/encodings/at_pebble_soc_all.cpp | #include "solver_common.hpp"
using namespace std;
/** Constructor of _MAPFSAT_AtPebbleSocAll.
*
* @param sol_name name of the encoding used in log. Defualt value is at_pebble_soc_all.
*/
_MAPFSAT_AtPebbleSocAll::_MAPFSAT_AtPebbleSocAll(string sol_name)
{
solver_name = sol_name;
cost_function = 2; // 1 = mks, 2 = so... | ALGO | 0.997751 | 3.353165 |
a5c01be2-6cfb-4686-9428-6decf863aae6 | ishandutta2007/codeforces | quang/normal/587/A.cpp | #include <bits/stdc++.h>
using namespace std;
const int N = 1000100;
int n;
int a[N];
int main() {
scanf("%d", &n);
for (int i = 1; i <= n; i++) {
int u;
scanf("%d", &u);
a[u]++;
}
int res = 0;
for (int i = 0; i < N - 1; i++) {
int x = a[i] / 2;
a[i + 1] += x;
res += a[i] % 2;
}
... | ALGO | 0.99992 | 3.69496 |
e19f3cbb-373a-4416-8b10-7913f1e6fafb | ludwhe/lcrypt | src/3rd_party/AES_candidates_1st_round_-_Gladman/aes_time.cpp |
#include <iostream>
#include <iomanip>
#include "../std_defs.h"
u4byte rand32(void);
const unsigned int loops = 100;
double cycles(void)
{ u4byte hi,lo;
__asm
{
_emit 0x0f
_emit 0xa2
_emit 0x0f
_emit 0x31
mov lo,eax
mov hi,edx
_... | ALGO | 0.997052 | 5.078693 |
4b5165b9-f884-4b37-946d-ce949c9cf04a | sirraghavgupta/cpp-data-structures-and-algorithms | problems/stringPalindrome.cpp | /*##############################################################################
AUTHOR : RAGHAV GUPTA
DATE : 7 june 2019
AIM : to check for string palindrome
STATUS : !!! success !!!
##############################################################################*/
#include <iostream>
using namespace std;
bool is... | ALGO | 0.999902 | 4.518363 |
506cfcef-083a-434b-aae1-a771440362f0 | efeslab/nvm-file-indexing | api/p-hot/boost_1_73_0/libs/graph/example/subgraph_properties.cpp | /*
Sample output:
After initializing properties for G1:
Global and local properties for vertex G0[C]...
G0[C]= A1
G1[A1]= A1
Global and local properties for vertex G0[E]...
G0[E]= B1
G1[B1]= B1
Global and local pr... | ALGO | 0.948585 | 5.147512 |
0095d89d-0b74-4c5a-b356-fbdc315d29fa | PrantaDas99/programming | codeforces/dipankar/c.cpp | #include <bits/stdc++.h>
using namespace std;
void printFrequency(string str)
{
unordered_map<char, int> M;
for (int i = 0; str[i]; i++)
{
if (M.find(str[i]) == M.end())
{
M.insert(make_pair(str[i], 1));
}
else
{
M[str[i]]++;
}
... | ALGO | 0.999293 | 4.67557 |
45c21a6d-813a-4181-ab74-643e17844066 | CharlieYJH/libcumat | example/example04_matrix_expressions.cpp | // ==================================================================================
// Libcumat Example
// ==================================================================================
// This example is a part of the following demonstrations:
//
// 01. Instantiation
// 02. Printing
// 03. Accessing/assigning ma... | TOOL | 0.941289 | 5.003587 |
72b4bca8-10eb-42b1-a5a3-1b12c2c247c1 | BaoTrung37/PTIT_Sources | SPOJ/BCNEPER.cpp | /*
https://www.spoj.com/PTIT/problems/BCNEPER/
*/
#include<bits/stdc++.h>
using namespace std;
const int mod = 1e9+7;
main(){
int t;
cin>>t;
while(t--){
int stt;
cin>>stt;
string s;
cin>>s;
long long n=s.size();
bool kt=false;
long long i=n-2;
while(i>=0 && s[i]>=s[i+1]){
i--;
}
if(i>=0){
l... | ALGO | 0.999725 | 4.392073 |
66b6cdac-a21f-4592-b6c2-5cf61fd2292a | aman-kumar162/local_random_repository | flood_fill.cpp | #include<bits/stdc++.h>
using namespace std;
class solution{
private:
void dfs(int sr,int sc,vector<vector<int>>&ans,vector<vector<int>>&image,int newcolor,int delrow[],int delcol[],int incolor)
{
ans[sr][sc]=newcolor;
int n = image.size();
int m = image[0].size();
for(int i = 0;i<4;i++)... | ALGO | 0.997835 | 5.128981 |
0bdfe2c0-2b71-4732-a8e9-8953349ac45d | plenilune3/problem_solving_cpp | beakjoon/BaaaaaaaarkingDog/0x01/1267_핸드폰 요금.cpp | #include <cstdio>
using namespace std;
int main(int argc, char const *argv[])
{
int Y = 0, M = 0, temp;
int N;
scanf("%d", &N);
for (int i = 0; i < N; i++)
{
scanf("%d", &temp);
Y += ((temp / 30) + 1) * 10;
M += ((temp / 60) + 1) * 15;
}
if (Y == M) printf("Y... | ALGO | 0.99746 | 3.572309 |
bc489fa3-2a94-4db9-908e-e50b2dbdfce5 | ishandutta2007/codeforces | chenjb/normal/911/C.cpp | #include <cstdio>
#include <cstring>
#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
#include <map>
#include <set>
#include <utility>
#include <bitset>
using namespace std;
#define mp(x,y) make_pair(x,y)
#define pb(x) push_back(x)
int n;
int a,b,c;
int main()
{
cin>>a>>b>>c;
for(int ... | ALGO | 0.999969 | 3.696065 |
185f3aa9-43a6-4f67-a5d0-3a502a430062 | Zu-rin/AtCoder | Dwango_5_qual/Dwango5qualB.cpp | #include <iostream>
#include <vector>
#include <string>
#include <list>
#include <queue>
#include <algorithm>
#define rep(i, n) for(i = 0; i < (n); i++)
#define chmax(x, y) x = max(x, y)
#define chmin(x, y) x = min(x, y)
#define MOD 1000000007
#define PI 3.14159265358979323846
#define INF 1 << 30
using namespace std;
... | ALGO | 0.999882 | 3.691761 |
070a2826-c905-4d70-808a-b048a61cf839 | gyf1214/OI | VIJOS_P1034/src/main.cpp | /*
* main.cpp
*
* Created on: 2014-3-28
* Author: gyf
*/
#include <cstdlib>
#include <cstdio>
#include <cstring>
#include <string>
#include <iostream>
#include <algorithm>
#define rep(i, a, b) for (int i = (a); i <= (b); ++i)
#define clr(i, a) memset(i, (a), sizeof(i))
#define max(a, b) ((a)>(b)?(a):(b))
#de... | ALGO | 0.999969 | 4.034787 |
31062aca-a902-4f20-9719-02e58e76f940 | ValeriiKoniushenko/VaKon2D | dependencies/boost_1_80_0/libs/graph/example/interior_property_map.cpp | #include <boost/config.hpp>
#include <iostream>
#include <algorithm>
#include <boost/graph/adjacency_list.hpp>
#include <boost/property_map/property_map.hpp>
#include <string>
using namespace std;
using namespace boost;
/*
Interior Property Map Basics
An interior property map is a way of associating properties
... | ALGO | 0.999589 | 4.969568 |
d188884e-8759-49fd-aa1d-267fa5436055 | elmucho05/compilers-frontend | finalProject/myCompiler/test_progetto/callfibo.cpp | #include <iostream>
extern "C" {
double fibo(double);
}
int main() {
double n;
std::cout << "Inserisci il valore di n: ";
std::cin >> n;
std::cout << "fibonacci(" << n << ") = " << fibo(n) << std::endl;
}
| ALGO | 0.990842 | 5.595519 |
22d55354-cdf3-4c95-94a4-2634a8355519 | ishandutta2007/codeforces | davoth/normal/911/D.cpp | #include <bits/stdc++.h>
//#pragma GCC optimize("Ofast")
/*#pragma comment(linker, "/stack:200000000")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")*/
//#pragma GCC optimize("O2")
/*#pragma GCC optimize("unroll-loops")
#pragma GCC target("avx,avx2,sse,sse2,fma")*/
using namespace std;
us... | ALGO | 0.999926 | 4.131465 |
128b1517-250f-4868-be41-d22e24ab53fc | RoshanSharma20/leetcode_answers | 0225-implement-stack-using-queues/0225-implement-stack-using-queues.cpp | class MyStack {
public:
queue<int> q1,q2;
MyStack()
{
}
void push(int x)
{
q1.push(x);
}
int pop()
{
if(!q2.empty())
{
int x = q2.front();
q2.pop();
return x;
}
else
{
... | ALGO | 0.99924 | 5.548616 |
5fce7a3a-13dd-43d5-9f13-3a01f64f1dfa | AnkitB018/My_Cpp-codes | heap/heap_using_array.cpp | #include<iostream>
#include<vector>
using namespace std;
class max_heap{
vector<int>heap;
public:
max_heap(){
heap.push_back(-1); // 0th index not used for ease in calculation so inserted -1
}
void insert(int key){ //insert one at a time
heap.push_back(key);
... | ALGO | 0.999852 | 4.170515 |
36921552-b987-4761-884a-ea7cbbd556e3 | kunaldeora09/4-apr-SE | Assignments_4-apr-SE/Module 4 [C++ Programming & OOPS]/Q16_concatenate.cpp | // 16.Write a program of to concatenate the two strings using Operator Overloading.
#include<iostream>
using namespace std;
string sum(string a, string b)
{
return a+b;
}
main()
{
cout<<"Concatenate the string:- "<<sum("Kunal","Deora");
}
| ALGO | 0.930148 | 4.341379 |
141a9735-d42e-4f93-90e7-14663780ec95 | Ashupaldeora/video_player_example | 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 |
96f66204-851f-4baf-a36a-6a8759f4f657 | bfeng/CryptoGRU | third_party/cryptoTools/thirdparty/linux/boost/libs/math/example/policy_ref_snip11.cpp | // Note that this file contains quickbook mark-up as well as code
// and comments, don't change any of the special comment mark-ups!
#include <iostream>
using std::cout; using std::endl;
// Setting (approximate) precision 25 bits in a single function call using make_policy.
//[policy_ref_snip11
#include <boost/math... | ALGO | 0.983417 | 4.549112 |
c64577ab-a2b6-4b67-971f-66d291ffade8 | Rage-Fox/LeetCode | 0025-reverse-nodes-in-k-group/0025-reverse-nodes-in-k-group.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:
int count(ListNode* h... | ALGO | 0.999988 | 5.844733 |
12b50ece-7a5f-4d46-99a7-029e7b931de1 | zgeybi/Data-Structures-and-algorithms2 | SparseTable.cpp | //
// Created by Tim on 12/12/2023.
//
#include <algorithm>
#include <iostream>
#include <limits>
#include <vector>
unsigned int LogBaseTwo(unsigned int value) {
if (value == 0) {
return -1;
}
unsigned int result = 0;
while (value >>= 1) {
++result;
}
return result;
}
template <typename T>
class Sp... | ALGO | 0.999994 | 6.322859 |
c5d4780f-3671-486a-8607-d3123e08e8ad | ishandutta2007/codeforces | dorijanlendvaj/normal/1313/D.cpp | //DUEL
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#define x first
#define y second
#define pii pair<int,int>
#define pb push_back
#define eb emplace_back
#pragma GCC optimize("unroll-loops")
#define shandom_ruffle(a, b) shuffle(a, b, rng)
#define vi vector<int>
#define vl vector<ll>
#define popcn... | ALGO | 0.999949 | 4.032645 |
622e4097-c063-4176-a1be-2c83ecd12553 | Hima0X2/codeforces | 1689A.cpp | /// BISMILLAHIR RAHMANIR RAHIM
#include<bits/stdc++.h>
using namespace std;
#define endl '\n'
#define optimize() ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define fraction() cout.unsetf(ios::floatfield); cout.precision(10); cout.setf(ios::fixed,ios::floatfield);
long long int lcm(long long int a,long long b)... | ALGO | 0.999953 | 4.430069 |
1d3b50cb-5200-4763-9a7a-31faee6171c3 | bambrow/courseworks | c++-object-oriented-programming/lab/lab0_Basic_C++_Program_Structure_and_Data_Movement/Lab0.cpp | /***********************************************************
Lab0: Basic C++ Program Structure and Data Movement
Author: Weiqiang Li
***********************************************************/
#include "stdafx.h"
#include "Lab0.h"
#include <vector>
#include <string>
#include <fstream>
#include <iostream>
#include <... | TOOL | 0.90141 | 4.207006 |
1b246b57-f002-47c3-b821-f05173b19b05 | yogendrarp/leetcode | algorithms/450/recursion/printuniqsubsets.cpp | #include <bits/stdc++.h>
using namespace std;
set<string> uniqueentries;
void solve(string ip, string op)
{
if (ip.length() == 0)
{
uniqueentries.insert(op);
return;
}
string op1 = op;
string op2 = op;
op2.push_back(ip[0]);
ip.erase(ip.begin() + 0);
solve(ip, op1);
... | ALGO | 0.999696 | 3.808254 |
0a38d09e-a30b-4c9c-92a6-ac13f52ceabb | d8lu/DMOJ | PizzaBag.cpp | #include "bits/stdc++.h"
#define int long long
using namespace std;
const int MM = 2e5+5;
int arr[MM], ans = -1e9;
void solve(){
deque<pair<int, int>>dq;//pair<value, pos>
int n, k;
cin >> n >> k;
for(int i = 1; i <= n; i ++)
cin >> arr[i], arr[i+n] = arr[i];
for(int i = 1; i <= 2*n; i ++)
... | ALGO | 0.999976 | 3.897668 |
404e6f81-8c21-4a45-a3d5-5b67321992ef | HashGate/HashCash | src/P2p/PeerListManager.cpp | #include "PeerListManager.h"
#include <time.h>
#include <boost/foreach.hpp>
#include <System/Ipv4Address.h>
#include "Serialization/SerializationOverloads.h"
using namespace CryptoNote;
namespace CryptoNote {
template <typename T, typename Indexes>
bool serialize(boost::multi_index_container<T, Indexes>& value,... | TOOL | 0.89062 | 6.531437 |
8a4297db-a52b-40cc-b8f5-82fd52508126 | loveneeshdhir/ACM-ICPC-Algorithms | Data Structures/Heap/Building_heap_from_arrays.cpp | //Code By CodeLogist
//Problem Also Present in Stanford University's Data Structure Course on Coursera.
#include <iostream>
#include <vector>
#include <algorithm>
using std::vector;
using std::cin;
using std::cout;
using std::swap;
using std::pair;
using std::make_pair;
class HeapBuilder {
private:
vector<int> da... | ALGO | 0.999928 | 4.156973 |
4c0ebbc3-4191-41f2-8173-79ad78341685 | LowPolyCount/LowPolyCount-Raytracer | lib/boost_1_57_0/libs/xpressive/perf/time_static_xpressive.cpp | #include "./regex_comparison.hpp"
#include <map>
#include <cassert>
#include <boost/timer.hpp>
#include <boost/xpressive/xpressive.hpp>
namespace sxpr
{
using namespace boost::xpressive;
// short matches
char const * sz1 = "^([0-9]+)(\\-| |$)(.*)$";
sregex rx1 = bol >> (s1= +range('0','9')) >> (s2= as_xpr('-')|' '|e... | TEST | 0.91648 | 5.566709 |
b46fb0a7-cfc2-4576-af4c-24243cea0566 | LeEcoDevs/android_device_leeco_s2 | data-ipa-cfg-mgr/hal/src/PrefixParser.cpp | /* External Includes */
#include <arpa/inet.h>
#include <netinet/in.h>
#include <netinet/ip.h>
#include <string.h>
#include <sys/socket.h>
#include <sys/types.h>
#include <vector>
/* Internal Includes */
#include "IOffloadManager.h"
#include "PrefixParser.h"
/* Avoiding namespace pollution */
using IP_FAM = ::IOffloa... | TOOL | 0.855578 | 6.35847 |
da6316d0-a91a-48b2-abb7-8b81f3636670 | seraph27/competitve-programming | codeforces/2034/b.cpp | // Problem: B. Rakhsh's Revival
// Contest: Rayan Programming Contest 2024 - Selection (Codeforces Round 989, Div. 1 + Div. 2)
// URL: https://codeforces.com/contest/2034/problem/B
// Time Limit: 1000
// Start: 2024/11/30 6:38:55
// mintemplate
#include <bits/stdc++.h>
#define int long long
#define sz(x) (int)x.size()
... | ALGO | 0.999682 | 5.017612 |
fcd8fb2e-c816-416c-b179-dc661bacabda | Abhinav200207/CrackYourPlacement | Graphs/wordladder2.cpp | #include <bits/stdc++.h>
using namespace std;
class Solution {
public:
vector<vector<string>> findLadders(string beginWord, string endWord, vector<string>& wordList) {
unordered_set<string> st(wordList.begin(),wordList.end());
queue<vector<string>> q;
q.push({beginWord});
vector<s... | ALGO | 0.99999 | 5.696211 |
743140f6-047c-406c-88c3-9d4789f5827a | andreaswanninger/Kratos_conservative_levelset-contact_line | kratos/geometries/oriented_bounding_box.cpp | // System includes
// External includes
// Project includes
#include "geometries/oriented_bounding_box.h"
#include "utilities/math_utils.h"
#include "utilities/mortar_utilities.h"
#include "utilities/intersection_utilities.h"
namespace Kratos
{
template<std::size_t TDim>
OrientedBoundingBox<TDim>::OrientedBoundingBo... | ALGO | 0.995875 | 4.241966 |
443fe612-8ce4-41e7-8130-496967db6844 | liuxiaocs7/AlgorithmLearn | LeetCode_C++/1765.地图中的最高点.cpp | /*
* @lc app=leetcode.cn id=1765 lang=cpp
*
* [1765] 地图中的最高点
*/
// @lc code=start
typedef pair<int, int> PII;
int dx[4] = {0, 1, 0, -1}, dy[4] = {1, 0, -1, 0};
class Solution {
public:
vector<vector<int>> highestPeak(vector<vector<int>>& isWater) {
int m = isWater.size(), n = isWater[0].size();
... | ALGO | 0.999987 | 6.384161 |
d88b13a3-81e1-42e8-a437-f883ebbda98f | Brave123555/leetcod1 | solution/1000-1099/1058.Minimize Rounding Error to Meet Target/Solution.cpp | class Solution {
public:
string minimizeError(vector<string>& prices, int target) {
int mi = 0;
vector<double> arr;
for (auto& p : prices) {
double price = stod(p);
mi += (int) price;
double d = price - (int) price;
if (d > 0) {
... | ALGO | 0.999835 | 5.006067 |
a8226e34-b44c-42a6-a700-2fa3df3aed6d | yumueat/cpp | train/刷题统计.cpp | #include<iostream>
using namespace std;
int main(){
long long a,b,n,s=0;
cin>>a>>b>>n;
long long i;
for (i=1;s<n;i++)
{
if (i%7 == 6 || i%7 == 0)
{
s += b;
}
else
{
s += a;
}
}
cout<<i-1;
return 0;
}
| ALGO | 0.999835 | 3.109101 |
3ec4683e-bcfc-43e6-b6e2-2435b92e89dd | EDCBlockchain/blockchain | libraries/chain/db_maint.cpp | #include <chrono>
#include <functional>
#include <fc/uint128.hpp>
#include <graphene/protocol/market.hpp>
#include <graphene/chain/database.hpp>
#include <graphene/chain/fba_accumulator_id.hpp>
#include <graphene/chain/hardfork.hpp>
#include <graphene/chain/account_object.hpp>
#include <graphene/chain/asset_object.... | TOOL | 0.958997 | 6.395452 |
30255bc3-9eae-40d1-b9f1-c21390e64b4b | Tushar2009/DSA | Arrays/trapping rain water naive soution.cpp | #include<iostream>
#include<cmath>
using namespace std;
// logic=isma hm har ek element ka leftmax and rightmax find karka phir minus us particular block ki height
int getwater(int arr[],int n)
{
int res=0;
int lmax,rmax;
//we start the loop one after and one before the limit because the ending of blocks do not stor... | ALGO | 0.999971 | 5.684974 |
7e8c200f-1bc5-47a3-a2af-588df35dbe8a | Sangwanaryan/CPP-DSA | C++ and DSA by Babbar/16_macros_and_more.cpp | #include "bits/stdc++.h"
using namespace std;
int firstOccurecne(vector<int> &nums, int target)
{
int s = 0;
int e = nums.size();
int mid = s + (e - s) / 2;
int ans = -1;
while (s <= e)
{
if (nums[mid] == target)
{
e = mid - 1;
ans = mid;
retu... | ALGO | 0.999663 | 5.093698 |
1c299372-6334-4716-a547-d9ee418d4036 | ishandutta2007/codeforces | wlzhouzhuan/normal/1404/A.cpp | #pragma GCC optimize(2)
#pragma GCC optimize(3)
#include<bits/stdc++.h>
using namespace std;
#define rint register int
#define rep(i,l,r) for(rint i=l;i<=r;i++)
#define per(i,l,r) for(rint i=l;i>=r;i--)
#define ll long long
#define ull unsigned long long
#define pii pair<int,int>
#define pll pair<ll,ll>
#define pb push... | ALGO | 0.99999 | 3.479653 |
bc8abaaa-8f52-4813-98e2-4243709bc611 | Koyingtw/CP | ZJ/F630.cpp | #pragma region
#pragma GCC optimize("O3")
#include <bits/stdc++.h>
#define Weakoying ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
// #define int long long
#define pii pair<int, int>
#define vi vector<int>
#define vii vector<pair<int, int>>
#define pqueue priority_queue
#define pb push_back
#define F first
#define ... | ALGO | 0.999938 | 4.038294 |
c37cf284-50eb-4f87-821a-396366d7b97a | Avnish027/LeetCode | 0349-intersection-of-two-arrays/0349-intersection-of-two-arrays.cpp | class Solution {
public:
vector<int> intersection(vector<int>& nums1, vector<int>& nums2) {
// vector<int> a;
// for(int i=0; i<nums1.size(); i++){
// for(int j=0; j<nums2.size();j++){
// if(nums1[i]==nums2[j]){
// a.push_back(nums1[i]);
// ... | ALGO | 0.999984 | 5.066729 |
3c9dab87-c4a0-4dab-ab98-b857c17b5441 | kando42/GeekForGeeks_MySolutions | Stack_StockSpan.cpp | //https://practice.geeksforgeeks.org/problems/stock-span-problem-1587115621/1
class Solution
{
public:
vector <int> calculateSpan(int price[], int n)
{
vector<int> result;
stack<int> st;
int index;
for(int i =0; i < n; i++){ result.push_back(i+1); }
st.... | ALGO | 0.999784 | 5.827017 |
ee8e74f0-7ae4-481d-9ae9-d0c0978e04ba | meamitacharya/stunning-lab-assignments-Cpp | Chapter-1-Function-in-c-plus-plus/Lab-01-Inline-01.cpp | // Using inline function to calculate the square of a number.
#include<iostream>
//#include<conio.h>
using namespace std;
inline int square(int num){
return num * num;
}
int main()
{
int number;
cout << "Please, Enter a number to find its square: " ;
cin >> number;
cout << "Square of " << number
... | TOOL | 0.950602 | 4.056057 |
4052a4e2-7fad-4148-bf0f-bd01f3461aed | piy1577/DSA | 34 graphs/11_bipartite_graph.cpp | #include <bits/stdc++.h>
using namespace std;
#define rep(i, a, b) for(int i=a; i<b;i++)
#define ff first
#define ss second
#define v(a) vector<a>
#define p(a) pair<a, a>
#define vv(a) vector<v(a)>
#define vp(a) vector<p(a)>
v(bool) vis;
vv(int) adj;
v(int) col;
bool flag = true;
void bipartite(int i, int j){
if(c... | ALGO | 0.999973 | 4.979709 |
23f2587d-c419-4e8b-a19e-d979f1c11252 | yzIAI/xxxt-homeworks | hw5/q2.cpp | /*
* [q2.cpp]
* 信息学堂2021 课后作业 Day 5 Question 2
*
* 信息学堂第五次的作业会带大家熟悉递归和一些简单的STL的库
* 请根据注释里的相应提示,完成 *TODO* 部分的作业内容
*
* © Tina J, 2021
* 作者:Tina Ji
* 时间:04/07/2021
* 版本:1.0.0
*/
#include <iostream>
#include <assert.h>
#include <string> //注意我们使用了新的库哦
using namespace std;
// TODO
// Step1: 新两个string类型的变量s1, s... | TOOL | 0.991273 | 3.830865 |
1651cc42-c012-48b4-a3ff-a11e5a73c4c4 | jpjandrade/coding_exercises | tour_of_cpp/container.cpp | #include <iostream>
#include "Vector.cpp"
using namespace std;
class Container {
public:
virtual double& operator[](int) = 0;
virtual int size() const = 0;
virtual ~Container() {}
};
class Vector_container : public Container {
public:
Vector_container(int s) : v(s) {}
~Vector_container() {}
double& op... | ALGO | 0.905717 | 5.190152 |
39b99c1d-ce48-4453-8b57-75a1e5dfb9b3 | muhammadahmadazhar/my-whole-programing | c++ programs/structured c++/228 array 2D/max min 2d array/main.cpp | #include <iostream>
using namespace std;
int main()
{
int a[3][3],i,j,max,min;
cout<<"enter values in matrix\n";
for(i=0;i<3;i++)
{
for(j=0;j<3;j++)
{
cin>>a[i][j];
}
}
for(i=0;i<3;i++)
{
for(j=0;j<3;j++)
{
cout<<a[i][j]<<" ... | ALGO | 0.999508 | 3.130508 |
17ba3fab-6359-443e-a4e8-2edbe19fea5f | AbdelrahmanMohamedd/Simulation-Tasks | Task 2 PRNG Without using any builtin Functions/main.cpp | #include <iostream>
#include <string>
using namespace std;
int main()
{
cout <<"******************************************"<< endl;
cout<<"* Pseudo Random Number Generator Program *"<<endl;
cout <<"******************************************"<< endl<<endl;
cout<<"Enter the Seed: "<<endl; ///Max 9 Digi... | TOOL | 0.933142 | 3.912357 |
3cccb03f-3d48-42e4-9fd9-7e8b8a9e1c0a | MinQuan-kun/Training | LUYENCODE/CONTETST/LCOJ Beginner Contest #1/SUM7 - Lại là căn bậc 2 lồng nhau/SUM7.cpp | #include<bits/stdc++.h>
using namespace std;
float Can(float temp)
{
float s = sqrt(temp);
if(s == 1)
return 1;
return sqrt(s+sqrt(temp - 1));
}
int main()
{
int n;
cin >> n;
float temp;
while(n--)
{
cin >> temp;
cout << fixed << setprecision(5) << Can(temp) << en... | ALGO | 0.991802 | 3.810448 |
fed8d29f-e11b-4bb4-a2ad-b61172e72e92 | Kyan820815/leetcode | lc12xx/lc1292.cpp | //--- Q: 1292. Maximum Side Length of a Square with Sum Less than or Equal to Threshold
//--- method 1: prefix sum
class Solution {
public:
int maxSideLength(vector<vector<int>>& mat, int threshold) {
int row = mat.size(), col = mat[0].size(), max = 0;
int leftsum, topsum, lastsum;
vector<v... | ALGO | 0.999945 | 6.292868 |
369decb4-80fd-4091-ab42-ac3d2929d695 | VedantK798/Cpp-practice-programs | pas demo.cpp | #include <iostream>
#include <vector>
using namespace std;
class PascalTriangle {
private:
vector<vector<int>> triangle;
public:
PascalTriangle(int rows) {
triangle.resize(rows);
for (int i = 0; i < rows; i++) {
triangle[i].resize(i + 1);
triangle[i][0] = 1;
... | ALGO | 0.998812 | 7.075251 |
22554d5c-5945-4740-befc-0cc600ccc6ce | Agasthya-Samyak-Jnan/LeetCode-Problems | Hard/Stream of Characters.cpp | #include<bits/stdc++.h>
using namespace std;
// Link to the Problem : https://leetcode.com/problems/stream-of-characters/
// Difficulty : Hard
/* DATA STREAM KIND OF MEMORY AND TIME MANAGEMENT WITH TRIE USAGE */
class Trie {
private:
Trie* a[26] = {0};
bool is_Word = false;
public:
Trie () {}
... | ALGO | 0.99962 | 6.100467 |
58e76cb0-2a3f-4ca6-ad7b-3c20590c48c8 | thanhtri59/DangThanhTri_monC | Chapter 7/Program/vd19.cpp | #include <iostream>
using namespace std;
void doubleArray(int [], int);
void showValues(int [], int);
int main()
{
const int ARRAY_SIZE = 7;
int set[ARRAY_SIZE] = {1, 2, 3, 4, 5, 6, 7};
cout << "The array's values are:\n";
showValues(set, ARRAY_SIZE);
doubleArray(set, ARRAY_SIZE);
cout << "Af... | ALGO | 0.996725 | 5.726268 |
a78368f7-bdbd-45c7-a5dd-75da07d18057 | ViXbob/MyCode | YaLi201810/Day5/b/b.cpp | #include <bits/stdc++.h>
#define ls p << 1
#define rs p << 1 | 1
#define mid (l + r >> 1)
using namespace std;
typedef long long LL;
const int maxn = 2e5 + 5;
const int LOG = 85;
const int inf = 1e9 + 7;
int n, m, k, A, B, a[maxn], b[maxn], w[maxn], vis[maxn], pos[maxn];
int S0[maxn], S1[maxn], S2[maxn], S3[maxn];
... | ALGO | 0.999965 | 3.56388 |
1b7a54e1-48da-4f9d-bc3f-ded4d833c6d7 | SalmanMinhas15/ProgrammingFundamentals | week 10 pd/task8.cpp | #include <iostream>
using namespace std;
int rotations(string array[], int length);
main(){
int length;
cout<<"Enter the length of the array: ";
cin >> length;
cout<<"Enter the elements of the array (\"left\" or \"right\"):"<<endl;
string array[length];
for(int i=0;i<length;i++){
cin >> ... | ALGO | 0.999358 | 3.737216 |
20905695-c7a6-4e89-933e-369b66e4e5a3 | oasi-adamay/misc | std_thread/main.cpp | #include <iostream>
#include <thread>
#include <mutex>
#include <vector>
#if 0
int main(void) {
for (int i = 0; i < 10; i++) {
std::cout << i << std::endl;
}
return 0;
}
#endif
int main(void) {
std::mutex theMtx;
std::vector<std::thread> threads;
int num_thread = 4;
for (int i = 0; i < num_thread; i++) {
... | TOOL | 0.932991 | 4.275531 |
660c91bf-8078-43ef-a87a-45f95b5f3dd0 | UserBits/OI-Codes | Luogu/P1606[图论][最短路][spfa][搜索]白银莲花池Lilypad Pond.cpp | //Luogu P1606
#include <cstdio>
#include <cstring>
#include <cmath>
#include <cstdlib>
#include <stack>
#include <queue>
#include <algorithm>
using namespace std;
#define EOL putchar('\n')
#define SPACE putchar(32)
#define lowbit(x) (x&(-x))
const int INF=2147483647,INE=-2147483647;
char ss[1<<17],*A=ss,*B=ss;
inline ... | ALGO | 0.999895 | 3.120332 |
31ba789c-9b1f-4d76-b721-57ac138b7ad1 | sunxu123/JianZhiOffer | jianzhioffer_变态跳台阶/jianzhioffer变态跳台阶.cpp | // jianzhioffer变态跳台阶.cpp : Defines the entry point for the console application.
//一只青蛙一次可以跳上1级台阶,也可以跳上2级……它也可以跳上n级。求该青蛙跳上一个n级的台阶总共有多少种跳法。
/*
n=1; 1
n=2; 1+1=2
n=3; 1+2+1=4
n=4; 8
n=5; 16
//f(n)的前一状态可以是f(0)~f(n-1)任意状态
f(n)=f(n-1) + f(n-2) + f(n-3) + f(n-4) + f(2) +f(1) +1;(f(0)==1)
*/
#include "stdafx.h"
#include <... | ALGO | 0.999841 | 4.178925 |
e9565fef-a4bf-499d-9997-84ebd9c21d0f | Wolframe/SMERP | examples/pecho/configFile.cpp | //
// configFile.cpp
//
// #define HAS_XML_CONFIG_FILE
#include "configFile.hpp"
#include "serverEndpoint.hpp"
#include <boost/filesystem.hpp>
#include <boost/foreach.hpp>
#include <boost/lexical_cast.hpp>
#include <boost/logic/tribool.hpp>
#include <boost/algorithm/string.hpp>
#include <boost/property_tree/ptree.h... | TOOL | 0.98228 | 5.705904 |
808fa279-6231-40db-8374-761921815432 | LegendaryBeast/Tanzim-s-All-Code | 1929B - Sasha and the Drawing.cpp | #include<bits/stdc++.h>
using namespace std;
#define int long long
#define ll long long
#define endl '\n'
#define ff first
#define ss second
#define pb push_back
#define all(x) x.begin(), x.end()
#define sz(... | ALGO | 0.999767 | 4.468149 |
43d74c70-8dc5-4560-af98-6b71e206bfe4 | IagoFloriano/TrabalhoBD | GRR20190427_GRR20196049/util.cpp | /* arquivo com implmentação de funções para serem usadas por todos os outros arquivos
*/
#include "util.hpp"
// função interna para achar indice de um vertice no grafo
// retorna o indice se exite e -1 caso contrário
int findNode(graph_t &g, int id){
for(size_t i {0}; i < g.nodes.size(); i++){
if(g.nodes[i].id... | ALGO | 0.98868 | 4.857423 |
23fe47dc-4263-4ae6-a8a9-d0f080c3b827 | xvzc/algorithms | boj/solved/10798/20240223_184829_main.cpp | #include <bits/stdc++.h>
#ifdef LOCAL
#define IF_LOCAL if constexpr (true)
#else
#define IF_LOCAL if constexpr (false)
#endif
#define debug IF_LOCAL std::cout << "[DEBUG]" << ' '
#define endl '\n'
#define fi first
#define se second
#define all(x) (x).begin(), (x).end()
typedef long long ll;
typedef unsigned long lon... | ALGO | 0.999752 | 4.114002 |
befd49b8-933a-4efe-aa5e-1704958a4cf8 | Akrobatik/ps | BaekJoon/18000/18185.cpp | // Title : 라면 사기 (Small)
// Link : https://www.acmicpc.net/problem/18185
// Time : 0 ms
// Memory: 2180 KB
#include <bits/stdc++.h>
using namespace std;
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
int n, b = 3, c = 2;
cin >> n;
vector<int> arr(n + 2);
for (int i = 0; i < n; i++) cin >... | ALGO | 0.999974 | 4.498924 |
02b527a4-4644-4a27-bf85-556284701ce3 | KaranBararwal/PW | Lec46_CountSort.cpp | #include <iostream>
#include <vector>
#include <climits>
using namespace std;
int CountSort(vector<int> &v)
{
int n = v.size();
int m = INT_MIN;
for (int i = 0; i < n; i++)
{
m = max(m, v[i]);
}
cout << "maximum element is " << m << endl;
// making array of size (m+1)
int freq... | ALGO | 0.999995 | 5.358708 |
e6041d27-c21a-4a0a-8ff5-ea06b086c8e5 | mfargo/ofxFilterLibrary | src/filters/DilationFilter.cpp | //
// DilationFilter.cpp
// ofxFilterLibraryExample
//
// Created by Matthew Fargo on 2014/07/17.
//
//
#include "DilationFilter.h"
DilationFilter::DilationFilter(float width, float height, int dilationRadius) : Abstract3x3PingPongFilter(width, height, ofVec2f(dilationRadius, dilationRadius)) {
_name = "Dilati... | TOOL | 0.94054 | 6.443711 |
25d42fd5-a062-4133-904a-263350a19b1e | Acylation/Mastermind | MasterMind.cpp | #include <vector>
#include <iostream>
#include <fstream>
#include <cmath>
#include <random>
#include <ctime>
#include <windows.h>
using namespace std;
using namespace std;
void PrintVec(vector<int> vtemp, const char prefix = '\0', const char seperator = ',', const char suffix = '\0')
{
int n = vtemp.size();
co... | TOOL | 0.927057 | 4.146785 |
20ce3c03-1fb0-4091-9b73-14899ad588f0 | Micky1304/ffaas-knapsackproblem | knapsacksolver/subsetsumsolver/algorithms/algorithms.cpp | #include "subsetsumsolver/algorithms/algorithms.hpp"
#include <boost/program_options.hpp>
using namespace subsetsumsolver;
namespace po = boost::program_options;
Output subsetsumsolver::run(
std::string algorithm, Instance& instance, std::mt19937_64&, Info info)
{
std::vector<std::string> algorithm_args ... | ALGO | 0.998017 | 6.034868 |
4a777537-46c6-4c9f-8d1a-7c0e0adaff82 | anzal1/Data-Structures-and-Algorithms | C++/soln-sorting-algo/heap-sort.cpp | /**
@author anzal abidi
Date 19-07-2021
Reference-
https://practice.geeksforgeeks.org/problems/heap-sort/1
*/
// { Driver Code Starts
// C++ program for implementation of Heap Sort
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
// The functions should be written in a way that array becom... | ALGO | 0.999951 | 6.078359 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.