text stringlengths 59 71.4k |
|---|
#include <bits/stdc++.h> using namespace std; const double pi = acos(-1); const int maxn = 1e6 + 10; const int mod = 1e9 + 7; typedef struct p { long long x, y; }; p a[maxn]; int main() { int n; scanf( %d , &n); for (int i = 0; i < n; i++) { scanf( %lld %lld , &a[i].x, &a[i].y); ... |
#include <bits/stdc++.h> using namespace std; const int maxN = (int)1e4 + 10; int n, w, b, x; long long dp[1005][maxN]; int c[maxN]; int cost[maxN]; int main() { cin >> n >> w >> b >> x; for (int i = 1; i <= n; i++) cin >> c[i]; for (int i = 1; i <= n; i++) cin >> cost[i]; memset(dp, -1, s... |
#include <bits/stdc++.h> using namespace std; int main() { int f[300][300]; f[2][1] = 2; f[2][2] = 1; f[4][1] = 32; f[4][2] = 30; f[4][3] = 80; f[4][4] = 109; f[8][1] = 6824; f[8][2] = 59808; f[8][3] = 147224; f[8][4] = 415870; f[8][5] = 1757896; f[8][6] = 1897056... |
`timescale 1ns / 1ps
//////////////////////////////////////////////////////////////////////////////////
// Company:
// Engineer:
//
// Create Date: 12:11:04 06/09/2015
// Design Name:
// Module Name: aesmodule
// Project Name:
// Target Devices:
// Tool versions:
// Description:
//
// Depen... |
//Com2DocHDL
/*
:Project
FPGA-Imaging-Library
:Design
RowsGenerator
:Function
Generate rows cache, **this module just support Pipeline mode now !!!**
The lowest color_width-bits of out_data are the first row!
You can configure all fifos by yourself, but fifos in one project whcih have same name must have same confi... |
#include <bits/stdc++.h> using namespace std; const int MOD = 1e9 + 7; int N; char c[2000000]; int numWays() { if (N == 1) { if (c[0] == * ) return 1; else if (c[0] == 0 ) return 1; else if (c[0] == ? ) return 2; else return 0; } if (c[0] ... |
#include <bits/stdc++.h> using namespace std; int A[105][105]; int main() { int n; int ans = 0; cin >> n; for (int i = 0; i < n; i++) { string s; cin >> s; for (int j = 0; j < n; j++) { if (s[j] == C ) { A[i][j] = 1; } else { A[i][j] = 0; ... |
//
// Copyright (c) 2001 Stephen Williams <>
//
// This source code is free software; you can redistribute it
// and/or modify it in source code form under the terms of the GNU
// General Public License as published by the Free Software
// Foundation; either version 2 of the License, or (at your option)
// ... |
#include <bits/stdc++.h> using namespace std; int n, m, z; int gcd(int n, int m) { return m == 0 ? n : gcd(m, n % m); } int main() { cin >> n >> m >> z; cout << (z / ((long long)n * m / gcd(n, m))); return 0; } |
/*
SLICEM at the following:
SLICE_XxY*
Where Y any value
x
Always even (ie 100, 102, 104, etc)
In our ROI
x = 6, 8, 10, 12, 14
SRL16E: LOC + BEL
SRLC32E: LOC + BEL
RAM64X1S: LOCs but doesn't BEL
*/
module top(input clk, stb, di, output do);
localparam integer DIN_N = 256;
localparam integer DOUT_N = 256... |
#include <bits/stdc++.h> using namespace std; const int Mod = 1e9 + 7; int n, inv; long long m; long long A[30]; inline int Qpow(int a, int b) { int ans = 1; while (b) { if (b & 1) ans = (long long)ans * a % Mod; b >>= 1; a = (long long)a * a % Mod; } return ans; } inli... |
#include <bits/stdc++.h> using namespace std; struct Node { int sz, val; Node *left, *right; Node() : left(NULL), right(NULL), sz(0), val(-1) {} ~Node() { delete left; delete right; } }; int A[200000]; void insert(Node*& curr, int i, int x) { if (curr == NULL) curr = new No... |
#include <bits/stdc++.h> int main() { int n, temp, count, i, len, len1, j; char c, a[200], b[40]; strcpy(b, qwertyuiopasdfghjkl;zxcvbnm,./ ); while (~scanf( %c , &c)) { getchar(); gets(a); len = strlen(a); len1 = strlen(b); if (c == R ) temp = -1; else ... |
/**
* 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... |
//======================================================================
//
// test_core.v
// -----------
// A simple test core used during verification of the coretest test
// module. The test core provies a few read and write registers
// that can be tested. Additionally it also provides an 8-bit data
// port direct... |
#include <bits/stdc++.h> using namespace std; int main() { int t; cin >> t; while (t--) { int x; cin >> x; int divisor = 1; int digits; int ans = 0; for (; divisor <= 9; divisor++) { if (x / divisor == 1 && x % divisor == 0) { digits = 1; b... |
// Copyright 1986-2015 Xilinx, Inc. All Rights Reserved.
// --------------------------------------------------------------------------------
// Tool Version: Vivado v.2015.4 (win64) Build Wed Nov 18 09:43:45 MST 2015
// Date : Fri Mar 04 11:10:30 2016
// Host : Dries007Laptop running 64-bit major release... |
// -*- verilog -*-
//
// USRP - Universal Software Radio Peripheral
//
// Copyright (C) 2003 Matt Ettus
//
// 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 2 of the License... |
#include <bits/stdc++.h> using namespace std; const int N = 2e5 + 5; int n, m, st[N], fn[N], timer, ans[N]; vector<int> adj[N], vec[N]; struct node { long long sum, lazy, sz, one; node() { sum = one = sz = lazy = 0; } } seg[N << 2]; void dfs1(int v, int p = -1) { st[v] = timer++; for (auto... |
// -------------------------------------------------------------
//
// Generated Architecture Declaration for rtl of inst_edb_e
//
// Generated
// by: wig
// on: Mon Apr 10 13:27:22 2006
// cmd: /cygdrive/h/work/eclipse/MIX/mix_0.pl -nodelta ../../bitsplice.xls
//
// !!! Do not edit this file! Autogenerated by MIX... |
#include <bits/stdc++.h> int main() { int n, h, arr[1000], c = 0, i; scanf( %d %d , &n, &h); for (i = 0; i < n; i++) { scanf( %d , &arr[i]); if (arr[i] > h) c = c + 2; else c = c + 1; } printf( %d , c); return 0; } |
// pg_sequencer.v
`timescale 1ns / 1ps
module pg_sequencer
(
input clk,
input sync,
input reset,
input enable,
input start,
output reg running,
output reg [4:0]pgout,
output reg [7:0]ip, // command index pointer
input [15:0]cmd
);
/* command word structure
15 14 13 12 11 10 9 8 7 6 ... |
`timescale 1ps/1ps
`default_nettype none
(* DowngradeIPIdentifiedWarnings="yes" *)
module axi_protocol_converter_v2_1_7_b2s_aw_channel #
(
///////////////////////////////////////////////////////////////////////////////
// Parameter Definitions
//////////////////////////////////////////////////////////////////////////... |
#include <bits/stdc++.h> using namespace std; const int N = 1 << 19; double pw2[8 * N]; struct mynum { double v; int sh; mynum(double _v, int _sh) { v = _v; sh = _sh; } mynum() {} mynum shift(int x) { return mynum(v, sh + x); } friend mynum operator+(mynum a, mynum b) { ... |
#include <bits/stdc++.h> using namespace std; const int mod = 1000000007; int n, m, i, j, k, l, a, b, sz[2], v1[2][5005]; string s; bool used[5005]; int main() { ios_base ::sync_with_stdio(); cin.tie(0); cin >> s; n = s.size(); if (n == 1) { cout << s; return 0; } int... |
/**
* 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 1986-2016 Xilinx, Inc. All Rights Reserved.
// --------------------------------------------------------------------------------
// Tool Version: Vivado v.2016.4 (win64) Build Wed Dec 14 22:35:39 MST 2016
// Date : Mon Feb 27 15:46:53 2017
// Host : GILAMONSTER running 64-bit major release (... |
#include <bits/stdc++.h> using namespace std; const int N = 100005; long long child[N], w[N], dp[N][65][3], ans[N][2]; void pre(int n) { for (int i = 0; i < n; i++) { dp[i][0][0] = w[i]; dp[i][0][2] = w[i]; dp[i][0][1] = child[i]; } for (int j = 1; j < 65; j++) { for (int i =... |
//////////////////////////////////////////////////////////////////////
//// ////
//// dpMem_dc.v ////
//// ////
//// This file is part of the usbhosts... |
// $Header: /devl/xcs/repo/env/Databases/CAEInterfaces/verunilibs/data/unisims/MUXCY.v,v 1.11 2007/08/23 23:00:26 yanx Exp $
///////////////////////////////////////////////////////////////////////////////
// Copyright (c) 1995/2004 Xilinx, Inc.
// All Right Reserved.
////////////////////////////////////////////////////... |
module test();
localparam [7:0] dly1 = 4;
wire [7:0] dly2 = 3;
reg [7:0] dly3 = 2;
reg i;
wire [6:1] o;
nmos #(dly1, dly2, dly3) buf1(o[1], i, 1'b1);
nmos #(dly2, dly3, dly1) buf2(o[2], i, 1'b1);
nmos #(dly3, dly1, dly2) buf3(o[3], i, 1'b1);
nmos #(dly2-1, dly2-2, dly2-3) buf4(o... |
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; int p = 1; int diagjump = n + 1; for (int i = 1; i <= n; i++) { p = i; for (int j = 1; j <= n; j++) { cout << p << ; if (p == n * j) p++; else p += diagjump; ... |
/**
* 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> #pragma GCC optimize( Ofast ) #pragma GCC target( sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2,fma ) #pragma GCC optimize( unroll-loops ) using namespace std; long long MOD = 998244353; double eps = 1e-12; void solve() { long long n, k; cin >> n >> k; if (n == 1 &&... |
// -------------------------------------------------------------
//
// Generated Architecture Declaration for rtl of ent_ba
//
// Generated
// by: wig
// on: Tue Jun 27 05:23:07 2006
// cmd: /cygdrive/h/work/eclipse/MIX/mix_0.pl -sheet HIER=HIER_MIXED ../../verilog.xls
//
// !!! Do not edit this file! Autogenerate... |
///////////////////////////////////////////////////////////////////////////////
//
// Project: Aurora Module Generator version 2.2
//
// Date: $Date: 2004/11/08 16:19:30 $
// Tag: $Name: i+H-38+78751 $
// File: $RCSfile: rx_stream.ejava,v $
// Rev: $Revision: 1.1.4.1 $
//
// ... |
// -------------------------------------------------------------
//
// Generated Architecture Declaration for rtl of ent_b
//
// Generated
// by: wig
// on: Tue Jul 4 08:52:39 2006
// cmd: /cygdrive/h/work/eclipse/MIX/mix_0.pl ../../verilog.xls
//
// !!! Do not edit this file! Autogenerated by MIX !!!
// $Author:... |
#include <bits/stdc++.h> using namespace std; int main() { int n, m, k, sum = 0, i, j, ara[100000], mid, low, high; scanf( %d , &n); for (i = 0; i < n; i++) { scanf( %d , &j); sum += j; ara[i] = sum; } scanf( %d , &m); for (i = 0; i < m; i++) { scanf( %d , &k); ... |
#include <bits/stdc++.h> using namespace std; int main() { int a, b, i, n; int edges[int(2e5 + 1)][2], weights[int(2e5 + 1)], freq[int(2e5 + 1)]; cin >> n; for (i = 1; i <= n; i++) freq[i] = 0; for (i = 0; i < n; i++) { weights[i] = -1; cin >> edges[i][0] >> edges[i][1]; freq[e... |
#include <bits/stdc++.h> using namespace std; const int maxn = 5e3 + 40; int f[maxn][maxn]; int dp[maxn]; char s[maxn]; int main() { int t; scanf( %d , &t); while (t--) { int n; scanf( %d , &n); scanf( %s , s + 1); f[n][n + 1] = f[n + 1][n] = f[n + 1][n + 1] = 0; fo... |
/*
* 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... |
// `define DEBUG
module spdif_dai #(
parameter MAX_CLK_PER_HALFBIT_LOG2 = 5 // 32 max
)(
input wire clk,
input wire rst,
input wire [(MAX_CLK_PER_HALFBIT_LOG2-1):0] clk_per_halfbit,
input wire signal_i,
output wire [23:0] data_o,
output wire ack_o,
output wire locked_o,
output wir... |
#include <bits/stdc++.h> using namespace std; int n, k; int a[120000]; int main() { cin >> n >> k; for (int i = 0; i < n * 2; i++) a[i] = i; for (int i = 0; i < k; i++) { int now = i * 2; swap(a[now], a[now + 1]); } k = n - k; for (int i = 0; i < n * 2; i++) { printf( %... |
/*
* 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; struct line { int x, l; } c[105]; bool cmp(line a, line b) { return a.x < b.x; } int f[105][105][2]; int main() { int n; scanf( %d , &n); for (int i = 1; i <= n; i++) scanf( %d%d , &c[i].x, &c[i].l); sort(c + 1, c + n + 1, cmp); c[0].x = ... |
/**
* 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 main(void) { int n, m, a, b; cin >> n >> m >> a >> b; int ans = 1000000000; for (int i = 0; i <= n / m + 1; i++) { ans = min(ans, i * b + max(n - m * i, 0) * a); } cout << ans << n ; return 0; } |
// ========== Copyright Header Begin ==========================================
//
// OpenSPARC T1 Processor File: bw_clk_gl_vrt_all.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 it... |
/////////////////////////////////////////////////////////////////////
//// Author: Zhangfeifei ////
//// ////
//// Advance Test Technology Laboratory, ////
//// Institute of Computing Technol... |
#include <bits/stdc++.h> using namespace std; template <typename T, typename U> std::istream& operator>>(std::istream& i, pair<T, U>& p) { i >> p.first >> p.second; return i; } template <typename T> std::istream& operator>>(std::istream& i, vector<T>& t) { for (auto& v : t) { i >> v; }... |
#include <bits/stdc++.h> int main(void) { long n; long sum = 0; int i; int call = 0; scanf( %li , &n); while (n != 1) { call = 0; for (i = 2; i <= (long)sqrt((double)n); i++) if (!(n % i)) { call = 1; break; } if (call) { sum += n; ... |
#include <bits/stdc++.h> using namespace std; const double EPS = 1e-10; const double PI = acos(-1.0); double tick() { static clock_t oldtick; clock_t newtick = clock(); double diff = 1.0 * (newtick - oldtick) / CLOCKS_PER_SEC; oldtick = newtick; return diff; } template <typename T> T m... |
#include <bits/stdc++.h> using namespace std; const long long N = 1e6 + 10, mod = 1e9 + 7; long long n, x; long long f[N]; void solve() { scanf( %lld , &n); long long s1 = 0, s2 = 0, ans = 0; for (long long i = 1; i <= n; i++) { scanf( %lld , &x); if (x == 1) s1++; else ... |
/* Author : Prakhar Rai */ #include<bits/stdc++.h> #define ll long long #define ld long double #define LB(x,num) lower_bound(x.begin(),x.end(),num) - x.begin() #define UB(x,num) upper_bound(x.begin(),x.end(),num) - x.begin() #define BS(x,num) binary_search(x.begin(),x.end(),num) #define pb push_back... |
#include <bits/stdc++.h> using namespace std; string s; int k; set<pair<string, int> > st; pair<string, int> tmp; int main() { cin >> s >> k; for (int i = 0; i < (int)s.length(); i++) { string q = ; q += s[i]; st.insert(make_pair(q, i)); } while (k > 1 && (int)st.size() >... |
(*
Copyright 2014 Cornell University
This file is part of VPrl (the Verified Nuprl project).
VPrl 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)... |
#include <bits/stdc++.h> using namespace std; const int INF = 1 << 29; const double EPS = 1e-9; const char *crop[3] = { Carrots , Kiwis , Grapes }; int m, n, nw, nq; int main() { scanf( %d%d%d%d , &m, &n, &nw, &nq); set<int> waste[40000]; for (int i = (0); i < (nw); ++i) { int x, y; ... |
#include <bits/stdc++.h> using namespace std; const int maxn = 105; int n, a[maxn], vis[maxn]; int gcd(int a, int b) { while (b) { int c = a % b; a = b; b = c; } return a; } int main() { scanf( %d , &n); for (int i = 1; i <= n; i++) scanf( %d , &a[i]); int flag = 0;... |
/////////////////////////////////////////////////////////////////////
//// ////
//// WISHBONE DMA WISHBONE Master Interface ////
//// ////
//// ... |
#include <bits/stdc++.h> const int kInf = 0x3f3f3f3f; int len, n; int msk[200010]; int mem[21][1 << 20]; int f[200010], s[200010]; int conv(char *s) { int res = 0; for (int i = 0; i < len; i++) res = (res << 1) + (s[i] - 0 ); return res; } int g(int i, int j) { int p = msk[i], q = msk[j... |
module ComWithCC3200(
input CC3200_SPI_CLK,
input CC3200_SPI_CS,
output reg CC3200_SPI_DIN,
input CC3200_SPI_DOUT,
input Envelop,
output reg [7:0] Line_Num,
output reg Enable,
output reg [1:0] Zoom,
output reg [5:0] Ga... |
// -------------------------------------------------------------
//
// Generated Architecture Declaration for rtl of inst_vb_e
//
// Generated
// by: wig
// on: Wed Jul 19 05:44:57 2006
// cmd: /cygdrive/h/work/eclipse/MIX/mix_0.pl ../../udc.xls
//
// !!! Do not edit this file! Autogenerated by MIX !!!
// $Author:... |
/**
* 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... |
// DESCRIPTION: Verilator: Verilog Test module
//
// This file ONLY is placed into the Public Domain, for any use,
// without warranty, 2004 by Wilson Snyder.
module t (/*AUTOARG*/
// Inputs
clk
);
input clk;
integer cyc; initial cyc=1;
reg [31:0] a;
reg [31:0] b;
wire [2:0] bf; buf BF0 (... |
#include <bits/stdc++.h> using namespace std; int read() { char c = getchar(); while (c < 0 || c > 9 ) c = getchar(); int x = 0; while (c >= 0 && c <= 9 ) { x = x * 10 + c - 0 ; c = getchar(); } return x; } const int maxn = (1 << 21) + 3; const int INF = 0x3f3f3f3f; ... |
#include <bits/stdc++.h> using namespace std; priority_queue<int, vector<int>, less<int> > num; int main() { int n, x; cin >> n; for (int i = 1; i <= n; i++) { cin >> x; num.push(x); } cout << ((num.top()) xor (x)) << n ; } |
#include <bits/stdc++.h> using namespace std; double EPS = 1e-9; int INF = 2000000000; long long INFF = 8000000000000000000LL; double PI = acos(-1); string IntToString(int a) { char x[100]; sprintf(x, %d , a); string s = x; return s; } int StringToInt(string a) { char x[100]; st... |
#include <bits/stdc++.h> namespace std { template <typename A, typename B> inline string to_string(pair<A, B> p); template <typename A, typename B, typename C> inline string to_string(tuple<A, B, C> p); template <typename A, typename B, typename C, typename D> inline string to_string(tuple<A, B, C, D> p);... |
//manages all the stuff needed to read and write to the flash ROM
module flash_manager(
clock, reset,
dots,
writemode,
wdata,
dowrite,
raddr,
frdata,
doread,
busy,
flash_data,
flash_address,
flash_ce_b,
flash_oe_b,
flash_we_b,
flash_reset_b,
flash_sts,
flash_byte_b,
... |
// ==============================================================
// File generated by Vivado(TM) HLS - High-Level Synthesis from C, C++ and SystemC
// Version: 2015.4
// Copyright (C) 2015 Xilinx Inc. All rights reserved.
//
// ==============================================================
`timescale 1ns/1ps
modul... |
#include <bits/stdc++.h> using namespace std; string proc(int a, int b) { if (a * 2 > b) return noob ; if (a * 5 > b) return random ; if (a * 10 > b) return average ; if (a * 100 > b) return hardcore ; return pro ; } int main() { int i, n, x; string s; map<string, int> score... |
// bsg_fsb_node_level_shift_fsb_domain
//
// This module is design to level shift all signals that connect the FSB to a
// node. This allows FSB nodes to exist in different power domains than the FSB.
// There are 2 types of level shifters:
//
// 1) Source - level shifting cell must be in the same power domain as th... |
#include <bits/stdc++.h> using namespace std; int main() { string s; int mod = 1e9 + 7; cin >> s; for (int i = 0; i < s.size(); i++) { if (s[i] == w || s[i] == m ) { cout << 0; return 0; } } int a, b = 1, c = 0; for (int i = 0; i < s.length(); i++) { ... |
#include <bits/stdc++.h> const long long RXD = 1e9 + 7; const long long N = 1e5 + 1000; using namespace std; long long C[N][110], a[N], s[N][110], n, m, l, r, K; long long read() { long long x = 0, f = 1, c = getchar(); while (c < 0 || c > 9 ) { if (c == - ) f = -1; c = getchar(); ... |
#include <bits/stdc++.h> using namespace std; const int N = 1e5 + 7; void read(long long &x) { x = 0; char ch = getchar(); long long pd = 1; while (ch < 0 || ch > 9 ) { if (ch == - ) { pd = -pd; } ch = getchar(); } while (ch >= 0 && ch <= 9 ) { x = x ... |
//////////////////////////////////////////////////////////////////////
//// ////
//// eth_random.v ////
//// ////
//// This file is part of the Ether... |
#include <bits/stdc++.h> using namespace std; int main() { char a[26], b[26], c[26], d[26]; scanf( %s , a); scanf( %s , b); int i = 0, m = 0, n = 0, k, q, w, j = 0, flag = 0, t = 0; while (a[i] != 0 ) { if (a[i] == | ) m = i; i++; } q = m; w = i - m - 1; n = i; ... |
`timescale 1ns/100ps
/**
* `timescale time_unit base / precision base
*
* -Specifies the time units and precision for delays:
* -time_unit is the amount of time a delay of 1 represents.
* The time unit must be 1 10 or 100
* -base is the time base for each unit, ranging from seconds
* to femtoseconds, and must be... |
import "DPI-C" context function int init_socket();
import "DPI-C" context function void close_socket();
import "DPI-C" context function void senduart(input bit[7:0] in);
import "DPI-C" context function bit[8:0] recuart();
module simuart(input wire clk,
input wire cs,
input wire [31:0] bus_addr,
... |
#include <bits/stdc++.h> using namespace std; const int maxn = 500; int n, ret, cnt; char a[maxn][maxn]; int arr[maxn][maxn]; pair<int, int> par[maxn][maxn]; multiset<pair<int, int> > s; pair<int, int> root(pair<int, int> c) { if (par[c.first][c.second].first < 0) return c; return par[c.first][c... |
/**
* 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... |
//--------------------------------------------------------------------------------
// spi_slave.v
//
// Copyright (C) 2006 Michael Poppitz
//
// 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 Found... |
/**
* 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 mod = 1e9 + 7; const long long inf = 2e18; struct custom_hash { static uint64_t splitmix64(uint64_t x) { x += 0x9e3779b97f4a7c15; x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9; x = (x ^ (x >> 27)) * 0x94d049bb133111eb; return x ^ (x ... |
//`include ".\src\image_capture_manager_S00_AXI.v"
`timescale 1 ns / 1 ps
module image_capture_manager #
(
// Users to add parameters here
parameter integer START_IMAGE_CAPTURE_COMMAND = 1,
parameter integer STOP_IMAGE_CAPTURE_COMMAND = 2,
parameter integer RESET_IMAGE_CAPTURE_COMMAND = 3, ... |
module SevenSegment(
output reg [6:0] display,
output reg [3:0] digit,
input wire [15:0] nums,
input wire rst,
input wire clk
);
reg [15:0] clk_divider;
reg [3:0] display_num;
always @ (posedge clk, posedge rst) begin
if (rst) begin
clk_divider <= 15'b0;
end else begin
... |
#include <bits/stdc++.h> using namespace std; const int inf = (int)2e9; const long long mod = 1000000007; int dx[] = {1, -1, 0, 0}, dy[] = {0, 0, 1, -1}; long long powmod(long long a, long long p) { long long ans = 1; a %= mod; while (p) { if (p & 1) ans *= a; p /= 2; a *= a; ... |
// Copyright 1986-2014 Xilinx, Inc. All Rights Reserved.
// --------------------------------------------------------------------------------
// Tool Version: Vivado v.2014.2 (win64) Build 932637 Wed Jun 11 13:33:10 MDT 2014
// Date : Tue Sep 16 21:34:47 2014
// Host : ECE-411-6 running 64-bit Service Pack... |
#include <bits/stdc++.h> using namespace std; int main() { stack<int> q; string str; cin >> str; int open = 0, count = 0, rcount = 0; for (int i = 0; i < str.length(); ++i) { if (str[i] == ( ) open++; else if (str[i] == ) ) { if (open != 0) open--; ... |
/*
* 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 main() { int n, m; cin >> n >> m; char arr[100][100]; for (int i = 0; i < n; i++) { for (int j = 0; j < m; j++) { cin >> arr[i][j]; if (arr[i][j] == - ) { arr[i][j] = - ; } else { if (i % 2 == 0 && ... |
`timescale 1ns / 1ps
//////////////////////////////////////////////////////////////////////////////////
// Company:
// Engineer:
//
// Create Date: 11:50:34 03/11/2015
// Design Name:
// Module Name: delay_line
// Project Name:
// Target Devices:
// Tool versions:
// Description:
//
// Dependencies:
//... |
/******************************************************************************
* License Agreement *
* *
* Copyright (c) 1991-2009 Altera Corporation, San Jose, California, USA. ... |
#include <bits/stdc++.h> using namespace std; const int inf = 0x3f3f3f3f; const long long mint = 0x7fffffff; const long long linf = 1000000000000000000LL; const long long mod = 1000000007LL; const double eps = 1e-3; const int N = 1000020; inline long long read() { long long x = 0, f = 1; char ch... |
//CLOCKS_PER_SEC using namespace std; #include<bits/stdc++.h> #define sqr(x) 1ll*(x)*(x) //#define sort stable_sort #define ll long long #define mk make_pair #define pb push_back #define in insert #define mtr(x,y,z) mk(mk(x,y),z) #define fi first #define se second #define lch(x) ((x)<<1) #defi... |
#include <iostream> #include <algorithm> using namespace std; int INF = 2e9; int pre[200001]; struct node{ int l, r, max, min; } segtree[800001]; void build(int ind, int l, int r){ if (l == r){ segtree[ind] = (node){l, r, pre[l], pre[l]}; } else { build(2*ind... |
// VGA¿ØÖÆÄ£¿é ¸ù¾Ýµ±Ç°É¨Ãèµ½µÄµãÊÇÄÄÒ»²¿·ÖÊä³öÏàÓ¦ÑÕÉ«
module VGA_Control
(
input clk,
input rst,
input [7:0]snake,
input [7:0]apple_x,
input [7:0]apple_y,
output reg[9:0]x_pos,
output reg[9:0]y_pos,
output reg hsync,
output reg vsync,
output reg [11:0] color_out
);
reg [19:0]clk_cnt;
reg [9:0]line_cn... |
#include <bits/stdc++.h> using namespace std; long long mod = 1000 * 1000 * 1000 + 7; struct suffix_array { vector<int> sa; vector<int> lcp; vector<vector<int>> st; vector<int> log2; vector<int> c; string str; int n; void sort_pairs(vector<pair<pair<int, int>, int>>& a) { vec... |
#include <bits/stdc++.h> using namespace std; int n; vector<pair<long long, long long> > a; set<int> extr; set<int>::iterator it; vector<int> e; int f[300005]; long long mnx = 999999999999999999, mny = 999999999999999999, mxx = -999999999999999999, mxy = -999999999999999999; int main() { ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.