uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
f994aaef-756d-4022-9fd6-1882bd9de43a | GarethFunk/chess | chess.cpp | /*Chess
Gareth Funk - 2015
*/
#include "header.h"
#include "drawing.cpp"
#include "parser.cpp"
int main(){
initialise();
cout<<"White to move"<<endl;
while(1==1){
getline(cin, command);
if(command != ""){
if(parse(command) == -1){
return 1;
}
else if(turn == white){
if(check_flag){
if(ch... | ALGO | 0.964127 | 4.527266 |
5e7b7d7e-7b39-493b-98b4-dc6daf776d87 | busebd12/InterviewPreparation | LeetCode/C++/General/Medium/MaxConsecutiveOnesII/solution.cpp | #include <algorithm>
#include <vector>
using namespace std;
class Solution
{
public:
int findMaxConsecutiveOnes(vector<int> & nums)
{
int result=0;
int n=nums.size();
int zeros=count(nums.begin(), nums.end(), 0);
if(zeros==0)
{
... | ALGO | 0.999985 | 6.122656 |
185f1e92-5e38-46ff-ab6e-ca7935a52552 | Aergan/STV_Multi-OLEDGameSelector | libraries/ErriezRotaryEncoderHalfStep/src/ErriezRotaryHalfStep.cpp | /*!
* \file ErriezRotaryHalfStep.cpp
* \brief Three speed half step Rotary Encoder library for Arduino.
* \details
* Source: https://github.com/Erriez/ErriezRotaryEncoderHalfStep
* Documentation: https://erriez.github.io/ErriezRotaryEncoderHalfStep
*/
#if (defined(__AVR__) || defined(ARDUINO_A... | ALGO | 0.970614 | 7.112845 |
2a9f0ce8-e267-47f3-8821-0a71a0a72ca4 | luffingluffy/cp | kattis/encodedmessage.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> ii;
typedef vector<int> vi;
typedef vector<char> vc;
typedef vector<string> vs;
typedef vector<ii> vii;
typedef vector<vector<int>> vvi;
typedef vector<vector<char>> vvc;
#define pb push_back
#define pf push_front
int main() {... | ALGO | 0.999931 | 4.182807 |
ff034671-b54e-4972-874e-10fd12f772ef | writecoffee/random_practice | cpp/code/stkandqueue/stkandqueue_06.cpp | ////////////////////////////////////////////////////////////////////////////
// "only push | pop | peek | isempty allowed"
//
// -- use a temp stack to "filter out" out-of-order values every time
// before pushing the highest order stuff
// -- O(n^2) time
//////////////////////////////////////////////////////////////... | ALGO | 0.999581 | 4.655466 |
00ea885d-1bfc-45c8-8364-894d77394c4d | class1c-j/FEUP-CAL | TP4/ex6.cpp | #include "exercises.h"
#include <cmath>
int maxSubsequenceDPAux(int k, int A[], unsigned int &j, unsigned int &i, int bestSums[], int bestI[], int bestJ[]) {
if (bestI[k] != -1) {
i = bestI[k];
j = bestJ[k];
return bestSums[k];
}
if (k == 0) {
bestI[k] = 0;
bestJ[k]... | ALGO | 0.999672 | 6.751987 |
fd303984-75a8-46cb-bb66-b315e5127a22 | anindya028/Programming-Contest-Problems | UVa/v113/11396.cpp | //good problem,bicoloring
#include<stdio.h>
#include<queue>
using namespace std;
#define SIZE 309
int g[SIZE][SIZE],vis[SIZE],n,col[SIZE],notpossible;
void ini(int n){
int i,j;
for(i=1;i<=n;i++)
for(j=1;j<=n;j++)
g[i][j]=0;
}
void bfs(int s){
queue<int> q;
int i,j;
col[s]=1;
vis[s]=1;
q.push(s);
whi... | ALGO | 0.999966 | 4.205957 |
fbcdfdd9-b9eb-47c9-abe7-bd54cdac95b2 | ishandutta2007/codeforces | nik_storm_2010/normal/463/E.cpp | #include <cstdio>
#include <vector>
using namespace std;
const int N = 2e6 + 100;
vector <int> edges[N], divisors[N], last[N];
int a[N], ans[N], deep[N];
void build(int x)
{
for (int i = 0; i < divisors[x].size(); i++)
{
int o = divisors[x][i];
if (last[o].size() != 0)
{
i... | ALGO | 0.999719 | 4.266896 |
f11804ef-dc7d-411d-acfd-7adfd9b928c4 | raincross7/code-similarity | codes/train_code/problem349/problem349_393.cpp | #include <iostream>
#include <iomanip>
#include <vector>
#include <string>
#include <stack>
#include <set>
#include <cmath>
#include <algorithm>
using namespace std;
struct card{
char m;
int n;
};
void b_sort(card* a , int n){
for(int i=n;i>=0;--i){
for(int j=0;j<i-1;++j){
if(a[j].n>a[j+1].n){
swap(a[j].n... | ALGO | 0.999961 | 3.946828 |
cea3bbb6-714f-4f9f-9a19-6d7f1013731a | ytyourstruly/MDV | w5/fibonacci_generator_tb.cpp | #include "Vfibonacci_generator.h"
#include "verilated.h"
#include <iostream>
#include "verilated_vcd_c.h"
int main(int argc, char **argv) {
// Initialize Verilator
Verilated::commandArgs(argc, argv);
// Instantiate the Verilog module
Vfibonacci_generator *tb = new Vfibonacci_generator;
Verilated::... | ALGO | 0.88966 | 6.229056 |
9bb7c2b5-a0dc-4810-8f0a-c6075e46a9a1 | paramgoswami/Codeforces-Codes | 672-A: Summer Camp.cpp | //https://codeforces.com/contest/672/problem/A
#pragma GCC optimize ("-O3")
#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef long double ld;
typedef pair<int,int> p32;
typedef pair<ll,ll> p64;
typedef pair<double,double> pdd;
typedef vector<ll> v64;
typedef vector<int> v32;
type... | ALGO | 0.999406 | 4.516976 |
5c561f3d-696d-403d-8a60-aa17211ff0b6 | mahmud34033/Solutions---Unlock-The-Algorithm-Programming-Contest | fall23_preli-B/B.cpp | // Seraching
#include <bits/stdc++.h>
#include <math.h>
#include <algorithm>
#include <string>
#include <numeric>
#define ll long long
#define nl endl
using namespace std;
int main(){
ll m, n, a, i, f=0;
cin >> m >> n;
for(i=0; i<m; i++){
cin >> a;
if(a == n){
f=1;
}
... | ALGO | 0.999492 | 3.733117 |
8daee84c-d93e-4f9f-afef-71d10ddd2b18 | parkes811-inu/codetree-TILs | 240214/나무 타이쿤/tree-tycoon.cpp | #include <iostream>
#include <vector>
using namespace std;
// → ↗ ↑ ↖ ← ↙ ↓ ↘ 순서
int dx[8] = {0, -1, -1, -1, 0, 1, 1, 1};
int dy[8] = {1, 1, 0, -1, -1, -1, 0, 1};
int map[16][16];
int n, m;
vector<int> d; // d는 이동방향
vector<int> p; // p는 이동칸수
vector<pair<int, int>> livro;
void move(int year) {
for(i... | ALGO | 0.999839 | 4.763809 |
b6860de4-c3a9-4196-99b5-efeef54916b6 | ayush-20701/100-Days-Of-Coding | Day16/make-the-string-great.cpp | // Leetcode 1544
#include <bits/stdc++.h>
using namespace std;
class Solution {
public:
string makeGood(string s) {
stack<char> x;
for (char c : s) {
if (!x.empty() && abs(c - x.top()) == 32) {
x.pop();
} else {
x.push(c);
}
... | ALGO | 0.999983 | 6.71515 |
eb39e20c-de4c-4426-b488-7410940745dd | MohamedAlmaasarawy/Cpp | assiut sheets codeforces/solution of sheet1/Coordinates of a Point/Coordinates of a Point.cpp | #include <iostream>
using namespace std;
int main()
{
// Input from user
float a, b;
cin >> a >> b;
// where the posation of point
if ( a == 0 && b == 0)
cout << "Origem" << endl;
else if ( a > 0 && b > 0)
cout << "Q1" << endl;
else if ( a < 0 && b > 0)
cout << "Q2" << ... | ALGO | 0.999894 | 3.992341 |
184532a8-9618-4ecd-8b90-a472257a44e7 | P1914/P1914 | Visual S Code/HTML/Cnn.Cpp | #include <iostream>
#include <cmath>
int main() {
double a, b, c;
std::cout << "Enter the coefficient a: ";
std::cin >> a;
std::cout << "Enter the coefficient b: ";
std::cin >> b;
std::cout << "Enter the coefficient c: ";
std::cin >> c;
c = 9;
std::cout << "The quadratic equatio... | ALGO | 0.977855 | 4.534779 |
3821366a-7ede-48ad-9c56-a10dd0ef9b3c | Pithiwit/Lab17 | lab17_2.cpp | #include<iostream>
using namespace std;
void myString(char *&data, int N){
data = new char[N + 1];
for(int i = 0; i < N; i++) *(data + i) = 'A'+i;
data[N] = 0;
}
int main(){
char *p;
int N;
cout << "N = ";
cin >> N;
myString(p,N);
cout << p;
delete [] p;
return 0;
}
| ALGO | 0.883177 | 3.207867 |
a0e5519d-85fd-4ef5-a0a1-106f81fc8204 | gvnee/dataStructures-Algorithm | codeforces/1328C.cpp | #include<bits/stdc++.h>
using namespace std;
#define all(x) x.begin(), x.end()
#define sz(x) int((x).size())
typedef pair<int,int> pi;
typedef long long ll;
#define pb push_back
#define S second
#define F first
void f(){
int n; cin>>n;
string s; cin>>s;
string a = "", b = "";
bool aGot = false;
for(char c:s... | ALGO | 0.999923 | 3.888176 |
157e43f5-1e59-4056-be8b-f7df267dab57 | govegito/Interview_prep | DSA/graph/TARJAN.cpp | int isBridge(int V, vector<int> adj[], int c, int d)
{
// Code here
vector<bool> vis(V,false);
vector<int> min_d(V,INT_MAX),levell(V,0);
dfs(c,adj,vis,min_d,levell,0,-1);
if(c==d)return 0; // if self edge
int ct=0;
for(int nb:adj[c]){
... | ALGO | 0.9997 | 4.709262 |
8dc497a3-48ab-42ed-af0e-b74526957ed2 | Tookerton21/ART-Logic_Programming_challenge | Encode.cpp | //
// Created by Nicholas Ruiz on 2019-04-09.
//
#include "Encode.h"
#include <iterator>
Encode::Encode() {
}
/**
* Set the high and low numbers from the integer that the user passed in, to allow
* to encode in base 2 form.
* @param num
* @param low
* @param high
*/
void Encode::setHighLow(int num, std::vecto... | TOOL | 0.928521 | 5.926195 |
11e2eea5-e823-407f-aed3-3f3985d2bab2 | projeto-de-algoritmos/DC_2DCollisionDetection | 2DCollisionDetection/src/QuadTree.cpp | #include <vector>
#include <utility>
#include "Ball.hpp"
#include "QuadTree.hpp"
Rectangle::Rectangle(){
}
Rectangle::Rectangle(int xb, int yb, int xt, int yt){
bottom = std::make_pair(xb, yb);
upper = std::make_pair(xb + xt, yb + yt);
}
int Rectangle::getX(){
return bottom.first;
}
int Rectangle::getY... | ALGO | 0.999141 | 4.854445 |
62f8b979-f634-4017-bde2-bc6d8913486e | namndtth/competitive-programming | codeforces/1344A.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
freopen("data.inp", "r", stdin);
int t;
cin >> t;
while (t--)
{
int n;
cin >> n;
vector<int> a(n);
set<int> exist;
bool posible = true;
for (int i = 0; i < n; i++)
{
cin... | ALGO | 0.999853 | 4.313763 |
1f2718db-95d9-4242-b71c-23f3e054b1b7 | yashk9293/NeetCode-150 | 02_Two Pointers/05_b_Trapping_Rainwater_optimalApproach.cpp | // Question Link :- https://leetcode.com/problems/trapping-rain-water/
// 42. Trapping Rain Water (Striver)
// T.C = O(n)
// S.C = O(1)
class Solution {
public:
int trap(vector<int>& height) {
int n = height.size();
int l = 0, r = n-1;
int res = 0;
int maxleft = height[l], maxright ... | ALGO | 0.999996 | 6.941521 |
a7f44c70-0986-4fc5-85ea-ecaedd503acd | Matthewlolops/rpcs3 | Utilities/sema.cpp | #include "sema.h"
#include "sync.h"
void semaphore_base::imp_wait()
{
for (int i = 0; i < 10; i++)
{
busy_wait();
const s32 value = m_value.load();
if (value > 0 && m_value.compare_and_swap_test(value, value - 1))
{
return;
}
}
#ifdef _WIN32
const s32 value = m_value.fetch_sub(1);
if (value <= 0)... | ALGO | 0.995713 | 5.972657 |
11bb5057-b959-4ac4-bb11-26e67df8ce1b | NimishSinghChouhan/LeetCode | 0504-base-7/0504-base-7.cpp | class Solution {
public:
string convertToBase7(int num) {
if(num == 0) return "0";
bool neg = (num < 0);
int digit = 0;
int ans = 0;
if(neg) num*=(-1);
while(num > 0){
// cout << (num%7) * pow(10, digit) << " ";
ans +... | ALGO | 0.999893 | 5.592072 |
541eadef-b75a-443a-9288-25fdb9971b2e | TungNguyen159/movie_app_with_modular | 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.998733 | 6.76775 |
865abc44-faad-4b11-b585-78d2afc859ef | Charles-T-T/Algorithm-Practice | Stack-Queue/225-MyStack/225.cpp | #include <iostream>
#include <queue>
using namespace std;
/*
请你仅使用两个队列实现一个后入先出(LIFO)的栈,并支持普通栈的全部四种操作(push、top、pop 和 empty)。
实现 MyStack 类:
void push(int x) 将元素 x 压入栈顶。
int pop() 移除并返回栈顶元素。
int top() 返回栈顶元素。
boolean empty() 如果栈是空的,返回 true ;否则,返回 false 。
注意:
你只能使用队列的标准操作 —— 也就是 push to back、peek/pop from front、size 和 ... | ALGO | 0.997163 | 4.928417 |
ba84e6d5-a5ee-482e-afb6-e6486e677a86 | proxmox/ceph | ceph/src/boost/libs/spirit/example/qi/num_list2.cpp | ///////////////////////////////////////////////////////////////////////////////
//
// This sample demontrates a parser for a comma separated list of numbers.
// The numbers are inserted in a vector using phoenix.
//
// [ JDG May 10, 2002 ] spirit1
// [ JDG March 24, 2007 ] spirit2
//
///////////////////////////... | TOOL | 0.982755 | 6.679771 |
55573b27-d671-4b5b-acf7-f522bb52d232 | okaryo/CompetitiveProgramming | AtCoder/ABC/001~100/071~080/079/D.cpp | #include <bits/stdc++.h>
typedef long long LL;
using namespace std;
int main() {
int h, w; cin >> h >> w;
vector<vector<int>> a(10, vector<int>(10));
for (int i = 0; i < 10; i ++) {
for (int j = 0; j < 10; j ++) cin >> a[i][j];
}
vector<vector<int>> g(h, vector<int>(w));
for (int i = 0; i < h; i ++) {
... | ALGO | 0.999894 | 3.787999 |
ad20f42c-ffd8-477a-915d-e478d6e27cd1 | helenjw/CSC317 | lab6/eigen/doc/examples/Tutorial_ArrayClass_interop.cpp | #include <Eigen/Dense>
#include <iostream>
using namespace Eigen;
using namespace std;
int main()
{
MatrixXf m(2,2);
MatrixXf n(2,2);
MatrixXf result(2,2);
m << 1,2,
3,4;
n << 5,6,
7,8;
result = (m.array() + 4).matrix() * m;
cout << "-- Combination 1: --" << endl << result << endl << e... | ALGO | 0.999261 | 4.531452 |
fbe70296-6e5d-45de-b2d6-cccfc358ecfb | AllenHuangGit/ompl-1.6.0 | src/ompl/geometric/planners/informedtrees/src/AITstar.cpp | // Authors: Marlin Strub
#include "ompl/geometric/planners/informedtrees/AITstar.h"
#include <algorithm>
#include <cmath>
#include <string>
#include <boost/range/adaptor/reversed.hpp>
#include "ompl/base/objectives/PathLengthOptimizationObjective.h"
#include "ompl/util/Console.h"
using namespace std::string_litera... | ALGO | 0.991089 | 7.334394 |
ef68b5fe-c026-48c4-a081-638f2f3506dc | alexandraback/datacollection | solutions_5766201229705216_0/C++/lummy/codejam.cpp | #include "stdafx.h"
// codejam.cpp : ̨Ӧóڵ㡣
//
#include <cstdio>
#include <iostream>
#include <fstream>
#include <iomanip>
#include<vector>
#include<stack>
#include<queue>
#define INPUTFILE "B-small-attempt1.in"
#define OUTPUTFILE "result.out"
using namespace std;
//#pragma warning(disable:4996)
bool *mark;
int **n... | ALGO | 0.999782 | 4.627994 |
4ab268dc-d1ba-4f5a-9fd6-886681f04648 | namhyo01/ForStudy | study/study/1531.cpp | //#include <bits/stdc++.h>
//
//using namespace std;
//
//int map1[101][101];
//
//int N, M;
//
//int main() {
// ios::sync_with_stdio(0);
// cin.tie(0); cout.tie(0);
// cin >> N >> M;
//
//
// for (int k = 0; k < N; k++) {
// int x1, x2, y1, y2;
// cin >> x1 >> y1 >> x2 >> y2;
// for (int x = x1; x <= x2; x++) {
/... | ALGO | 0.999871 | 3.595168 |
2c24c20b-dc19-4054-8593-0688a9d4fc9a | jgehrig/neovim-qt-exp | src/gui/shellwidget/konsole_wcwidth.cpp | /* $XFree86: xc/programs/xterm/wcwidth.characters,v 1.9 2006/06/19 00:36:52 dickey Exp $ */
/*
* This is an implementation of wcwidth() and wcswidth() (defined in
* IEEE Std 1002.1-2001) for Unicode.
*
* http://www.opengroup.org/onlinepubs/007904975/functions/wcwidth.html
* http://www.opengroup.org/onlinepubs/007... | TOOL | 0.913711 | 5.55756 |
59f31375-a37d-49bf-bea4-0b5ef92ea86a | virtyaluk/leetcode | problems/2095/solution.cpp | /**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode() : val(0), next(nullptr) {}
* ListNode(int x) : val(x), next(nullptr) {}
* ListNode(int x, ListNode *next) : val(x), next(next) {}
* };
*/
class Solution {
public:
ListNode* deleteMiddl... | ALGO | 0.999892 | 6.040075 |
2bd8a1f3-2e08-4992-99e5-b4d6077e586a | amchp/CompetitivePrograming | Practice/F_Asya_And_Kittens.cpp | #include <vector>
#include <map>
#include <cstdlib>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <sstream> // istringstream buffer(myString);
#include <stack>
#include <algorithm>
#include <cstring>
#include <cassert>
#include <math.h>
#include <unordered_map>
#include <queue>
#include <arra... | ALGO | 0.999972 | 4.555019 |
9080411a-42fa-4436-a07c-ead700364227 | Sean0628/competitive_programming | atcoder/abc/abc204/b.cpp | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (n); ++i)
using ll = long long;
using P = pair<int, int>;
int main() {
int n; cin >> n;
vector<int> a(n);
rep(i, n) cin >> a[i];
int ans = 0;
rep(i, n) if (a[i] > 10) ans += a[i] - 10;
cout << ans << endl;
return 0;
}
| ALGO | 0.998969 | 3.816839 |
ac752375-c203-4fd2-b4e3-e1c94e40648a | Junghs-cloud/Baekjoon | Silver/2/_23977.cpp | #include <iostream>
using namespace std;
long long GCD(long long x, long long y)
{
if (y == 0)
{
return x;
}
else
{
return GCD(y, x % y);
}
}
long long LCM(long long x, long long y)
{
long long gcd = GCD(x, y);
long long lcm = (x * y) / gcd;
return lcm;
}
int main()
{
cin.tie(NULL);
ios::sync_with_std... | ALGO | 0.999941 | 3.984891 |
eea1af9a-6d88-4eff-9942-e78a30530307 | Ashish-21CS132/DSA-C-plus | Graph/dikshtra_algo.cpp | #include <iostream>
#include <vector>
#include <queue>
#include <climits>
using namespace std;
typedef pair<int, int> pii;
void dijkstra(int source, vector<vector<pii>>& adj, vector<int>& dist) {
priority_queue<pii, vector<pii>, greater<pii>> pq;
dist[source] = 0;
pq.push({0, source});
while (!pq.em... | ALGO | 0.999994 | 5.790966 |
887c356a-666a-4b32-867d-3ffef528f23b | brew02/FastPFHook | FastPFHookLib/translate.cpp | #include "translate.h"
// We need to deal with double branches (place breakpoints on them properly)
// Ex.
// jcc (2 bytes)
// jmp (x bytes)
//
ZyanStatus PlaceAbsoluteInstruction(PFHook* hook,
UINT64 rip, Disassembler* disassembler)
{
ZydisDecodedInstruction* instruction = &disassembler->instruction;
ZydisDecoded... | ALGO | 0.972975 | 5.670092 |
4612ac2c-0e3c-456d-ae60-90ead944739b | xoyolucas/My-solutions-for-Leetcode | 初级数组/从排序数组中删除重复项.cpp | #include <iostream>
#include <vector>
using namespace std;
int removeDuplicates(vector<int> &nums){
if(nums.empty())
return 0;
int n=0;
for (int i = 1; i < nums.size(); i++){
if(nums[i]!=nums[n]){
n++;
nums[n]=nums[i];
}
}
return n+1;
}
int main(int ... | ALGO | 0.999042 | 5.210135 |
17752838-327c-4a73-a492-764a625fbccd | jizhang-cmu/autonomy_stack_diablo_setup | src/slam/dependency/gtsam/gtsam/basis/Chebyshev2.cpp | /**
* @file Chebyshev2.cpp
* @brief Chebyshev parameterizations on Chebyshev points of second kind
* @author Varun Agrawal, Jing Dong, Frank Dellaert
* @date July 4, 2020
*/
#include <gtsam/basis/Chebyshev2.h>
namespace gtsam {
Weights Chebyshev2::CalculateWeights(size_t N, double x, double a, double b) {
// ... | ALGO | 0.999771 | 7.259824 |
4989cf61-660f-4746-9c04-6b0bfb507a9a | terry-hsu/smv | userspace/apps/firefox/firefox-45.0/gfx/skia/skia/src/core/SkMath.cpp | #include "SkMathPriv.h"
#include "SkFloatBits.h"
#include "SkFloatingPoint.h"
#include "SkScalar.h"
const uint32_t gIEEENotANumber = 0x7FFFFFFF;
const uint32_t gIEEEInfinity = 0x7F800000;
const uint32_t gIEEENegativeInfinity = 0xFF800000;
#define sub_shift(zeros, x, n) \
zeros -= n; \
x >>= n... | ALGO | 0.993113 | 6.614688 |
4d52904b-f9a6-4de7-8d98-52ee8a579d57 | AnuragKrVerma/Cpp | question/leetcodeq1281.cpp | // 1281. subtract the product & sum of the digit
// Example
// input=234
// output=15
// explanation
// product of digit= 2x3x4=24
// sum of digit= 2+3+4=9
// subtract of product and sum
// result = 24 -9 = 15
#include <iostream>
#include <process.h>
using namespace std;
int main()
{
system("cls");
system("c... | ALGO | 0.999894 | 5.103353 |
0dfa42ba-b22e-441d-b58c-99e8047fc067 | petrum/percentile | main.cpp | #include <iostream>
#include <vector>
#include <cassert>
#include <queue>
#include <limits>
struct Percentile
{
Percentile(double d) : percentile(d) {}
void add(double);
double get() const { return top.size() ? top.top() : std::numeric_limits<double>::quiet_NaN(); }
std::size_t size() const { return to... | ALGO | 0.999672 | 4.980701 |
377353ec-79fc-40e8-8c4d-ea9e3491b4ca | wenyangfu/EE361M_Homework | term_project/reference-code/ListNet/Source/multiLearn/main.cpp | //----------------------------------------------------------------------------------//
//Project: ListNet //
//Author: Ngo Xuan Bach, School of Information Science, JAIST //
//email: <EMAIL> //
//Date: April, 2010 //
//Source Paper: Learning to Rank: From Pairwise Appr... | DATA | 0.978925 | 4.640034 |
a169b3e4-18f2-452e-b6dc-b5abde4950a4 | abdul1mannan/LeetCode | 1319-number-of-operations-to-make-network-connected/1319-number-of-operations-to-make-network-connected.cpp | class dsu{
vector<int>parent,size;
public:
dsu(int n){
parent.resize(n+1);
size.resize(n+1,1);
for(int i=0;i<=n;i++){
parent[i]=i;
}
}
int findpar(int node){
if(node==parent[node]){
return node;
}
return parent[node... | ALGO | 0.999873 | 5.543685 |
f221cacc-6e73-4689-bebb-ba53c9cffcde | jebouin/CompetitiveProgramming | CodeForces/CF1060-D12-B.cpp | /*
* Author: Jeremy Bouin
*
* Idea:
* - Start from the least significant digit.
* - For each digit d, maximise the sum of two digits that sum to d modulo 10. If d < 9, the answer is
* d + 10 - c where c is the carry (0 or 1) from the previous operation. If d = 9, the answer is
* ... | ALGO | 0.999905 | 5.062129 |
9c4c22bd-c992-496f-90b3-80520c385cde | hungcs98/thundersvmwithgpu | thundersvm/eigen/bench/vdw_new.cpp | #include <iostream>
#include <Eigen/Core>
using namespace Eigen;
#ifndef SCALAR
#define SCALAR float
#endif
#ifndef SIZE
#define SIZE 10000
#endif
#ifndef REPEAT
#define REPEAT 10000
#endif
typedef Matrix<SCALAR, Eigen::Dynamic, 1> Vec;
using namespace std;
SCALAR E_VDW(const Vec &interactions1, const Vec &inter... | ALGO | 0.999753 | 3.519938 |
9a26e47c-f4c2-4eee-90af-11aff90a98ce | manikanta2901/ubuntu | .history/imp/cpp/Algorithm/DynamicPrograming/LengthOfLongestIncreasingSubSequence_20210117125928.cpp | #include<bits/stdc++.h>
using namespace std;
int LengthOfOncreasingSubsequence(vector<int> arr){
vector<int> lis(size,1);
for(int i = 1; i < size; i++){
for(int j = 0; j < i; )
}
}
int main(){
int size;
cin >> size;
vector<int> arr;
for(int i = 0; i < size; i++){
int a;
... | ALGO | 0.999967 | 4.622315 |
66a0910c-a075-4146-bc84-b3a083bdc9db | Coding1610/DSA | Patterns/P_015.cpp | #include<iostream>
using namespace std;
int main(){
/*
A B C D
A B C D
A B C D
A B C D
*/
int n = 4;
int i = 1;
while( i <= n ){
int j = 1;
while( j <= n ){
char ch = 'A'+j-1;
cout << ch << " ";
j = j+1;
}
cout << end... | ALGO | 0.99974 | 3.219916 |
7936aa92-9184-4bbc-91e2-2d4e11c1f99b | DAVID-NGUYEN-S16/Competition-programming_ | DATA-STRUCTURES/Segment tree/day_con_tang.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
ios_base::sync_with_stdio(false); cin.tie(NULL);
#ifndef ONLINE_JUDGE
freopen("input.txt", "r", stdin);
freopen("output.txt", "w", stdout);
#endif
multiset <int> S;
multiset <int> :: iterator it;
int n, ai;
scanf("%d", ... | ALGO | 0.999426 | 3.430824 |
8a88ec92-a5f9-4d1c-b47d-729dcb48a319 | voidcs/Binarysearch.com-Solutions | C++/Insertion_Index_In_Sorted_List/main.cpp | //https://binarysearch.com/problems/Insertion-Index-in-Sorted-List
int solve(vector<int>& v, int target) {
int n = v.size();
int l = 0, r = n-1;
while(l <= r){
int m = (l+r)/2;
if(v[m] <= target)
l = m+1;
else
r = m-1;
}
return l;
} | ALGO | 0.999988 | 6.134918 |
0bc6d26d-95d2-45dc-bd87-e7804e4e0055 | victorsenam/acampinasmento | s01/e01/D/D.cpp | #include <bits/stdc++.h>
using namespace std;
const double eps = 1e-9;
double h[2], t[2];
inline double sqr (double a)
{ return a*a; }
int main() {
for (int i = 0; i < 2; i++)
scanf("%lf %lf", h+i, t+i);
if (h[0] < h[1]) {
swap(h[0], h[1]);
swap(t[0], t[1]);
}
double lo = 0.0;
double hi = t[1];
whi... | ALGO | 0.999203 | 3.417084 |
490a1405-6637-4ca9-9633-3304d406ffb4 | priyanshu1019/CrackYourPlacement | 36_SmallestWindowInAString.cpp | class Solution {
public:
string simplifyPath(string path) {
string result = "";
string token = "";
stack<string> st;
stringstream ss(path);
while(getline(ss , token , '/')){
if( token == "" || token == "."){
continue;
}else if... | ALGO | 0.999956 | 5.66736 |
ad913a91-860b-4fd2-8145-3d5f6c6851cd | EASINTUHA/Phitron-Basic-All-Code | phitron-batch4-codes-main/phitron-batch4-codes-main/DS/Week_5/104.cpp | class Solution
{
public:
int maxDepth(TreeNode *root)
{
if (root == NULL)
return 0;
return 1 + max(maxDepth(root->left), maxDepth(root->right));
}
}; | ALGO | 0.999007 | 5.982231 |
ac7f826a-f9a1-4750-9a53-38fa15e7a04b | kinstugi/algorithms_journey_folder | codeforces/b/008_penchick_and_satay_sticks.cpp | #include <bits/stdc++.h>
using namespace std;
int main(){
cin.tie(0)->sync_with_stdio(0);
// freopen("sample.in", "r", stdin);
int t, n;
cin >> t;
while(t--){
cin >> n;
vector<int> arr(n);
for (int i = 0; i < n; i++)
cin >> arr[i];
bool flag = true;
... | ALGO | 0.999875 | 5.080277 |
88d790b9-2dbe-48a1-8b14-c9b9523f6444 | ryo-manba/AtCoder | ABC/ABC190/b/main.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
int n, s, d;
cin >> n >> s >> d;
int a[n], b[n];
for (int i = 0; i < n; i++)
cin >> a[i] >> b[i];
for (int i = 0; i < n; i++)
{
if (s > a[i] && d < b[i]){
cout << "Yes" << endl;
return (0);
}else
continue;
}
cout <... | ALGO | 0.999963 | 3.47913 |
e8346cce-32ea-40c8-8cb9-76be21a58a0e | mini7007/myleetcode | 18 Feb 2375. Construct Smallest Number From DI String.cpp | class Solution {
public:
string smallestNumber(string pattern) {
string ans;
stack<char> stack{{'1'}};
for (const char c : pattern) {
char maxSorFar = stack.top();
if (c == 'I')
while (!stack.empty()) {
maxSorFar = max(maxSorFar, stack.top());
ans += stack.top(), ... | ALGO | 0.999913 | 6.487741 |
b5202ca8-8eba-4d19-ba6f-6124d2769180 | Adiihub/DSA | 01 - Array/1 - Binary Search/8-Find-In-RotatedSorted.cpp | #include <bits/stdc++.h>
using namespace std;
class Solution
{
public:
// Function to find index of the minimum element (pivot point)
int findMinIndex(vector<int> &arr)
{
int low = 0, high = arr.size() - 1;
while (low < high)
{
int mid = low + (high - low) / 2;
... | ALGO | 0.999999 | 6.90606 |
2365fe51-e400-45e3-8770-877f64f6f12f | Skywt2003/codes | HDU/1007/15167803_AC_811ms_4576kB.cpp | #pragma GCC optimize(2)
#include<cstdio>
#include<cstring>
#include<iostream>
#include<algorithm>
#include<cmath>
using namespace std;
const int maxn=200005;
const double INF=1.0e8;
int n;
struct PointInfo{
double x,y;
};
PointInfo a[maxn],que[maxn];
inline bool cmp(PointInfo aa,PointInfo bb){
return aa.x<bb.x;... | ALGO | 0.99976 | 4.445725 |
d9067e75-c81d-4dfb-94b8-8b4e89c54450 | wesley-stone/leetcode | 464_Can_I_Win/Solution.cpp | //
// Created by wesley shi on 2017/12/10.
//
#include "Solution.h"
#include <bitset>
#include <vector>
using namespace std;
bool Solution::canIWin(int maxChoosableInteger, int desiredTotal){
int size = 1 << (maxChoosableInteger-1);
vector<bitset> dp(desiredTotal, bitset<size>());
}
| ALGO | 0.999615 | 5.749582 |
7da24365-1205-4b68-8c68-e01137b718e2 | Aditya-Mohite/CodingNinjas_Answers | Day_35/CodeStudio_Zero Matrix.cpp | #include <bits/stdc++.h>
vector<vector<int>> zeroMatrix(vector<vector<int>> &matrix, int n, int m)
{
vector<bool> zeroRows(n, false);
vector<bool> zeroCols(m, false);
// Mark rows and columns that contain 0
for (int i = 0; i < n; i++) {
for (int j = 0; j < m; j++) {
if (matrix[i][j] ... | ALGO | 0.999856 | 6.050062 |
f8581374-d7aa-4f61-b297-9d992c3d0788 | Roykesydon/uva_pratice | 動態規劃DP/背包問題/OJ-10819-Trouble of 13-Dots/test.cpp | #include<iostream>
#include<cstring>
#include<algorithm>
using namespace std;
int w[101];
int v[101];
int dp[101][10201];
int main()
{
int origin,tmp_weight;
int weight,num;
int i,j;
int ans;
while(cin>>weight>>num)
{
if(weight>1800)
weight+=200;
//--------------
for(int i=1;i<=num;i++)
cin>>w[i]>>v[i... | ALGO | 0.999764 | 3.493824 |
ba2d859b-799f-4b4f-bb48-96cb6f551b93 | eneagoe/codeforces | cpp/1030A.cpp | #include <iostream>
using namespace std;
int main()
{
int n, s;
bool hard = 0;
cin >> n;
for (auto i = 0; i < n; i ++) {
cin >> s;
if (s) {
hard = 1;
break;
}
}
if (hard)
cout << "HARD" << endl;
else
cout << "EASY" << endl;
... | ALGO | 0.998852 | 3.583455 |
edbc6a2a-e1c1-484f-9040-14a76ae37efd | SuryaCS719/DSA | Arrays/2D Arrays & Vectors/Transpose of a Matrix.cpp | // 5. Transpose of a Matrix
void transpose(int arr[][3], int row, int col){
for(int i=0;i<row;i++){
for(int j=i; j<col;j++){
swap(arr[i][j], arr[j][i]);
}
}
}
// Print arr
void printArr(int arr[][3], int row, int col){
for(int i=0;i<row;i++){
for(int j=0; j<col;j++){
... | ALGO | 0.999676 | 5.024899 |
a6fe3034-8704-49a7-885f-4099c1220b4b | hellspawn679/practice- | codewithharry/tut18.cpp | #include <iostream>
using namespace std;
int factrioal(int n){
if(n<=1){
return 1;
}
return n* factrioal(n-1);
}
int main(){
// facorial of a number;
int a;
cout<<"enter a number ";
cin>>a;
cout<< " the factorial of "<<a<< " is " << factrioal(a)<<endl;
return 0;
} | ALGO | 0.993726 | 3.160115 |
e5ce5259-aca5-4dd7-b025-6e982c604104 | tlxucheng/mylinux | App/leetcode/leetcode/toHex/toHex.cpp | #include <iostream>
#include <string>
#include <math.h>
class Solution {
public:
std::string toHex(int a)
{
std::string hex_str;
int remainder = 0;
char c = '0';
unsigned int num = a;
if(num > 0)
{
while(0 != num)
{
remainder = num %16;
if(remainder < 10)
... | ALGO | 0.996078 | 5.456623 |
3783baff-d833-4fcf-a985-64a5e5610478 | tschuett/mpi-examples | cart-fompi-counter.cpp | #include "fompi.h"
#include <omp.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <cassert>
#include <chrono>
#include <cstdint>
#include <utility>
#include "my-malloc.hpp"
#include "simple.hpp"
int iterations = 1000;
const uint64_t one = 1;
using namespace std;
int main(int argc, char** ar... | ALGO | 0.999732 | 4.349623 |
5e958556-4087-47e3-86d7-d00ed5836b73 | Dhina0508/Online-Shop-using-Provider-State-Management | 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 |
3adfe52d-d696-43d9-bd7d-676180878c14 | GBao294/NMLT2021 | 4.08/4.08/4.08.cpp |
#include <iostream>
using namespace std;
void input(int &n)
{
cin >> n;
}
int input()
{
int n;
cin >> n;
return n;
}
int TongUocChung(int a, int b)
{
int s = 0;
for (int i = 1; (i <= a || i <= b); i++)
if (a%i == 0 && b%i == 0)
s += i;
return s;
}
int main()
{
int a, b;
a= input();
input(b);
std::... | ALGO | 0.999794 | 4.434257 |
d6362201-6c1b-47e9-ae9a-020713d24c77 | Darshanjasani73/DSA-CPP | Array/find_duplicates.cpp | #include<iostream>
using namespace std;
void DuplicateArray(int arr[],int n)
{
int count=0;
for(int i=0; i<n; i++)
{
for(int j=i+1; j<n; j++)
{
if(arr[i]==arr[j])
{
cout<<"Duplicate Value: "<<arr[i]<<endl;
count++;
}
... | ALGO | 0.998456 | 3.441059 |
d3c0233f-5866-45e8-b204-51d9378343ee | dora-explora/dnasm | dnasmparser.cpp | // this file takes in text describing dnasm code and turns it into a file.
#include <iostream>
#include <fstream>
#include <sstream>
#include <string>
#include <algorithm>
#include <vector>
#include <map>
#include <bitset>
using namespace std;
map<string, char> codontable {
{"Attach", 0b111110},
{"Detach", ... | TOOL | 0.917957 | 4.407912 |
3ef1d969-f2c1-4f58-9376-8279be44efe6 | Barrun-Kabir-Rifat/Data-Structure-and-Algorithmic-Problem | Recursion/subsequece_sum_equalto_k.cpp | #include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define en "\n"
typedef long long int ll;
// description: subsequence sum of an array that is equal to k. print those subsequence;
// here , take - not take formula applied . that how subsequence works;
void subsequence(int ind, ll arr[], vector<ll> ... | ALGO | 0.999894 | 4.430182 |
b0622d04-2288-45d9-8458-efe7c14bba7e | SeSACAlgorithm/AlgorithmStudy | 프로그래머스/LEVEL 2 (2)/17683) [3차] 방금 그곡/경호.cpp | #include <string>
#include <vector>
#include <map>
#include <algorithm>
using namespace std;
struct MusicData
{
int origin_idx = 0;
int minutes = 0;
string name = "";
string codes = "";
MusicData() {}
MusicData(int idx, int m, const string& n, const string& c)
{
origin_id... | ALGO | 0.994979 | 5.5788 |
e0d1bab1-f79c-4d4c-8c55-04e2a1249ecf | jurikimurik/C11_Standard_Library_Exercises | Section 7/Exercise9_ForwardList.cpp | // Zadanie 9 - Zabawa w poszukiwacza. Posiadasz forward_list o pojemnosci 100. Twoim zadaniem jest znalezc kazda liczbe podzielna przez 2 i przed nia wpisac liczbe 99.
#include <forward_list>
#include <algorithm>
#include <iostream>
using namespace std;
//****************************************************************... | ALGO | 0.998923 | 3.895155 |
6daa3bc7-20c5-4072-8f44-7cf9c1baf0be | tyler-jurczyk-2020/cuda_gpu | Project/project/third_party/eigen/bench/benchmarkX.cpp | // g++ -fopenmp -I .. -O3 -DNDEBUG -finline-limit=1000 benchmarkX.cpp -o b && time ./b
#include <iostream>
#include <Eigen/Core>
using namespace std;
using namespace Eigen;
#ifndef MATTYPE
#define MATTYPE MatrixXLd
#endif
#ifndef MATSIZE
#define MATSIZE 400
#endif
#ifndef REPEAT
#define REPEAT 100
#endif
int mai... | ALGO | 0.932224 | 3.370773 |
c60913b4-42e3-48b3-a6ea-b1fb10cfe2af | EvanSanjoe/C-programming_108123034 | Triangle.cpp | /*Type of Triangle*/
#include <stdio.h>
int main()
{
int a,b,c;
printf("Enter lengths of sides of triangle");
scanf("%d %d %d",&a,&b,&c);
if(a==b && a==c)
printf("Equilateral triangle");
else if(a==b || b==c || c==a)
printf("Isosceles triangle");
else
printf("Scalene triangle");
}
| ALGO | 0.999122 | 3.767131 |
716e3dac-2f65-49de-aec5-6e78a99cd75d | mvp-sales/computacaoGraficaUfes | TC2/util.cpp | #include <math.h>
#include <GL/freeglut.h>
#include <string.h>
#include "util.h"
double Point::distPoints(Point p){
return sqrt(pow(coordX - p.coordX,2) + pow(coordY - p.coordY,2));
}
void Circle::drawCircle(){
GLfloat twicePi = 2.0f * M_PI;
glBegin(GL_TRIANGLE_FAN);
decideColor(fill);
glVertex3f(center.coordX... | TOOL | 0.90933 | 4.083388 |
cc52fae1-c3ab-4583-8c84-d9343f2d155e | raincross7/code-similarity | codes/train_code/problem071/problem071_196.cpp | #include<iostream>
#include <string> // string, to_string, stoi
#include <vector> // vector
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <utility> // pair, make_pair
#include <tuple> // tuple, make_tuple
#include <cstdint> // int64_t, int*_t
#include <cstdio> // printf
#inclu... | ALGO | 0.999813 | 3.161147 |
bd442642-9b1d-4fae-85df-016ca4850fe1 | Parvdaga/Leetcode-Daily-Challenge | 1013-fibonacci-number/fibonacci-number.cpp | class Solution {
public:
int fib(int n) {
if(n <= 1) return n;
// vector<int> dp(n+1, -1);
// dp[0] = 0;
// dp[1] = 1;
int p2=0, p1=1;
for(int i = 2; i <= n; i++) {
// dp[i] = dp[i-1] + dp[i-2];
int cur = p1+p2;
p2=p1;
... | ALGO | 0.999997 | 6.226341 |
3b627f97-41d5-48c8-8a00-68019eb806a6 | ssk4988/Coding | UCFPT/24napc/mathgeo/turningtrominos.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using vi = vector<int>;
using vl = vector<ll>;
using vd = vector<ld>;
using vii = vector<pii>;
using vll = vector<pll>;;
using vvi = vector<vi>;
#define f first
#define s s... | ALGO | 0.999951 | 4.553673 |
bae8ee34-3a60-4a5f-bd13-cfdea92358c0 | manishsaini6421/leetcode-solutions | 2000-minimum-speed-to-arrive-on-time/2000-minimum-speed-to-arrive-on-time.cpp | class Solution {
public:
int minSpeedOnTime(vector<int>& dist, double hour) {
int left=1;
int right =1000000000;
int n=dist.size();
if(hour<=n-1)return -1;
while(left<=right){
int mid=(left+right)/2;
int time=0;
for(int i=0; i<n-1; i++){
... | ALGO | 0.99996 | 5.414352 |
44d37518-4d59-41e7-b937-06821bb5a001 | TobiasFaller/FreiTest | libraries/solver/sat-cadical/src/rephase.cpp | #include "internal.hpp"
namespace CaDiCaL {
/*------------------------------------------------------------------------*/
// We experimented with resetting and reinitializing the saved phase with
// many solvers. Actually RSAT had already such a scheme. Our newest
// version seems to be quite beneficial for satisfia... | ALGO | 0.999801 | 6.440598 |
244bb8f9-2f90-44e7-ada5-e1127a4096f9 | geekygirl8/Hacktoberfest_2022_DSA | C++/C++/construct-k-palindrome-strings.cpp | // Time: O(n)
// Space: O(1)
class Solution {
public:
bool canConstruct(string s, int k) {
bitset<26> odd;
for (const auto& c : s) {
odd.flip(c - 'a');
}
return odd.count() <= k && k <= s.length();
}
};
// Time: O(n)
// Space: O(1)
class Solution2 {
public:
bo... | ALGO | 0.99994 | 6.33844 |
a78dcd6b-6f0f-4944-9858-a592e5cbdabd | kslk11/Problem_solving_using_cpp | 69-sqrtx/sqrtx.cpp | class Solution {
public:
int mySqrt(int x) {
if (x < 2) return x;
long i = 1;
while (i * i <= x) {
i++;
}
return i - 1;
}
}; | ALGO | 0.999928 | 5.432549 |
f8a629a2-78e8-4b38-9836-bf92969a844c | hezhaojiang/leetcode-cpp | 1686.石子游戏-vi.cpp | /*
* @lc app=leetcode.cn id=1686 lang=cpp
*
* [1686] 石子游戏 VI
*/
#include <algorithm>
#include <vector>
using namespace std;
// @lc code=start
class Solution {
public:
int stoneGameVI(vector<int>& aliceValues, vector<int>& bobValues) {
int n = aliceValues.size();
vector<int> index(n, 0);
... | ALGO | 0.999995 | 5.70564 |
4ce57690-091d-4589-a393-4c6d49823cad | minoooo119/codetree-TILs | 241005/최소 거리 합/minimum-distance-sum.cpp | #include <iostream>
#include <bits/stdc++.h>
using namespace std;
int n,k;
priority_queue<pair<int,int>,vector<pair<int,int>>,greater<pair<int,int>>> q;
int res=0;
int dx[2]={-1,1};
set<int> s;
void bfs(int target){
int num=0;
while(!q.empty()){
int pos=q.top().second;
int val=q.top().first;
... | ALGO | 0.999934 | 3.520914 |
6664ddc0-0603-44b5-a171-fa705e5b946e | maopu2001/Codeforces | A_Average_Height.cpp | #include <bits/stdc++.h>
using namespace std;
#define nl endl
typedef long long ll;
const int MOD = 1e9 + 7;
void solve(int T) {
int n, x;
cin >> n;
vector<int> o, e;
for (int i = 0; i < n; i++) {
cin >> x;
if (x % 2 == 0)
o.push_back(x);
else
e.push_back(x);
}
for (int i : o)
... | ALGO | 0.999751 | 4.479465 |
88c19d5f-ab1a-4001-963a-0d61f577855d | h3x4n1um/CP | Codeforces/455A.cpp | #include <bits/stdc++.h>
using namespace std;
int n;
int cnt[100005];
int64_t ans;
vector <int> a;
map <int, int64_t> f;
int main(){
#ifndef ONLINE_JUDGE
freopen("455A.inp", "r", stdin);
#endif // ONLINE_JUDGE
scanf("%d", &n);
for (int i = 1; i <= n; ++i){
int temp;
scanf("%d"... | ALGO | 0.999878 | 3.605909 |
dcd9f8ac-957e-4262-890a-a39654bd783d | kmjp/procon | atcoder/abc351-400/abc369/g.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.999852 | 3.763305 |
c9527863-244b-4dfb-b14f-1de92febd05d | hieupm123/swap | code/C++/CSES-Solutions/Range Queries/Forest Queries II (1739)/Benq.cpp | /*
ID: bqi3431
PROG: ~
LANG: C++11
*/
#pragma GCC optimize ("O3")
#pragma GCC target ("sse4")
#include <bits/stdc++.h>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/rope>
using namespace std;
using namespace __gnu_pbds;
using namespace __gnu_cxx;
typedef long long l... | ALGO | 0.998495 | 3.917879 |
6c9ba47d-df02-4cd0-bb4d-099d55ed497e | DingZhan/Data-Structure-and-Algorithm-Chinese-PTA- | 21. 求前缀表达式的值/a.cpp | #include <iostream>
#include <string>
#include <stack>
#include <vector>
#include <sstream>
#include <iomanip>
#include <cstdlib>
using namespace std;
/*ǰʽֵ:
Ҫɨʽ֣ŵջУ
Ϊջеݣм㣬Ȼٴѹջ
ɨ赽ʽʱɨջΨһݾս
*/
int main()
{
//һַȡķ
std::vector<string> tokens;
//ջ
std::stack<double> dataStack;
string lineStr, ... | ALGO | 0.999581 | 4.220564 |
3f340371-204b-413d-a1e5-e1e82b0bb511 | thucdx/algorithm-solution | OTHER/UVA Soluton/poj1610_广搜.cpp | #include <algorithm>
#include <vector>
#include <string>
using namespace std;
const int MAXN = 555;
int n;
string ans;
int a[MAXN][MAXN];
struct Node{
int x, y, l;
Node(int x = 0, int y = 0, int l = 0):x(x), y(y), l(l) {};
};
vector<Node> q;
void init(){
scanf("%d", &n);
for (int i = 1; i <= n; i++)
for (int ... | ALGO | 0.999575 | 3.987631 |
04e0537f-8f47-4a7c-9c14-30b2285d18b3 | mhaddaou/CPP-Module-09 | ex01/src/RPN.cpp | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* RPN.cpp :+: :+: :+: ... | ALGO | 0.949982 | 4.825742 |
39a4007b-9569-4678-90ba-6d80966a3a05 | TusharPani14/Tushar-LeetCode | 0637-average-of-levels-in-binary-tree/0637-average-of-levels-in-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.999935 | 6.708479 |
dea130b3-9e48-4f79-aece-15fe1203ec1d | Riodsa/CompetitiveProgramming | DP-Atcoder/D - Knapsack 1(top-down).cpp | #include<bits/stdc++.h>
using namespace std;
#define ll long long
const int N = 1e2+5, W = 1e5+5;
ll dp[N][W];
ll w[N],v[N];
int n,k;
ll solve(ll a,ll wei)
{
if(a == 0 || wei == 0) return 0;
if(dp[a][wei] != -1) return dp[a][wei];
if(wei-w[a] >= 0)
{
dp[a][wei] = max(solve(a-1,wei),solve(a-1... | ALGO | 0.999996 | 3.817678 |
73b3afb6-ed83-492b-bf33-d58aefe4be1d | facebookarchive/BOLT | clang/tools/libclang/CIndexer.cpp | #include "CIndexer.h"
#include "CXString.h"
#include "clang/Basic/LLVM.h"
#include "clang/Basic/Version.h"
#include "clang/Driver/Driver.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/SmallString.h"
#include "llvm/Support/FileSystem.h"
#include "llvm/Support/MD5.h"
#include "llvm/Support/Path.h"
#include "llvm/S... | TOOL | 0.936616 | 7.697338 |
18f3b8b2-35c2-44a4-a6b4-8e4ba03720e8 | manikanta2901/ubuntu | .history/codingChallenges/cpp/Codechef/longChallenges/August/ChefAndWedding.cpp_20200816131959.cpp | #include<bits/stdc++.h>
#include<vector>
#include<iostream>
#include<cmath>
#include<algorithm>
#include<iterator>
#include<string>
#include<map>
#define vv vector
#define F first
#define S second
#define MP make_pair
#define EXECUTE_FASTER ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define printM... | ALGO | 0.999946 | 3.530482 |
e3df3953-2b05-4087-a0e4-0e21ae02b12f | Mdananda/Competitive-Programming | Learn Topic/Bainary-search/Advance Class _Bainary Search.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define sc scanf
#define pf printf
#define pb push_back
int main()
{
int lo = 0, hi = 10, tmp;
int nm, np;
cin>>nm>>np;
while((hi-lo) > 1)
{
int md = (lo+hi)/2;
tmp = nm/md;
if(nm%md != 0)
tmp ... | ALGO | 0.999862 | 3.265181 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.