text stringlengths 59 71.4k |
|---|
#include <bits/stdc++.h> using namespace std; long long n, k; long long c[100006], freq[100006], people[100006], h[100006]; long long catche[5005][505]; long long dp(long long left, long long pep) { if (left == 0 || pep == 0) return 0; long long &ans = catche[left][pep]; if (ans != -1) return ans;... |
#include <bits/stdc++.h> using namespace std; const int Maxn = 1010; const int inf = 1 << 23; int ch[Maxn << 1][3], siz[Maxn << 1], maxs[Maxn << 1], alls, core; bool vis[Maxn << 1]; int n, tot, T; void dfs(int x, int fa) { siz[x] = 1; maxs[x] = 0; for (int i = 0; i < 3; i++) { int y = ch... |
`timescale 1 ns / 1 ps
module axi_trivium_v1_0 #
(
// Users to add parameters here
// User parameters ends
// Do not modify the parameters beyond this line
// Parameters of Axi Slave Bus Interface S00_AXI
parameter integer C_S00_AXI_DATA_WIDTH = 32,
parameter integer C_S00_AXI_ADDR_WIDTH = 6
)
(
... |
`timescale 1ns / 1ps
//////////////////////////////////////////////////////////////////////////////////
// Company:
// Engineer: Hasan Hassan
//
// Create Date: 08/18/2015 09:16:16 PM
// Design Name:
// Module Name: pcie_data_receiver
// Project Name:
// Target Devices:
// Tool Versions:
// Description:
//
// D... |
// ***************************************************************************
// ***************************************************************************
// Copyright 2014 - 2017 (c) Analog Devices, Inc. All rights reserved.
//
// In this HDL repository, there are many different and unique modules, consisting
// of... |
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; cin.ignore(); vector<vector<string> > templa(n); for (int c = 0; c < n; c++) { string s; getline(cin, s); for (int c2 = 0; c2 < s.size(); c2++) if ((s[c2] >= a && s[c2] <= z ) || (s[c2] >= A... |
#include <bits/stdc++.h> using namespace std; int howfar(const std::string& s) { const int N = s.length(); int r(0); int d(1); for (int i = 0; i != N; ++i) { switch (s[i]) { case F : r += d; break; case T : d = -d; break; defaul... |
// $Header: $
///////////////////////////////////////////////////////////////////////////////
// Copyright (c) 1995/2010 Xilinx, Inc.
// All Right Reserved.
///////////////////////////////////////////////////////////////////////////////
// ____ ____
// / /\/ /
// /___/ \ / Vendor : Xilinx
// \ \ \/ ... |
#include <bits/stdc++.h> #pragma comment(linker, /STACK:102400000,102400000 ) using namespace std; const double eps = 1e-8; const int INF = 1e9 + 7; const long long inf = (1LL << 62); const int MOD = 1e9 + 7; const int M = 100010; const int maxn = 1001; const int lowbit(int x) { return x & -x; } in... |
#include <bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(false); char arr[1000]; cin >> arr; int flag = 1, curr = 0; for (int i = 0; i < strlen(arr); i++) { if (i == 0) curr = 1; else if (flag == 1) { if (arr[i] == arr[i - 1]) { 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... |
#include <bits/stdc++.h> using namespace std; int fun(string s, int i) { int k = 0; while (s[i] == 0 & i >= 0) { k++; i--; } return k; } int main(int argc, char const *argv[]) { string s; int a, k = 0, count = 1; cin >> a; cin >> s; string ans = ; int i = ... |
#include <bits/stdc++.h> using namespace std; int32_t main() { ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0); long long n; cin >> n; long long mxmx = -1, mnmx = -1; while (n--) { long long x, y, h, w; char c; cin >> c; if (c == + ) { cin >> x ... |
#include <bits/stdc++.h> using namespace std; int bit[210000], n; void upd(int i) { while (i <= n) bit[i] += 1, i += i & (-i); } void dec(int i) { while (i <= n) bit[i] -= 1, i += i & (-i); } int cal(int i) { int ret = 0; while (i > 0) ret += bit[i], i -= i & (-i); return ret; } in... |
#include <bits/stdc++.h> using namespace std; bool mayorigual(const string &s, int i, int ifin, int j, int jfin) { if (ifin - i > jfin - j) return true; if (ifin - i < jfin - j) return false; int len = ifin - i; for (int k = 0; k < len; k++) { if (s[k + i] > s[k + j]) return true; ... |
#include <bits/stdc++.h> using namespace std; const int M = 500005; int n, m, q; struct Edge { Edge() {} Edge(int u_, int v_) : u(u_), v(v_) {} int u, v; bool operator<(const Edge &a) const { if (v != a.v) return v < a.v; return u > a.u; } } edge[M << 1]; int fa[M]; int get... |
#include <bits/stdc++.h> using namespace std; long long c[110], k; int n, a[110]; int main() { c[0] = c[1] = 1LL; for (int i = 2; i < 100; i++) c[i] = c[i - 1] + c[i - 2]; scanf( %d%I64d , &n, &k); for (int i = 1; i <= n;) { if (k > c[n - i]) { k -= c[n - i]; a[i] = i + 1; ... |
#include <bits/stdc++.h> using namespace std; int main() { int n, k; cin >> n >> k; vector<int> a(100, 0); int b; for (int i = 0; i < n; i++) { cin >> b; b--; a[b]++; } sort(a.begin(), a.end()); int s = 0; s = a[99] / k; if (a[99] % k > 0) { s++; }... |
#include <bits/stdc++.h> #pragma comment(linker, /STACK:16777216 ) using namespace std; int n, a, b, c, ans = 0; int main() { cin >> n >> a >> b >> c; for (int i = 0; i <= a; i += 2) for (int j = 0; j < (int)(b + 1); j++) { int k = n - (i * 0.5 + j); if (k < 0) break; if (... |
#include <bits/stdc++.h> using namespace std; long long n, m, v, k, cnt; signed main() { scanf( %lld%lld%lld , &n, &m, &v), k = (v == 1) ? 2 : 1; if (m < n - 1 || m > n - 1 + (n - 2) * (n - 3) / 2) puts( -1 ), exit(0); for (long long i = 1; i <= n; i++) if (i != v) printf( %lld %lld n , i, v); ... |
//--------------------------------------------------------------------------------
// 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... |
#include <bits/stdc++.h> using namespace std; using pii = pair<int, int>; using vi = vector<int>; using ll = long long; int main() { ios_base::sync_with_stdio(0); cin.tie(0); vi count(3); enum { R, B, G }; map<char, int> val = {{ R , R}, { B , B}, { G , G}}; int n; cin >> n; vi... |
`timescale 1ns/10ps
module RegBankP4Sim;
reg clock;
reg reset;
reg [11:0] inst;
reg inst_en;
wire [7:0] out_0;
wire [7:0] out_1;
wire [7:0] out_2;
wire [7:0] out_3;
wire [7:0] out_4;
wire [7:0] out_5;
wire [7:0] out_6;
wire [7:0] out_7;
initial begin
... |
//Legal Notice: (C)2015 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
//simulation files), and any associated do... |
#include <bits/stdc++.h> using namespace std; int main() { int T; cin >> T; string ans = / ; while (T--) { string s; cin >> s; if (s[0] == p ) { cout << ans << endl; continue; } cin >> s; if (s[0] == / ) ans = s + / ; else ... |
#include <bits/stdc++.h> using namespace std; const int Maxn = 500010; const int Maxk = 110; const int Maxp = 110; const int inf = 2147483647; int read() { int x = 0, f = 1; char ch = getchar(); while (ch < 0 || ch > 9 ) { if (ch == - ) f = -1; ch = getchar(); } while (ch... |
#include <bits/stdc++.h> using namespace std; const int INF = 1000000007; const int N = 100100; int n; int main() { cin >> n; for (int i = n + 1; i <= n + n; i++) cout << i << ; } |
#include <bits/stdc++.h> using namespace std; vector<int> r1, r2, cr; int main() { int n, prev = 0; cin >> n; r1.push_back(0); r2.push_back(0); for (int i = 0; i < n - 1; i++) { int w; cin >> w; w += prev; prev = w; r1.push_back(w); } prev = 0; for (in... |
#include <bits/stdc++.h> using namespace std; template <typename T> struct BIT { int n; vector<T> dat; BIT(int n = 0) { initialize(n); } void initialize(int nin) { n = nin; dat.resize(n, 0); } T sum(int i) { T s = 0; while (i >= 0) { s += dat[i]; i =... |
`define bmp_data_file "./bmp_dat.txt"
`timescale 1ns/1ns
module DMAtest( clk,
rst,
we,
ack_out,
done,
readstart,
mem_adr_i,
mem_dat_o,
mem_dat_i
);
input clk;
input rst;
input readstart;
input we;
input done;
input ack_out;
i... |
#include <bits/stdc++.h> using namespace std; int n, m; char s[200], t[200]; int cnt[200], cnt2[200]; int check(int p, char t[]) { int i; for (i = 0; i < 26; i++) { cnt2[i] = 0; } for (i = p; i < p + n; i++) { cnt2[t[i] - a ]++; } for (i = 0; i < 26; i++) { if (cnt[i... |
#include <bits/stdc++.h> using namespace std; inline void solve() { int d, m; scanf( %d%d , &d, &m); int ans = 1; for (int i = 0; (1 << i) <= d; ++i) { ans = 1ll * ans * ((1 << i) + 1) % m; d -= (1 << i); } if (d) ans = 1ll * ans * (d + 1) % m; printf( %d n , (ans - 1 + m) % ... |
// (C) 2001-2016 Intel Corporation. All rights reserved.
// Your use of Intel 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 simulation
// files), and any associated docum... |
module spi_i2s_ipi_clk_div
#(
parameter PARAM_CNT_WIDTH = 8, // total number of bits
parameter PARAM_STAGE_WIDTH = 3 // maximum number of the bits per stage
)(
//Outputs
output reg clkd_clk_out_o, // clock output
output clkd_time_base_o, // indicate when there is transition in signal clkd_clk_o... |
#include <bits/stdc++.h> using namespace std; long long int N, M, Max = 0, Maxj = 0, A[1000][1000], arr[1000][1] = {}; int main() { cin >> N >> M; for (int i = 0; i < M; i++) { Max = -1; for (int j = 0; j < N; j++) { cin >> A[i][j]; if (Max < A[i][j]) { Max = A[i][j];... |
#include <bits/stdc++.h> using namespace std; int main() { int N, M; scanf( %d%d , &N, &M); long long ans = 0; for (int b = M + 1; b <= (N + 1) / 2; b++) { for (int a = M + 1; a <= N - M; a++) { int coe = (b * 2 - 1 == N ? 3 : 6); int num = (2 * b - a) * (N + 1 - b); in... |
#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}; template <class T> inline T biton(T n, T pos) { return n | ((T)1 << pos); } template <class T> inline T bitoff(T n, T pos) { return n & ~((T)1 << pos); } template <cl... |
// -------------------------------------------------------------
//
// File Name: hdl_prj\hdlsrc\controllerPeripheralHdlAdi\Debounce_A.v
// Created: 2014-09-08 14:12:09
//
// Generated by MATLAB 8.2 and HDL Coder 3.3
//
// -------------------------------------------------------------
// ---------------------------... |
/*
Distributed under the MIT license.
Copyright (c) 2015 Dave McCoy ()
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, mo... |
#include <bits/stdc++.h> using namespace std; long long n, x, y, m, ans, f[5000], q[5000]; pair<int, int> t[200000]; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); cin >> n; cout << n << ; for (int i = 1; i < n; i++) { cout << i << ; } } |
// zhiyang ong
// andrew mattheisen
//`include "control.h"
// this statement is for ncverilog only
`include "~/ee577b/syn/src/control.h"
// this statement for synthesis only
module control(instr,
aluop, ppp, ww,
memop, maddr, wbyteen,
regop, rrdaddra, rrdaddrb, rwraddrd,
reginmuxop,
aluinmuxop,
... |
#include <bits/stdc++.h> using namespace std; long long N, i, j, k, a, b; long long gcd(long long a, long long b) { long long t; while (b > 0) { t = b; b = a % b; a = t; } return a; } long long lcm(long long a, long long b, long long c) { long long d = a * b / gcd(a, b); ... |
#include <bits/stdc++.h> using namespace std; const int INF = (int)1e9 + 7; const double EPS = 1e-9; int main() { ios_base::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr); long long x, y, z; cin >> x >> y >> z; long long sasha = x % z; long long masha = y % z; if ((s... |
/////////////////////////////////////////////////////////////
// Created by: Synopsys DC Ultra(TM) in wire load mode
// Version : L-2016.03-SP3
// Date : Sun Nov 20 02:53:03 2016
/////////////////////////////////////////////////////////////
module GeAr_N16_R2_P4 ( in1, in2, res );
input [15:0] in1;
input [... |
#include <bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); cout.precision(10); cout << fixed; int base; cin >> base; string s; cin >> s; vector<long long> dp(s.size() + 1); dp[0] = 0; long long MAX = 1e18; for (int i = ... |
/*****************************************************************************
* File : processing_system7_bfm_v2_0_arb_rd.v
*
* Date : 2012-11
*
* Description : Module that arbitrates between 2 read requests from 2 ports.
*
*****************************************************************************/
module p... |
#include <bits/stdc++.h> #define ll long long #define db double #define str string #define pii pair<int, int> #define pll pair<ll, ll> #define pdd pair<db, db> #define fi first #define se second #define vc vector<char> #define vvc vector<vc> #define vi vector<int> #define vvi vector<vi> ... |
//Legal Notice: (C)2017 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
//simulation files), and any associated do... |
#include <bits/stdc++.h> using namespace std; int main() { ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); int T; cin >> T; while (T--) { int n; cin >> n; int mid = sqrt(n + 0.5); vector<int> ans; ans.push_back(0); for (int i = 1; i <= mid; i++) { ... |
// module probador ();
// wire [31:0]cmd_argument;
// wire [5:0]cmd_index;
// wire [127:0]response;
// CMD cmd1(clk_host, reset_host, new_command, cmd_argument, cmd_index, cmd_complete, cmd_index_error, response, CMD_PIN_OUT, IO_enable_pin, CMD_PIN_IN, clk_SD);
// testbench t1(cl... |
#include <bits/stdc++.h> using namespace std; const int N = 1000000; bool can[2]; int a[N]; int main() { ios::sync_with_stdio(false); int n, x, y, l; cin >> n >> l >> x >> y; for (int i = 0; i < n; i++) { cin >> a[i]; } set<int> q; for (int i = 0; i < n; i++) { q.insert... |
///////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2014 Francis Bruno, All Rights Reserved
//
// 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... |
(** * ImpCEvalFun: Evaluation Function for Imp *)
(* #################################### *)
(** * Evaluation Function *)
Require Import Imp.
(** Here's a first try at an evaluation function for commands,
omitting [WHILE]. *)
Fixpoint ceval_step1 (st : state) (c : com) : state :=
match c with
| SKIP =>
... |
/*
* Milkymist VJ SoC
* Copyright (C) 2007, 2008, 2009, 2010 Sebastien Bourdeauducq
*
* 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, version 3 of the License.
*
* This program is distri... |
`timescale 1ns / 1ps
//////////////////////////////////////////////////////////////////////////////////
// Company:
// Engineer:
//
// Create Date: 20:20:24 02/22/2015
// Design Name:
// Module Name: Add
// Project Name:
// Target Devices:
// Tool versions:
// Description:
//
// Dependencie... |
#include <bits/stdc++.h> using namespace std; signed main() { ios_base::sync_with_stdio(false); cin.tie(0); string s; cin >> s; int64_t N = s.size(); vector<int64_t> v(N, 0); int64_t l = 0, r = N - 1; for (int64_t i = 0; i < N; ++i) { if (s[i] == l ) { v[r] = i + 1; ... |
#include <bits/stdc++.h> int main() { int n, i, j, ans = 0; char c[101]; scanf( %d , &n); scanf( %s , c); int l; for (l = 1; l <= n; l++) { for (i = 0; i < n - 4 * l; i++) { if (c[i] == * && c[i + l] == * && c[i + 2 * l] == * && c[i + 3 * l] == * && c[i + 4 * ... |
//=================================================
// PEAK FINDER MODULE
//=================================================
// Returns true detection @ absolute peak, instead of at threshold
// Results are stored in FIFO buffers
module PEAKFINDER # (
parameter taps = 7'd65)(
input SYS_CLK,
input RST,
in... |
#include <bits/stdc++.h> #define lo long long #define KKH 1546C #define fi first #define se second #define BIT(x,k) (((x)>>(k-1))&1) #define rs(x,a) memset(x,(a),sizeof x) #define off(x,k) ((x)^(1<<(k-1))) using namespace std; void START() { #ifdef toilagun2004 freopen(KKH .inp , r ,st... |
#include<bits/stdc++.h> #define pb push_back #define fast ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0) #define ll long long #define pii pair<int,int> #define pll pair<ll,ll> #define f first #define s second #define int long long #define sz(x) (ll)(x.size()) using namespace std; ... |
#include <bits/stdc++.h> using namespace std; const int OO = 1e9; const double EPS = 1e-9; const int MX = 1e6 + 5; int p = 1299709, n, m, u, v; vector<vector<int>> adj(MX); unsigned long long pPw[MX], M = 1000000009, Hash[MX]; int main() { ios::sync_with_stdio(false); cout.precision(10); cin... |
#include <bits/stdc++.h> using namespace std; template <typename base_type, base_type _MOD> struct IntMod { static const int INVERSE_CACHE_SIZE = (1 << 20); static base_type MOD; static void set_mod(base_type new_mod) { MOD = new_mod; } base_type n; IntMod(long long d = 0) { n = (d >= 0 ? d % ... |
module inicial ( botao, aberto, fechado, motor, sentido, ledVerde, ledVermelho, display, clock );
input botao, aberto, fechado, motor, sentido, clock;
output ledVerde, ledVermelho;
output [6:0] display;
reg [1:0] estado;
reg [4:0] entrada;
reg [6:0] tmpDisplay;
reg tmpLedVerde, tmpLedVermelho;
parameter F... |
#include <bits/stdc++.h> using namespace std; long long modulo = 1000000007; int choose(int n, int r) { if (n < r) { return 0; } if (n == r || r == 0) { return 1; } return choose(n - 1, r - 1) + choose(n - 1, r); } int get_factors(int n) { int numFactors = 0; for (int i... |
`timescale 1ns / 1ps
module multiplier_8bit_tb( );
reg [7:0] x0;
reg [7:0] y0;
wire [15:0] mult_out;
reg status;
multiplier_8bit DUT (
.\a_in[0] (x0[0]), .\a_in[1] (x0[1]), .\a_in[2] (x0[2]), .\a_in[3] (x0[3]), .\a_in[4] (x0[4]), .\a_in[5] (x0[5]), .\a_in[6] (x0[6]), .\a_in[7] ... |
#include <bits/stdc++.h> using namespace std; const long long int INF = 9223372036854775807; const long long int mod = 998244353; long long int MOD(long long int a, long long int b) { if (a > b) return a - b; else return b - a; } long long int max3(long long int a, long long int b, long ... |
// megafunction wizard: %FIFO%
// GENERATION: STANDARD
// VERSION: WM1.0
// MODULE: scfifo
// ============================================================
// File Name: altera_primitive_sync_fifo_34in_34out_8depth.v
// Megafunction Name(s):
// scfifo
//
// Simulation Library Files(s):
// altera_mf
// ==========... |
/**
* 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; #pragma comment(linker, /stack:200000000 ) #pragma GCC optimize( Ofast ) #pragma GCC optimize(3) #pragma GCC target( sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native ) #pragma GCC target( sse3 , sse2 , sse ) #pragma GCC target( avx , sse4 , sse4.1 ... |
#include <bits/stdc++.h> using namespace std; bool cmp(string s1, string s2) { return (s1 + s2) < (s2 + s1); } int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); long long int a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z; cin >> n; vector<stri... |
/*
* 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... |
//Legal Notice: (C)2013 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
//simulation files), and any associated do... |
#include <bits/stdc++.h> using namespace std; int n; string s, ret; bool dfs(int idx, int four, int seven, bool flag) { if (idx == n) return true; if (flag) { for (int i = 0; i < four; i++) ret[idx + i] = 4 ; for (int i = four; i < four + seven; i++) ret[idx + i] = 7 ; return true; ... |
//----------------------------------------------------------------------------
//
// COPYRIGHT (C) 2011, VIPcore Group, Fudan University
//
// THIS FILE MAY NOT BE MODIFIED OR REDISTR... |
/* Generated by Yosys 0.3.0+ (git sha1 3b52121) */
(* src = "../../verilog/bytemuxoct.v:1" *)
module ByteMuxOct(A_i, B_i, C_i, D_i, E_i, F_i, G_i, H_i, SAB_i, SC_i, SD_i, SE_i, SF_i, SG_i, SH_i, Y_o);
(* src = "../../verilog/bytemuxoct.v:36" *)
wire [7:0] AB;
(* src = "../../verilog/bytemuxoct.v:37" *)
wire [7... |
#include <bits/stdc++.h> using namespace std; int main() { int n, o, z, t; o = z = t = 0; cin >> n; string s; cin >> s; for (int i = 0; i < n; i++) { if (s[i] == 0 ) z++; else if (s[i] == 1 ) o++; else t++; } for (int i = 0; i < n && z < n ... |
#include <bits/stdc++.h> using namespace std; const int N = 200005; using ll = long long; struct TNode { int l, r; ll v; } t[N << 2]; inline int lc(int pos) { return pos << 1; } inline int rc(int pos) { return pos << 1 | 1; } int a[N], n, m; ll sum[N], lazy[N << 2]; inline void pushup(int po... |
`timescale 1ns/1ps
`include "global.v"
module SigRegisterFile(clk_in, reset_in, writeEnableR0_in, writeEnableR1_in, writeValueR0_in, writeValueR1_in,
shiftEnableR0_in,
readSelectA_in, readSelectB_in, readResultA_out, readResultB_out);
//default register width
parameter REGISTER_WI... |
/**
* 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; template <typename T, typename A> istream& operator>>(istream& in, vector<T, A>& p) { for (auto& i : p) in >> i; return in; } template <typename T, typename A> ostream& operator<<(ostream& out, std::vector<T, A> const& v) { for (auto i : v) out << i ... |
#include <bits/stdc++.h> using namespace std; long long a[201010]; int main() { long long n, m, k; while (~scanf( %lld%lld%lld , &n, &m, &k)) { memset(a, 0, sizeof(a)); long long i, j, ans = 0, sum = k; for (i = 1; i <= n; i++) scanf( %lld , &a[i]); for (i = n; i >= 1; i--) { ... |
// ==============================================================
// File generated by Vivado(TM) HLS - High-Level Synthesis from C, C++ and SystemC
// Version: 2014.4
// Copyright (C) 2014 Xilinx Inc. All rights reserved.
//
// ==============================================================
`timescale 1ns/1p... |
#include <bits/stdc++.h> using namespace std; long long t, n, i, j, k, x, y, z, ans, l, r, mid, s, q; long long a[100005], b[100005], c[100005], d[100005], p[100005], dp[100005][20]; vector<long long> v[100005], u[100005]; map<pair<int, int>, int> m; void dfs(int x, int y, int z) { dp[x][0] = y; d[x... |
#include <bits/stdc++.h> using namespace std; int l[51], r[51], a[51], c[51], dp[51][51][51]; void inline FilterRestrictions(int i, int j, int h, vector<int> &v) { vector<int> u; for (int x : v) { if (r[x] < i || j < l[x] || a[x] >= h) { continue; } u.push_back(x); } v = ... |
#include <bits/stdc++.h> using namespace std; int main() { int a; string s; cin >> a; for (int i = 1; i <= a + 5; i++) { stringstream sa; string ssa; sa << i; sa >> ssa; s.append(ssa); } cout << s[a - 1]; return 0; } |
module sorter_testbench;
reg reset;
reg clock;
wire load;
wire [7:0] in0;
wire [7:0] in1;
wire [7:0] in2;
wire [7:0] in3;
wire [7:0] in4;
wire [7:0] in5;
wire [7:0] in6;
wire [7:0] in7;
wire sorted;
wire [7:0] out0;
wire [7:0] out1;
wire [7:0] out2;
wire [7:0] out3;
wire [7:0] out4;
... |
// Copyright 1986-2016 Xilinx, Inc. All Rights Reserved.
// --------------------------------------------------------------------------------
// Tool Version: Vivado v.2016.3 (win64) Build Mon Oct 10 19:07:27 MDT 2016
// Date : Mon Sep 25 09:34:51 2017
// Host : vldmr-PC running 64-bit Service Pack 1 ... |
#include <bits/stdc++.h> using namespace std; int main() { int n; while (cin >> n) { string str; cin >> str; bool flag = true; if (n < 3) { if (n == 1) { if (str[0] == 1 ) cout << Yes << endl; else cout << No << endl; }... |
#include <bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0); int n; cin >> n; string s; cin >> s; char arr[n + 10]; if (n % 2 == 1) { int temp = n / 2; int j = 0; int k = 1; for (int i = 0; i < (int)s.size(); i+... |
#include <bits/stdc++.h> int a[105]; int main() { int n; scanf( %d , &n); for (int i = 0; i < n; ++i) scanf( %d , &a[i]); int s = 0; for (int i = 0; i < n; ++i) { int t = 0; for (int j = i; j < n; ++j) { t ^= a[j]; if (s < t) s = t; } } printf( %d n , s)... |
//=============================================================
//
// Copyright (c) 2017 Simon Southwell. All rights reserved.
//
// Date: 11th August 2017
//
// This code 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... |
/**
* 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 2011(c) Analog Devices, Inc.
//
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without modification... |
// (C) 2001-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 simulation
// files), and any associated doc... |
/*
* 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; using pii = pair<int, int>; using pll = pair<ll, ll>; using ld = long double; const int MN = 2e5 + 3, MOD = 1e9 + 7; void solve() { int n, a, b; scanf( %d %d %d , &n, &a, &b); if (a > b) swap(a, b); printf( %d %d n , min(n... |
//------------------------------------------------------------------------------
// YF32 -- A small SOC implementation based on mlite (32-bit RISC CPU)
// @Taiwan
//------------------------------------------------------------------------------
//
// ... |
/**
* 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 mn[1111]; int main() { int n, m, k; scanf( %d%d%d , &n, &m, &k); for (int i = 0; i < m; i++) { mn[i] = 1e9; } for (int i = 0; i < n; i++) { int x, y; scanf( %d%d , &x, &y); --x; mn[x] = min(mn[x], y); } int... |
module shift_in (
data_in,
wr_en,
shift_en,
data_out,
clk,
rst
);
parameter WIDTH=1;
input [(64*WIDTH)-1:0] data_in;
input wr_en;
input shift_en;
output [(16*WIDTH)-1:0] data_out;
input clk;
input rst;
wire [(64*WIDTH)-1:0] reg_in;
wire [(64*WIDTH)-1:0] reg_out;
reg line_wr_en;
reg s_or_w_;
always @ (shift_en... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.