uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
68dc9c9e-107e-4832-be06-4c927d1a3cbc | Cmixed/C-_SC_work | 24.06.08 Final/T3 Online.cpp | #include <iostream>
#include <cstring>
#include <cstdlib>
using namespace std;
int EightQueen(int n) { //函数返回八皇后问题的解法个数
int *p = new int[n]; //p[8]用来存储八皇后的位置,下标表示行号,数值表示列号
//例如p[2]=3表示落在(2,3)这个点上,行号列号均为0~8
memset(p, 0, n * sizeof(int));//初始化所有p[i]=0
int k = 0; //k用来记... | ALGO | 0.999801 | 4.029045 |
2f2c50c9-868d-4949-b0f6-20e3f7352055 | ishandutta2007/codeforces | marcina007/normal/55/B.cpp | #include<algorithm>
#include<cassert>
#include<complex>
#include<map>
#include<iomanip>
#include<sstream>
#include<queue>
#include<set>
#include<string>
#include<vector>
#include<iostream>
#include<cstring>
#include<bitset>
#define FOR(i, a, b) for(int i =(a); i <=(b); ++i)
#define FORD(i, a, b) for(int i = (a); i >= (... | ALGO | 0.999975 | 3.628486 |
a251a6e2-b130-4d7a-bcb3-15ee8cbbcadc | GUUDIN/Kaishita | Hardware_Firmware/src/components/arduino/libraries/WebServer/src/Parsing.cpp | #include <Arduino.h>
#include <esp32-hal-log.h>
#include "NetworkServer.h"
#include "NetworkClient.h"
#include "WebServer.h"
#include "detail/mimetable.h"
#ifndef WEBSERVER_MAX_POST_ARGS
#define WEBSERVER_MAX_POST_ARGS 32
#endif
#define __STR(a) #a
#define _STR(a) __STR(a)
static const char *_http_method_str[] = {
#... | WEB | 0.959012 | 3.894363 |
801684e4-41c7-48ac-9bbe-0b16c524a889 | GH2005/myLeetcodeSolutions | 492. Construct the Rectangle.cpp | class Solution {
public:
vector<int> constructRectangle(int area) {
int width = sqrt(area);
while (area % width != 0) width--;
return {area/width, width};
}
};
| ALGO | 0.99926 | 6.543324 |
69c51d4d-59fb-4f72-adf9-b4524194f2b0 | Yunlong323/Sophomore_codes | c语言/积分赛.cpp | #include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <math.h>
typedef struct string{
char na[505];
int len;
}string;
int main()
{
int n=0;
freopen("data.txt","r",stdin);
while(~scanf("%d",&n))
{
getchar();
string name[500]={{0},0};
for(int i=0;i<n;i++)
{
gets(name[i].na);
name[i].len... | ALGO | 0.999909 | 3.37827 |
6137b777-9d87-4772-afed-f968c0b68a07 | xR3b0rn/dbcppp | third-party/boost/libs/spirit/classic/example/fundamental/more_calculators/vmachine_calc.cpp | ////////////////////////////////////////////////////////////////////////////
//
// The calculator using a simple virtual machine and compiler.
//
// Ported to v1.5 from the original v1.0 code by JDG
// [ JDG 9/18/2002 ]
//
////////////////////////////////////////////////////////////////////////////
#include <boost/s... | ALGO | 0.998631 | 6.031153 |
ce29019e-e151-465d-a22e-4a4a34fc0de0 | ocfbnj/Exercises | tools/records/P1135.cpp | #include <iostream>
#include <vector>
#include <queue>
#include <utility>
#include <unordered_set>
int func(const std::vector<int>& arr, int begin, int end, int n) {
std::queue<std::pair<int, int>> que;
std::unordered_set<int> set;
que.push({ begin, -1 });
while (!que.empty()) {
std::pair<int, int> cur = que.fr... | ALGO | 0.999983 | 4.17583 |
edaa9159-dda5-443f-ac26-2a3a15fb50e5 | jsren/llvm-detex | clang-tools-extra/clangd/unittests/TypeHierarchyTests.cpp | namespace clang {
namespace clangd {
namespace {
using ::testing::AllOf;
using ::testing::ElementsAre;
using ::testing::Eq;
using ::testing::Field;
using ::testing::IsEmpty;
using ::testing::Matcher;
using ::testing::Pointee;
using ::testing::UnorderedElementsAre;
// GMock helpers for matching TypeHierarchyItem.
MATC... | TEST | 0.875265 | 7.65508 |
4ac56e55-7b9d-4f03-9c3b-ee4d7e78f439 | mozilla/integration-mozilla-inbound | xpcom/ds/nsPersistentProperties.cpp | /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
#include "nsID.h"
#include "nsCRT.h"
#include "nsReadableUtils.h"
#include "nsIInputStream.h"
#include "nsUnicharInputStream.h"
#include "pratom.h"
#include "nsEnumeratorUtils.h"
#include "nsReadableUtils.h"
#include "nsPrintfCString.h"
#i... | TOOL | 0.886965 | 3.310541 |
f3df5220-5757-4508-abc1-792267479fb2 | MaSteve/UVA-problems | UVA10105.cpp | #include <iostream>
#include <unordered_map>
#include <utility>
using namespace std;
unordered_map<int, unordered_map<int, long long> > comb;
long long proc(int n, int m) {
if (m == 0 || m == n) return 1;
if (m < 0 || m > n) return 0;
if (comb[n][m] == 0) comb[n][m] = proc(n-1, m-1) + proc(n-1, m);
ret... | ALGO | 0.999975 | 3.987689 |
4cc65e6a-f265-4c6f-8369-7ef4e4c9f375 | AkankshRakesh/leetcode-solutions | 33. Search in Rotated Sorted Array.cpp | #include <iostream>
#include <vector>
using namespace std;
class Solution {
public:
int search(vector<int>& nums, int target) {
int n = nums.size();
int left = 0, right = n - 1;
while (left < right) {
int mid = left + (right - left) / 2;
if (nums[mid] > nums[right])... | ALGO | 0.999963 | 5.768635 |
e50c9c56-b759-44f5-91fe-de06442b9c9c | ploscky/cs010c | Program2/BSTree.cpp | #include <iostream>
#include <string>
#include <algorithm> //for finding max in height function
#include "BSTree.h"
using namespace std;
//constructor: empty tree-- root is just nullptr
BSTree::BSTree() : root(nullptr) {}
//destructor: keep removing the root until tree is empty (root = nullptr)
BSTree::~BSTree() {
... | ALGO | 0.99919 | 5.591499 |
a7f4c0a4-b5f8-44fd-9a2e-38e59eabcd9c | 18ivan18/DataStructuresAndProgramming2024 | week08 - BST/solutions/5.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), left(left), right(... | ALGO | 0.999996 | 6.25142 |
8ca2bc38-f7d4-4a1d-b62c-688b1646da0c | ssirawiitch/Algorithm_Design | a66_q3b_hex_map_v2/main.cpp | #include <iostream>
#include <vector>
#include <queue>
#include <tuple>
using namespace std;
// 6 directions
int dx_odd[] = {-1,-1,0,1,1,0};
int dy_odd[] = {0,1,1,1,0,-1};
int dx_even[] = {-1,-1,0,1,1,0};
int dy_even[] = {-1,0,1,0,-1,-1};
int main()
{
int r,c,a1,b1,a2,b2;
cin >> r >> c;
vector<vector<int... | ALGO | 0.999637 | 4.442254 |
13dd79b1-7b68-454d-bf14-ee184bc6fd73 | hjiang13/LLMs-in-IR | POJ-104/2/1121.cpp | #include <iostream>
using namespace std;
struct book
{
char writer[26];
int num;
struct book *next;
}
;
struct book *creat()
{
struct book *head,*p1,*p2;
int i,m;
cin >> "%d",&m);
p1=p2=(struct book *)malloc(sizeof(struct book));
head=NULL;
for(i=0; i<m; i++)
{
if(i==0) head=p1;
else p2->next=p1;
p2=p1;
p1=(struct book... | ALGO | 0.999914 | 3.379361 |
d6aa0d79-8063-463f-9e0c-8c638761596a | billtian/libgeos | source/geomgraph/EdgeEnd.cpp | #include <geos/geomgraph.h>
#include <geos/util.h>
#include <typeinfo>
#include <cmath>
#include <sstream>
namespace geos {
//CGAlgorithms* EdgeEnd::cga=new RobustCGAlgorithms();
EdgeEnd::EdgeEnd() {
this->edge=NULL;
label=NULL;
node=NULL;
dx=dy=0.0;
quadrant=0;
}
EdgeEnd::~EdgeEnd() {
// delete edge;
delete ... | TOOL | 0.869227 | 6.120787 |
5b119855-04d9-4341-940c-7e7899c7c7cf | MAMAlgorithmStudy/Programmers | Lv0/가까운 1 찾기/수혁.cpp |
#include <string>
#include <vector>
using namespace std;
int solution(vector<int> arr, int idx) {
// 결과를 저장할 변수 answer를 -1로 초기화 (찾지 못한 경우 반환할 값)
int answer = -1;
for(int t = idx; t < arr.size(); ++t)
{
// 현재 인덱스 t의 값이 1인지 확인
if(arr[t] == 1)
{
// 값이 1인 경우 answer에... | ALGO | 0.999933 | 5.525731 |
dd4eecd3-debc-4043-9637-bd59f56a513e | tpratap/LeetCode | 225-implement-stack-using-queues/225-implement-stack-using-queues.cpp | class MyStack {
queue <int> q1 ;
queue <int> q2 ;
public:
MyStack() {
queue <int> q1 ;
queue <int> q2 ;
}
void push(int x) {
while(!q1.empty()){
q2.push(q1.front()) ;
q1.pop();
}
q1.push(x);
while(!q2.empty()){
... | ALGO | 0.998395 | 4.857804 |
10cccc32-ae09-4a6f-b400-7970264ad499 | sfofgalaxy/Second-Year-Summary-of-Software-Engineering-Coursework-in-Zhejiang-University | 面向对象程序设计/教师内部资料/新教材/OOP/OOP even numbered exercise/Exercise12_34.cpp | #include <iostream>
#include <ctime> // for time function
#include <cstdlib> // for rand and srand functions
#include <vector> // to store answers
using namespace std;
bool contains(vector<int> v, int answer)
{
for (unsigned i = 0; i < v.size(); i++)
if (v[i] == answer)
return true;
return false;
}
int... | ALGO | 0.981578 | 4.187217 |
399914ec-5b00-452d-8c1e-6ecb13f2e1c3 | oluteo/CSE-232 | hw 05/CharIncreasing/main.cpp | // WRITE YOUR CODE HERE
#include <iostream>
using std::cout;
using std::cin;
using std::endl;
int main() {
char c;
char c_pre = '\0';
cin>>std::noskipws;
while (cin>>c){
if (c == '\n'){
cout<<c;
c_pre = '\0';
}
else if ( (c > c_pre|| c_pre == '\0')){
cout<<c;
c_pre = c;
}
else{
cout<<"_";
}
c_pre ... | ALGO | 0.998061 | 3.790432 |
67491776-fe22-44a1-bca2-dd815402635f | Rishi838/code-freak | cpp/Vishal Dubey/Anton and danik.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int n,count=0,t=0;
cin>>n;
string s;
cin>>s;
for(int i=0;i<n;i++){
if(s[i]=='D'){
count++;
}
if(s[i]=='A'){
t++;
}
}
if(count>t){
cout<<"Danik"<<endl;
}
else
if(count<t){
cout<<"Anton"<<endl;
}
else
... | ALGO | 0.999971 | 3.679185 |
4d2ebd05-0a01-477d-a18c-d8a95642b33c | Vishalbhardwj/Cplusplus | PROGRAMS/01Mathematics/07Lcm.cpp | #include<iostream>
using namespace std;
#include<math.h>
int Gcd(int c,int d){
if(d==0){
return c;
}
return Gcd(d,c%d);
}
int Lcm(int c,int d){
return (c*d)/Gcd(c,d);
}
int main(){
// Way 1
// int a,b;
// cin>>a>>b;
// int r=max(a,b);
// while(true){
// if(r%a==0&&... | ALGO | 0.99981 | 4.381352 |
90da6eb9-5848-4a65-ad9f-46e3423faa8e | AnoopSingh07/DBMS-Project | B+Tree/AcceptedB+tree2Level.cpp | #include <bits/stdc++.h>
using namespace std;
class rootNode
{
public:
int indicator, ind;
rootNode *next;
rootNode(int indicator, int ind)
{
this->indicator = indicator;
this->ind = ind;
next = NULL;
}
static vector<vector<int>> bucketList;
static rootNode *first;... | ALGO | 0.999922 | 4.355601 |
41828be5-706f-491e-b7bf-7245d95ad175 | Forsyth-Creations/ForsythCreations | Marlin Builds/AstroEnder3/Marlin/src/feature/bedlevel/ubl/ubl_motion.cpp | #include "../../../inc/MarlinConfig.h"
#if ENABLED(AUTO_BED_LEVELING_UBL)
#include "../bedlevel.h"
#include "../../../module/planner.h"
#include "../../../module/stepper.h"
#include "../../../module/motion.h"
#if ENABLED(DELTA)
#include "../../../module/delta.h"
#endif
#include "../../../MarlinCore.h"
#include <m... | ALGO | 0.987404 | 7.586849 |
aa029fe0-becb-4b22-b4ef-b4f273c95fbd | aashimasaxena91/Data-Structures-and-Algorithms | 0257-binary-tree-paths/0257-binary-tree-paths.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.999898 | 5.575797 |
b663ebf5-af01-4218-85ba-d87c0a4c86c4 | gradientspace/UnrealMeshProcessingTools | UE4.24/IGLMeshProcessingProject/Plugins/MeshProcessingPlugin/ThirdParty/libigl/include/igl/copyleft/cork/mesh_boolean.cpp | template <
typename DerivedVA,
typename DerivedFA,
typename DerivedVB,
typename DerivedFB,
typename DerivedVC,
typename DerivedFC>
IGL_INLINE void igl::copyleft::cork::mesh_boolean(
const Eigen::PlainObjectBase<DerivedVA > & VA,
const Eigen::PlainObjectBase<DerivedFA > & FA,
const Eigen::PlainObjectBa... | ALGO | 0.972924 | 6.907867 |
d21c796d-4b84-45a1-a3be-e528b7d1f18d | Libaier/ABC | 算法/leetcode/29-Divide Two Integers.cpp | // 29. Divide Two Integers My Submissions QuestionEditorial Solution
// Total Accepted: 63073 Total Submissions: 404916 Difficulty: Medium
// Divide two integers without using multiplication, division and mod operator.
// If it is overflow, return MAX_INT.
// Subscribe to see which companies asked this question
// 这... | ALGO | 0.999964 | 5.234888 |
8eca1820-1177-4eae-a940-a1c19baa624f | rennaMAhcuS/PlagiarismChecker | autograder/phase2/phase1_submissions/23b0948_23b0942_23b1079.cpp | #include <array>
#include <iostream>
#include <span>
#include <vector>
#include <cmath>
// -----------------------------------------------------------------------------
#include <algorithm>
#include <set>
#include <map>
#include <stack>
#define MAX_MOD 1000000007
#ifdef DEBUG
#undef DEBUG
#endif
#ifndef NDEBUG
#def... | ALGO | 0.999566 | 4.672786 |
424ef1ee-0510-4a5c-b6a0-325d8fd30943 | mukeshlraj/GCL-42 | Class-11/queue_using_two_stacks.cpp | #include<iostream>
#include<vector>
using namespace std;
class Queue {
stack<int> s1;
stack<int> s2;
public:
// TC : O(1)
void queue_push(int x) {
s1.push(x);
}
int queue_pop() {
if (s1.empty()) {
cout<<"Performing pop on empty queue";
return -1;
... | ALGO | 0.998556 | 5.15032 |
f591b2fb-cc55-4e69-9ce8-04a21de77143 | jesuswr/cp-codes-and-problems | A.equation.cpp | #include <iostream>
#include <vector>
#include <queue>
#include <stack>
#include <algorithm>
#include <math.h>
#include <string>
#include <cstring>
#include <set>
#include <map>
#include <unordered_map>
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<int,pair<int,int>> piii;
typedef... | ALGO | 0.999302 | 3.355295 |
0573167a-60a7-4863-9f5c-f75a7a6f56fd | 1119-2916/competitive-programming | atcoder/comp/flyer/18/qual/d.cpp | #include <bits/stdc++.h>
using namespace std;
#define INF 1001000100010001000
#define MOD 1000000007
#define EPS 1e-10
#define int long long
#define rep(i, N) for (int i = 0; i < N; i++)
#define Rep(i, N) for (int i = 1; i < N; i++)
#define For(i, a, b) for (int i = (a); i < (b); i++)
#define pb push_back
#define eb ... | ALGO | 0.999778 | 4.024846 |
a0a7af65-5c9d-4f0d-b528-baa9d6135f15 | maet98/competitive_programming | codeforces/b.cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
long long x;
cin >> x;
long long c = 1;
vector<int>a(10,1);
int i = 0;
while(c < x){
c/=a[i];
a[i]++;
c*=a[i];
i++;
i%=10;
}
string code = "codeforces";
for(int i = 0;i <10;i++){
... | ALGO | 0.99996 | 3.442346 |
fc988a2a-26b5-45cc-b3d1-2e02ac3e1a1b | vestatus/wolves | src/models/animals/ai/ai.cpp | #include "../../../../inc/tools/algorythms.hpp"
pair<float, float> Animal::decideWhereToGo() {
if (type == AnimalType::HARE) {
#include "hare_ai.cpp"
} else if (type == AnimalType::WOLF) {
#include "wolf_ai.cpp"
}
} | ALGO | 0.998751 | 4.91787 |
625368b9-019c-402c-ade4-6f7325c3b350 | aadil124/Data-Structure-and-Algorithm-Assignments | Mypractice/patterns/numberPattern.cpp | #include<iostream>
using namespace std;
void numberPattern(int n){
for(int i=1; i<=n; i++){
for(int j=1;j<=n-i;j++){
cout<<" ";
}
for(int k=1; k<=i;k++){
cout<<k<<" ";
}
cout<<endl;
}
}
int main(){
int n;
cout<<"Enter rows for print number pattern: ";
cin>> n;
nu... | ALGO | 0.999143 | 4.0787 |
ab10e787-5a3f-44ea-aeaf-fd4b181894f5 | gs252525/scpc_solution | 2024-1차/mo_right_solution.cpp | #include <bits/stdc++.h>
#include <array>
using namespace std;
#define rep(i, n) for (int i = 0; i < n; i++)
#define rrep(i, n) for (int i = 1; i <= n; i++)
#define all(v) (v).begin(), (v).end()
#define ll long long
#define pb push_back
#define ff first
#define ss second
const int MAXN = 50100;
int psum[MAXN][400]... | ALGO | 0.999851 | 4.02748 |
f9e264d1-871a-422a-a186-de44b9799dfa | abhisg/allcodes | dij.cpp | #include<cstdio>
#include<vector>
#include<queue>
#include<algorithm>
#include<cstring>
#define SIZE 200
using namespace std;
typedef struct edge
{
int tail;
long long int weight;
}edge;
typedef struct node
{
bool visited;
long long int weight;
vector<edge> links;
}node;
node graph[SIZE];
vector<int> current;
//... | ALGO | 0.999339 | 3.719947 |
4155f09e-b9c2-4e70-bb8d-fa9d42301ccb | abhaygupta08/Hacktober-2022 | Arrays-CPP/014Kadane_sum.cpp | //constraints n<=10
#include<iostream>
#include<math.h>
using namespace std;
int kadane(int a[],int n){
// int x[10];
// int final=a[0];
// x[0]=a[0];
// for(int i=1;i<n;i++){
// x[i]=max(a[i],a[i]+x[i-1]);
// if(x[i]>final){
// final=x[i];
// }
// }
int final=a[0]; // let a[0] is max or the answer
... | ALGO | 0.999933 | 4.105002 |
34fb9bfc-cb22-4be0-a35f-aae2e88e1ce8 | harun-u-r-rashid/XPSC | 1st week/Day 03/A - Discount.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
double A,B; cin>>A>>B;
double ans = ((A-B)/A)*100;
cout<<ans<<"\n";
return 0;
}
| ALGO | 0.999843 | 3.695696 |
c8f9e72f-d207-4f85-b064-460ba86dabd3 | PrathamSharma1510/Cpp-Practice | CB/LinkList/oddeven2.cpp | #include <iostream>
using namespace std;
class node
{
public:
int data;
node *next;
node(int data)
{
this->data = data;
next = NULL;
}
};
void pushback(node *&head, int d)
{
if (head == NULL)
{
head = new node(d);
return;
}
node *tail = head;
while... | ALGO | 0.999996 | 4.35738 |
345e9c4e-cd52-413c-b6c0-78d32a76a34d | Weijun-H/PAT | BasicLevel/1032.挖掘机技术哪家强/1032.挖掘机技术哪家强/1032.挖掘机技术哪家强.cpp | #include<cstdio>
#include<algorithm>
using namespace std;
int main() {
int num_people;
scanf_s("%d", &num_people);
int* p = new int[num_people];
fill(p, p + num_people, 0);
for (size_t i = 0; i < num_people; i++)
{
int a, b;
scanf_s("%d%d", &a, &b);
p[a] += b;
}
int max = p[0], id = 0;
for (size_t i = 0... | ALGO | 0.999874 | 3.824705 |
0e9bbbe1-6684-4419-8ae3-cb8b159d0149 | tomalbrc/ProceduralTerrainGeneration | Extern/bullet3/src/BulletCollision/CollisionDispatch/btDefaultCollisionConfiguration.cpp | #include "btDefaultCollisionConfiguration.h"
#include "BulletCollision/CollisionDispatch/btConvexConvexAlgorithm.h"
#include "BulletCollision/CollisionDispatch/btEmptyCollisionAlgorithm.h"
#include "BulletCollision/CollisionDispatch/btConvexConcaveCollisionAlgorithm.h"
#include "BulletCollision/CollisionDispatch/btCom... | TOOL | 0.931576 | 6.795847 |
a3e98cfa-86e5-4f11-868d-f0c974db05b7 | Grav1tum/algorithm | codeforce/cf972-div2/B_hard.cpp | #include<bits/stdc++.h>
using namespace std;
#define fast ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define ll long long
int a[200005];
int main(){
fast;
int t;
cin >> t;
while(t--){
int n, m, q;
cin >> n >> m >> q;
for (int i = 1; i <= m; ++i){
cin >> a[i];
... | ALGO | 0.999984 | 3.533254 |
c2d2d07d-036d-4142-afaf-028b1b90ff1b | FreCap/telnet-boost | ext/boost_1_59_0/libs/bimap/example/mi_to_b_path/mi_bidirectional_map.cpp | /******************************************************************************
Boost.MultiIndex
******************************************************************************/
#include <boost/config.hpp>
//[ code_mi_to_b_path_mi_bidirectional_map
#include <iostream>
#include <boost/tokenizer.hpp>
#include <boost/m... | ALGO | 0.953655 | 6.431124 |
eaac9deb-ac82-4b61-811f-95c253ff31a1 | renbaoshuo/OI-codes | S2OJ/1898/1898.cpp | #include <iostream>
#include <algorithm>
#include <iterator>
using std::cin;
using std::cout;
const char endl = '\n';
const int N = 2005;
const int mod = 1e9 + 9;
int n, k, inv[N], fac[N], inv_fac[N], a[N], b[N], l[N], f[N][N], g[N], ans;
inline int C(int n, int m) {
return static_cast<long long>(fac[n]) * inv_... | ALGO | 0.999993 | 4.194676 |
bada068f-d21c-4e0f-989a-57acdecdfc52 | ishandutta2007/codeforces | fqw/normal/715/A.cpp | #include <algorithm>
#include <cassert>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <limits>
#include <memory>
#include <queue>
#include <sstream>
#include <string>
#include <vector>
using namespace std;
#define all(a) (a).begin(), (a).end()
#define sz(a) stati... | ALGO | 0.999866 | 3.415834 |
b58b9231-2c96-4124-ac77-7de55525faa6 | Siddhesh-Bagade149/DSA-codes | LINKED LIST/2doubly_LL.cpp | #include <iostream>
using namespace std;
class Node
{
public:
int data;
Node *prev;
Node *next;
// constructor
Node(int d)
{
this->data = d;
this->prev = NULL;
this->next = NULL;
}
};
void print(Node *head, Node *tail)
{
Node *temp = head;
while (temp !... | ALGO | 0.999676 | 5.145409 |
21b72c67-6bb6-4d94-8233-dc11510c301c | elador/FeatureDetection | libImageIO/src/imageio/SimpleModelLandmarkFormatParser.cpp | /*
* SimpleModelLandmarkFormatParser.hpp
*
* Created on: 29.05.2014
* Author: Patrik Huber
*/
#include "imageio/SimpleModelLandmarkFormatParser.hpp"
#include "boost/lexical_cast.hpp"
#include "boost/algorithm/string.hpp"
#include "boost/filesystem.hpp"
#include <stdexcept>
#include <utility>
#include <fstre... | TOOL | 0.924019 | 6.175287 |
ff98a6be-6d07-4e07-a9f5-a42a7397a105 | Volgarenok/spbspu-labs-2025-aads-a | demehin.maxim/S1/main.cpp | #include <iostream>
#include <utility>
#include <string>
#include <algorithm>
#include <list/list.hpp>
#include <calc_utils.hpp>
namespace
{
using ListOfUll = demehin::List< unsigned long long >;
using ListOfPairs = demehin::List< std::pair< std::string, ListOfUll > >;
size_t defineMaxSize(const ListOfPairs& pa... | ALGO | 0.934671 | 5.268226 |
8c06b250-0bd4-4053-82ec-380e46aba72c | tngus211/learn_cpp_basic | ch05/t520.cpp | //[Lab]프로그램 5-20 거듭제곱 구하기
/* 반복문을 사용해서 밑을 지수의 수만큼 곱해서 거듭제곱을 구하는 프로그램*/
#include <iostream>
using namespace std;
int main()
{
int base, exponent;
unsigned long int power, temp;
bool overflow;
do
{
cout << "밑을 음수가 아닌 정수로 입력 : ";
cin >> base;
} while (base < 0);
do
{
... | ALGO | 0.999569 | 4.73093 |
c353a19b-58d4-4f9c-95c9-f052df50a227 | ChandlerNgo/CP | Contest2044/A.cpp | #include <bits/stdc++.h>
typedef long long ll;
using namespace std;
int main(){
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int t;
cin >> t;
while(t--){
int n;
cin >> n;
cout << n-1 << endl;
}
} | ALGO | 0.999645 | 4.284136 |
c3f83c4e-2114-4f18-9827-307e6cc35068 | ishandutta2007/codeforces | qwqcorz/normal/1028/D.cpp | #include<bits/stdc++.h>
using namespace std;
const int N=4e5+5;
const int p=1e9+7;
int read()
{
int s=0;
char c=getchar(),lc='+';
while (c<'0'||'9'<c) lc=c,c=getchar();
while ('0'<=c&&c<='9') s=s*10+c-'0',c=getchar();
return lc=='-'?-s:s;
}
void write(int x)
{
if (x<0)
{
putchar('-');
x=-x;
}
if (x<10) pu... | ALGO | 0.999973 | 4.335891 |
64517a79-d5f6-420b-ae62-d823cca6f340 | axel99andersson/px4-firmware | src/lib/lat_lon_alt/lat_lon_alt.cpp | #include "lat_lon_alt.hpp"
using matrix::Vector3f;
using matrix::Vector3d;
using matrix::Vector2d;
LatLonAlt LatLonAlt::fromEcef(const Vector3d &p_ecef)
{
// Convert position using Borkowski closed-form exact solution
// P. D. Groves, "Principles of GNSS, inertial, and multisensor integrated navigation systems, 2nd... | TOOL | 0.963489 | 7.285411 |
f9d82c5f-bc36-4e80-b4af-40fc8fd2b003 | RibhavBansal/LeetCode | first-unique-character-in-a-string/first-unique-character-in-a-string.cpp | class Solution {
public:
int firstUniqChar(string s) {
int n = s.size();
map<char,int>mp;
int id = -1;
for(int i = n-1; i >= 0; i--){
mp[s[i]] += 1;
}
for(int i = n-1; i >= 0; i--){
if(mp[s[i]] == 1) id = i;
}
return id... | ALGO | 0.999753 | 6.009341 |
68645774-6f3b-47b5-923e-567b81999ec1 | Takaaki-Saeki/Algorithms | atcoder/collatz.cpp | #include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
int main()
{
int s;
cin >> s;
int m = 1000010;
vector<int> v(m+1);
v[0] = -1;
v[1] = s;
for(int i=1; i<m; i++){
if(i % 2 == 0) v[i+1] = 1 / 2;
else v[i+1] = 3 * i + 1;
}
int ans;
for(i... | ALGO | 0.999898 | 3.714052 |
abcb640c-a350-4675-a426-8317795a6004 | ishandutta2007/codeforces | darkkcyan/normal/560/A.cpp | #include <iostream>
using namespace std;
int main() {
int n; cin >> n;
bool has1 = false;
for (int a, i = 0; i < n; ++i) cin >> a, has1 |= a == 1;
if (has1) cout << -1;
else cout << 1;
return 0;
} | ALGO | 0.999781 | 3.792667 |
25ff633d-d3d1-4533-bdc6-6b7cbbb7b0b4 | 778477/LeetCode | 00072. Edit Distance.cpp |
//Accepted 25 ms cpp
class Solution {
public:
int minDistance(string word1, string word2) {
int n = word1.size();
int m = word2.size();
if(0 == n || 0 == m) return max(n,m);
int dp[n+1][m+1];
for(int i=0;i<=n;i++) dp[i][0] = i;
for(int i=0;i<=m;i++) dp[0][i]... | ALGO | 0.999995 | 5.965474 |
a3eb981c-e0e2-4535-9d12-1554ddaee03f | deepaklowanshi10x/DSA-VS-CODE | Operators and For loop/Bitwise.cpp | // AND & , OR | ,NOT ~ , XOR ^;
#include <iostream>
using namespace std;
int main()
{
int a = 4, b = 6;
cout << (a & b) << endl;
cout << (a | b) << endl;
cout << (~a) << endl;
cout << (a ^ b) << endl;
} | ALGO | 0.990363 | 4.435197 |
8434733e-e134-48c7-a973-0d00aa97bd72 | ishandutta2007/codeforces | dlalswp25/normal/1523/E.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int MX = 200000;
const ll MOD = 1000000007;
int N, K;
ll F[202020];
ll I[202020];
ll pw(ll a, ll b) {
ll ret = 1;
while(b) {
if(b & 1) ret = ret * a % MOD;
a = a * a % MOD;
b >>= 1;
}
return ret;
}
ll inv(ll x) { return pw(x, MOD -... | ALGO | 0.999946 | 4.407098 |
10b0c729-622d-49e5-83a1-1067c032ee88 | 113bommy/deepmind_codecontests_refine | cpp_source_filter_file/cpp_train_4395_16.cpp | #include <bits/stdc++.h>
using namespace std;
const unsigned _mod = 998244353;
const unsigned mod = 1e9 + 7;
const long long infi = 0x3f3f3f3f3f3f3f3fll;
const int inf = 0x3f3f3f3f;
long long ksm(long long x, long long y) {
long long ret = 1;
while (y) {
if (y & 1ll) ret = ret * x % mod;
y >>= 1ll;
x = ... | ALGO | 0.999988 | 4.398695 |
f2a07619-9f4a-4e2d-8ad1-d8680b171e5d | kudotoan/PTIT-THCS2 | C01172.cpp | #include <stdio.h>
void sapxepchon(int n, int a[]) {
for (int i=0; i<n-1; i++) {
int min=a[i];
int nho=i;
for (int j=i+1; j<n; j++) {
if (a[j]<min) {
min=a[j];
nho=j;
}
}
a[nho]=a[i];
a[i]=min;
for (int i=0; i<n; i++) printf("%d ",a[i]);
printf("\n");
}
}
main () {
int n;
scanf("%d",&n... | ALGO | 0.999966 | 3.919107 |
0ca0dee0-213b-4573-a609-70b2e47c5775 | DanceManiac/Gamma-Ray-Engine | SDK/sources/MagicSoftware/FreeMagic/Source/Containment2D/MgcCont2DMinBox.cpp | #include "MgcCont2DMinBox.h"
using namespace Mgc;
//----------------------------------------------------------------------------
Box2 Mgc::MinBox (int iQuantity, const Vector2* akPoint)
{
// The input points are V[0] through V[N-1] and are assumed to be the
// vertices of a convex polygon that are counterclock... | ALGO | 0.999854 | 7.619165 |
947787e2-21bf-4452-93a4-c236230bae49 | huntrag/CSESAndOtherSamples | SortingandSearching/27_Subarray_Sums_I.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef vector<ll> vi;
typedef vector<vector<ll>> vii;
#define MOD 1e9 + 7
#define fi first
#define se second
int main()
{
#ifndef ONLINE_JUDGE
freopen("input.txt", "r", stdin);
freopen("output.txt", "w", stdout);
#endi... | ALGO | 0.999982 | 4.451169 |
f9667805-6996-4457-a353-64ca3dba15c6 | mayankrajput123/DSA-Problem-Practice | 0326-power-of-three/0326-power-of-three.cpp | class Solution {
public:
bool isPowerOfThree(int n) {
if(n==0){
return false;
}
while(n>0){
if(n==1){
return true;
}
if(n%3 != 0){
break;
}
n = n/3;
}
return false;
}
... | ALGO | 0.999607 | 5.772951 |
955cdb8e-fa56-4a58-874d-c76413d05b8f | megait004/28tech-oj | vonglap/bai35vonglaptochuc.cpp | #include<iostream>
using namespace std;
int main(){// in tam giác cân ngược thì chỉ cần cho i chạy từ n về 1 còn bên trong vòng for j đã có công thức
int n ; cin >> n;
// code for của j thì giống bài 33
for(int i = n ; i >= 1 ; i--){
for( int j = 1 ; j <= n - i ; j ++){
cout << " " << " ";
}
for(int j = 1 ... | ALGO | 0.999938 | 3.339138 |
75f1fcd3-d271-4ae9-8a90-f3416ca57252 | ggjae/Algorithm-CS | cpp/dp/11055-2.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main(){
int n;
vector<int> a;
int dp[1001];
cin >> n;
for(int i=0;i<n;i++){
int tmp;
cin >> tmp;
a.push_back(tmp);
dp.push_back(tmp);
}
dp[0] = a[0];
for(int i=1;i<n;i++){
... | ALGO | 0.999946 | 3.835391 |
0039a410-5ce3-45c2-b83e-46ddac9b59d5 | Jac96/Tesi | Tesi-DPDK/mysql-8.0.21/extra/icu/source/i18n/string_segment.cpp | #include "unicode/utypes.h"
#if !UCONFIG_NO_FORMATTING
// Allow implicit conversion from char16_t* to UnicodeString for this file:
// Helpful in toString methods and elsewhere.
#define UNISTR_FROM_STRING_EXPLICIT
#include "numparse_types.h"
#include "string_segment.h"
#include "putilimp.h"
#include "unicode/utf16.h"... | TOOL | 0.943598 | 7.329206 |
b91108c3-7fcc-4459-a0de-f723749126d5 | prashkrans/DSA | 7. Stacks and Queues/Stacks/4. Daily Temperatures (LC#739).cpp | /* Stack Problem 3 - LC#739. Daily Temperatures
Given an array of integers temperatures represents the daily temperatures, return an array answer such that answer[i]
is the number of days you have to wait after the ith day to get a warmer temperature. If there is no future day for
which this is possible, keep answer[... | ALGO | 0.999972 | 6.649843 |
8af729c2-3ce7-47e1-a6a8-4e1a1a4d68c2 | germanohn/competitive-programming | codeforces/719-b.cpp | #include <bits/stdc++.h>
#define ff first
#define ss second
#define pb push_back
#define mp make_pair
#define debug(args...) fprintf (stderr, args)
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
// ATENCAO: cuidado com as variáveis dadas no exercício, nao as reutilize
const int MAX = 100005;
... | ALGO | 0.999743 | 3.64056 |
d5501099-b70f-4ddd-aa3d-cce15b63b287 | josecastillo100/codigosestructuradedatos | Periodo 2/Clase 1/Declaracion_Arreglos2.cpp | #include <iostream>
#include <iomanip>
int main(int argc, const char * argv[])
{
using namespace std;
//Declarar e inicializar arreglo de 10 enteros
int numeros[10] = {23, 7, 9, 52, 41, -4, 35, 16, 0, 18};
//Imprimir valores del arreglo
cout << "Indice\tValor\n------\t-----\n";
for(int i= 0; i < 10; i++)
{
... | ALGO | 0.954381 | 4.0681 |
237db16a-e282-4ffa-9f70-2d2026c18dcc | kartikeyagg/Practice-Cpp | cf_ceil_and_flowers322.cpp | #include<bits/stdc++.h>
using namespace std;
#define mod int(1e9+7)
#define ll long long
int main()
{
ios_base::sync_with_stdio(false);
vector<int> vec(3,0);
for (int i = 0; i < 3; i++)
{
cin>>vec[i];
}
sort(vec.begin(),vec.end());
vector<int> arr = vec;
// int high = vec[... | ALGO | 0.999986 | 3.865341 |
2ee8ff3b-ea17-4874-a201-d241a39f6d9a | kmjp/procon | leetcode/biweekly/081-120/095/2525.cpp | #include <bits/stdc++.h>
using namespace std;
typedef signed long long ll;
#undef _P
#define _P(...) (void)printf(__VA_ARGS__)
#define FOR(x,to) for(x=0;x<(to);x++)
#define FORR(x,arr) for(auto& x:arr)
#define FORR2(x,y,arr) for(auto& [x,y]:arr)
#define ALL(a) (a.begin()),(a.end())
#define ZERO(a) memset(a,0,sizeof(a)... | ALGO | 0.995304 | 4.102936 |
af5d5065-9e74-43ed-957d-882ee74dc3bb | roobiul/codeforce | A. YES or YES.cpp | #include<iostream>
#include<string>
#include<bits/stdc++.h>
using namespace std;
int main () {
int t;
cin >> t;
string s;
while(t--)
{
cin >>s;
if (s=="YES" || s=="Yes"|| s=="YEs" || s=="YeS"|| s=="yes"|| s=="yES"|| s=="yEs"||s=="yeS")
{
cout << "YES"<<endl;
}
else{
cout << "... | ALGO | 0.998986 | 4.437914 |
1ac73689-6063-40db-96ff-c81d38a67b13 | SEDS/OASIS | oasis/EINode/Configuration.cpp | // $Id: Configuration.cpp 2097 2012-01-08 17:52:08Z dfeiock $
#include "Configuration.h"
#if !defined (__OASIS_INLINE__)
#include "Configuration.inl"
#endif
#define BOOST_SPIRIT_DEBUG_INDENT 2
#include "boost/config/warning_disable.hpp"
#include "boost/spirit/include/qi.hpp"
#include "boost/spirit/include/phoenix_b... | CONFIG | 0.893137 | 6.960157 |
2a6892fa-1acb-4d30-a6b8-21743b2e91db | WhereIsHeroFrom/cpp_advanced_data_structure | 10、树状数组/10-3 刷题实战/10-3-1 排序/main.cpp | #include <iostream>
#include <vector>
using namespace std;
template<class T>
class FenwickTree {
private:
vector<T> m_tree;
int lowbit(int x); // 12 -> 1100 lowbit -> 100
public:
FenwickTree(int n) : m_tree(n + 1, 0) {}
void Update(int idx, T val);
T Query(int idx);
T Query(int l, int r);
};
... | ALGO | 0.999972 | 4.679522 |
bfb4cc26-86e0-43ff-9728-84ab77d0c9b1 | ishandutta2007/codeforces | kmjp/normal/1477/B.cpp | #include <bits/stdc++.h>
using namespace std;
typedef signed long long ll;
#define _P(...) (void)printf(__VA_ARGS__)
#define FOR(x,to) for(x=0;x<(to);x++)
#define FORR(x,arr) for(auto& x:arr)
#define FORR2(x,y,arr) for(auto& [x,y]:arr)
#define ALL(a) (a.begin()),(a.end())
#define ZERO(a) memset(a,0,sizeof(a))
#define ... | ALGO | 0.999891 | 3.38826 |
d8982cfa-b974-4086-991f-2a1422d1982e | imabhinavdev/LeetCode-Problems | container_with_water.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
vector<int> height = {1, 8, 6, 2, 5, 4, 8, 3, 7};
int l = 0, r = height.size() - 1;
cout << r << endl;
int area = 0;
while (1)
{
int left = height[l];
cout << left << endl;
int right = height[r];
cout << ... | ALGO | 0.999722 | 3.42532 |
6529a8bd-e438-4727-a1f1-f6168ef834b9 | houhaien/structure_data | 15.Double_arr_trie.cpp | /*************************************************************************
> File Name: 15.Double_arr_trie.cpp
> Author: houhaien
> Mail: github.com/houhaien
> Created Time: 2019年11月14日 星期四 11时17分39秒
************************************************************************/
#include <iostream>
#include <cstdio>
... | ALGO | 0.999892 | 4.021959 |
4cf55481-0a7e-49f5-b5ac-e8759331fdcb | HCRL-ALLSTAR/makeDucation_library | lib/HCRL_EDU/utility/quaternionFilters.cpp |
// Implementation of Sebastian Madgwick's "...efficient orientation filter
// for... inertial/magnetic sensor arrays"
// (see http://www.x-io.co.uk/category/open-source/ for examples & more details)
// which fuses acceleration, rotation rate, and magnetic moments to produce a
// quaternion-based estimate of absolute d... | ALGO | 0.994232 | 6.421824 |
6f97e00f-503d-4889-8976-a2f0742d26fc | kuskbee/line-break-remover | line-break-remover/line-break-remover.cpp | // line-break-remover.cpp
//
#include "framework.h"
#include "line-break-remover.h"
#include <string>
#define MAX_LOADSTRING 100
// resource
#define ID_EDIT 100
// ui
#define WINDOW_WIDTH 350
#define WINDOW_HEIGHT 280
#define EDIT_X 10
#define EDIT_Y 10
#define EDIT_WIDTH 300
#define EDI... | TOOL | 0.951174 | 4.695543 |
690d1031-d600-49a3-9323-68ccf4317ac5 | SMiles02/CompetitiveProgramming | Codeforces/CF 1600 - 1699/CF1659/CF1659A.cpp | #include <bits/stdc++.h>
using namespace std;
void solve() {
int n, r, b;
cin >> n >> r >> b;
vector<int> v(b * 2 + 1, 1);
r -= b + 1;
while (r > 0)
for (int i = 0; i < b * 2 + 1 && r--; i += 2)
++v[i];
for (int i = 0; i < b * 2 + 1; ++i)
while (v[i]--) {
... | ALGO | 0.998624 | 4.29267 |
7c7dac9a-94e5-4524-9458-1a2f12d9e645 | yitati/LCProject | Lcode/SquareRootI.cpp | /*
* Laicode_SquareRootI.cpp
*
Given an integer number n, find its integer square root.
Assumption:
n is guaranteed to be >= 0.
Example:
Input: 18, Return: 4
Input: 4, Return: 2
*/
#include <iostream>
using namespace std;
// Binary search solution
int sqrt(int x)
{
long lhs = 1, rhs = x;
while(lhs + 1 < ... | ALGO | 0.999818 | 4.917902 |
39d97c80-e242-47d4-823c-b45c5e4a4a3c | limecaster/mlp-classifier-cpp | test.cpp | #include <iostream>
#include <xtensor/xarray.hpp>
#include <xtensor-blas/xlinalg.hpp>
#include <tensor/xtensor_lib.h>
using namespace std;
int main(){
xt::xarray<double> X = {1, 2, 3};
xt::xarray<double> Y = {4, 5, 6};
//cout << outer_stack(X, xt::transpose(Y)) << endl;
cout << xt::linalg::outer(X, Y... | ALGO | 0.884745 | 3.98895 |
5e8b1170-811b-4073-ae6f-d573ad56761f | ry0u/SRM | SRM337/AnagramList.cpp | // BEGIN CUT HERE
// END CUT HERE
#line 5 "AnagramList.cpp"
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define REP(i,k,n) for(int i=k;i<(int)(n);i++)
#define each(it,v) for(__typeof((v).begin()) it=(v).begin();it!=(v).end();it++)
#define INF 1<<30
#define mp make_pair
#define fi first
#def... | ALGO | 0.999994 | 5.37882 |
6a369fe0-c665-48f8-b091-3845c6e7bf7b | yeshengm/SJTU_OJ | hw/1207assign.cpp | #include <iostream>
#include <iomanip>
using namespace std;
int kcfront, hcfront, kcrear, hcrear;
int kc[25000], hc[25000];
int N;
int systime = 0;
bool existhc();
bool existkc();
bool existfourkc();
int main()
{
kcfront = hcfront = 20000;
kcrear = hcrear = kcfront + 1;
cin >> N;
int cartype, currtime;
for (i... | ALGO | 0.998667 | 3.803947 |
10b09d22-ebb0-4e17-bad9-17c44311a239 | itsme-aparna/DSA-Resources | 79-word-search/79-word-search.cpp | class Solution {
public:
bool isValid(vector<vector<char>>& board, int x, int y){
int n = board.size();
int m = board[0].size();
if(x<0 || x>n-1 || y<0 || y>m-1){
return false;
}
return true;
}
bool recur(vector<vector<char>>& board, string word,... | ALGO | 0.999704 | 6.248132 |
60621943-b9dd-4091-a5b9-e3caee27b84d | ishandutta2007/codeforces | ei133333/normal/856/A.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
std::mt19937 rnd((unsigned) time(NULL));
int T;
cin >> T;
while(T--) {
int N, A[100];
cin >> N;
for(int i = 0; i < N; i++) {
cin >> A[i];
}
cout << "YES" << endl;
bool v[2000001] = {};
vector< int > vs;
while(... | ALGO | 0.999818 | 4.012476 |
06d3fae8-010a-4714-9a40-cf7051f79dc1 | Naseemmm/DSA-Coding | 283-move-zeroes/283-move-zeroes.cpp | class Solution {
public:
void moveZeroes(vector<int>& nums) {
int n=nums.size();
int left=0;int right=0;
if(n==0){
return;
}
while(right<nums.size()){
if(nums[right]==0){
right++;
}
else{
swap(nums[left],nums[right]);
... | ALGO | 0.999952 | 6.287767 |
60cf41e1-d6f0-4192-82c1-18f77efc8346 | Viritha-D/CodeNest | Minimize_platform.cpp.cpp | #include<iostream>
using namespace std;
void sorting(int arr[],int n){
for(int i=0;i<n-1;i++){
for(int j=0;j<n-i-1;j++){
int temp=arr[j];
if(arr[j]>arr[j+1]){
arr[j]=arr[j+1];
arr[j+1]=temp;
}
}
}
}
int minimize_platform(int arr[],int dep[],int n){
int pc... | ALGO | 0.999973 | 4.951817 |
4abe5775-cffa-4cc0-9cf3-b9667b044cba | QlQlqiqi/cmu-15-445-lab | src/buffer/lru_k_replacer.cpp | #include "buffer/lru_k_replacer.h"
#include <common/logger.h>
#include <cstddef>
#include <memory>
#include <ostream>
#include <queue>
#include "common/exception.h"
// #include <cstddef>
namespace bustub {
LRUKReplacer::LRUKReplacer(size_t num_frames, size_t k) : replacer_size_(num_frames), k_(k) {
for (size_t i = ... | TOOL | 0.884989 | 5.363252 |
871f2ae1-4b9c-41f1-884d-446f1cad4ddb | olly-horde/211-172-Labs | Лабораторная работа 4/second_lab.cpp | #include <iostream>
class Weapon
{
public:
std:: string name;
int damage;
int weight;
bool check_weight(int w) {
if (w < weight) return false;
return true;
}
int weight_sum(Weapon *other) {
return weight_sum(other->weight);
}
int weight_sum(int w) {
... | TOOL | 0.867629 | 3.728859 |
c0e86e55-1dba-4963-9c43-4c08bd4f0a57 | asanik16/Codes | Codeforces/1476/A.cpp | #include<bits/stdc++.h>
using namespace std;
#define int long long
#define ll long long
#define fast ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define endl '\n'
#define Endl '\n'
#define cont continue
#define gcd(a,b) __gcd(a,b)
#define lcm(a,b) a*b/__gcd(a,b)
#define pb push_back
#define mp make_pair
... | ALGO | 0.999591 | 3.716907 |
8e037d33-7355-4a94-89f1-0662c96e4d0e | oscarjeff920/gym_bro | 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 |
caefddd3-0377-4b1d-aa2c-5f5ce064c945 | uxth/leetcode | cpp/1716.calculate-money-in-leetcode-bank.cpp | /*
* @lc app=leetcode id=1716 lang=cpp
*
* [1716] Calculate Money in Leetcode Bank
*/
// @lc code=start
class Solution {
public:
int totalMoney(int n) {
int weeks = n / 7;
int days = n % 7;
int res = weeks > 0 ? 28 * weeks + (weeks - 1) * weeks * 7 / 2 : 0;
res += (1+weeks) * da... | ALGO | 0.999184 | 4.916234 |
89ace472-4808-475f-b3dd-e96188a26e24 | bluewhitesheen/Leetcode | minimum-time-to-complete-trips/Runtime Error/3-7-2023, 9_39_16 AM/Solution.cpp | // https://leetcode.com/problems/minimum-time-to-complete-trips
class Solution {
public:
bool chk(vector<int>& time, long long m, long long tot){
long long tmp = 0;
for(auto i: time) tmp += m / i;
return tmp >= tot;
}
long long minimumTime(vector<int>& time, int totalTrips) {
... | ALGO | 0.999988 | 6.331826 |
ff27eb6a-0738-4596-9e87-efa8d23623dd | AndrewKapok/code | luogu/P5722.cpp | #include <cstdio>
int main()
{
int n;
scanf("%d", &n);
printf("%d", ((1 + n) * n) / 2);
} | ALGO | 0.999672 | 4.119151 |
f8092d5b-9130-42a5-b6c0-338941e56477 | elemental/Elemental | src/lapack_like/props-C.cpp | #include <El-lite.hpp>
#include <El/lapack_like/factor.hpp>
#include <El/lapack_like/props.hpp>
#include <El-lite.h>
#include <El/lapack_like/factor.h>
#include <El/lapack_like/props.h>
using namespace El;
extern "C" {
#define C_PROTO_BASE(SIG,SIGBASE,T) \
/* Trace
===== */ \
ElError ElTrace_ ## SIG \
( El... | TOOL | 0.995133 | 6.149108 |
1e917404-f8db-479c-a5ce-92e8fce70529 | HoanghuytranT2207A/LBEP | Assignment deadline 23-59 august 10th versione 2 use while.cpp | #include <stdio.h>
int main(){
int n;
printf("nhap n=");
scanf("%d",&n);
int i=1;
while(i=<n){
n\i=1;
i++;
}
printf("n la so nguyen to:%d,n");
}
| ALGO | 0.999086 | 3.253624 |
a93dbf01-717e-4e34-a17d-41f25e4bd7de | Ame314/ajedrez-back | backend/utils/stockfish/src/movegen.cpp | #include "movegen.h"
#include <cassert>
#include <initializer_list>
#include "bitboard.h"
#include "position.h"
namespace Stockfish {
namespace {
template<GenType Type, Direction D, bool Enemy>
ExtMove* make_promotions(ExtMove* moveList, [[maybe_unused]] Square to) {
constexpr bool all = Type == EVASIONS || T... | ALGO | 0.943555 | 6.626182 |
965a1035-7fd0-494b-852c-2da1d7b55525 | ShivamBhasin2002/competitiveCoding | wordCapitalization.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
string s;
getline(cin, s);
s[0] = toupper(s[0]);
cout << s;
} | ALGO | 0.993906 | 3.770966 |
25a08775-7186-4d51-8ad0-5a7368a4cceb | Johniel/contests | codeforces/824div2/A/main.cpp | // github.com/Johniel/contests
// codeforces/824div2/A/main.cpp
#include <bits/stdc++.h>
#define each(i, c) for (auto& i : c)
#define unless(cond) if (!(cond))
// #define endl "\n"
using namespace std;
template<typename P, typename Q> ostream& operator << (ostream& os, pair<P, Q> p) { os << "(" << p.first << "," <<... | ALGO | 0.999934 | 4.396892 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.