text stringlengths 59 71.4k |
|---|
#include <bits/stdc++.h> using namespace std; int n, m, s, ans = 0, f[2 * 200005]; inline int find(int x) { return f[x] == x ? x : f[x] = find(f[x]); } int main() { scanf( %d%d%d , &n, &m, &s); for (register int i = 1; i <= m + n; i++) f[i] = i; for (register int i = 1; i <= s; i++) { register... |
#include<bits/stdc++.h> using namespace std; #define all(x) (x).begin(), (x).end() #define acarr(arr, n, type) type *arr=new type[n]; for(long long i=0; i<n; ++i) cin >> arr[i]; #define ll long long #define TF(ok) cout << (ok ? YES n : NO n ) #define ld long double #define... |
#include <bits/stdc++.h> using namespace std; long long x, x2, y, y2, n, m, k, a, b, rep, koliko, koliko2, p; long long hi, lo, mid; bool t; char c; string s; int main() { vector<long long> V; cin >> n >> k; k = n - k; for (int i = 0; i < n; i++) { cin >> x; V.push_back(x); ... |
#include <bits/stdc++.h> using namespace std; const int MOD = 1e9 + 7; int main() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); int n, x; cin >> n >> x; long long a[n], b[n]; for (int i = 0; i < n; ++i) cin >> a[i]; for (int i = 0; i < n; ++i) cin >> b[i]; sort(a, a ... |
#include <bits/stdc++.h> using namespace std; int fen1[200002]; void upd1(int pos, int val) { for (; pos <= 200000; pos |= (pos + 1)) fen1[pos] += val; } int fnd1(int pos) { int ret = 0; for (; pos >= 0; pos = (pos & (pos + 1)) - 1) ret += fen1[pos]; return ret; } int fen2[200002]; void ... |
// (c) Copyright 1995-2017 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 property
// laws.
//
// DISCLAIMER
// This disclaimer is not a license and does not grant ... |
/**
* 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... |
//////////////////////////////////////////////////////////////////////
//// ////
//// OR1200's reg2mem aligner ////
//// ////
//// This file is part of the OpenR... |
#include <bits/stdc++.h> using namespace std; const int N = 100005, MAX = 202; struct Leg { int len, cost; friend bool operator<(const Leg x, const Leg y) { return x.len < y.len; } }; Leg l[N]; int sum[N]; int c[MAX][N]; int f[N]; bool vis[N]; int main() { int n; scanf( %d , &n); ... |
#include <bits/stdc++.h> using namespace std; inline int in() { int32_t x; scanf( %d , &x); return x; } inline long long lin() { long long x; scanf( %lld , &x); return x; } inline string get() { char ch[2000010]; scanf( %s , ch); return ch; } const int MAX_LG = 21; ... |
`timescale 1ns / 1ps
//////////////////////////////////////////////////////////////////////////////////
// Company: Do I need to reiterate?
// Engineer: Colt Wilkens
//
// Create Date: 10/15/2014 03:00:43 PM
// Design Name: CODENAME: MAGICHAT
// Module Name: PS3spiControl
// Project Name: FPGA Hero II
// Target Device... |
/**
* 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... |
module auto_module
( input my_clk,
input my_rst_n,
output manually_listed,
/*AUTOINOUTMODPORT("automodport_if" "pure_mp")*/
// Beginning of automatic in/out/inouts (from modport)
output out_pure,
input in_pure,
// End of automatics
//ex: in... |
#include <bits/stdc++.h> using namespace std; const int MOD = 1000000007, dx[] = {0, 1, 0, -1}, dy[] = {1, 0, -1, 0}; const double eps = 1e-8; void read(int &k) { k = 0; char x = getchar(); while (x < 0 || x > 9 ) x = getchar(); while (x >= 0 && x <= 9 ) { k = k * 10 - 48 + x; ... |
//
// Copyright (c) 1999 Steven Wilson ()
//
// 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> #pragma GCC optimize( O3 ) #pragma GCC optimize( -Ofast , -funroll-all-loops , -ffast-math ) using namespace std; using LL = long long; constexpr LL mod = 1e9 + 7; long long ex_gcd(long long a, long long b, long long &x, long long &y) { if (!b) { x = 1; y = 0; ... |
#include <bits/stdc++.h> using namespace std; int main() { int n, p; cin >> n >> p; int a[n], maxi = 0; for (int i = 0; i < n; i++) { cin >> a[i]; } sort(a, a + n); for (int i = 0; i < n; i++) { maxi = max(maxi, a[i] - i); } int b = 0; for (int i = 0; i < n; 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 la... |
#include <bits/stdc++.h> using namespace std; int n, m, x; long long f[1510], g[1510]; long long sum[1510]; int main() { memset(f, 0, sizeof(f)); scanf( %d%d , &n, &m); for (int i = 0; i < n; ++i) { scanf( %d , &x); sum[0] = x; for (int j = 1; j < m; ++j) { scanf( %d , &x... |
// (C) 2001-2012 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... |
// ALU implementation
`include "verilog/mips_alu_defines.v"
module alu
(
input wire[31:0] opr_a_alu_i,
input wire[31:0] opr_b_alu_i,
input wire[5:0] op_alu_i,
output wire[31:0] res_alu_o,
output wire z_alu_o,
output wire n_alu_o
);
... |
/*
* 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 = 3e3; int r, c, n, k, tot, bound[maxn + 2], vis[maxn + 2], suc[maxn + 2], pre[maxn + 2], rest[maxn + 2]; bool exist[maxn + 2][maxn + 2]; long long ans; struct vertex { int x, y; } a[maxn + 1]; vector<int> t[maxn + 1]; int main() {... |
// ====================================================================
// MAH PONK
//
// Copyright (C) 2007, Viacheslav Slavinsky
// This design and core is distributed under modified BSD license.
// For complete licensing information see LICENSE.TXT.
// ----------------------------... |
#include <bits/stdc++.h> using namespace std; inline int read() { int x, f = 1; char c; while ((c = getchar()) < 0 || c > 9 ) if (c == - ) f = 0; for (x = c - 0 ; (c = getchar()) >= 0 && c <= 9 ;) x = x * 10 + c - 0 ; return f ? x : -x; } struct vec { int x, y; } v[10 + ... |
// $Id: c_crossbar.v 1534 2009-09-16 16:10:23Z dub $
/*
Copyright (c) 2007-2009, Trustees of The Leland Stanford Junior University
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
Redistributions of sou... |
#include <bits/stdc++.h> using namespace std; bool check(int hr, int min) { if (hr % 10 == 7 || hr / 10 == 7 || min % 10 == 7) { return true; } return false; } int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); int x, hr, min, res = 0; cin >> x >> hr >> min; whil... |
#include <bits/stdc++.h> using namespace std; map<int, int> mp; int main() { long long n; int k, cnt = 0; scanf( %lld %d , &n, &k); for (int i = 0; i < 63; i++) { if (n >> i & 1) { mp[i] = 1; ++cnt; } } if (cnt > k) return puts( No ), 0; puts( Yes ); int... |
`include "bsg_defines.v"
// MBT 11/26/2014, bsg_fsb_node_trace_replay
// Shaolin 01/06/2018, generalized from the bsg_trace_replay
// trace format (see enum below)
//
// Debug Display Levels:
// 0 = suppress all non-errors. only shows mismatch and unknown op
// (default) 1 = adds finish and done
// ... |
#include <bits/stdc++.h> using namespace std; const int MOD = 1e9 + 7; using namespace std; int num[1001]; long long n; long long check(long long k) { long long p = 0, v = 0; long long t = n; while (t) { if (t >= k) { p += k; t -= k; } else { p += t; t... |
#include <bits/stdc++.h> using namespace std; int main() { long long t, a, b, x; cin >> t; while (t--) { cin >> a >> b; if (a == b) { cout << 0 << endl; continue; } if (a < b) { x = (b / 10) - (a / 10); } else { x = (a / 10) - (b / 10); ... |
module ALU_tb();
reg [31:0] x, y;
reg carry;
wire ocarry;
wire signed [31:0] summ;
wire [31:0] mult_h;
wire [31:0] mult_l;
wire [31:0] zand, zor, zxor, znot;
wire signed [31:0] sub, ashiftl, ashiftr;
wire [31:0] lshiftl, lshiftr, revers;
reg fake;
ALU alu1(x, y, carry, summ, ocarry, mult_h, mult_l, zand, zor, z... |
// Generated by altmemphy 10.0 [Altera, IP Toolbench 1.3.0 Build 262]
// ************************************************************
// THIS IS A WIZARD-GENERATED FILE. DO NOT EDIT THIS FILE!
// ************************************************************
// Copyright (C) 1991-2011 Altera Corporation
// Any megafuncti... |
#include <bits/stdc++.h> using namespace std; static const double EPS = 1e-8; int main() { istream &fin = cin; ostream &fout = cout; FILE *fpin = stdin; FILE *fpout = stdout; string s; fin >> s; bool p = true; string res; for (int i = s.size() - 1; i >= 0; i--) { if (p &&... |
#include <bits/stdc++.h> #define fasterio ios::sync_with_stdio(false);cin.tie(0);cout.tie(0) #define X first #define Y second #define forn(i, n) for(int i=0;i<(n);i++) #define pb push_back using namespace std; typedef long long ll; typedef pair<int, int> pii; const int inf = 0x3f3f3f3f; const long l... |
//
// Copyright (c) 1999 Steven Wilson ()
//
// 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; const int N = 100 + 10; int n, m; int SG[N << 1]; int main() { int T; for(scanf( %d , &T); T--; ) { scanf( %d%d , &n, &m); memset(SG, 0, (n + m) << 2); for(int i = 0; i < n; i++) { for(int j = 0; j < m; j+... |
#include <bits/stdc++.h> using namespace std; long long n, dp[200000]; vector<long long> bit(200000, 0); void update(long long x, long long val) { while (x <= n) { bit[x] ^= val; x += x & -x; } } long long query(long long x) { long long ans = 0; while (x) { ans ^= bit[x]; ... |
#include <bits/stdc++.h> using namespace std; const int INF = 1 << 29; int n, m; int main(void) { while (cin >> n >> m && n && m) { priority_queue<long long, vector<long long>, greater<long long> > que; for (int i = 0; i < n; i++) { long long a; que.push((cin >> a, a)); } ... |
#include <bits/stdc++.h> using namespace std; const int N = 1007; struct P { int x, y, k; int d; void in() { scanf( %d %d %d , &x, &y, &k); d = x * x + y * y; } } p[N]; bool cmp(P a, P b) { return a.d <= b.d; } int main() { int n, s, i; int M = 1000000; while (~scanf(... |
#include <bits/stdc++.h> using namespace std; long long n, m; long long a[100000], b[100000]; long long val(long long p) { long long ret = 0; for (long long i = 0; i < n; ++i) ret += max((long long)0, p - a[i]); for (long long i = m - 1; i >= 0; --i) ret += max((long long)0, b[i] - p); return re... |
// ========== Copyright Header Begin ==========================================
//
// OpenSPARC T1 Processor File: dram_ddr_pad_rptr_south.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 redistrib... |
//Legal Notice: (C)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 do... |
#include <bits/stdc++.h> const int N = 300010; int n, m, i, j, js, root, mx; int a[N], x[N], y[N], num[N], f[N], next[N * 2], last[N * 2], tov[N * 2], bh[N * 2], ans[N * 2]; bool dir[N * 2], bz[N]; int gf(int xx) { if (f[xx] == xx) return xx; int jl = gf(f[xx]); f[xx] = jl; return jl; ... |
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; int maxx = -1; set<int> s; map<int, int> m; vector<int> l(n); for (int i = 0; i < n; i++) { cin >> l[i]; m[l[i]]++; if (m[l[i]] > maxx) maxx = m[l[i]]; s.insert(l[i]); } cout << ma... |
/*
* 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... |
/**
* 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; mt19937 rnd(chrono::steady_clock::now().time_since_epoch().count()); const int N = 200005; const int M = 1000000007; long long ast(long long x, long long n) { x %= M; long long ans = 1; while (n) { if (n % 2 == 1) ans = (ans * x) % M; x = (... |
#include <bits/stdc++.h> using namespace std; const long double EPS = 1e-6; const int INF = (int)(INT_MAX - 100); const long long mod = (int)(1e+9 + 7); const int N = (int)(1e5); int main() { int n, s; cin >> n >> s; char d; int p, k; map<int, int, greater<int> > C; map<int, int> V; ... |
#include <bits/stdc++.h> using namespace std; int main() { double a, d; int n; cin >> a >> d >> n; scanf( %lf%lf%d , &a, &d, &n); for (int i = 0; i < n; i++) { double temp = fmod((i + 1) * d, 4 * a); if (temp < a) printf( %lf %lf n , temp, 0.0); else if (temp < a * 2) ... |
////////////////////////////////////////////////////////////////////////////////
// Copyright (c) 2016-2020 NUDT, Inc. All rights reserved.
////////////////////////////////////////////////////////////////////////////////
//Vendor: NUDT
//Version: 0.1
//Filename: user_mgmt_slave.v
//Target Device: Altera
//Dscri... |
#include <bits/stdc++.h> using namespace std; int main() { int n, k; cin >> n >> k; string K; cin >> K; if (K.size() == 1 and k != 0) { cout << 0; return 0; } if (k == 0) { cout << K; return 0; } if (K[0] != 1 ) { K[0] = 1 ; k -= 1; for... |
/**
* 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> const int N = 100005; const int MOD = 1000000009; int f[N]; int find(int x) { if (x != f[x]) f[x] = find(f[x]); return f[x]; } int main() { int i, n, m, x, y, a, b, r = 0; scanf( %d%d , &n, &m); for (i = 1; i <= n; i++) f[i] = i; while (m--) { scanf( %d... |
// megafunction wizard: %RAM: 2-PORT%VBB%
// GENERATION: STANDARD
// VERSION: WM1.0
// MODULE: altsyncram
// ============================================================
// File Name: DAS_RF.v
// Megafunction Name(s):
// altsyncram
//
// Simulation Library Files(s):
// altera_mf
// =================... |
#include <bits/stdc++.h> const long long oo = (long long)1e18 + 1; using namespace std; int n, q; int b[200002]; pair<int, int> a[200002]; int T[200002]; vector<pair<int, int> > query[200002]; int k[200002], p[200002]; int res[200002]; void upd(int x) { while (x < 200002) { T[x]++; x... |
module inpad (
output Q,
(* iopad_external_pin *)
input P
);
specify
(P => Q) = 0;
endspecify
assign Q = P;
endmodule
module outpad (
(* iopad_external_pin *)
output P,
input A
);
specify
(A => P) = 0;
endspecify
assign P = A;
endmodule
module ckpad (
output Q,
(* iopad_external_pi... |
/**
* 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 maxn = 2e5 + 5; int ans[maxn]; struct node { int l, r; bool operator<(const node& a) const { int s1 = r - l + 1; int s2 = a.r - a.l + 1; if (s1 == s2) return a.l < l; else return a.r - a.l + 1 > r - l + 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; const long long inf = (1ll << 60); const int maxn = 10010; long long dp[2][maxn], c; int p[maxn], s[maxn]; int n, id; int main() { scanf( %d%I64d , &n, &c); for (int i = 0; i < n; i++) scanf( %d , p + i); for (int i = 0; i < n; i++) scanf( %d , s +... |
#include <bits/stdc++.h> long long n, m, k, a[11111], kq; long long min(long long a, long long b) { if (a < b) return a; return b; } int main() { scanf( %lld %lld %lld , &n, &m, &k); for (int i = 1; i <= n; i++) scanf( %lld , &a[i]); if (n % 2 == 0) printf( 0 ); else { kq = a... |
#include <bits/stdc++.h> using namespace std; long long int n, k, nb, a[1005], b[2005], t = -10000, pos = 0, p, d; long long int save[1005][2005]; long long int time(int i, int j) { if (save[i][j] != -1) return save[i][j]; if (i == n) return 0; if (j == k) return 3e9; return (save[i][j] = min(ti... |
/*
* Copyright (c) 2002 Jane Skinner
*
* 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)
* any ... |
//*****************************************************************************
// (c) Copyright 2008 - 2013 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 property
/... |
#include <bits/stdc++.h> using namespace std; char str1[100 + 10], str2[100 + 10]; int main() { int m, s; while (~scanf( %d%d , &m, &s)) { for (int i = 0; i < m; i++) str1[i] = str2[i] = 0 ; int ss = s; if (m == 1 && s == 0) { printf( 0 0 n ); continue; } if ... |
/////////////////////////////////////////////////////////////////////
//// ////
//// or1200_fpu_fcmp ////
//// Single precision Floating Point Compare Unit ////
//// ... |
#include <bits/stdc++.h> using namespace std; const int oo = 0x3f3f3f3f; const long long ooo = 9223372036854775807ll; const int _cnt = 1000 * 1000 + 7; const int _p = 1000 * 1000 * 1000 + 7; const int N = 200005; const double PI = acos(-1.0); const double eps = 1e-9; int o(int x) { return x % _p; } ... |
#include <bits/stdc++.h> using namespace std; mt19937 rng(chrono::steady_clock::now().time_since_epoch().count()); int rnd(int l, int r) { return l + rng() % (r - l + 1); } const int N = 200010; int n; long long ret; int a[N], lz[N], b[N]; int f[N][25]; int que(int i, int j) { int t = lz[j - i + 1... |
#include <bits/stdc++.h> using namespace std; const int MAXN = 10101; const int BIT = 30; int N; int arr[MAXN], brr[MAXN]; int real_arr[MAXN]; bool isb[MAXN], risb[MAXN]; vector<pair<int, int> > vans; void action(int a, int b) { arr[b] ^= arr[a]; vans.push_back(make_pair(b + 1, a + 1)); } ... |
#include <bits/stdc++.h> using namespace std; const int N = 8; const int dx[9] = {-1, -1, -1, 0, 0, 0, 1, 1, 1}; const int dy[9] = {-1, 0, 1, -1, 0, 1, -1, 0, 1}; string a[N]; int v[105][N][N], f[105][N][N]; int main() { for (int i = 0; i < N; ++i) cin >> a[i]; memset(v, 0, sizeof(v)); for (in... |
/**
* 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 = (int)1e9 + 7; const int MOD2 = MOD + 2; const int INF = (int)1e9; const long long LINF = (long long)1e18; const long double PI = acos((long double)-1); const long double EPS = 1e-9; inline long long gcd(long long a, long long b) { long lo... |
#include <bits/stdc++.h> using namespace std; const long long M = 3e4 + 1; long long n, m, d; const long long K = 3e4 + 5; const long long huge = 1e15; long long dp[K][500]; long long a[K], ps[K]; long long solve(long long i, long long j) { if (i >= M) return 0; long long jj = j - (d - 250); ... |
/**
* 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 maxn = 100010; int n; int q; long long a[201]; multiset<long long> s; int main() { cin >> q; while (q--) { int flag = 0; s.clear(); cin >> n; long long x; for (int i = 1; i <= n; i++) { cin >> 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... |
// -------------------------------------------------------------
//
// Generated Architecture Declaration for rtl of inst_a_e
//
// Generated
// by: wig
// on: Mon Jun 26 16:30:00 2006
// cmd: /cygdrive/h/work/eclipse/MIX/mix_0.pl ../../genwidth.xls
//
// !!! Do not edit this file! Autogenerated by MIX !!!
// $Aut... |
#include <bits/stdc++.h> using namespace std; void mf() { freopen( input.in , r , stdin); } int a[1007]; int n, k; map<int, int> mm; queue<int> q; bool f(map<int, int>& _mm, int x) { return _mm.find(x) != _mm.end(); } void solve() { int m; n = 0; cin >> k >> m; int x; for (int i = 1... |
#include <bits/stdc++.h> using namespace std; long long p = 1000000007; long long fact[100000]; long long dp[100000]; long long factdp[100000]; long long ar[200000]; int main() { fact[0] = 1; fact[1] = 1; dp[0] = 1; dp[1] = 1; factdp[0] = 1; factdp[1] = 1; for (int i = 2; i < 1... |
// file: clk_divider.v
//
// (c) Copyright 2008 - 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 property
// laws.
//
// DISCLAIMER
// This disclaimer is not ... |
/**
* 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 2017 Damien Pretet ThotIP
//
// 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://w... |
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; int foot = n / 36; float b = n % 36; int kkk = b / 3; double kk = kkk + 0.5; float inch = b / 3; if (inch >= kk) inch = ceil(inch); else if (inch < kk) inch = floor(inch); int sss = (float... |
#include <bits/stdc++.h> using namespace std; #pragma comment(linker, /stack:200000000 ) #pragma GCC optimize( Ofast ) #pragma GCC target( sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2,tune=native ) #pragma GCC optimize( -ffloat-store ) const long long INF = 0xFFFFFFFFFFFFFFFL; const long long... |
module my_uart_tx(rst_n, baud_clk, tx_start, tx_data, tx_enable, tx_complete, uart_tx, error);
input rst_n;
input baud_clk;
input tx_start;
input[7:0] tx_data;
output tx_enable;
output tx_complete;
output uart_tx;
output error;
/*************************************************************************************
* ... |
#include <bits/stdc++.h> using namespace std; const double PI = acos(-1.0); namespace IO { bool REOF = 1; inline char nc() { static char buf[100000], *p1 = buf, *p2 = buf; return p1 == p2 && REOF && (p2 = (p1 = buf) + fread(buf, 1, 100000, stdin), p1 == p2) ? (REOF = ... |
//`include "timescale.vh"
module spi (
input wire clk,
input wire resn,
input wire trig,
output wire done,
output reg [15:0] rdData,
input wire [15:0] wrData,
// SPI interface
output reg SCLK,
output reg SS,
output reg M... |
#include <bits/stdc++.h> using namespace std; void __print(int first) { cerr << first; } void __print(long first) { cerr << first; } void __print(long long first) { cerr << first; } void __print(unsigned first) { cerr << first; } void __print(unsigned long first) { cerr << first; } void __print(unsigned l... |
#include <bits/stdc++.h> using namespace std; long long n, len, wmax, ans; vector<long long> vec[2]; inline void _read(long long &x) { long long f = 1; x = 0; char c = getchar(); while (!isdigit(c)) { if (c == - ) f = -1; else f = 1; c = getchar(); } wh... |
`timescale 1us/100ns
module top;
reg pass = 1'b1;
reg [3:0] ia = 4'd1;
wire signed [3:0] iconstp, iconstm, isfunc, iufunc;
wire [7:0] istring;
/* Integer constant value. */
assign #1 iconstp = 2; // 2
assign #1 iconstm = -2; // -2
assign #1 istring = "0"; // "0"
/* Integer System Function. */
as... |
#include <bits/stdc++.h> using namespace std; const int MAXN = 200000 + 100; const int M = 30; vector<int> G[MAXN]; int deep[MAXN], fa[MAXN][M]; void DFS(int cur, int pre) { fa[cur][0] = pre; for (int i = 1; i < 20; ++i) fa[cur][i] = fa[fa[cur][i - 1]][i - 1]; for (int i = 0; i < G[cur].size(); ... |
// File: ClockDividerTBV.v
// Generated by MyHDL 0.10
// Date: Tue Aug 14 06:51:30 2018
`timescale 1ns/10ps
module ClockDividerTBV (
);
// myHDL -> Verilog Testbench for `ClockDivider` module
reg clk = 0;
reg rst = 0;
wire [31:0] count;
reg [31:0] Divisor = 0;
wire clkOut;
reg [31:0] ClockDivider0_0_count_i = 0;
... |
//////////////////////////////////////////////////////////////////////
//// ////
//// or1200_fpu_pre_norm_div ////
//// ////
//// This file is part of the OpenR... |
// -*- Mode: Verilog -*-
// Filename : testing_wb_master.v
// Description : Testing a Wishbone Bus Master
// Author : Philip Tracton
// Created On : Fri Nov 27 16:22:45 2015
// Last Modified By: Philip Tracton
// Last Modified On: Fri Nov 27 16:22:45 2015
// Update ... |
/*
* 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... |
// ==============================================================
// 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... |
// ==============================================================
// File generated by Vivado(TM) HLS - High-Level Synthesis from C, C++ and SystemC
// Version: 2017.4
// Copyright (C) 1986-2017 Xilinx, Inc. All Rights Reserved.
//
// ==============================================================
`timescale 1 ns / 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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.