uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
4f56b76d-81a3-416a-b597-397a3d26af6c | CunZy/codetree-TILs | 250706/2개 이상의 알파벳/more-than-one-alphabet.cpp | #include <iostream>
#include <string>
using namespace std;
string A;
bool isTrue(string s) {
for(int i = 0; i < s.length(); ++i) {
if(s[0] != s[i]) {
return true;
}
}
return false;
}
int main() {
cin >> A;
// Please write your code here.
if(isTrue(A)) {
c... | ALGO | 0.999891 | 4.101434 |
cf6e4236-b47a-4056-841c-b87f6f7621d9 | Aastha-1812/Xylophone | 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.998799 | 6.776823 |
ee69efd0-222a-4b89-a45f-2d59219adc8d | sduerr85/OpenBuildEnergyPlus | third_party/DElight/line2.cpp | // Authors: W.L. Carroll and R.J. Hitchcock
// Building Technologies Department
// Lawrence Berkeley National Laboratory
// This work was supported by the Assistant Secretary for Energy Efficiency
// and Renewable Energy, Office of Building Technologies,
// Building Systems and Materials Divisio... | TOOL | 0.974647 | 5.554901 |
04d0f86f-50ca-47cb-b47a-ec7433434251 | sarvex/leetcode-tcsh | solution/2200-2299/2255.Count Prefixes of a Given String/Solution.cpp | class Solution {
public:
int countPrefixes(vector<string>& words, string s) {
int ans = 0;
for (auto& word : words)
if (s.substr(0, word.size()) == word)
++ans;
return ans;
}
}; | ALGO | 0.999832 | 5.918141 |
d88af0fb-7f3b-4959-9fdf-8078dda6a81c | Rakshitpant22/Code_Kosh | LINKED LIST/DLL/OPERATIONS.cpp | //! To insert a new node at given position in doubly linked list.
https://www.geeksforgeeks.org/problems/insert-a-node-in-doubly-linked-list/1?utm_source=youtube&utm_medium=collab_striver_ytdescription&utm_campaign=insert-a-node-in-doubly-linked-list
void addNode(Node *head, int pos, int data)
{ //~ Pth node k baad k... | ALGO | 0.99987 | 3.662855 |
780fd6d7-7c08-4e53-a3a2-994e89f71ec2 | UdaySharmaGitHub/DSA-CPP | GFG/School Problems/Surface_Area_and_Volume_of_Cuboid.cpp | /*
Given length l, width b and height h of a cuboid. Find the total surface area and volume of cuboid.
Example 1:
Input: l = 1, b = 2, h = 3
Output: 22 6
Explanation: Surface area = 2 * (2 * 3
+ 3 * 1 + 1 * 2) = 22 and volume =
1 * 2 * 3 = 6
Example 2:
Input: l = 2, b = 3, h = 5
Output: 62 30
Explanation: Surface a... | ALGO | 0.993982 | 5.632902 |
f25ec99e-5451-480c-8408-14770aa28d22 | Pranav-Jain/Neural-Monte-Carlo-Fluid-Simulation | bindings/zombie/deps/fcpw/deps/eigen-git-mirror/doc/snippets/Tutorial_AdvancedInitialization_LinSpaced.cpp | ArrayXXf table(10, 4);
table.col(0) = ArrayXf::LinSpaced(10, 0, 90);
table.col(1) = M_PI / 180 * table.col(0);
table.col(2) = table.col(1).sin();
table.col(3) = table.col(1).cos();
std::cout << " Degrees Radians Sine Cosine\n";
std::cout << table << std::endl;
| ALGO | 0.938284 | 3.543272 |
0d5f0fba-9e07-4b4a-b13e-8f684663215e | madhav-bits/Coding_Practice | leetCombinationsDFS.cpp | /*
*
//*************************************************************77. Combinations.****************************************************
Given two integers n and k, return all possible combinations of k numbers out of 1 ... n.
For example,
If n = 4 and k = 2, a solution is:
[
[2,4],
[3,4],
[2,3],
[1,2],
[... | ALGO | 0.999894 | 6.944816 |
a48f7992-b206-448c-8588-c0b253c854df | Hackeries/CP | Questions/A/boring_apartments.cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
int t;
cin >> t;
while(t--){
int x;
cin >> x;
int length = 0;
int digit = (x%10) - 1;
while(x>0){
x/=10;
length++;
}
int len = length*(length+1)/2;
int ans = (... | ALGO | 0.999636 | 4.587573 |
172824a5-2340-44cf-ba3a-f71bba0f19c9 | rishitabura/ai-lab | uninformed-seacrh1/water jug problem/waterjugproblemDFS.cpp | #include <iostream>
#include <stack>
#include <map>
using namespace std;
void printSolution(map<pair<int, int>, pair<int, int>> mp, pair<int, int> u) {
if (u.first == 0 && u.second == 0) {
cout << 0 << " " << 0 << endl;
return;
}
printSolution(mp, mp[u]);
cout << u.first << " " << u.sec... | ALGO | 0.999995 | 5.303395 |
fd8c69ff-fbdb-4698-b7b7-d46d46c6ce19 | ste-cartu/Lab-TNDS | Lab4-5/Esercizio5.3/main.cpp | #include "posizione.hpp"
#include "campo.vettoriale.hpp"
#include "punto.materiale.hpp"
#include <iostream>
#include <iomanip>
#include "TApplication.h"
#include "TCanvas.h"
#include "TGraph.h"
#include "TF1.h"
#include "TAxis.h"
#include "TArrow.h"
#include "TEllipse.h"
#include "TText.h"
#include "TPaveText.h"
#d... | ALGO | 0.969571 | 4.356448 |
dfc304e6-1c1e-44ec-a2ce-abcfaf557750 | AngelAnibal23/01_funciones | sumaPrimerosNum.cpp | #include <iostream>
using namespace std;
int sumaPrimeNum(int);
int main(){
int n;
cout<<"Digite la cantidad de terminos a sumar: ";
cin>>n;
cout<<"La suma de los "<<n<<" primeros numeros es: "<<sumaPrimeNum(n)<<endl;
return 0;
}
int sumaPrimeNum(int a){
if(a==1){
return 1;
}
else{
return ... | ALGO | 0.999521 | 3.957948 |
df0f9758-6392-4597-8295-6b6b1d7060d2 | atharvk47/DSA | Graphs/Bipartite Graph using BFS.cpp | // Link: https://practice.geeksforgeeks.org/problems/bipartite-graph/
// Approach:
// 1) Traverse using BFS and color the adjacent nodes in a brute-force fashion.
// 2) If there comes a case in which above thing is not possible, return false.
class Solution {
public:
bool check(int start,int V,vector<int> adj[],int ... | ALGO | 0.99993 | 6.078534 |
3c5b6918-70cd-4084-92fa-b71d0815f8d8 | UvanAdhithya/DSA | Lab6/List ADT Stack.cpp | // Stack menu
#include <iostream>
using namespace std;
class Stack{
private:
char val;
int arr[5] = {0};
int top;
public:
Stack(){
top = -1;
}
char push(char);
char pop();
char peek();
};
int main(){
int option;
char value;
... | TOOL | 0.852337 | 3.883525 |
659f27c1-688b-4a99-978a-e6404a2034f8 | avBuffer/caffe_ssd-android-lib | eigen_3.2.7/doc/snippets/JacobiSVD_basic.cpp | MatrixXf m = MatrixXf::Random(3,2);
cout << "Here is the matrix m:" << endl << m << endl;
JacobiSVD<MatrixXf> svd(m, ComputeThinU | ComputeThinV);
cout << "Its singular values are:" << endl << svd.singularValues() << endl;
cout << "Its left singular vectors are the columns of the thin U matrix:" << endl << svd.matrixU(... | ALGO | 0.999767 | 3.463409 |
6e86af6a-cc4a-47e1-90cf-93d3c942336c | Akshitguptaa/cp | cp/2111D.cpp | //// AKSHIT - template ////
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp> // Common file
#include <ext/pb_ds/tree_policy.hpp>
#include <functional>
using namespace __gnu_pbds;
using namespace std;
typedef long long int int64;
#define int long long
#define endl "\n"
#define INF LLONG_MAX
#def... | ALGO | 0.999871 | 4.765419 |
9372a55d-1c62-44be-8bdd-2d22992887fb | altrohit/sem7 | IS/Enigma Machine.cpp | #include<iostream>
#include<conio.h>
#include<string.h>
#define size 100
using namespace std;
int c1,c2,c3;
void rotate(char *temp)
{
int i,l=strlen(temp);
char t=temp[l-1];
for(i=l-1;i>0;i--)
{
temp[i]=temp[i-1];
}
temp[0]=t;
}
void lower(char *a)
{
int l=strlen(a);
for(int i=0;i<l;i++)
{
a[i]=tolower(a[i... | ALGO | 0.999896 | 3.377069 |
7636fe72-74c7-41c6-8c1a-447c86ad8f6e | kishangupta2023/DSA | LinkedList/1D_LinkedList/insertionll.cpp | #include<bits/stdc++.h>
using namespace std;
class Node{
public:
int data;
Node* next;
public:
Node(int data1,Node* next1){
data = data1;
next = next1;
}
public:
Node(int data1){
data = data1;
next = nullptr;
}
};
Node* convertArrLL(vector<int> &arr... | ALGO | 0.999869 | 5.123642 |
883af9e9-37ac-401e-a085-ad292990bcd5 | elysiumcoin/els | src/scrypt.cpp | #include "scrypt.h"
#include "util.h"
#include <stdlib.h>
#include <stdint.h>
#include <string.h>
#include <openssl/sha.h>
#if defined(USE_SSE2) && !defined(USE_SSE2_ALWAYS)
#ifdef _MSC_VER
// MSVC 64bit is unable to use inline asm
#include <intrin.h>
#else
// GCC Linux or i686-w64-mingw32
#include <cpuid.h>
#endif
#e... | ALGO | 0.98621 | 5.092005 |
4490cb1b-b14f-4843-8211-f9adaecbd7c7 | akgmage/data-structures-and-algorithms | Dynamic Programming/knight_probability_chessboard.cpp | /*
On an n x n chessboard, a knight starts at the cell (row, column) and attempts to make exactly k moves. The rows and columns are 0-indexed, so the top-left cell is (0, 0), and the bottom-right cell is (n - 1, n - 1).
A chess knight has eight possible moves it can make, as illustrated below. Each move is two cells i... | ALGO | 0.999987 | 7.756065 |
316987ed-8abb-4207-a076-69772bafe162 | HansN87/ReferencePriors | example11/calcs.cpp | namespace calcs {
long double integrate_likelihood(int steps, double theta, pdf &this_pdf) {
// this is a brute force 1D integration
// TODO: wrap around GSL
// range of integration: theta in (0,1)
double up = 1.0;
double low = 0.0;
long double dx = 1./steps * (up - low);
long double val = 0.0;
... | ALGO | 0.999777 | 4.077677 |
21232e83-a744-43bf-8ca4-e3e84b1b0d76 | areian13/PS_BOJ | 1. Bronze/Bronze 2/[B2] 10501 Ragged Right.cpp | #include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#define FastIO ios_base::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr)
using namespace std;
int main()
{
FastIO;
vector<string> sens;
int n = 0;
while (true)
{
string s;
getline(cin, s);
... | ALGO | 0.979063 | 4.019757 |
787fe352-de17-4d4a-b3c1-50c7cf8c3f69 | DUT-SUN/DUT-1 | DUT-C++1/DUT-C++1/Mystring.cpp | //#define _CRT_SECURE_NO_WARNINGS 1
//#include<iostream>
//#include<cstring>
////ַMyString˽ݳԱchar* p, int size; //ַ
////
////1صĹ캯졢Աʵ¹ܣ
////
////2ءʵַӹܣ
////
////3ء == жַǷȣַݵֵ˳true / false
////
////4ء << 롰 >> ʵַcin >> s3; cout << s2 << endl;
////
////ѡ
////
////1()ַзһӴs1(2, 4)ʾشӴs[2](s13ַ)ʼӴ(s1[2]s1[3]s1[4]ַ)
////
////... | TOOL | 0.967997 | 3.395518 |
05d24fd4-c3a6-43ff-8073-aa4fadc2db25 | mehedihasankanon/cp-code-archive | All_codes/Inversion_Count.cpp | // Bismillahir Rahmanir Rahim
// link : https://vjudge.net/problem/SPOJ-INVCNT
// status : ac
#pragma GCC optimize("O1,O2,O3")
#pragma GCC optimize("Ofast,unroll-loops")
#include <bits/stdc++.h>
// #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2,fma,bmi,bmi2,lzcnt")
u... | ALGO | 0.999854 | 4.281906 |
57295aed-f3e5-41d2-9d09-131b49938258 | ishandutta2007/codeforces | monyura/normal/360/A.cpp | #ifdef _MONYURA_
#pragma comment(linker,"/STACK:256000000")
#endif
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <bitset>
#include <memory>
#include <algorithm>
#include <set>
#include <map>
#include <vector>
#include <list>
#include <string>
#include <cstring>
#include <fstream>
#include <function... | ALGO | 0.999993 | 3.237549 |
c0fb5b62-919e-47ce-9a03-c8864e1f7985 | tub-rip/epba | thirdparty/basalt-headers/thirdparty/eigen/doc/examples/TutorialLinAlgSelfAdjointEigenSolver.cpp | #include <iostream>
#include <Eigen/Dense>
using namespace std;
using namespace Eigen;
int main()
{
Matrix2f A;
A << 1, 2, 2, 3;
cout << "Here is the matrix A:\n" << A << endl;
SelfAdjointEigenSolver<Matrix2f> eigensolver(A);
if (eigensolver.info() != Success) abort();
cout << "The eigenvalues of A ... | ALGO | 0.999423 | 3.846247 |
fe6b612b-64ac-4613-b852-27de59d4701b | haiku/haiku | src/libs/linprog/LayoutOptimizer.cpp | #include "LayoutOptimizer.h"
#include <algorithm>
#include <new>
#include <stdio.h>
#include <string.h>
#include <AutoDeleter.h>
//#define TRACE_LAYOUT_OPTIMIZER 1
#if TRACE_LAYOUT_OPTIMIZER
# define TRACE(format...) printf(format)
# define TRACE_ONLY(x) x
#else
# define TRACE(format...)
# define TRACE_ONLY(x)
#endi... | ALGO | 0.999422 | 5.880367 |
ff817579-c88f-4ff8-838f-c914d799e544 | luigicast0408/Algoritmi | Teoria/Esercizi/flip-maxSequence/flip_maxSequence.cpp | #include <iostream>
using namespace std;
int flip_max_sequence(int sequence[], int size) {
if (size == 0 || size == 1) {
return size;
}
if (sequence[0] < sequence[size - 1]) {
return size;
}
return flip_max_sequence(sequence + 1, size - 1);
}
int main() {
int sequence[] = {3,... | ALGO | 0.999532 | 5.457871 |
b66f0866-c4f8-490d-9938-6cc348609361 | MedoN11/CompetitiveProgramming | Timus/1156.cpp | #include <iostream>
#include <cstdio>
#include<list>
#include<iomanip>
#include<cmath>
#include<queue>
#include <functional>
#include<stdio.h>
#include<assert.h>
#include<stack>
#include<sstream>
#include <cstdlib>
#include<map>
#include<algorithm>
#include<iostream>
#include<set>
#include<utility>
#include<memory.h>
#... | ALGO | 0.999969 | 3.908642 |
d627163b-f360-4730-bf2d-73c57727bba9 | RanggaHijriawanHaryadi/pd_activity2_063 | latihan/latihan.cpp | #include <iostream>
using namespace std;
float luaspersegipanjang(float p, float l) {
return p * l;
}
float luaslingkaran(float r) {
return 3.14 * r * r;
}
float luassegitiga(float a, float t) {
return 0.5 * a * t;
}
int main() {
float panjang, lebar, jejari, alas, tinggi;
int pilihan;
do
... | TOOL | 0.928229 | 3.105017 |
eeff9c32-0812-4f17-8423-d007ae3cfecc | stwind/atcoder | contests/abc017/C/main.cpp | #include <bits/stdc++.h>
using namespace std;
// clang-format off
#define PARENS ()
#define EXPAND(...) EXPAND4(EXPAND4(EXPAND4(EXPAND4(__VA_ARGS__))))
#define EXPAND4(...) EXPAND3(EXPAND3(EXPAND3(EXPAND3(__VA_ARGS__))))
#define EXPAND3(...) EXPAND2(EXPAND2(EXPAND2(EXPAND2(__VA_ARGS__))))
#define EXPAND2(...) EXPAND1(... | ALGO | 0.999987 | 4.469397 |
d1cd94ee-fdcf-4270-9496-303a70284658 | tsiktsiris/eightpuzzle | src/AStarManhattanMove.cpp | /**
8 Puzzle Solver using BFS,IDS & AStar
Assignment 01 @ Artificial Intelligence
Dimitris Tsiktsiris - University Of Western Macedonia
**/
#include "AStarManhattanMove.h"
void AStarManhattanMove::add_to_queue()
{
DEBUG_PRINT("Preparing for adding new child..\n");
string key = current_state_obj.get_id();
... | ALGO | 0.999938 | 4.383308 |
72d81fa0-6919-4eee-8fa0-c81574212920 | Ngochuy2137/simulation_ws | src/costmap_2d/src/array_parser.cpp | #include <cstdio> // for EOF
#include <string>
#include <sstream>
#include <vector>
namespace costmap_2d
{
/** @brief Parse a vector of vector of floats from a string.
* @param input
* @param error_return
* Syntax is [[1.0, 2.0], [3.3, 4.4, 5.5], ...] */
std::vector<std::vector<float> > parseVVF(const std::string... | TOOL | 0.949596 | 5.081814 |
cd1aeaeb-3504-4ad1-b763-01bf5e70b10d | mohosy/CS8_Data_Structures | PCC Class Assignments/Final Exam/rationalsample.cpp |
#include <iostream>
#include <iostream>
#include <cmath>
using namespace std;
class Rational
{
public:
Rational();
Rational(int, int);
Rational add(const Rational&);
Rational subtract(const Rational&);
Rational multiply(const Rational&);
Rational divide(const Rational&);
void print();
pri... | TOOL | 0.998244 | 5.733374 |
f0bbf700-e9d4-45f0-ac42-4351742694b1 | toufunn/fun | FACEBOOK/283_Move_Zeroes.cpp | /*don't think too muc two pointer!!!*/
class Solution {
public:
void moveZeroes(vector<int>& nums) {
int j = 0;
for (int i = 0; i < nums.size(); i++){
if(nums[i]) nums[j++] = nums[i];
}
for(;j<nums.size(); j++) {
nums[j] = 0;
}
}
};
| ALGO | 0.999969 | 5.974034 |
29daa309-7c2e-436c-8f78-57d794d2a79b | SnowySparks/Algorithm_Solve | BackJoon_solved/다이나믹프로그래밍/25953_템포럴그래프.cpp | #include <iostream>
using namespace std;
const int inf = 1e9 + 7;
int N, T, M, S, E;
int dist[1001][10000];
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
cin >> N >> T >> M >> S >> E;
for (int i = 0; i < N; i++) dist[0][i] = inf;
dist[0][S] = 0;
for(int t = 0; t < T; t++) {
for (int i = 0; i < N; i++) dis... | ALGO | 0.999952 | 4.532314 |
924df42e-9ce9-4cf3-93ae-85248f8d7455 | poby123/studyAlgorithm | 종만북/07 분할정복/빠른합.cpp | /*
분할정복 알고리즘은 크게 3가지 요소로 이루어져 있다.
1. divide: 문제를 더 작은 문제로 분할하는 과정
2. merge : 각 문제에 대해 구한 답은 원래 문제에 대한 답으로 병합하는 과정
3. base case: 더 이상 답을 분할하지 않고 곧장 풀 수 있는 매우 작은 문제
n이 짝수일 때
fastSum(n)
= 1 + 2 + ... + (n/2) + (n/2+1) + ... + n
= {1 + 2 + (n/2)} + {(n/2+1) + ... + n}
= fastSum(n/2) +... | ALGO | 0.999958 | 5.342875 |
0753f990-29be-4908-b25a-c1018fb730d2 | teju85/programming | codeeval/cpp/moderate/RemoveCharacters.cpp | //
// Challenge name: Remove Characters
// Difficulty : moderate
// Link : http://codeeval.com/open_challenges/13/
// Compile : gcc -Wall -g -o RemoveCharacters RemoveCharacters.c
//
#include <stdio.h>
// assuming that line contains only 8192 characters
#define MAX_LINE 8192
int stringLen(char* str,... | ALGO | 0.962741 | 4.16236 |
603ac5ec-6165-484f-961d-ceb5f6bc51a6 | natmwong/Flutter-fitnessApp-UI | 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.998799 | 6.776823 |
12726199-7009-44ed-aa7d-5567c8141569 | Gabyyi/highschool-code | functie_nrdiv.cpp | #include<iostream>
#include<cmath>
using namespace std;
int nr(float a, float b)
{
int x=0;
x=abs((int)a-(int)b)+1;
return x;
}
int main()
{
int a,k,p,q,x=0;
cin>>a>>k;
p=pow(10,k-1);
q=pow(10,k)-1;
for(int i=p;i<=q;i++)
if(i%a==0) x=x+nr(i,i);
cout<<x;
} | ALGO | 0.997928 | 3.367129 |
f882919a-50de-4756-acbd-ffe37b26809b | chosh95/STUDY | BaekJoon/2020/토마토 (7576번).cpp | #include <iostream>
#include <queue>
#include <algorithm>
#include <cstring>
using namespace std;
int N, M, res;
int p[1002][1002];
int visit[1002][1002];
queue < pair<int, int>> q;
int dx[4] = { -1,0,0,1 };
int dy[4] = { 0,-1,1,0 };
void bfs()
{
while (!q.empty()) {
int x = q.front().first;
int y = q.front().sec... | ALGO | 0.999982 | 4.569197 |
ef98fef9-b85d-49d0-844c-f2b0a1878ef5 | nitintayal008/leetcode-daily-questions | 410-split-array-largest-sum/410-split-array-largest-sum.cpp | class Solution {
public:
int splitArray(vector<int>& nums, int m) {
int l=0,r=0,n=nums.size();
for(int i=0;i<n;++i) l=max(l,nums[i]), r+=nums[i];
int mid=0,ans=0;
while(l<=r){
mid=(l+r)/2;
int count=0,tempsum=0;
for(int i=0;i<n;++i){
... | ALGO | 0.999981 | 5.888022 |
29d677c2-d90b-4518-8345-546ebff9d694 | sarvex/leetcode-umka | solution/0100-0199/0125.Valid Palindrome/Solution.cpp | class Solution {
public:
bool isPalindrome(string s) {
int i = 0, j = s.size() - 1;
while (i < j) {
if (!isalnum(s[i])) {
++i;
} else if (!isalnum(s[j])) {
--j;
} else if (tolower(s[i]) != tolower(s[j])) {
return fal... | ALGO | 0.999421 | 6.480253 |
76028291-a7ec-4bfa-bcf7-6d7e694b07ed | Thalisson-Alves/Competitive-Programming | submissions/CodeForces/1957/a.cpp | #include <bits/stdc++.h>
using namespace std;
#ifdef DEBUG
#include "debug.cpp"
#else
#define dbg(...)
#endif
using ll = long long;
void solve() {
int n;
cin >> n;
vector<int> hist(101);
for (int i = 0; i < n; i++) {
int x;
cin >> x;
++hist[x];
}
int res = 0;
for (int i = 0; i <= 100; i++) ... | ALGO | 0.99949 | 4.800685 |
8fcbd01f-05ad-4be4-ba7e-c1aa1635cec8 | kevinzhang334455/Scout | boost_1_56_0/libs/graph/example/scaled_closeness_centrality.cpp | //[scaled_closeness_centrality_example
#include <iostream>
#include <iomanip>
#include <boost/graph/undirected_graph.hpp>
#include <boost/graph/exterior_property.hpp>
#include <boost/graph/floyd_warshall_shortest.hpp>
#include <boost/graph/closeness_centrality.hpp>
#include "helper.hpp"
using namespace std;
using nam... | ALGO | 0.99986 | 7.06719 |
17a3a31d-23dc-4177-ada6-17f5ba52fa3d | itstepP12814/Himbitski | HW27/27Hw2.cpp | #include <iostream>
#include <ctime>
using namespace std;
template <typename T> struct Item
{
T number;
Item *next;
Item *prev;
};
template <typename T> class Doublelist{
size_t size;
T junk;
Item<T> *begin;
Item<T> *end;
public:
Doublelist<T>::Doublelist(){
begin = nullptr;
end = nullptr;
size = 0;
};
... | ALGO | 0.998893 | 3.845341 |
0cfea724-5a16-4cfe-a4fa-589348b6ea3d | leonardoamurca/BSI | AEDs-01/leonardoAguilar_roteiro5/leonardoAguilar_ex03.cpp | /*
Leonardo Aguilar
Imprime os n primeiros nmeros da srie de Fibonacci
Entrada: n
Sada: Srie de Fibonacci
*/
#include <iostream>
#include <locale.h>
#include <windows.h>
#include <math.h>
using namespace std;
//Varivel Global
int main(){
//Incluso de caracteres especiais
setlocale(LC_ALL, "Portuguese");
... | ALGO | 0.998936 | 4.317761 |
92ae4c86-848a-48f1-9242-e467ec5ddd98 | SohrabRoohi/ICPC2018Open | Blink.cpp | /*
Sohrab Roohi
*/
#include <bits/stdc++.h>
using namespace std;
const double pi=acos(-1.0);
typedef pair<int, int> PII;
typedef vector<int> VI;
typedef vector<string> VS;
typedef vector<PII> VII;
typedef vector<VI> VVI;
typedef map<int,int> MPII;
typedef set<int> SETI;
typedef multiset<int> MSETI;
typedef long in... | ALGO | 0.999877 | 4.400708 |
2f5d9ade-4b2e-4a16-8040-7387a54f6e5e | rathoresrikant/competitive-programming-solutions | Codechef/CHEFPTNT.cpp | #include <iostream>
#include <string>
using namespace std;
void print_util(int arr[], int size) {
for (int i = 0 ; i < size ; i++) {
cout << arr[i] << " ";
}
cout << endl;
}
void go(int total_patents, int max_months, int workers, int max_workers, string str) {
if (max_workers <= 0) {
cout << "no" << endl;
... | ALGO | 0.9999 | 3.952285 |
d0f67633-ca1e-42d6-a70e-c8520d4157a2 | Zimse12345/Code | Codeforces_Contest/CF2004/B.cpp | #include <bits/stdc++.h>
using namespace std;
const int N=1.01e6;
int T,a,b,c,d;
signed main(){
cin>>T;
while(T--){
cin>>a>>b>>c>>d;
if(c<a)swap(a,c),swap(b,d);
if(b<c)printf("1\n");
else if(b<d){
int x=b-c+1;
if(a!=c)++x;
printf("%d\n",x);
... | ALGO | 0.999707 | 3.295411 |
9aa3e899-f937-4fc7-a4f2-61eac4a3f9e9 | Evolution-X/frameworks_av | media/module/codecs/amrwb/dec/src/preemph_amrwb_dec.cpp | /*
------------------------------------------------------------------------------
Filename: preemph_amrwb_dec.cpp
Date: 12/10/2004
------------------------------------------------------------------------------
REVISION HISTORY
Description:
-------------------------------------------------------------------... | ALGO | 0.99991 | 5.47154 |
da4c72f7-7b68-42fa-acb8-3afdf0b36591 | sjhaberman/maxliklib | quadrature/eaps.cpp | //Find EAP and corresponding conditional covariance matrix for all n observations.
//For each observation j, posts(j) has a vector of m probabilities and
//a m by k matrix of m responses of dimension k.
//eap.v is mean and eap.m is covariance.
#include<armadillo>
using namespace std;
using namespace arma;
// Combinatio... | ALGO | 0.99817 | 3.762079 |
d2e265fa-6b77-4627-8021-0b1a17bf2f78 | wh2per/SW-PRO-Algorithm | SW_PRO_Algorithm/교육P-0022(히스토그램에서가장큰직사각형).cpp | #include <iostream>
#include <vector>
#include <algorithm>
#include <stack>
using namespace std;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
int tc;
cin >> tc;
for (int t = 1; t <= tc; ++t) {
int n;
cin >> n;
stack<pair<long, long>> s;
long long ans = 0;
for (int i ... | ALGO | 0.999808 | 3.805097 |
768d6eea-f3eb-4f10-b2c9-53b039371809 | rony2510/180DaysOfCode | C++/int2char.cpp | #include <bits/stdc++.h>
using namespace std;
void int2char(){
int x;
cin>>x;
char c=x+'0';
cout<<c<<endl;
return;
}
int main(){
int2char();
return 0;
}
/**
* https://codeforces.com/profile/Captcha
* https://www.codechef.com/users/codecloude
* https://atcoder.jp/users/Captcha
* ht... | ALGO | 0.998223 | 3.581063 |
9b279193-696e-4f13-be41-9033dbf89a82 | cbkpar/BOJ | boj_32216.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
int iN, iK, iT;
cin >> iN >> iK >> iT;
int iTotal = 0;
for (int i = 0;i < iN;++i)
{
int iTemp;
cin >> iTemp;
if (iT < iK)
{
iT = iT + iTe... | ALGO | 0.999897 | 3.967431 |
f93b6eff-54a5-4f4f-acb9-371b877d23a3 | ishandutta2007/codeforces | frame233/normal/1578/B.cpp | #include<bits/stdc++.h>
#define pb push_back
#define SZ(x) ((int)x.size())
const int N=2005;typedef std::pair<int,int> pi;
char s[N],t[N],tmp[N];int n,k,c,p[N];
bool cmp(char *a,char *b){for(int i=1;i<=n;++i)if(a[i]!=b[i])return a[i]<b[i];return 0;}
std::vector<pi> solve(char *s){
std::vector<pi> ans;int pos;
auto ap... | ALGO | 0.999914 | 3.339783 |
cba33d6f-1649-40d5-a68f-4d4c93b40b7c | Sameermoyal/22Aug_cpp_ass | prog_13.cpp |
#include<bits/stdc++.h>
using namespace std;
int main(){
vector<int> arr = { 870, 710, 390, 180, 370, 830, 290};
for(int i=0;i<arr.size();i++){
int mini=i;
for(int j=i+1;j<arr.size();j++){
if(arr[j]<arr[mini]){
mini=j;
}
... | ALGO | 0.999896 | 3.640076 |
c4055e31-7398-456a-b187-41f37b98ef6c | RinCloud/TrickCatcher | Datasets/TrickyBugs/GenProgs/tc_generated_progs_cpp/p02641/p02641_num3_parsed.cpp | #include <iostream>
#include <cmath>
using namespace std;
int main() {
int X, N;
cin >> X >> N;
bool arr[101] = {false};
for (int i = 0; i < N; i++) {
int p;
cin >> p;
arr[p] = true;
}
int answer = X;
for (int i = 0; i <= 100; i++) {
if (!arr[X - i]... | ALGO | 0.99994 | 3.819443 |
e757b83d-accf-4978-94b1-0dde5ea9e37e | shreejitverma/SDE-Interview-Prep | competitive-programming/Binary Trees/Bottom View of Binary Tree.cpp | /*https://practice.geeksforgeeks.org/problems/bottom-view-of-binary-tree/1
https://www.geeksforgeeks.org/bottom-view-binary-tree/
Bottom View of Binary Tree
Medium Accuracy: 45.32% Submissions: 90429 Points: 4
Given a binary tree, print the bottom view from left to right.
A node is included in bottom view if it can be... | ALGO | 0.999996 | 6.133663 |
11619156-6cc4-40bd-8dea-f02bed818781 | Xilinx/llvm-aie | llvm/lib/Support/CachePruning.cpp | #include "llvm/Support/CachePruning.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/Errc.h"
#include "llvm/Support/Error.h"
#include "llvm/Support/FileSystem.h"
#include "llvm/Support/Path.h"
#include "llvm/Support/WithColor.h"
#include "llvm/Support/raw_ostream.h"
#define DEB... | TOOL | 0.928226 | 7.635558 |
34a6bbef-0ac9-4d0b-9676-052d1c414599 | sdulaney/hackerrank | Data Structures/Tries - Contacts/Tries - Contacts/main.cpp | #include <iostream>
using namespace std;
const int NUM_CHARACTERS = 26;
class Node {
Node* children[NUM_CHARACTERS];
int size = 0;
public:
int getCharIndex(char c){
return c - 'a';
}
Node* getNode(char c){
return children[getCharIndex(c)];
}
void setNode(char c, Node* ... | ALGO | 0.999385 | 4.783616 |
32b062d0-611a-4915-bf8f-abdfae211f10 | lcd479/MVP | lib/OpenNI2-TX1/OpenNI2/Source/Drivers/OniFile/Formats/XnStreamCompression.cpp | //---------------------------------------------------------------------------
// Includes
//---------------------------------------------------------------------------
#include "XnStreamCompression.h"
#include <XnStatus.h>
#include <XnLog.h>
#define XN_MASK_STREAM_COMPRESSION "xnStreamCompression"
//-----------------... | ALGO | 0.989884 | 6.561326 |
8efcd7c9-142d-43da-83b8-bd54c03f45e0 | MereyPolatkhan/competitive_programming_and_algorithms | _ya_tren_3/37.cpp | #include <bits/stdc++.h>
using namespace std;
#define N 100009
#define M 100009
int n;
vector<int> g[N];
vector<int> used(N, 0);
vector<int> d(N, 1e9);
vector<int> parent(N, -1);
void bfs(int v) {
used[v] = 1;
queue<int> q;
q.push(v);
d[v] = 0;
while (q.size() > 0) {
int x = q.front();
... | ALGO | 0.999674 | 4.191512 |
4bdc8484-1e5e-495f-a8a9-e83ea24d0660 | eric-cw-hsu/uva | uva686.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define PB push_back
#define PII pair<int, int>
#define MP make_pair
#define all(x) x.begin(), x.end()
#define REP(x, y, z) for(int x = y; x <= z; x++)
#define F first
#define S second
#define maxn 100000
#define MSET(x, y) memset(x, y, sizeof(x))
//st... | ALGO | 0.999809 | 4.033747 |
172e55cd-d288-4276-9f09-64c2f1023caa | deepak-ky/cpp-codes | cpp-codes/Fast_power.cpp | #include<iostream>
#include<bits/stdc++.h>
using namespace std;
int raiseto(int a,int b)
{
if(b==0)
{
return 1;
}
if(b==1)
{return a;}
else return a*raiseto(a,b-1);
}
int main()
{
int a,b;
cin>>a>>b;
cout<<raiseto(a,b);
return 0;
}
| ALGO | 0.999977 | 4.126266 |
b380cbd4-4cd8-432f-9d45-9f7033f50d6a | K0nnyaku/Code | Data/CSP-JS2021二轮提高组数据/SD-00006/bracket/bracket.cpp | #include<bits/stdc++.h>
using namespace std;
unsigned int f[256][256][256][2];
char str[256];
unsigned int n, k;
int main(){
freopen("bracket.in", "r", stdin);
freopen("bracket.out", "w", stdout);
cin>>n>>k;
while(isspace(cin.peek()))cin.get();
cin.getline(str+1, 255);
f[0][0][0][0]=1;
//f[0][0][0][1]=1;... | ALGO | 0.999929 | 3.495223 |
cca0dffd-fa11-408b-a42c-c243ae134ab0 | dseitani/cplusplus_projects | Networks/random.cpp | #include <fstream>
#include <cstdlib>
#include <vector>
using namespace std;
int main(int argc, char const *argv[]) {
int i,j,k;
int m=1000;
int N1=1000;
double p=0.16;
double x,sum;
vector<vector<int> > list1(N1);
vector<vector<int> > size1(N1, vector<int>(m,0));
srand(4372);
ofstream f1("random.tx... | ALGO | 0.970324 | 3.17183 |
c833e3af-f4cf-4de6-a8a9-87fb65243ef7 | carrtesy/Problem-Solvings | bkj/1463/to1_v3.cpp | #include <iostream>
using namespace std;
int getCount(int * arr, int n){
// check if data is in already
if(arr[n]){
return arr[n];
} else if(n == 1) {
return 0;
}
// a: n / 3
// b: n / 2
// c: n - 1
if(n % 3 == 0 && n % 2 == 0){
int a = getCount(arr, n/3);
int b = getCount(arr, n/... | ALGO | 0.999968 | 4.530883 |
6d179cd1-151a-494e-9c13-c1c3402d6c83 | null0ptr/numerical-method | curve-fitting/tmp.cpp | #include<iostream>
#include<math.h>
#define S 50
using namespace std;
int main()
{
int n, i;
float x[S], y[S], sumX = 0, sumX2 = 0, sumY = 0, sumXY = 0, a, b, A;
/* Input */
cout << "How many data points? " << endl;
cin >> n;
for (i = 1; i <= n; i++)
{
cout << "x[" << i << "] = ";
cin >> x[i];
cout <<... | ALGO | 0.998031 | 3.319507 |
8854c278-b8f1-486b-b2e5-e9b0d94a78aa | vietnakid/ACM-ICPC | CodeChef/MARCH19LongChal/_CHEFSOC.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector< vector<int> > vvi;
typedef vector<ll> vl;
typedef vector< vector<ll> > vvl;
typedef pair<int, int> ii;
typedef vector<ii> vii;
typedef vector< vii> vvii;
#define INF 1000000007
#define INFLL 100000000000000000... | ALGO | 0.999909 | 4.129976 |
a18eceb6-528e-4003-9885-5742a9606730 | SovietPower/My-OI-ACM | 图论/欧拉路 哈密顿路/BZOJ.4727.[POI2017]Turysta(哈密顿路径&回路 竞赛图).cpp | /*
4884kb 9220ms
$Description$
һnͼ֮ҽһߡÿvvһ࣬ûظͬһһϵļ·
n<=2000
$Solution$
ͼõͼһһΪͼǰϵȷֻһ
ǰǿͨеһ Եǿͨһ
Ϊͼÿǿͨһһܶٻ·
ֻҪÿһǿͨĹܶٻ·ȻߣÿǿͨĻ·УӺǰ
*/
#include <cstdio>
#include <cctype>
#include <vector>
#include <algorithm>
#define gc() getchar()
const int N=2005;
int n,dfn[N],low[N],id,cnt,bel[N],sk[N],top,nxt[N],dgr[N],pos[N];
boo... | ALGO | 0.999982 | 3.498481 |
69580273-a2fa-41de-b103-53f26656d5ff | JonyeLH/interview_test | 阿里/阿里第一题.cpp | /*
ʵһ˫˶
1 ʾͷ 2 ʾβ
3 ʾͷɾ 4 ʾβɾ
룺
7 ʾж
2 3 β3 [3]
1 3 ͷ3 [3 3]
2 4 β4 [3 3 4]
3 ͷɾ [3 4]
3 ͷɾ [4]
2 5 β5 [4 5]
1 1 ͷ1 [1 4 5]
1 4 5
*/
#include <iostream>
#include <deque>
#include <vector>
#include <unordered_map>
#include <algorithm>
using namespace std;
int main() {
int N,op, temp;
cin >> N;
vector... | ALGO | 0.999909 | 4.174347 |
7d05f2f8-e85a-4f2a-ab1e-59d7c6eee3bb | truong11062002/IT001 | 20522087_02/Bai_033/Bai_033.cpp | #include<iostream>
#include<cmath>
using namespace std;
float Tong(int);
int main()
{
int n;
cout << "Nhap n: ";
cin >> n;
float kq = Tong(n);
cout << "Ket qua : " << kq;
return 1;
}
float Tong(int k)
{
float s = 0.5;
for (int i = 2; i <= k; i = i + 1)
s = s + (float)i / (i + 1);
return s;
} | ALGO | 0.998734 | 3.304964 |
70cad389-ba64-41f5-8600-5bfab74051a1 | MaximePremont/R-Type_Epitech | libs/boost/libs/sort/test/test_parallel_stable_sort.cpp | //----------------------------------------------------------------------------
/// @file test_parallel_stable_sort.cpp
/// @brief test program of the parallel_stable_sort algorithm
///
/// @author Copyright (c) 2016 Francisco Jose Tapia (<EMAIL> )\n
/// Distributed under the Boost Software License, Version 1.0.... | TEST | 0.905492 | 6.078225 |
28b5d206-4446-4973-88f3-a88b0854845c | ishandutta2007/codeforces | cheetose/normal/1307/A.cpp | #include<cstdio>
#include<cstdlib>
#include<iostream>
#include<vector>
#include<queue>
#include<bitset>
#include<string>
#include<stack>
#include<set>
#include<unordered_set>
#include<map>
#include<unordered_map>
#include<cstring>
#include<complex>
#include<cmath>
#include<iomanip>
#include<numeric>
#include<algorithm>... | ALGO | 0.999957 | 3.596087 |
0fbf56e5-be6d-40ce-9866-b745694adb4f | BestUsername/project_euler | pe010.cpp | #include <iostream>
#include <memory>
#include <vector>
#include "pe.h"
/*
The sum of the primes below 10 is 2 + 3 + 5 + 7 = 17.
Find the sum of all the primes below two million.
*/
typedef long long type;
//since we know the full range of primes, we can use a sieve
type get_primes_sum_under_faster(int n) {
std:... | ALGO | 0.999882 | 5.311403 |
9c6591ea-b00e-4a43-b65b-e71fcd5eff62 | Ig-dolci/Nektar_sensitivity_stability | library/MultiRegions/PreconditionerDiagonal.cpp | #include <LibUtilities/BasicUtils/VDmathArray.hpp>
#include <MultiRegions/PreconditionerDiagonal.h>
#include <MultiRegions/GlobalMatrixKey.h>
#include <MultiRegions/GlobalLinSysIterativeStaticCond.h>
#include <cmath>
using namespace std;
namespace Nektar
{
namespace MultiRegions
{
/**
* Regis... | ALGO | 0.985974 | 4.633236 |
e33eedd4-cdb5-4c68-af22-cebfce7a378d | Koweiyi/LC_cpp | 404.左叶子之和.cpp | /*
* @lc app=leetcode.cn id=404 lang=cpp
*
* [404] 左叶子之和
*
* https://leetcode-cn.com/problems/sum-of-left-leaves/description/
*
* algorithms
* Easy (54.61%)
* Likes: 151
* Dislikes: 0
* Total Accepted: 25.6K
* Total Submissions: 46.8K
* Testcase Example: '[3,9,20,null,null,15,7]'
*
* 计算给定二叉树的所有左叶子... | ALGO | 0.999935 | 6.894704 |
45c20630-c385-44b9-92e8-7343d884a725 | yhm-amber/virtualbox | src/VBox/HostDrivers/VBoxUSB/USBFilter.cpp | /* $Id$ */
/** @file
* VirtualBox USB filter abstraction.
*/
/*********************************************************************************************************************************
* Header Files ... | TOOL | 0.872821 | 7.510212 |
8fc95974-a2e8-4c71-b36f-eda6321781eb | warck/Marlin-2.0.5.3-U20-SKR-v1.4-TURBO | Marlin/src/gcode/bedlevel/abl/G29.cpp | /**
* G29.cpp - Auto Bed Leveling
*/
#include "../../../inc/MarlinConfig.h"
#if HAS_ABL_NOT_UBL
#include "../../gcode.h"
#include "../../../feature/bedlevel/bedlevel.h"
#include "../../../module/motion.h"
#include "../../../module/planner.h"
#include "../../../module/stepper.h"
#include "../../../module/probe.h"
#... | ALGO | 0.977151 | 7.774064 |
2bfeefcc-7169-4eca-baaa-5ce7926d07d9 | Seokwon-Park/BAEKJOON-BOJ | 프로그래머스/unrated/120806. 두 수의 나눗셈/두 수의 나눗셈.cpp | #include <string>
#include <vector>
using namespace std;
int solution(int num1, int num2) {
float a = (float)num1 / (float)num2;
a*=1000;
return a;
} | ALGO | 0.995674 | 4.091245 |
0510c288-e089-4467-ad94-00b29f6feaa9 | santoshjambagigit/Net_Finance_Hub_main | Net_Finance_Hub-main/windows/flutter/ephemeral/.plugin_symlinks/firebase_auth/example/windows/runner/utils.cpp | #include "utils.h"
#include <flutter_windows.h>
#include <io.h>
#include <stdio.h>
#include <windows.h>
#include <iostream>
void CreateAndAttachConsole() {
if (::AllocConsole()) {
FILE* unused;
if (freopen_s(&unused, "CONOUT$", "w", stdout)) {
_dup2(_fileno(stdout), 1);
}
if (freopen_s(&unuse... | TOOL | 0.997875 | 6.771462 |
1d2b9593-ed6d-4ec5-aef7-195717c2ccf5 | knockcat/Leetcode | 0div-idbig-omega-company-tagsdiv-idbig-omega-topbardiv-classcompanytagscontainer-styleoverflow-x-scroll-flex-wrap-nowrap-div-classcompanytagscontainer-tagno-companies-found-for-this-problem-div-divdiv-classcompanytagscontainer-chevrondivsvg-version11-idicon-xmlnshttp-wwww3org-2000-svg-xmlns-xlinkhttp-wwww3org-1999-xlin... | class Solution {
public:
int minOperations(vector<int>& arr) {
int n = arr.size();
if(n == 1) return 0;
sort(arr.begin(), arr.end());
vector<int> a;
for(int i = 0; i < n-1; i++) {
while(arr[i] == arr[i+1]) i++;
a.push_back(arr[i]);
}
if(arr.back() != a.back()) a.push_... | ALGO | 0.999971 | 5.672921 |
87c89a38-eb88-48bf-b5b8-0bf7c98e2f13 | potty-dzmeia/PrimeNumbersToBitmap | Eratosthenes.cpp | //==============================================================================
// File name: Eratosthenes.cpp
//
// Description: Cpp file for Eratosthenes class
//==============================================================================
#include "eratosthenes.h"
Eratosthenes::Eratosthenes(void)
{
//Set th... | ALGO | 0.994607 | 4.701643 |
b401e41b-2584-48cc-a845-2a59dbfa0d38 | EdenGoforIt/cplus-image-processing | ch2/src/main.cpp | #include <iostream>
#include <opencv2/opencv.hpp>
#include <unordered_set>
using namespace cv;
using namespace std;
typedef pair<int, int> pairs;
int main(int argc, char **argv)
{
// if no arguments are given, argc - 1 evaluates to 0, so argv[0] (program name) is accessed.
// void simply evaluate the expression a... | ALGO | 0.997489 | 4.710277 |
1738a0dc-ab52-4154-a7cc-df6a17e6b7f9 | GabrielCFormiga/Competitive-Programming | Constests/I SBC São Paulo Programming Marathon/D_Dealing_with_São_Paulo_Hot_Dogs.cpp | /**
* @file d.cpp
*
* Created on 2025-06-10 at 15:08:08
* @author GabrielCampelo
*/
#include <bits/stdc++.h>
#define _ ios_base::sync_with_stdio(0);cin.tie(0);
#define endl '\n'
#define pb push_back
#define all(x) (x).begin(), (x).end()
using namespace std;
typedef long long ll;
typedef unsigned long long llu;
cons... | ALGO | 0.999139 | 3.927903 |
bc1ed4b5-1f35-4510-b2ca-a2effdac8d6a | skinnyiam/SdeSheetChallenge | VerticalOrderTraversal.cpp | class Solution {
public:
vector<vector<int>> verticalTraversal(TreeNode* root) {
map<int,map<int,multiset<int>>> ans;
queue<pair<TreeNode*,pair<int,int>>> q;
q.push({root,{0,0}});
while(!q.empty()){
auto it=q.front();
q.pop();
TreeNode* node=it.fir... | ALGO | 0.999994 | 6.097059 |
15c0ad11-ac0d-4968-817c-19b69395d819 | ara2am/Competitive-programming | informatics.mccme.ru/Структуры данных и алгоритмы/Динамическое программирование/Последовательности/C. Последняя цифра числа Фибоначчи/842.cpp | #include <iostream>
using namespace std;
int main ()
{
int n;
cin >> n;
int f1 (1), f2 (1);
for (int i (0), tmp; i < n; i++)
{
tmp = (f1 + f2) % 10;
f1 = f2;
f2 = tmp;
}
cout << f1;
return 0;
} | ALGO | 0.999849 | 3.515797 |
ecfa1027-6382-46a4-bc1b-1b4d51d5c7f0 | ytrsk/ICPC_training_respository | OJ/region_contest/2018shenyang/G_test.cpp | #include <bits/stdc++.h>
#define mp make_pair
using namespace std;
typedef pair<int,int> pii;
typedef long long ll;
const int maxn=100007;
const int inf=1<<29;
int read(){
int x=0,f=1;
char ch=getchar();
while(ch<'0'||ch>'9') {if(ch=='-') f=-1;ch=getchar();}
while(ch>='0'&&ch<='9') x=x*10+ch-'0',ch=getc... | ALGO | 0.99967 | 3.815804 |
cbc94e0f-b5d8-4607-9923-217973930e2b | oolmos98/CSE170-Assignments | PA1/sig/src/sigkin/kn_ik_body.cpp | # include <sigkin/kn_ik_body.h>
# include <sig/sn_lines.h>
# include <sig/sn_group.h>
# include <sigkin/kn_skeleton.h>
//========================= KnIkBody ================================
KnIkBody::KnIkBody ()
{
_skeleton = 0;
_coldet = 0;
_result = KnIk::Ok;
_posroot = 0;
_solvetime = -1;
for ( int i=0; i... | TOOL | 0.850885 | 4.531642 |
3181e4e9-cc64-4265-a682-243972279c0d | towmiess/DSA_PTIT | web_DSA/sinh68bangQUEUE.cpp | #include<bits/stdc++.h>
using namespace std;
using ll = long long;
queue<pair<ll,int>>q;
vector<ll>v;
void sinh68(){
q.push({6,1});
q.push({8,1});
while(q.size()){
pair<ll,int> t = q.front(); // lon hon kieu du lieu minh truyen vao ban dau
q.pop(); // day cap 6,1 ra
v.push_back(t.first);// chua nhung so mk co... | ALGO | 0.99909 | 4.126867 |
0dba2dff-56e0-4b87-a19e-45e3e0ec5878 | UnnamedOrange/OI | Source Code/莫队算法/Luogu 1903 数颜色.cpp | #include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cstring>
#include <cassert>
#include <cctype>
#include <climits>
#include <ctime>
#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <stack>
#include <queue>
#include <deque>
#include <map>
#include <set>
#include <bitset... | ALGO | 0.999887 | 3.913831 |
109453cc-29c3-4306-82ec-c62858fcaec4 | ishandutta2007/codeforces | akulyat/normal/1214/B.cpp | #include <bits/stdc++.h>
using namespace std;
#define F first
#define S second
typedef long long ll;
typedef long double ld;
typedef pair <ll, ll> pll;
ifstream in;
ofstream out;
const long long kk=1000;
const long long ml=kk*kk;
const long long mod=ml*kk+7;
const long long inf=ml*ml*ml+7;
ll n,i,j, b, g;
vector... | ALGO | 0.999686 | 3.014754 |
058d5d72-3bcc-44bc-b569-6fe155cc9445 | nabilareyna/sas | 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.998693 | 6.797273 |
1f835799-8e14-41bf-acdb-ca3c14140574 | chiefdome/mumble-code | plugins/lol/lol.cpp | #include "../mumble_plugin_win32.h"
/*
Arrays of bytes to find addresses accessed by respective functions so we don't have to blindly search for addresses after every update
Remember to disable scanning writable memory only in CE! We're searching for functions here, not values!
Current addresses as of version <IP... | TOOL | 0.873669 | 3.845675 |
690f869c-6e14-4c74-bf5e-d1913fa312da | cathyjf/PokemonLab | src/shoddybattle/BattleField.cpp | #include <boost/bind.hpp>
#include <boost/shared_array.hpp>
#include "BattleField.h"
#include "../mechanics/BattleMechanics.h"
#include "../scripting/ScriptMachine.h"
#include "../text/Text.h"
#include "../main/Log.h"
#include <iostream>
#include <list>
#include <cmath>
using namespace std;
using namespace boost;
nam... | TOOL | 0.896238 | 6.279678 |
811346c0-b650-4e9c-882d-0ddd230ae67f | boostorg/math | test/test_pareto_cdf_nvrtc_double.cpp | #define BOOST_MATH_OVERFLOW_ERROR_POLICY ignore_error
#define BOOST_MATH_PROMOTE_DOUBLE_POLICY false
// Must be included first
#include <nvrtc.h>
#include <cuda.h>
#include <cuda_runtime.h>
#include <iostream>
#include <iomanip>
#include <vector>
#include <random>
#include <exception>
#include <boost/math/distributio... | TEST | 0.941229 | 6.782586 |
fc26c5f4-6b02-44c3-8fda-6c21f995f178 | Lint-89/Tarefas_LPR | 2o_Trimestre/Aula9/Exc4/Program.cpp | #include <iostream>
#include <map>
#include <string>
using namespace std;
int main() {
int n;
cout << "Quantas cidades deseja cadastrar? ";
cin >> n;
cin.ignore(); // Limpa o buffer para usar getline em seguida
map<string, int> cidades; // Dicionário de cidades e suas populações
// Cadastro d... | TOOL | 0.997334 | 5.477218 |
068cc268-9258-450e-be4d-5772fddc1226 | cisuu/CarND-Path-Planning-Project | src/Eigen-3.3/doc/examples/Tutorial_ArrayClass_interop_matrix.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 * n;
cout << "-- Matrix m*n: --" << endl << result << endl << endl;
result = m.array() * ... | ALGO | 0.996782 | 4.306757 |
3765dfca-298b-4a0d-be7a-07654804f149 | juparopi/tybaTestPrueba | flutter_application_1/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.997791 | 6.787361 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.