uuid
string
repo_name
string
relative_path
string
content
string
category
string
algo_rel_score
float64
quality_score
float64
e68f1a5f-5c9a-41f3-a681-e65ec6eb00fb
Project-Flare-Staging/frameworks_av
media/libeffects/lvm/lib/Common/src/LVC_Core_MixHard_2St_D16C31_SAT.cpp
/********************************************************************************** INCLUDE FILES ***********************************************************************************/ #include "LVC_Mixer_Private.h" #include "ScalarArithmetic.h" /***********************************************************************...
ALGO
0.988802
5.380741
6475963b-c152-4770-ae6f-f7ae6b030e6c
Madness-D/My_LeetCode
dp/509斐波那契数.cpp
/* ************************************************************************ > File Name: 509斐波那契数.cpp > Author: bwding > Mail: <EMAIL> > Created Time: 2022-06-30 20:18:42 > Link: https://leetcode.cn/problems/fibonacci-number/ > Description: ************************************************************************...
ALGO
0.999993
5.35863
34eb410b-0269-47bf-b0ec-05396e242062
carttman/Backjoon
Bronze/2566_최댓값.cpp
#include <iostream> #include <vector> using namespace std; int main() { vector<vector<int>> arr(9, vector<int>(9, 0)); int maxNum = 0; pair<int, int> maxidx; for (int i = 0; i < arr.size(); i++) { for (int j = 0; j < arr[i].size(); j++) { cin >> arr[i][j]; if (maxNum <= arr[i][j]) { maxNum = ar...
ALGO
0.999888
4.36687
b3f8f19c-7e4c-4d70-b9cd-e7f753d96490
OverPoweredZ/The-Blue-Bridge-Cup-s-Learning-Record
Practice/1371.cpp
#include<iostream> #include<cstring> #include<cstdio> #include<algorithm> using namespace std; typedef long long LL; const int N=10010,M=30; int n,m; LL f[M][N]; int v[M]; int main(){ scanf("%d%d",&n,&m); for(int i=1;i<=n;++i){ scanf("%d",&v[i]); } f[0][0]=1; for(int i=1;i<=n;++i){ for(int j=0;j<=...
ALGO
0.999987
3.591843
38d30711-132c-4e58-bb8c-d41c9d759e19
itsMuhammadtalha/OOP-in-C-
Assignments/2D ARRAY (2)/question 2 .cpp
#include<iostream> using namespace std; int rsum() { int a[5][5],d1sum=0,d2sum=0,m,i,j; cout<<"RIGHT DIAGONALS"<<endl; cout<<"Enter size of the square matrix(max 5):"; cin>>m; cout<<"\nEnter the Matrix elements :\n"; for(i=0;i<m;i++) for(j=0;j<m;++j) cin>>a[i][j]; for(i=0;i<m;i++) { for(j=0;j<m;++j) ...
ALGO
0.998066
3.114346
9f4757b2-ccb1-4f23-9fda-750bdd134cf8
AreebAhmadSiddiqui/DSA-Prep
Leetcode Daily/April/25)-Smallest-Number-In-An-Infinite-Set.cpp
// 2336. Smallest Number in Infinite Set // You have a set which contains all positive integers [1, 2, 3, 4, 5, ...]. // Implement the SmallestInfiniteSet class: // SmallestInfiniteSet() Initializes the SmallestInfiniteSet object to contain all positive integers. // int popSmallest() Removes and returns the smallest...
ALGO
0.998446
6.347089
aa4cd5f8-8d3c-4e9e-8464-e39195957546
davidgldv/C-Programs
06_alternativas/bit1bit2.cpp
#include<stdio.h> #include<stdlib.h> int main () { int bit1; int bit2; printf("Dame el primer bit:"); scanf(" %i", &bit1); printf("Dame el segundo bit:"); scanf(" %i", &bit2); if(bit1 == 1){ if(bit2 == 1) printf("el numero resultante es 3.\n"); else printf("el numero re...
ALGO
0.999801
3.601238
c18cbde4-7999-44b5-a310-ec37325f918c
motapinto/feup-CAL
Dynamic_Programming/algorithms/nCrDynamic.cpp
# define MAX 100 #include <iostream> using namespace std; long long row[MAX + 1]; // initialized with 0's by default if declared globally int nCrDynamic(int n, int r) { int i, j; // initialize by the first row row[0] = 1; // this is the value of C(0, 0) for(i = 1; i <= n; i++) { for(j = i; j...
ALGO
0.999945
5.062924
8826fe57-01ea-4176-a864-fc878dace6c5
KY2001/atcoder-all-my-submissions
abc023/abc023_c_1587273558.cpp
#include "bits/stdc++.h" #define int long long #define FOR(i, a, b) for (int i = (int)(a); i < (int)(b); i++) #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define ALL(obj) begin(obj), end(obj) #define MAX(x) *max_element(ALL(x)) #define MIN(x) *min_element(ALL(x)) #define sqr(x) (x) * (x) #define cube(x) (z) * ...
ALGO
0.999891
3.484307
bda6c36e-fcae-4554-86cd-6878b2d956bb
tausif39/Leetcode
706-design-hashmap/706-design-hashmap.cpp
class MyHashMap { public: vector<int> arr; MyHashMap() { arr.resize(1e6+1,-1); } void put(int key, int value) { arr[key]=value; } int get(int key) { if(arr[key] == -1) return -1; else return arr[key]; ...
ALGO
0.999114
5.935297
8b6fd500-52cf-444d-98c6-bfa81af7877d
SuperBigFive/Charming_XCPC
Codeforces/Div3/805div3/B.cpp
#include <bits/stdc++.h> #define ll long long #define ull unsigned ll #define ld long double using namespace std; const int maxn = 2e5 + 5; int t, n; char str[maxn]; void charming () { cin >> str + 1; int len = strlen (str + 1); ll ans = 0; char ch1, ch2, ch3; for (int i = 1; i <= len; ++i) { int j = i; ch1 ...
ALGO
0.999779
3.789969
700b4af8-a0bd-4b5a-945b-a35f46afecfa
113bommy/deepmind_codecontests_refine
cpp_gold_filter_file/cpp_train_3508_4.cpp
#include <bits/stdc++.h> #pragma GCC optimize("Ofast") #pragma GCC target( \ "sse,sse2,sse3,ssse3,sse4,sse4.1,sse4.2,popcnt,abm,mmx,avx,tune=native") using namespace std; const int MOD = 1000000007; const int UNDEF = -1; const int INF = 1 << 30; template <typename T> inline bool chkmax(T& aa, T bb) { return aa < ...
ALGO
0.999929
3.717542
95ccf0eb-7e1e-4dba-bb71-2b6e4698036e
TengFeiyang01/Algorithm
bishi/9-10深信服/o.cpp
#include <bits/stdc++.h> int main() { int n = 100; // 假设有n个数 int m = 100; // 假设异或和最大为m std::cin >> n >> m; std::vector<std::vector<std::vector<int>>> dp(n, std::vector<std::vector<int>>(m + 1, std::vector<int>(m + 1, 0))); int ans = 0; // 假设初始化 dp[0][...][...] 的值 for (int i = 0; i <= m; +...
ALGO
0.999984
4.361397
17b06532-2a47-4e11-a8aa-c4499c3e8f37
bsc-mem/Mess-Paraver
libs/boost_1_79_0/libs/compute/example/threefry_engine.cpp
#include <boost/compute/random/threefry_engine.hpp> #include <boost/compute/container/vector.hpp> #include <boost/compute/command_queue.hpp> #include <boost/compute/context.hpp> #include <boost/compute/device.hpp> #include <boost/compute/system.hpp> #include <iostream> int main() { using boost::compute::uint_; ...
TOOL
0.974233
3.940955
e3ddebf1-832e-4521-aaa9-1d11110d3128
axelu/leetcode
cpp/02500-02999/findthesubstringwithmaximumcost.cpp
// 2606. Find the Substring With Maximum Cost // https://leetcode.com/problems/find-the-substring-with-maximum-cost/ class Solution { private: int maxSubArray(vector<int>::iterator first, vector<int>::iterator last) { if ( first == last ) return *first; // divide auto middle = first + ((...
ALGO
0.99959
6.265869
d19b7e7d-7885-427c-b856-12bf8939db97
torchesburn/physx-wasm
PhysX/physx/source/geomutils/src/GuInternal.cpp
#include "foundation/PxBounds3.h" #include "geometry/PxCapsuleGeometry.h" #include "PsIntrinsics.h" #include "GuInternal.h" #include "GuBox.h" #include "GuVecPlane.h" #include "PsMathUtils.h" #include "PsVecMath.h" using namespace physx::shdfnd::aos; using namespace physx; /** Computes the aabb points. \param pts [o...
TOOL
0.961665
7.723776
8383626c-913c-4dc8-a533-6e75ce605d1b
namecheker/SE-module-3
module 3 assignment/qution no 19.cpp
// 19. calculate compound interest #include<stdio.h> #include<math.h> int main(){ float a,r,t,CI; int p; printf("\n enter your principal amount:"); scanf("%d",&p); printf("\n enter the annuale interest rate:"); scanf("%f",&r); printf("\n enter the time the money is invested for in year:"); scanf("%f",&...
ALGO
0.997858
3.072433
afaa8afa-6ed1-43da-adb8-c39f27bc13f2
ArcticFoox/autocommit_window
tetromino.cpp
//14500 dfs #include<iostream> using namespace std; int n, m; int arr[500][500]; bool visit[500][500]; int dx[4] = {0, 0, -1, 1}; int dy[4] = {1, -1, 0, 0}; int ans; void dfs(int x, int y, int cnt, int sum){ if(cnt == 4){ ans = max(ans, sum); return; } if(!visit[x][y]){ for(int ...
ALGO
0.999955
4.522683
05f43e08-6c3e-45ff-b198-fe87be5a4a07
TheTrustyPwo/CP
CodeForces/1768/B/main.cpp
#include <bits/stdc++.h> using namespace std; typedef long long ll; void test_case(int test) { int n, k; cin >> n >> k; int a[n]; for (int i = 0; i < n; i++) cin >> a[i]; int target = 1, cnt = 0; for (int i = 0; i < n; i++) { if (a[i] == target) target++; else cnt++; } int x = c...
ALGO
0.999786
4.352931
e2cec56e-5445-4df4-8f85-ce4a082d7cff
camil0palacios/Competitive-programming
solutions/codeforce/Codeforces Round #761 (Div. 2)/c.cpp
#include <bits/stdc++.h> #define endl '\n' #define ll long long #define fori(i,a,b) for(int i = a; i < b; i++) #define forr(i,a,b) for(int i = a; i >= b; i--) #define fore(i,a,b) for(int i = a; i <= b; i++) #define ft first #define sd second #define all(v) v.begin(), v.end() #define sz(v) (int) v.size() #define mp make...
ALGO
0.999319
4.417159
7fd9ecd5-9520-4222-beb2-3437fdc6e44b
muskan-aggarwal/DATA-STRUCTURES
Stack/reverse_string_using_stack.cpp
#include<iostream> #include<string.h> using namespace std; class stack { public: int top=-1; char s[20]; void push(char x) { if(top==19) cout<<"overflow"<<endl; else { top++; s[top]=x; } } void pop() { top--; } void display() { if(top==-1) { cout<<"underflow...
ALGO
0.993981
4.16304
fe844a54-27a3-4ce9-834f-9d30adb1411b
ishandutta2007/codeforces
igori/normal/1709/A.cpp
const long long MOD = 1e9 + 7; const long long INF = 1e9 + 10; const long long INFLL = 1e18; #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int, int> pii; typedef pair<ll, ll> pll; typedef vector<int> vi; typedef vector<vector<int> > vvi; typedef vector<ll> vll; typedef complex<doub...
ALGO
0.999946
4.093329
d263f63a-8b54-49eb-b064-8265f8df7797
karthikkumar957/CSA0431
os 9.cpp
#include<stdio.h> #include<stdlib.h> #include<pthread.h> #include<semaphore.h> #include<unistd.h> sem_t room; sem_t chopstick[5]; void * philosopher(void *); void eat(int); int main() { int i,a[5]; pthread_t tid[5]; sem_init(&room,0,4); for(i=0;i<5;i++) sem_init(&chopstick[i],0,1); for(i=0;i<5;i++){ a[i]=i; pthread_cre...
ALGO
0.999189
3.428389
9e9013b0-f7f9-4874-840e-d9f0029438ee
sd2001/HacktoberFest2020
cpp files/Binary Search Iter.cpp
#include<iostream> using namespace std; int binarySearch(int [], int, int, int); int main() { int a[10], i, h, elem, result; cout <<"Enter the number of elements in the array\n"; cin >> h; cout <<"Enter the elements one by one\n"; for(i=0; i<h; i++) cin >> a[i]; cout <<"Enter the elemen...
ALGO
0.999721
4.651674
b6b426d3-c378-4694-ae40-b5f770d32f05
LANSGANBS/MyCppCode_Vscode
Codeforces/Educational Codeforces Round 167 (Rated for Div. 2)/A_Catch_the_Coin.cpp
#include <bits/stdc++.h> #include <bits/extc++.h> using namespace std; using namespace __gnu_pbds; using i64 = long long; /*using i128 = __int128;*/ #define endl '\n' #define buff ios::sync_with_stdio(false), cin.tie(nullptr), cout.tie(nullptr) #define debug cout << "----------------------------------------------" << e...
ALGO
0.999868
5.392145
b2b32b62-8671-433a-a4c5-2cb0e5437bfb
yash240804/CPP_DSA
56.cpp
#include<iostream> using namespace std; void Swap(int &a, int &b){ a = a + b; b = a - b; a = a - b; } int main(){ int a, b; cin>>a>>b; Swap(a, b); cout<<a<<" "<<b; return 0; }
ALGO
0.999922
3.807355
39f89482-7e35-43d7-96fd-c7a07c24ccec
ishandutta2007/codeforces
enchom/normal/1556/B.cpp
#include <iostream> #include <stdio.h> using namespace std; int t; int n; int a[200111]; int b[200111]; int g[200111]; int is1, is0; void moveEm(int ind) { is0 = max(is0, ind); is1 = max(is1, ind); while(is0 <= n && b[is0] != 0) is0++; while(is1 <= n && b[is1] != 1) is1++; } int tryM...
ALGO
0.999968
4.12641
347573b3-9527-4853-b2f7-9ebcc43fc60b
chris-martin/cs6241
llvm/lib/CompilerDriver/Tool.cpp
#include "llvm/CompilerDriver/BuiltinOptions.h" #include "llvm/CompilerDriver/Tool.h" #include "llvm/ADT/StringExtras.h" #include "llvm/System/Path.h" #include <algorithm> using namespace llvm; using namespace llvmc; namespace { sys::Path MakeTempFile(const sys::Path& TempDir, const std::string& BaseName, ...
TOOL
0.920336
6.740866
93e0323e-d81d-4d55-aff7-da8efa4901c9
zxyDEDIRE/ACM_CODE
出题/中国人民解放军战略支援部队信息工程大学/zxy/又是个数论题/gen.cpp
// #include "testlib.h" #include<bits/stdc++.h> using namespace std; using ll=long long; mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());//ull 大概率生成不相同数据 ll getRand(ll l,ll r){ uniform_int_distribution < ll > uid(l,r); return uid(rng); } // main 需要接收命令行参数 int main(int argc, char *argv[]...
ALGO
0.994368
3.05116
ddb65b83-daee-47d2-83df-af9a1cf46306
113bommy/deepmind_codecontests_refine
cpp_gold_filter_file/cpp_train_1924_29.cpp
#include <bits/stdc++.h> #pragma GCC target("avx") #pragma GCC optimize(3) #pragma GCC optimize("Ofast") #pragma GCC optimize("inline") #pragma GCC optimize("-fgcse") #pragma GCC optimize("-fgcse-lm") #pragma GCC optimize("-fipa-sra") #pragma GCC optimize("-ftree-pre") #pragma GCC optimize("-ftree-vrp") #pragma GCC opt...
ALGO
0.999958
3.443696
cabf0731-0e7e-4e1e-ac9d-f9d5f3a90c2f
FHead/PhysicsHiggsProperties
Likelihood/15123_AttachFullEFTLikelihoodZAAZWithPDF/StockM4l.cpp
#include <vector> using namespace std; #include "Code/DrawRandom2.h" #include "StockM4l.h" StockM4l::StockM4l(int Seed, int Size) { Initialize(Seed, Size); } double StockM4l::operator [](int index) { if(M4l.size() == 0) return 0; return M4l[index%M4l.size()]; } void StockM4l::Initialize(int Seed,...
TOOL
0.874506
4.540044
8567626c-623d-4cc7-a8d6-6af6a93647a9
amanhex/Leetcode-Solutions
705. Design HashSet.cpp
/* Design a HashSet without using any built-in hash table libraries. Implement MyHashSet class: void add(key) Inserts the value key into the HashSet. bool contains(key) Returns whether the value key exists in the HashSet or not. void remove(key) Removes the value key in the HashSet. If key does not exist in the HashS...
ALGO
0.997911
5.588705
17864d00-82a0-4039-8414-3ca49f9df690
Ayushluthra2001/LeetCodeTop150
Maximum Depth of Binary Tree.cpp
/** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode() : val(0), left(nullptr), right(nullptr) {} * TreeNode(int x) : val(x), left(nullptr), right(nullptr) {} * TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), l...
ALGO
0.999512
6.444004
4d0b1e39-023a-41b9-806d-3fa24a435961
ALive-WoW/RC2
src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_argent_challenge.cpp
/* ScriptData SDName: Argent Challenge Encounter. SD%Complete: 90 % SDComment: AI from bosses need more improvements. Need AI for lightwell SDCategory: Trial of the Champion EndScriptData */ #include "ScriptPCH.h" #include "trial_of_the_champion.h" #include "ScriptedEscortAI.h" enum eSpells { //Eadric SPELL_E...
ALGO
0.938339
3.051579
f97ba8bf-9a71-4926-ae84-ed623420726f
waterfogSW/Cracking-Coding-Interview
Coding Test/DFS-BFS/[BJ-1261]알고스팟-DFS.cpp
#include <bits/stdc++.h> using namespace std; #define INF 100000 int n, m; int dx[4] = {1, 0, -1, 0}; int dy[4] = {0, 1, 0, -1}; char miro[100][100]; bool v[100][100]; int result = INT_MAX; // DFS int dfs(int x, int y, int count) { // 종료조건 if (x == n-1 && y == m-1) { result = count; return...
ALGO
0.999871
4.453139
c1c08aec-df80-46d3-854d-7ac113984598
a-a-ahmed/C-CPP-Games
PINGBALL.CPP
#include<stdio.h> #include<ctype.h> #include<conio.h> #include<stdlib.h> #include<dos.h> #include<graphics.h> #include<time.h> int x1,y1,x2,y2,x1old,x2old,ycenter,xcenter; int xnewcenter,ynewcenter,radius,ballspeedx,ballspeedy; char sym,pit[20]; int score=0,speed=10; void ball() { time_t t; xcenter=xnewcenter; ...
ALGO
0.975444
3.916397
0df207de-e1fa-418f-b3c9-490e97c16224
TaleGcloud/CppLearning
引用/创建引用.cpp
#include<iostream> using namespace std; //ʹý void swap(int& a, int& b) { int temp = a; a = b; b = temp; } int main() { int a = 10; int b = 20; swap(a, b); cout << "a= " << a << endl; cout << "b= " << b << endl; system("pause"); return 0; }
ALGO
0.998598
3.38856
ff0bb976-a103-4402-bdbb-0c6e8f6d6dce
fairy-stockfish/variant-nnue-tools
src/xboard.cpp
#include <iostream> #include <string> #include "evaluate.h" #include "misc.h" #include "partner.h" #include "search.h" #include "thread.h" #include "types.h" #include "uci.h" #include "xboard.h" namespace Stockfish { namespace { const Search::LimitsType analysisLimits = []{ Search::LimitsType limits; limi...
ALGO
0.990856
6.597551
b271adde-90f3-4d19-9277-f26de31a0e23
cornflower26/PPSA
find_prim_roots.cpp
#include <iostream> #include <cinttypes> #include <sstream> // g++ find_prim_roots.cpp -o find -O3 -I ~/.local/include -L ~/.local/lib -pthread -lntl -lgmp -Wall -Werror // g++ find_prim_roots.cpp -o roots -std=c++14 -O3 -I ~/.local/include -L ~/.local/lib -pthread -lntl -lgmp -Wall -Werror #include "numbertheory.h" ...
ALGO
0.999017
4.798401
e481a1ae-54fb-48f0-a280-c6cc2b1a9043
sejinik/Algorithm
boj/2018 KCPC - Beginner/16677.cpp
#include <iostream> #include <algorithm> #include <string> #include <vector> using namespace std; string s; int n,ssize; double maxScore; vector<pair<string,double>> vt; void input(string st,int score){ int j=0; for(int i=0;i<st.size();i++){ if(st[i]==s[j]) j++; } if(j<ssize) return; int le...
ALGO
0.999984
3.976388
daf10ed6-b0a4-4a68-b0fc-613a1f391e6f
almaaz7/SDE
practice/quickpractic.cpp
#include<iostream> #include<algorithm> using namespace std; int partition(int arr[],int s,int e) { int pivotElement = arr[s]; int count = 0; for(int i = s+1;i<e;i++){ if(arr[i]<=pivotElement){ count++; } } int rightIndex = s + count; swap(pivotElement,arr[rightInde...
ALGO
0.999974
5.074675
ee69862a-e528-4c65-a278-ee8201abab6a
ProtonAOSP-Alioth/android_frameworks_av
media/codecs/amrnb/enc/src/g_pitch.cpp
/* ------------------------------------------------------------------------------ Pathname: ./audio/gsm-amr/c/src/g_pitch.c Date: 06/12/2000 ------------------------------------------------------------------------------ REVISION HISTORY Description: Placed into template and began to optimize. Description...
ALGO
0.999219
5.62798
0edf5515-7756-4904-8c11-d183abbe36fb
Dr-Ivan/ObjectOrientedProgramming
Lab3 - inheritance, static members, operator overloading/Triangle_implementation.cpp
#include "Triangle_header.hpp" #define _USE_MATH_DEFINES #define EPS 1e-2 #include <math.h> #include <stdbool.h> #include <iostream> #include <random> using namespace std; // проверка равенства вещественных чисел bool equal_float(const float a, const float b){ return (abs(a - b) < EPS); }; float random_number(fl...
ALGO
0.879878
5.478091
4a31d195-e236-4a87-aa9c-41415aded1f7
digant73/Artillery-Sidewinder-X1_releases_main_board
artillery_swx1_marlin_fw_2.0.6.1/bltouch_standard_mod_(z_min_used)/source/Marlin-2.0.x/Marlin/src/libs/vector_3.cpp
#include "../inc/MarlinConfig.h" #if ABL_PLANAR || ENABLED(AUTO_BED_LEVELING_UBL) #include "vector_3.h" #include <math.h> /** * vector_3 */ vector_3 vector_3::cross(const vector_3 &left, const vector_3 &right) { const xyz_float_t &lv = left, &rv = right; return vector_3(lv.y * rv.z - lv.z * rv.y, // YZ...
TOOL
0.897498
6.860394
3bf67928-54df-4e15-9562-c251cc5801b0
manikanta2901/ubuntu
.history/practice/cpp/codeforces/puzzleFronFuture_20210124111019.cpp
#include <bits/stdc++.h> #include<vector> #include<iostream> #include<cmath> #include<algorithm> #include<iterator> #include<string> #include<map> #include<queue> using namespace std; #define trav(dataType,DataStruct,name) for(dataType<DataStruct>::itt ip = name.bb(); ip != name.ee(); ip++) //Pre processors & typedefs ...
ALGO
0.999961
3.797867
5bab6dc7-f60b-4861-a160-8b1b370728b4
mohdzafeer/DSA
12.cpp
// #include <iostream> // using namespace std; // int main() // { // int n; // cout << "Enter n "; // cin >> n; // int i = 0; // while (i < n) // { // int j = 1; // while (j <= n) // { // int value = j; // cout << value; // value = va...
ALGO
0.999635
4.288326
461f29df-a68c-49ed-82e1-a153eb1babc5
jakub-prokopiuk/639B-INxxx-MEP-ZCUZ
src/BFSSolver.cpp
#include "BFSSolver.hpp" #include <map> BFSSolver::BFSSolver(Board& board) : Solver(board) {} std::vector<char> BFSSolver::solve() { std::queue<std::pair<Board, std::vector<char>>> q; std::unordered_set<std::string> visited; std::map<char, std::pair<int, int>> moves = {{'w', {-1, 0}}, {'s', {1, 0}}, {'a',...
ALGO
0.999798
6.023562
1f0169b0-bae3-4e08-8e67-04493e79bb0b
naman360/groking-the-coding-interview-questions
Fast & Slow Pointers/linkedlist-cycle.cpp
/** * */ #include <iostream> using namespace std; class ListNode { public: int value = 0; ListNode *next; ListNode(int value) { this->value = value; next = nullptr; } }; class LinkedListCycle { public: static bool hasCycle(ListNode *head) { ListNode *fast = head; ...
ALGO
0.999199
5.080022
134b05ab-1d25-4a53-a424-04116891f7e8
ishandutta2007/codeforces
shoemakerjo/normal/672/A.cpp
#include <iostream> #include <vector> using namespace std; int main() { int n; cin >> n; vector<int> v; int cur = 1; while (v.size() < n) { vector<int> temp; int tempo = cur; while (tempo > 0) { temp.push_back(tempo%10); tempo/=10; } for (int i = temp.size()-1; i >= 0; i--) { v.push_back(temp[i...
ALGO
0.999722
4.017485
d0533211-9da8-4475-8516-40f8e1557e28
alpha079/LeetCode-Problems
81-search-in-rotated-sorted-array-ii/81-search-in-rotated-sorted-array-ii.cpp
class Solution { public: bool search(vector<int>& nums, int target) { int n=nums.size(); if(n==0)return false; if(n==1) { return (nums[0]==target?true:false); } int low=0,high=n-1; while(low<=high) { int mid=(...
ALGO
0.999985
6.134799
6df411f0-d60e-4764-a710-ccac41010d6c
Dr-Khatib/PT1-SESJ1013
Students/alyaqistina/LAB_EXERCISE/LE2_(4).cpp
//SET 4 /*Write a complete C++ program that reads an integer number and then calculate the product of its digits. After that, identify whether the product of digits for the integer is an even or odd number, and a multiple of 3, and/ or 5. Hint: You should use operator divide (/) and modulus (%) and also post-test loop...
ALGO
0.999102
4.2489
619ee717-3272-451c-ab3d-31121abbc408
MongXinChan/Oj
Leetcode-基础语法/LeetCode 1486数组异或.cpp
class Solution { public: int xorOperation(int n, int start) { int a=0; for(int i=0;i<n;i++){ a^=(start + i*2); } return a; } };
ALGO
0.99995
5.346735
315c8b28-08e6-4419-aa32-0913c0bb8b5f
Dong-Young-Kim/for-study-algorithm-by-problem
algorithm-problem-solving-strategies/SNAIL/arr_fill.cpp
#include <iostream> int main() { const int rows = 3; // 배열의 행 개수 const int cols = 4; // 배열의 열 개수 double arr[rows][cols]; // 배열 내용 입력 int k = 0; for (int i = 0; i < rows; ++i) { for (int j = 0; j < cols; ++j) { // **(arr + k) = k++; *(*(arr+ i) + j) = k++; ...
TOOL
0.88219
4.559636
9bc2cf76-e567-4677-b12d-f7d83f57264a
raincross7/code-similarity
codes/train_code/problem050/problem050_303.cpp
//Radhe Radhe #include<bits/stdc++.h> #define ll long long #define fast_io ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL); #define mod 1000000007 using namespace std; int main() { fast_io ll i,j,a,b,c; string s,yr,dd,mm; cin>>s; yr=s.substr(0,4); mm=s.substr(5,2); dd=s.substr...
ALGO
0.995904
3.661863
9780c541-42ce-4d17-b246-729a56107416
Apelpisia/CSES
Sorting and Searching/subarray_sums1.cpp
#include <bits/stdc++.h> using namespace std; const int nx = 2e5+5; int n, x, arr[nx], ans = 0, l=0, r=0, s=0; int main(int argc, char** argv){ cin >> n >> x; for(int i=0; i<n; i++) cin >> arr[i]; s = arr[0]; while(l<=r){ if(s==x){ ans++; if(r>=n-1) break; ...
ALGO
0.999959
4.32722
0d858b72-f5fd-4ed3-9374-f72f9e784950
teetangh/competitive-programming-and-dsa
CodeZen/03 Algorithms and Competitive Programming/05 10 Recursion/Recursion 1 Basic/prog007isSortedArray.cpp
#include <iostream> #include <iomanip> #include <string> #include <bits/stdc++.h> using namespace std; bool is_sorted2(int a[], int size) { if (size == 0 || size == 1) return true; bool isSmallerSorted = is_sorted2(a + 1, size - 1); if (!isSmallerSorted) return false; if (a[0] > a[1...
ALGO
0.999818
4.022927
d58cd591-e0af-4f16-a8db-228037466eca
Ganbilly/algostudy-BS
C++basic/2022.01.09.모임/[1085]/es1085.cpp
#include <iostream> using namespace std; int main(){ int x, y, w, h; int d1, d2; cin >> x >> y >> w >> h; d1 = x < w - x ? x : w - x; d2 = y < h - y ? y : h - y; cout << (d1 < d2? d1 : d2) ; return 0; }
ALGO
0.999121
3.318028
da370dfa-3888-492b-b474-ae4a9a837eb3
Junmarlou/C-C-
arry.cpp
#include <iostream> using namespace std; int main() { int n[9]; for(int i = 0; i < 10; i++) { cout << "Enter a number: "; cin >> n[i]; } for(int i = 0; i < 10; i++) { for(int j = i + 1; j < 10; j++) { if(n[i] > n[j]) { in...
ALGO
0.999674
3.926372
e925217c-d5b8-4f10-a766-3034c91c348b
carrtesy/Problem-Solvings
bkj/13398/create_case.cpp
#include <iostream> #include <fstream> using namespace std; int main(void){ string filePath = "input2.txt"; ofstream writeFile(filePath.data()); if(writeFile.is_open()){ writeFile << "100000\n"; for(int i = 1; i <= 100000; i++){ writeFile << 1000 << " "; } writeFile.close(); } }
TOOL
0.923891
3.484594
54d5da67-54b6-4415-910b-b9c8c65ee29f
pavankumar4404/Competitive_Programming
Even_Sum_Subarray.cpp
#include <bits/stdc++.h> using namespace std; // Speed #define fastio() ios_base::sync_with_stdio(false), cin.tie(nullptr), cout.tie(nullptr); // Macros typedef long long ll; #define rep(i,j) for(int i=0;i<j;i++) #define rrep(i,j) for(int i=j-1;i>=0;i--) #define all(x) x.begin(), x.end() #define pb push_back // Bina...
ALGO
0.999536
5.281183
57126b0e-072f-4d94-8673-4c7498fb1982
03-prathamesh/DSA_LEETCODE_PROBLEMS
0001_array/0058_how_many_nos_are_smaller_than_the_currrent_no.cpp
class Solution { public: vector<int> smallerNumbersThanCurrent(vector<int>& nums) { vector<int>ans; for(int i=0;i<nums.size();i++){ int count=0; for(int j=0;j<nums.size();j++){ if(nums[i]>nums[j] && i!=j){ count++; } } ans.push_back(count); } retu...
ALGO
0.999954
5.583345
d44308f1-0b5a-418f-a73c-f17da232d8ce
santu-dhali/DSA-Practice
58-length-of-last-word/length-of-last-word.cpp
class Solution { public: int lengthOfLastWord(string s) { int n = s.size(); int count = 0; bool flag = false; for(int i=n-1; i>=0; i--){ if(s[i] ==' ' and flag == false){ continue; } if(s[i] != ' '){ flag = true; ...
ALGO
0.999628
5.626326
9448d1b8-bc0c-4ad0-ab5d-4a9fbdc778cc
sarvex/leetcode-basic
solution/0100-0199/0164.Maximum Gap/Solution.cpp
using pii = pair<int, int>; class Solution { public: const int inf = 0x3f3f3f3f; int maximumGap(vector<int>& nums) { int n = nums.size(); if (n < 2) return 0; int mi = inf, mx = -inf; for (int v : nums) { mi = min(mi, v); mx = max(mx, v); } ...
ALGO
0.999983
5.173188
4e246770-f7ce-4a67-8025-76d2a7d51ae9
raincross7/code-similarity
codes/train_code/problem493/problem493_264.cpp
#include "bits/stdc++.h" using namespace std; void Main() { int A, B, C, D; cin >> A >> B >> C >> D; int ans = 0; if (D <= A || B <= C) { ans = 0; } else { ans = min(B, D) - max(A, C); } cout << ans << endl; } int main() { std::cout << std::fixed << std::setprecis...
ALGO
0.99987
4.02605
1600647e-8ddf-4543-9868-88f4a56a5562
Liz-Nozomi/luogu
alo2-1/P1719.cpp
#include <bits/stdc++.h> using namespace std; int main(){ int n; cin>>n; int mat[150][150]; int dp[150][150]; for(int i=1;i<=n;i++){ for(int j=1;j<=n;j++){ cin>>mat[i][j]; } } dp[1][1] = mat[1][1]; for(int i=2;i<=n;i++){ dp[1][i] = dp[1][i-1] + mat[...
ALGO
0.999864
3.225606
92421a49-bf97-4e46-b9d3-3ad4c9c7e7bd
bantosik/LeakFreeByDefaultTraining
main.cpp
#include <iostream> #include <memory> #include <cassert> //this shows how hard implementing doubly linked list really is //even with the help of unique pointer to handle ownership of pointers it is still (and maybe because of that) //difficult not to screw things up. //Two major challenges: // 1. Dtor of LinkedList w...
TEST
0.932563
6.059872
2fdbe836-e931-41f6-8c45-0aca63f6dcca
tristanlcarter/AdventOfCode2021
Day5.cpp
#include "Day5.h" #include <fstream> #include <sstream> #include <string> #include <iostream> #include <vector> #include <list> using namespace std; int day5::part1() { ifstream infile("../day5.txt"); string line; vector<int> start, end; vector< vector<int> > field; while (getline(infile, line)) ...
ALGO
0.997967
5.754394
43892b89-3ee4-41a8-8b6d-1467763e4760
raincross7/code-similarity
codes/train_code/problem303/problem303_328.cpp
#include <bits/stdc++.h> using namespace std; int main() { ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); string s, t; cin >> s >> t; vector<int > v; for (int i = 0; i < s.size(); i++) if (s[i] != t[i]) v.push_back(i); int ans = v.size(); cout << ans << '\n'; return 0; }
ALGO
0.999967
4.267653
eae8a34a-358e-4107-bac8-d4de09d11e72
ishandutta2007/codeforces
wangzhikun/normal/1209/D.cpp
#include <set> #include <queue> #include <cmath> #include <bitset> #include <cstdio> #include <cstdlib> #include <vector> #include <cstring> #include <iostream> #include <algorithm> #define debug(x) cerr<<#x<<'='<<x<<endl #define set0(x) memset(x,0,sizeof(x)) using namespace std; typedef long long ll; typedef pair<ll,l...
ALGO
0.999912
4.051242
0a3cc8dc-909a-45cc-b77c-e4103533ac20
ishandutta2007/codeforces
andrew.volchek/normal/315/D.cpp
#include <iostream> #include <cstdio> #include <vector> #include <map> #include <set> #include <cmath> #include <algorithm> #include <cstdlib> #include <cstring> using namespace std; #define mp make_pair #define pb push_back int dp[222][105]; int dp2[105]; char cc[555]; char c[111]; char a[111]; int alen, clen; int...
ALGO
0.999901
3.353267
cb13835c-9914-4c22-bb3f-9157c2f982c2
Shawdox/Pymutate
code_translation/Datasets/TransCoder/transcoder_evaluation_gfg/cpp/ADD_1_TO_A_GIVEN_NUMBER.cpp
#include <iostream> #include <cstdlib> #include <string> #include <vector> #include <fstream> #include <iomanip> #include <bits/stdc++.h> using namespace std; int f_gold ( int x ) { int m = 1; while ( x & m ) { x = x ^ m; m <<= 1; } x = x ^ m; return x; } //TOFILL int main() { int n_success = 0;...
ALGO
0.999684
5.668757
741356ba-3519-495e-a06d-02299789aa83
fishy15/competitive_programming
online/cf/510/leaf_sets.cpp
#include <iostream> #include <iomanip> #include <fstream> #include <vector> #include <array> #include <algorithm> #include <utility> #include <map> #include <queue> #include <set> #include <cmath> #include <cstdio> #include <cstring> #define ll long long #define ld long double #define eps 1e-8 #define MOD 1000000007 ...
ALGO
0.999949
4.924089
c89bb680-4483-4bb6-88fe-0dca9a292ed7
Shadat-tonmoy/ACM-Problem-Solution
UVa/10474 - Where is the Marble?.cpp
#include <bits/stdc++.h> using namespace std; #define lli long long int #define MAX 10005 int main() { lli i,j,k,l,m,n,a,b,c,d,q,tc=0,num[MAX],numToFind,ansIndex; while(cin>>n>>q) { if(n==0 && q==0) break; tc++; for(i=0;i<n;i++) cin>>num[i]; sort(num, num+n); ansIndex = -...
ALGO
0.9993
3.688912
f294f615-ac92-4850-93f0-f433b08aa1ee
MANISHDUTT224/LeetCode
0410-split-array-largest-sum/0410-split-array-largest-sum.cpp
class Solution { public: bool isPossible(vector<int>&nums,int mid,int k){ int sum=0,cnt=1; for(int i=0;i<nums.size();i++){ if(nums[i]>mid){ return false; } if(sum+nums[i]>mid){ sum=nums[i]; cnt++; } ...
ALGO
0.999992
5.625222
d6f13bff-e41f-4f62-b384-093bfc9c0c33
krishna-raj007/BodhiTree-Annotation
CS101_Spring2020-21 /LAB4_L1/categorized/mod/all_passed/116_mod.cpp
#include<simplecpp> main_program{ long int a,i,n,m; cin>>n>>m; i=1; repeat(n-1){ n=n*i%m; i=i+1; } a=n%m; cout<<a; }
ALGO
0.999949
3.242662
36a9fd9f-bede-46b5-bc50-1afa95d62ac7
Jopepato/PracticasTercero
Jose/Algoritmica/P1/Ruben/metodoInsercionBinaria.cpp
/*! @author Ruben @file metodoInsercionBinaria.cpp @brief Definicion de las funciones para Insercion Binaria */ #include "metodoInsercionBinaria.hpp" #include <vector> using namespace std; void InsercionBinaria::ordenar() { int j,aux,izq,der,m; vector<int> auxV= getVector(); for(int i=0;i<ge...
ALGO
0.999923
4.535101
534c4e41-d525-43e9-9241-2dc90d3f3ca9
spacecowgirl314/FBAlpha-Core
src/intf/video/scalers/hq3xs.cpp
#include "hq_shared32.h" #include "interp.h" #define SIZE_PIXEL 2 // 16bit = 2 bytes #define PIXELTYPE unsigned short #define Interp1 Interp1_16 #define Interp2 Interp2_16 #define Interp3 Interp3_16 #define Interp4 Interp4_16 #define Interp5 Interp5_16 void hq3xS(unsigned char * pIn, unsigned int srcPitch, unsign...
ALGO
0.998355
4.915371
4ddd5754-accd-408e-ab69-6b55959b5533
ZG-xx/TC
src/server/scripts/Kalimdor/CavernsOfTime/DarkPortal/instance_dark_portal.cpp
/* ScriptData SDName: Instance_Dark_Portal SD%Complete: 50 SDComment: Quest support: 9836, 10297. Currently in progress. SDCategory: Caverns of Time, The Dark Portal EndScriptData */ #include "ScriptPCH.h" #include "dark_portal.h" #define MAX_ENCOUNTER 2 #define C_MEDIVH 15608 #define C_T...
TOOL
0.90209
5.867826
1c35ecf2-384b-4e44-bc43-378bca4309cd
Nilesh-0203/Daily-Codes
Easy/Exit Point in a Matrix/exit-point-in-a-matrix.cpp
//{ Driver Code Starts #include <bits/stdc++.h> using namespace std; // } Driver Code Ends class Solution { public: vector<int> FindExitPoint(int n, int m, vector<vector<int>>& matrix) { // Code here int i=0, j=0; int p_i=0, p_j=0; char ch = 'R'; while(i>=0 and j>=0 and i<...
ALGO
0.999841
5.502756
904347d5-833b-4679-bc5a-7592008330b4
anwar-arif/acm-code
spoj/CODEM4 - Problem4.cpp
#include<bits/stdc++.h> using namespace std ; const int N = (int) 50 + 10 ; const int inf = (int) 2e9 ; long long arr[N] , dp1[N][N][2] , dp2[N][N][2] ; int n ; long long F(int i , int j , int t) { if( i > j ) return 0 ; long long &ret = dp1[i][j][t] ; if( ret != -1 ) return ret ; if( t == 0 ) { ...
ALGO
0.999928
3.760361
ee5c526c-1162-4032-b0fd-7f2e90aabadb
ishandutta2007/codeforces
golikovnik/normal/1662/J.cpp
// #pragma comment(linker, "/stack:200000000") // #pragma GCC optimize("Ofast,no-stack-protector") // #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2,tune=native") // #pragma GCC optimize("unroll-loops") #include <stdio.h> #include <bits/stdc++.h> #ifdef PERVEEVM_LOCAL #define debug(x) std::c...
ALGO
0.99995
4.034953
6da97425-448b-4d63-b10f-508818f81b96
localhost44374/dsa
BinarySearch.cpp
#include <iostream> using namespace std; int main() { int num[10], i; int first, last, mid; int target; int flag = 0, size; cout << "***Binary Search***" << endl; cout << "Enter the size of the array:"; cin >> size; cout << "Enter " << size << " elements:" << endl; for (i = 0; i < si...
ALGO
0.999636
5.793202
3bb53b78-ba9b-4a16-80f8-5487dd3709a7
Abhay-yadav966/DSA-in-Cpp
Patterns/pyramid.cpp
#include<iostream> using namespace std; int main(){ int n; cout<<"Enter the number:"<<endl; cin>>n; // outer loop for( int row = 1; row <= n; row++ ){ // inner loop for( int col = 0; col < n ; col++ ){ if( col < n - row ){ cout<<" "; } ...
ALGO
0.999906
3.663097
8729e544-bdce-409a-b6d8-925bbbed5fc8
SSTato/YOLOX_obb
yolox/ops/pytorch/box_iou_rotated/src/box_iou_rotated_ext.cpp
#include <ATen/ATen.h> #include <torch/extension.h> #ifdef WITH_CUDA at::Tensor box_iou_rotated_cuda( const at::Tensor& boxes1, const at::Tensor& boxes2, const bool iou_or_iof); #endif at::Tensor box_iou_rotated_cpu( const at::Tensor& boxes1, const at::Tensor& boxes2, const bool iou_or_iof); ...
ALGO
0.855959
5.555
8d275907-c849-49b4-8f8b-85a0c70c02b8
Pierrot-jang-pilkyu/cpp_module_02
ex03/srcs/Point.cpp
#include "../includes/Point.hpp" Point::Point() : x(Fixed(0)), y(Fixed(0)) {} Point::Point(const float &_x, const float &_y) : x(Fixed(_x)), y(Fixed(_y)) {} Point::Point(const Point &_p) : x(Fixed(_p.getFixedX())), y(Fixed(_p.getFixedY())) {} Fixed Point::getFixedX(void) const { return (this->x); } Fixed Point::g...
TOOL
0.954665
4.525366
67654575-7f6f-4592-b115-0b32aa4603ab
alemuntoni/meshlab-external-libraries
downloads/CGAL-5.6/examples/Algebraic_kernel_d/Sign_at_1.cpp
// $URL$ // $Id$ #include <CGAL/config.h> #ifdef CGAL_USE_MPFI #include <CGAL/Algebraic_kernel_d_1.h> #include <CGAL/Gmpz.h> #include <vector> typedef CGAL::Algebraic_kernel_d_1<CGAL::Gmpz> AK; typedef AK::Polynomial_1 Polynomial_1; typedef AK::Algebraic_real_1 ...
ALGO
0.907269
5.663543
8828f7a7-cf13-43d8-a98e-ea0972954e11
sangmin7b/algorithm
algorithm/convex_hull/1708.cpp
#include<bits/stdc++.h> #define X first #define Y second using namespace std; using pii = pair<int, int>; using ll = long long; ll ccw(pii a, pii b, pii c){ pii A = {b.X - a.X, b.Y - a.Y}; pii B = {c.X - b.X, c.Y - b.Y}; return ((ll)A.X * B.Y - (ll)A.Y * B.X); } int main(int argc, char const *argv[]){ ...
ALGO
0.999991
5.020176
83fdfa45-a301-49fd-a550-018eab2738d8
huyhuy1712/thu
c/code hk1/on5 dequi.cpp
#include <bits/stdc++.h> using namespace std; int gt(int n){ int k = n; for (int i = k - 1; i >= 1; i--){ n *= i; } return n; } int main(){ int n, k; cout << "k= "; cin >> k; cout << "n= "; cin >> n; if (k > n) {cout << "error!"; } else{ int C = gt(n) / (gt(n-k)*gt(k)); int A = gt(n) / gt(n-k); cout << n << ...
ALGO
0.999362
4.353234
653afcd4-c831-432c-afc9-588e94ec36d6
fithisux/FSL
extras/include/boost/libs/flyweight/example/custom_factory.cpp
/* We include the default components of Boost.Flyweight except the factory, * which will be provided by ourselves. */ #include <boost/flyweight/flyweight.hpp> #include <boost/flyweight/factory_tag.hpp> #include <boost/flyweight/static_holder.hpp> #include <boost/flyweight/simple_locking.hpp> #include <boost/flyweight...
TOOL
0.881091
7.778376
354e92c1-d5bb-443f-8dcd-24458431c3c4
Raj-Thombare/dsa
Recursion/nthTermFib.cpp
#include<iostream> using namespace std; int fibonacci(int n){ if(n <= 1) return n; return fibonacci(n - 1) + fibonacci(n - 2); } //0 1 1 2 3 5 8 13 21 int main(){ int n; cout << "Enter n: "; cin >> n; cout << fibonacci(n); return 0; }
ALGO
0.99959
4.811614
e64c27e0-5724-4919-80de-2b6cca1d63c9
AIZ2201/VisualCampus
demo3/opencv/sources/modules/imgproc/src/matchcontours.cpp
#include "precomp.hpp" double cv::matchShapes(InputArray contour1, InputArray contour2, int method, double) { CV_INSTRUMENT_REGION(); double ma[7], mb[7]; int i, sma, smb; double eps = 1.e-5; double mmm; double result = 0; bool anyA = false, anyB = false; HuMoments( moments(contour1),...
ALGO
0.989056
4.398113
d4f4cf1d-6088-41d4-89a4-16822c899ec6
githubwlh2014/leetcode
CountandSay.cpp
#include<iostream> #include<string> using namespace std; string convert(string& say) { char pre=say[0]; int coun=1; string tmp=""; int len=say.size(); for(int i=1;i<len;i++) { if(pre==say[i]) { coun++; }else { tmp+=char(coun+'0'); ...
ALGO
0.999981
4.1731
53a48c15-42e2-46eb-80fc-eb9ade9013f9
Maniac198/Competitve-Programming
D_Triangle_Coloring.cpp
#include <bits/stdc++.h> using namespace std; #define yes {cout<<"YES"<<endl;} #define no {cout<<"NO"<<endl;} #define int long long #define endl '\n'; #define all(x) x.begin(),x.end() #define rep(i, begin, end) for (__typeof(end) i = (begin) - ((begin) > (end)); i != (end) - ((begin) > (...
ALGO
0.999922
4.860817
2823a510-5281-46fe-9133-e3080dd6f936
Sanskar31/CodeForces-Solutions
SpecialElements.cpp
/* Author: Sanskar Agarwal Nick: sanskaragarwal Birla Institute Of Technology, Mesra */ #include <bits/stdc++.h> using namespace std; #define ll long long int #define endl "\n" #define fast ios::sync_with_stdio(0);cin.tie(0);cout.tie(0); #define F(i,a,b) for(ll i = (ll)(a); i <= (ll)(b); i++) #define RF(i,a,b) for(ll i...
ALGO
0.999899
4.252834
183a2bb7-a694-43f9-b86a-eb82d151408d
KurodaKanbei/ACM
Template of other teams/Dreadnought/SCL-collection/SuperNova/线性递推/a.cpp
// given first m a[i] and coef c[i] (0-based), // calc a[n] mod p in O(m*m*log(n)). // a[n] = sum(c[m-i]*a[n-i]), i = 1...m // i.e. a[m] = sum(c[i]*a[i]), i = 0...m-1 int linear_recurrence(LL n, int m, int a[], int c[], int p) { LL v[M] = {1 % p}, u[M<<1], msk = !!n; for(LL i = n; i > 1; i >>= 1) msk <<= 1; for(LL x...
ALGO
0.999931
3.934817
101b8fbc-4ec9-4aa1-82c6-340215a30bb3
101magikarp101/USACO
933-3/E.cpp
#include <iostream> #include <algorithm> #include <vector> #include <set> #include <queue> #include <map> #include <cmath> #include <iomanip> #include <cstring> #include <bitset> #include <string> #include <unordered_map> #include <deque> #include <climits> #include <unordered_set> using namespace std; #define ll long...
ALGO
0.999609
5.364709
98302ee2-2eef-4409-94b3-fff914999dfe
DustinMaiden/Databases
sort.cpp
#include <sys/types.h> #include <functional> #include <string.h> #include <iostream> #include <sstream> #include <vector> #include "stdlib.h" using namespace std; #include "sort.h" #define MIN(a,b) ((a) < (b) ? (a) : (b)) // These comparison functions are visible only within this // source file. reccmp is the compa...
TOOL
0.981779
5.150151
180b55f8-d4a6-4685-97b2-9ddeee96843d
Sselrats/pnote-study-algorithm
ALLERGY.cpp
#include <iostream> #include <map> #include <vector> using namespace std; int int_max = 987654321; int T; int pupil_num, food_num; map<string, int> name_to_index; vector<int> foods_eaten_by[50], pupils_who_eat[50]; int available_food_count[50]; int answer; void solve(); void get_answer(int selected_food_number); int...
ALGO
0.999908
4.299765
106bae2e-e5c6-47d8-bcb4-f028984b4256
haeunyoung/algorithmStudy
algorithm/algorithm/day33_2193.cpp
#include<iostream> using namespace std; int n; long long d[91]; long long dp(int a) { if (a == 1) return 1; if (a == 2) return 1; if (d[a] != 0) return d[a]; return d[a] = dp(a - 2) + dp(a - 1); } int main(void) { cin >> n; printf("%lld\n",dp(n)); }
ALGO
0.999982
3.766777
4a933fa8-2f27-4ab6-818f-62fe64eec124
javidscool/coding_projects
Computer Graphics/GLSL Materials/BRDFRead.cpp
// IN NO EVENT SHALL MERL BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, // OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE AND // ITS DOCUMENTATION, EVEN IF MERL HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. // MERL SPECIFICALLY DISCLAIMS ANY WARRANT...
ALGO
0.983102
6.505951