text stringlengths 59 71.4k |
|---|
#include <bits/stdc++.h> using namespace std; const int N(200009); struct LnkNode { int v, w, nxt; } edge[N << 3]; int etot = 1, fst[N], cur[N]; void addedge_(int u, int v, int w) { ++etot; edge[etot].v = v; edge[etot].w = w; edge[etot].nxt = fst[u]; fst[u] = etot; } void addedge... |
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ *********... |
#include <bits/stdc++.h> #pragma GCC optimize( Ofast ) using namespace std; int l[100005], r[100005], fr[100005], to[100005]; int f[100005]; vector<int> v[600000]; int fa[100005], it[100005]; int getfa(int x) { return (x == fa[x]) ? x : (fa[x] = getfa(fa[x])); } void merge(int x, int y) { if (x == y... |
#include <bits/stdc++.h> using namespace std; const int mod = 1e9 + 7; long long fp(long long x, long long y) { long long res = 1; while (y) res = (y & 1) ? res * x % mod : res, x = x * x % mod, y >>= 1; return res; } int t; int n, m, rb, cb, rd, cd, lx = 1, ly = 1; long long p; void dfs(int... |
`timescale 1ns / 1ps
////////////////////////////////////////////////////////////////////////////////
// Company:
// Engineer:
//
// Create Date: 22:19:51 10/29/2015
// Design Name: eightInput_PE
// Module Name: /home/sidharth/Documents/Xilinx Projects/PriorityEncoder/eightInput_tester.v
// Project Name: Prior... |
#include <bits/stdc++.h> using namespace std; long long n, m, a[100005], sum, en; bool cheak(long long mid) { long long sum = 0, cnt = m; for (int i = 1; i <= n; ++i) { if (a[i]) { sum += a[i]; while (sum > mid - i) { sum -= (mid - i); cnt--; if (cnt < 0... |
#include <bits/stdc++.h> using namespace std; int T; int N, X, Y, Ord[100005]; bool print; int A[100005], Freq[100005], Freq2[100005], F[100005]; vector<int> V; vector<int> Ap[100005]; set<pair<int, int> > S1, S2; int Res[100005]; void Read() { scanf( %d%d%d , &N, &X, &Y); for (int i = 1; i ... |
/* #pragma GCC optimize( O2 ) #pragma GCC optimize( Ofast ) #pragma GCC optimize( unroll-loops ) #pragma GCC target( avx,avx2,sse,sse2,fma ) */ #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef long double ld; typedef pair<int , int> pii; mt19937 rng(chrono::stea... |
#include <bits/stdc++.h> using namespace std; const int inf = 2000000000; const int maxn = 1000005; int n; int a[maxn]; bool vis[maxn]; int main() { long long ans = 0LL; scanf( %d , &n); for (int i = n; i >= 0; i--) { if (vis[i]) continue; int t = 0, s = 0; for (int j = 0; j ... |
#include <bits/stdc++.h> using namespace std; const int N = 81; const int inf = 1e9; int n, c, a[N]; int dp[N][N][N * N]; vector<int> vc; int main() { scanf( %d , &n); c = 0; for (int i = 1; i <= n; i++) { scanf( %d , &a[i]); c += a[i]; if (a[i]) vc.push_back(i); } in... |
// megafunction wizard: %FIFO%VBB%
// GENERATION: STANDARD
// VERSION: WM1.0
// MODULE: dcfifo
// ============================================================
// File Name: fifo_174x128.v
// Megafunction Name(s):
// dcfifo
//
// Simulation Library Files(s):
// altera_mf
// ==========================... |
#include <bits/stdc++.h> using namespace std; int dx[] = {0, 0, 1, -1, 1, 1, -1, -1}; int dy[] = {1, -1, 0, 0, 1, -1, 1, -1}; char mat[105][105]; int n, m; int main() { scanf( %d %d , &n, &m); for (int i = 0; i < n; i++) { scanf( %s , mat[i]); } int flag = 0; for (int i = 0; i < n... |
/**
* Copyright 2020 The SkyWater PDK Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable la... |
/**
* Copyright 2020 The SkyWater PDK Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable la... |
/**
* Copyright 2020 The SkyWater PDK Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable la... |
#include <bits/stdc++.h> using namespace std; const int _ = 2e5 + 7; const int __ = 8e5 + 7; const long long inf = 1e17; int n, m, q; long long wgt[2][_], cst[_], minx[__], tag[__]; struct edge { int x, y; long long w; } e[_]; void build(int k, int l, int r, bool id) { tag[k] = 0; if (... |
/*
* Copyright (C) 2011 Kiel Friedt
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This p... |
#include <bits/stdc++.h> using namespace std; const int INF = 1000000007; const long long LLINF = 1000000000000000007LL; const double EPS = 1e-9; const int sz = 200100; int ar[600][600]; int p[600][600]; int suf_sum_2d(int i1, int j1, int i2, int j2) { return p[i2 + 1][j2 + 1] - p[i2 + 1][j1] - p[i1... |
#include <bits/stdc++.h> using namespace std; signed main() { long long int n, i, m, k, x, pc = 0, c = 0; cin >> n >> m >> k; long long int p, f; queue<long long int> q; for (i = 0; i < m; i++) { cin >> x; q.push(x - 1); } x = 0; while (!q.empty()) { f = q.front(); ... |
#include <bits/stdc++.h> using namespace std; int main() { int n, m, a; cin >> n >> m; int l = 0, r = n + 1; string s, s1; for (int i = 0; i < m; i++) { cin >> s >> s >> s1 >> s >> a; if (s1[0] == r ) l = max(l, a); else r = min(a, r); } int ans = r - l... |
#include <bits/stdc++.h> using namespace std; using ll = long long; template <class T, class U> using Pa = pair<T, U>; template <class T> using vec = vector<T>; template <class T> using vvec = vector<vec<T>>; bool chmax(int &a, int b) { if (a < b) { a = b; return true; } return... |
module SortX4 # (
parameter DSIZE = 18,
parameter OFFSET = 8
)(
input [DSIZE-1:0] a0,
input [DSIZE-1:0] a1,
input [DSIZE-1:0] a2,
input [DSIZE-1:0] a3,
output wire [DSIZE-1:0] sort0,
output wire [DSIZE-1:0] sort1,
output wire [DSIZE-1:0] sort2,
output wire [DSIZE... |
#include <bits/stdc++.h> using namespace std; int main() { int x, mx = -1, n, res = -1; scanf( %d , &n); for (int i = 0; i < n; i++) { scanf( %d , &x); if (x - mx > 1 && res == -1) res = i + 1; mx = max(mx, x); } printf( %d n , res); return 0; } |
#include <bits/stdc++.h> using namespace std; set<pair<string, string> > m; int n, z[2000], d, k, ans; string a[2000], b[2000], zx[2000][5]; int main() { cin >> n >> d; for (int i = 0; i < n; i++) { cin >> a[i]; cin >> b[i]; cin >> z[i]; } for (int i = 0; i < n; i++) fo... |
#include <bits/stdc++.h> using namespace std; int n, a[10005], sum1 = 0, sum2 = 0; int main() { cin >> n; for (int i = 1; i <= n; i++) { cin >> a[i]; if (a[i] < 0) sum2++; else { if (a[i] == 0) sum1++; else cout << a[i] << ; } } ... |
/*
* Copyright 2020 The SkyWater PDK Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law... |
#include <bits/stdc++.h> using namespace std; const int MAXN = 1005; int tt, n; string s, t; int main() { cin >> tt; while (tt--) { cin >> n >> s >> t; bool ok = 1; vector<pair<int, int> > v; for (int i = 0; i < n; i++) { if (s[i] == t[i]) continue; bool naso = ... |
#include <bits/stdc++.h> using namespace std; template <typename Arg1> void __f(const char* name, Arg1&& arg1) { cerr << name << : << arg1 << std::endl; } template <typename Arg1, typename... Args> void __f(const char* names, Arg1&& arg1, Args&&... args) { const char* comma = strchr(names + 1, ... |
#include <bits/stdc++.h> using namespace std; int main() { int temp = 0; int n = 0; cin >> n; vector<int> city(n); for (int i = 0; i < n; ++i) { cin >> city[i]; } int max = 0; int min = 0; for (int j = 0; j < n; ++j) { if (j == n - 1) { min = abs(city[j] - cit... |
#include <bits/stdc++.h> using namespace std; int main() { long n, k, a; cin >> n >> k >> a; long n_moves; cin >> n_moves; set<pair<long, long> > s; s.insert(make_pair(n, 1)); long max_ships = (n + 1) / (a + 1); for (int i = 1; i <= n_moves; i++) { long x; cin >> x; ... |
#include <bits/stdc++.h> using namespace std; const int N = 1000000; int T, tot, prod, mn[1000010]; bool solved[10000][11]; bitset<1000> b[10000][11]; vector<int> V, prime; unordered_map<int, int> id; int main() { scanf( %d , &T); for (int i = 2; i <= N; i++) if (!mn[i]) { if (prim... |
#include <bits/stdc++.h> using namespace std; long long n, m, k, day, dep[1000010], arr[1000010], cost[1000010], cel, from, coss; long long mini[1000010], wylot[1000010], dolot[1000010], sum, inf = 1e7; vector<pair<long long, int> > tab; int ptr; int main() { ios_base::sync_with_stdio(0); cin.... |
/**
* Copyright 2020 The SkyWater PDK Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable la... |
//////////////////////////////////////////////////////////////////////////////
//
// Xilinx, Inc. 2008 www.xilinx.com
//
//////////////////////////////////////////////////////////////////////////////
//
// File name : encode.v
//
// Description : TMDS encoder
//
// Date - revision : Jan.... |
//*******************************************************************************************
//Author: Yejoong Kim
//Last Modified: Aug 23 2017
//Description: (Testbench) MBus Master Controller
//Update History: May 21 2016 - Updated for MBus r03 (Yejoong Kim)
// Combined the f... |
#include <bits/stdc++.h> int main() { int n, i, j, c; int a[1000][1000]; int b[10000]; c = 0; scanf( %d , &n); for (i = 1; i <= n; i++) for (j = 1; j <= n; j++) scanf( %d , &a[i][j]); for (i = 1; i <= n; i++) { int flag = 0; for (j = 1; j <= n; j++) { if (a[i][j] ... |
// ========== Copyright Header Begin ==========================================
//
// OpenSPARC T1 Processor File: bw_clk_cl_misc_jbus.v
// Copyright (c) 2006 Sun Microsystems, Inc. All Rights Reserved.
// DO NOT ALTER OR REMOVE COPYRIGHT NOTICES.
//
// The above named program is free software; you can redistribute ... |
/*
* Copyright 2020 The SkyWater PDK Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law... |
#include <bits/stdc++.h> const int N = 105; int n, m, i, j, k, s[N], h[N], id[N], a[N], l[N], r[N]; int fr[N], fl[N]; bool cmp(int x, int y) { return s[x] < s[y]; } int main() { scanf( %d%d , &n, &m); for (i = 1; i <= m; ++i) scanf( %d%d , s + i, h + i), id[i] = i; if (m == 1) { printf( %d n... |
`timescale 1 ns / 1 ps
module axis_window #
(
parameter integer C_PIXEL_WIDTH = 8,
parameter integer C_IMG_WBITS = 12,
parameter integer C_IMG_HBITS = 12
)
(
input wire clk,
input wire resetn,
input wire [C_IMG_WBITS-1 : 0] win_left,
input wire [C_IMG_HBITS-1 : 0] win_top,
input wire [C_IMG_WBITS-1 : 0] win_... |
#include <bits/stdc++.h> const int MAX_N = 300000; const int MAX_M = 300000; std::vector<int> types[1 + MAX_N]; std::vector<int> neighbours[1 + MAX_N]; int c; int colours[1 + MAX_M]; bool used[1 + MAX_M]; void dfs(int u = 1, int father = 0) { for (int type : types[u]) if (colours[type] != 0) u... |
/**
* Copyright 2020 The SkyWater PDK Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable la... |
// Copyright (C) 2020-2021 The SymbiFlow Authors.
//
// Use of this source code is governed by a ISC-style
// license that can be found in the LICENSE file or at
// https://opensource.org/licenses/ISC
//
// SPDX-License-Identifier:ISC
module \$lut (
A,
Y
);
parameter WIDTH = 0;
parameter LUT = 0;
input... |
#include <bits/stdc++.h> using namespace std; void solve() { int N; cin >> N; string s1, s2; cin >> s1 >> s2; int num_different = 0; vector<pair<bool, int>> differences; int num_s1_has_a = 0; int num_s1_has_b = 0; for (int i = 0; i < N; ++i) { if (s1[i] != s2[i]) { ... |
#include <bits/stdc++.h> using namespace std; const int INF = 0x3f3f3f3f; const double EPS = 0.000000001; const double PI = 3.141592653589793; const long long LLINF = 99999999999999999LL; const int MAX_N = 100005; const int MOD = 1000000007; int N, M, n, cnt, ans; vector<int> v[MAX_N], w[MAX_N], SCC[M... |
#include <bits/stdc++.h> using namespace std; long long dp[31][31][51]; void Cal() { for (int i = 0; i <= 30; i++) for (int j = 0; j <= 30; j++) for (int k = 0; k <= 50; k++) { dp[i][j][k] = (k == 0 || k == i * j) ? 0 : 10000000000000000; for (int kk = 0; kk <= k; kk++) { ... |
// DESCRIPTION: Verilator: Verilog Test module
//
// This file ONLY is placed into the Public Domain, for any use,
// without warranty, 2003 by Wilson Snyder.
module t (/*AUTOARG*/
// Inputs
clk
);
input clk;
// verilator lint_off GENCLK
reg [7:0] cyc; initial cyc=0;
reg genclk;
// ver... |
////////////////////////////////////////////////////////////////////////////////////
// Copyright (c) 2014, University of British Columbia (UBC); All rights reserved. //
// //
// Redistribution and use in source and binary forms, w... |
#include <bits/stdc++.h> using namespace std; int n, m, u, v; vector<int> g[100005], gr[100005]; vector<int> order; bool used[100005]; int G[100005], C[100005], k = 0; void dfs1(int x) { used[x] = 1; for (int(i) = (0); (i) < (g[x].size()); (i)++) { int nn = g[x][i]; if (!used[nn]) dfs1... |
//-----------------------------------------------------------------------------
//
// (c) Copyright 2010-2011 Xilinx, Inc. All rights reserved.
//
// This file contains confidential and proprietary information
// of Xilinx, Inc. and is protected under U.S. and
// international copyright and other intellectual pro... |
/*
* Copyright 2020 The SkyWater PDK Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law... |
#include <bits/stdc++.h> using namespace std; using ll = long long; const int INF = 0x3f3f3f3f; const ll LINF = 0x3f3f3f3f3f3f3f3fLL; int main() { ios_base::sync_with_stdio(0); cin.tie(0); cout << setprecision(10) << fixed; int n, k; cin >> n >> k; vector<double> p(n); for (auto& x... |
/* amiga_clk.v */
/* 2012, */
module amiga_clk (
input wire rst, // asynhronous reset input
input wire clk_in, // input clock ( 27.000000MHz)
output wire clk_114, // SDRAM ctrl clock (114.750000MHz)
output wire clk_sdram, // SDRAM output clock... |
#include <bits/stdc++.h> using namespace std; struct si { long long x, s; }; long long t[2][6] = {0}, k[200] = {0}, p[6][7] = {0}, sp = 0; vector<si> s; bool cmp(si a, si b) { return a.x < b.x; } int main() { long long n, q, p, x, y, a, m; si S; cin >> n; m = n; for (int i = 0; i <... |
#include <bits/stdc++.h> using namespace std; int n, k; int ans; inline int f(int n) { int rt = 0; for (int i = 0; n / pow(k, i) != 0; i++) rt += n / pow(k, i); return rt; } void bin_search() { int s = 1, e = n; int m; while (s <= e) { m = (s + e) / 2; if (f(m) >= n) { ... |
`timescale 1ns / 1ps
////////////////////////////////////////////////////////////////////////////////
// Company: California State University San Bernardino
// Engineer: Bogdan Kravtsov
// Tyler Clayton
//
// Create Date: 11:21:00 10/17/2016
// Module Name: CONTROL
// Project Name: MIPS
... |
#include<bits/stdc++.h> #define ll long long using namespace std; const int N = 2e5 + 10; struct Seg_Tree { struct { int l, r, num; ll sum, sL, sR; } t[N << 3]; #define update(p) { t[p].sum = ... |
#include <bits/stdc++.h> using namespace std; const int MAXN = 100005; const int INF = 1e9; struct dot { int l, r; }; typedef int node; const int neutro = 0; struct RMQ { int sz; node t[4 * MAXN]; node &operator[](int p) { return t[sz + p]; } void init(int n) { sz = 1 << (32 - ... |
#include <bits/stdc++.h> using namespace std; long long int power(long long int a, long long int b) { if (b == 0) return 1; if (b == 1) return a; long long int r = power(a, b / 2) % 1000000007; if (b % 2 == 0) return (r * r) % 1000000007; else return (((r * r) % 1000000007) * a) % 10... |
#include <bits/stdc++.h> using namespace std; const int inf = 0x3f3f3f3f; int isprime[1010]; int mp[256]; int main() { isprime[0] = isprime[1] = 1; for (int i = 2; i <= 1000; i++) if (!isprime[i]) for (int j = i * 2; j <= 1000; j += i) isprime[j] = 1; char s[1100], str[1010]; sca... |
#include <bits/stdc++.h> using namespace std; int n, m; int color[400100]; int w[400100]; struct segment_tree { long long a[1600100]; bool put[1600100]; void push(int x) { if (put[x]) { a[x * 2] = a[x * 2 + 1] = a[x]; put[x] = false; put[x * 2] = put[x * 2 + 1] = true... |
`timescale 1ns / 1ps
//////////////////////////////////////////////////////////////////////////////////
// Company:
// Engineer:
//
// Create Date: 11:51:28 03/28/2015
// Design Name:
// Module Name: muxparam
// Project Name:
// Target Devices:
// Tool versions:
// Description:
//
// Depend... |
#include <bits/stdc++.h> using namespace std; int dx[8] = {-1, -1, -1, 0, 1, 1, 1, 0}; int dy[8] = {-1, 0, 1, 1, 1, 0, -1, -1}; const int N = 100005; struct mes { char c; int id; }; int n, m; bool no[N]; mes all[N]; int p[N]; int main() { scanf( %d%d , &n, &m); for (int i = 0; i < ... |
//
// Designed by Qiang Wu
//
`timescale 1ns/1ps
module packet_buffer_bypass(
input clk,
input reset,
output [239:0] TRIG0,
input [63:0] in_data,
input [23:0] in_pkt_route,
input in_wr,
output reg in_empty,
input in_req,
output reg in_ack,
output reg [63:0] out_data,
output reg [23:0] out_pk... |
#include <bits/stdc++.h> using namespace std; class Solution { public: long long solve(vector<int>& A) { int n = A.size(); int F = 0; for (int i = 0; i < n; ++i) { if (A[i] == -1) { F = i; break; } } if (F == n - 1) { return 0; }... |
#include <bits/stdc++.h> using namespace std; const int N = 1e5 + 5; struct que { int l, r, id; long long ans; } q[N]; int block, s[N], tong[N * 20], k; bool cmp1(que i, que j) { if (i.l / block != j.l / block) return i.l / block < j.l / block; return i.r < j.r; } bool cmp2(que i, que j)... |
///////////////////////////////////////////////////////////////////////////////
//
// Project: Aurora 64B/66B
// Company: Xilinx
//
//
//
// (c) Copyright 2008 - 2009 Xilinx, Inc. All rights reserved.
//
// This file contains confidential and proprietary information
// of Xilinx, Inc. and is protected unde... |
/*
* Copyright 2020 The SkyWater PDK Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law... |
#include <bits/stdc++.h> using namespace std; int const MAX = 1e5 + 41; int n; int q; int s[MAX]; int m[MAX]; int r[MAX]; int const BLOCK = 441; bool sp[MAX]; int lt[MAX]; int ltb[MAX]; vector<pair<int, int> > a[MAX]; vector<long long> prefsum[MAX]; vector<long long> prefspeed[MAX]; int co... |
// Copyright 1986-2014 Xilinx, Inc. All Rights Reserved.
// --------------------------------------------------------------------------------
// Tool Version: Vivado v.2014.1 (lin64) Build 881834 Fri Apr 4 14:00:25 MDT 2014
// Date : Tue May 13 23:58:38 2014
// Host : macbook running 64-bit Arch Linux
// ... |
/**
* Copyright 2020 The SkyWater PDK Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable la... |
#include <bits/stdc++.h> using namespace std; const int N = 1e5 + 10; vector<int> v[N]; int num[N]; int q[N]; int cnt; int check(int mid) { int t = num[0] + mid, res = 0, tot = 0; for (int i = 1; i <= 100000; i++) { for (int j = 0; j <= max(-1, num[i] - t); j++) tot++, res += v[i][j]; } ... |
#include <bits/stdc++.h> using namespace std; string s; string name; string hostname; string res; int is_good(char c) { if (c - a >= 0 && c - a < 26) return 1; if (c - A >= 0 && c - A < 26) return 1; if (c - 0 >= 0 && c - 0 < 10) return 1; if (c == _ ) return 1; return 0; ... |
#include <bits/stdc++.h> using namespace std; int n, m; int a[50][50], neigh[5][2] = {{0, 0}, {1, 0}, {0, 1}, {-1, 0}, {0, -1}}; int best; void dfs(int x) { vector<pair<int, int> > tmp; int i, j, xx = 0, yy = 0, b1 = 0, x1 = 0, y1 = 0, x2 = 0, y2 = 0; for (i = 0; i < m; i++) { for (j = 0; j ... |
#include <bits/stdc++.h> using namespace std; const double PI = acos(-1.0); const int INF = 0x3f3f3f3f; const double eps = 1e-8; const long long mod = 10007; const int N = 110; int val[110]; int main() { int n; scanf( %d , &n); for (int i = 1; i <= n; i++) { for (int j = i; j <= n; j++... |
/*
:Project
FPGA-Imaging-Library
:Design
ColorBin2Channels
:Function
Covert Bin to more channels.
:Module
Main module
:Version
1.0
:Modified
2015-05-12
Copyright (C) 2015 Tianyu Dai (dtysky) <>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Publ... |
#include <bits/stdc++.h> using namespace std; int main() { ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); ; long long n; cin >> n; long long t = n; vector<pair<int, int> > laptop; for (int i = 0; i < n; i++) { long long temp1, temp2; cin >> temp1 >> temp2; la... |
//////////////////////////////////////////////////////////////////////
//// ////
//// OR1200's IC FSM ////
//// ////
//// This file is part of the OpenR... |
/*
* Copyright 2013, Homer Hsing <>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to ... |
#include <bits/stdc++.h> using namespace std; int A[100005]; map<int, int> mymap; int main() { int n; map<int, int>::iterator it; int d; cin >> n; for (int i = 0; i < n; i++) { cin >> A[i]; mymap[A[i]]++; d = A[i]; while (mymap[d] % 2 == 0) { mymap[d + 1]++; ... |
#include <bits/stdc++.h> using namespace std; template <typename A, typename B> string to_string(pair<A, B> p); string to_string(const string &s) { return + s + ; } string to_string(const char *s) { return to_string((string)s); } string to_string(bool b) { return (b ? true : false ); } template ... |
//-----------------------------------------------------------------------------
// File : register_bank.v
// Creation date : 16.05.2017
// Creation time : 11:39:39
// Description : Stores registers and the logic needed to access them. In case of multiple simultaenous writes, the one with most priority is don... |
/**
* Copyright 2020 The SkyWater PDK Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable la... |
/*
** -----------------------------------------------------------------------------**
** dma_fifosync353.v
**
** DMA controller/fifo
**
** Copyright (C) 2002-2007 Elphel, Inc.
**
** -----------------------------------------------------------------------------**
** This file is part of X353
** X353 is free software - ... |
#include <bits/stdc++.h> using namespace std; int n, cnt; char x[55]; int main() { scanf( %s , x); n = strlen(x); for (int i = 0; i < n; i++) cnt += x[i] == a ; printf( %d n , min(n, cnt * 2 - 1)); } |
/**
* Copyright 2020 The SkyWater PDK Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable la... |
#include <bits/stdc++.h> using namespace std; int arr[10000]; int n = 0; void init() { queue<string> q; q.push( 4 ); q.push( 7 ); while (!q.empty()) { string u = q.front(); q.pop(); arr[n++] = stoi(u); if (u.length() < 9) { q.push(u + 4 ); q.push(u + 7 )... |
/**
* bsg_nonsynth_cache_axe_tracer.v
*
* use SystemVerilog 'bind' on bsg_cache.
*
*
* @author tommy
*
*/
`include "bsg_defines.v"
`include "bsg_cache.vh"
module bsg_nonsynth_cache_axe_tracer
import bsg_cache_pkg::*;
#(parameter `BSG_INV_PARAM(data_width_p)
, parameter `BSG_INV_PARAM(addr_width_p)... |
#include <bits/stdc++.h> using namespace std; const double pi = acos(-1.0); long long int path[100001]; long long int dist[100001]; void shortest_path(vector<pair<long long int, long long int>> v[], long long int start) { long long int i; for (i = 0; i < 100001; i++) dist[i] = 1e1... |
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you ... |
/*
* Copyright 2020 The SkyWater PDK Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law... |
// (C) 1992-2014 Altera Corporation. All rights reserved.
// Your use of Altera Corporation's design tools, logic functions and other
// software and tools, and its AMPP partner logic functions, and any output
// files any of the foregoing (including device programming or simulati... |
#include <bits/stdc++.h> using namespace std; int main() { double sum; int n, m, k, i; while (scanf( %d %d %d , &n, &m, &k) == 3) { sum = 1; if (k + n < m) { printf( 0 n ); continue; } else { for (i = 0; i <= k; i++) { sum *= (m - i); sum /= ... |
/*
* i2s_audio - Convert PCM to i2s
*
* Converts PCM to i2s
*
* Part of the CPC2 project: http://intelligenttoasters.blog
*
* Copyright (C)2017
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software... |
// ----------------------------------------------------------------------
// Copyright (c) 2016, The Regents of the University of California All
// rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:... |
Require Export GeoCoq.Tarski_dev.Annexes.midpoint_theorems.
Section Varignon.
Context `{TE:Tarski_euclidean}.
(** This is the usual proof presented in classroom based on
the midpoint theorem but this proof suffers from two problems.
It needs the fact that IJK are not collinear,
which is not always the case when the... |
`timescale 1ns / 1ps
/**
Pipelined CPU
*/
module pipeline ( input wire clk,
input wire rst,
output i_read_en,
output [31:0] i_addr,
input [31:0] i_instr_in,
input wb_... |
/*
* Copyright 2020 The SkyWater PDK Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law... |
#include <bits/stdc++.h> using namespace std; const long long inf = 1e18; const int N = 1e6 + 20; vector<int> v[N]; map<int, int> mp, ml, mr; long long n, m, k, a[N], b[N], f[N]; int num[N]; long long did[N]; string s; long long s1, s2, ans, flag, tot, t, sum; int cnt; int main() { ios::sync... |
// DESCRIPTION: Verilator: Verilog Test module
//
// This file ONLY is placed under the Creative Commons Public Domain, for
// any use, without warranty, 2005 by Wilson Snyder.
// SPDX-License-Identifier: CC0-1.0
module t (/*AUTOARG*/
// Inputs
clk
);
input clk;
reg [31:0] narrow;
reg [63:0] quad;
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.