text stringlengths 59 71.4k |
|---|
#include <bits/stdc++.h> using namespace std; void FLASH() { ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); } void SETF() { cout.ios_base::setf(ios_base::fixed); cerr.ios_base::setf(ios_base::fixed); } void UNSETF() { cout.ios_base::unsetf(ios_base::fixed); cerr... |
#include <bits/stdc++.h> int main() { long long n; while (scanf( %lld , &n) != EOF) { printf( %lld n , n - n / 2 - n / 3 - n / 5 - n / 7 + n / 6 + n / 10 + n / 14 + n / 15 + n / 21 + n / 35 - n / 30 - n / 42 - n / 70 - n / 105 + n / 210); } r... |
#include <bits/stdc++.h> using namespace std; int main() { long long n, a[10000], first = -1, val, t = 1; cin >> n; cin >> a[0]; for (int i = 1; i < n; i++) { cin >> a[i]; if (a[i - 1] > a[i] || a[i - 1] == a[i]) t = 0; } if (t == 1) { cout << YES ; return 0; } ... |
#include <bits/stdc++.h> using namespace std; template <typename _T, typename _T2> string to_string(pair<_T, _T2> x) { return < + to_string(x.first) + , + to_string(x.second) + > ; } template <typename _T> string to_string(vector<_T> vec) { string s = [ ; for (auto el : vec) s += to_stri... |
// DESCRIPTION: Verilator: Verilog Test module
//
// This file ONLY is placed into the Public Domain, for any use,
// without warranty.
// bug998
interface intf
#(parameter PARAM = 0)
();
logic val;
function integer func (); return 5; endfunction
endinterface
module t1(intf mod_intf);
initial begin
... |
/*
* Copyright (c) 2011-2014 Travis Geiselbrecht
*
* 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, modify, m... |
//`define CONN_INTERNAL_BITS
`define PINTYPE 6'b010001
// `define IOSTANDARD "SB_LVCMOS"
`define IOSTANDARD "SB_LVCMOS"
// The following IO standards are just aliases for SB_LVCMOS
// `define IOSTANDARD "SB_LVCMOS25_16"
// `define IOSTANDARD "SB_LVCMOS25_12"
// `define IOSTANDARD "SB_LVCMOS25_8"
// `define IOSTANDARD... |
// ***************************************************************************
// ***************************************************************************
// Copyright 2011(c) Analog Devices, Inc.
//
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without modification,
// a... |
#include <bits/stdc++.h> using namespace std; long long n, m, p, prt[100005], num[100005], ans = 1, cnt, u, v; inline int getfather(int u) { if (u == prt[u]) return prt[u]; prt[u] = getfather(prt[u]); return prt[u]; } int main() { scanf( %lld%lld%lld , &n, &m, &p); for (register int i = 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 n, a, b; int primect = 0; int primes[40000]; int arr[1000000]; set<int> pset; long long costl[1000000]; long long costr[1000000]; long long minCosts[30]; long long inf = numeric_limits<long long>::max(); void fillInPrimes() { primes[0] = 2; ... |
#include <bits/stdc++.h> #pragma GCC optimize( O3 ) using namespace std; const int N = (int)5e5 + 100; const int M = (int)2e6 + 100; const int inf = (int)1e9 + 100; string s, t; long long mod = 998244353; bool was[3001][3001]; long long table[3001][3001]; long long f(int x, int y) { if (x < 0) r... |
#include <bits/stdc++.h> using namespace std; long long n, A[100005]; int main() { ios_base::sync_with_stdio(false); cin >> n; for (int i = 0; i < n; i++) cin >> A[i]; sort(A, A + n); int mid = n / 2; long long res = 0; for (int i = 0; i < mid; i++) { res = (res + A[i] * A[n - 1 ... |
#include <bits/stdc++.h> using namespace std; int main() { string s; cin >> s; int n = s.length(); int l = n, r = n; bool found = false; for (int i = 0; i < n; i++) { if (found == false && s[i] > a ) { found = true; l = i; } if (found == true && s[i] == a ... |
/* Module from the schematic_gui program written by Andreas Ehliar <>
This Verilog file is licensed under the CC0 license. */
module mux3 #(parameter WIREWIDTH = 1) (input wire [1:0] s,
input wire [WIREWIDTH:0] d0, d1, d2,
output reg [WIREWIDTH:0] o);
initial begin
$schematic_boundingbox(40,160);... |
#include <bits/stdc++.h> using namespace std; const int N = 1e5 + 1; string s, t; char c[N]; int cs[2][N], ct[2][N], q; int main() { scanf( %s , c); s = c; scanf( %s , c); t = c; int at = 0; for (auto &i : s) { at++; if (i == C || i == B ) { i = B ; ... |
#include <bits/stdc++.h> using namespace std; vector<int> graph[3010]; int cycle[3010]; int cycle_size; bool visited[3010]; bool found_cycle; int dist[3010]; int b, e; void dfs(int node, int father, int c) { if (found_cycle) return; visited[node] = true; for (int i = 0; i < graph[node].siz... |
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; for (int i = 0; i < n * n / 2; i++) { cout << i + 1 << << n * n - i; if (2 * (i + 1) % n == 0) cout << endl; else cout << ; } return 0; } |
/**
* 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() { ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); int n; cin >> n; vector<int> a(n); for (int i = 0; i < n; i++) { cin >> a[i]; } map<vector<int>, int> H; for (int i = 0; i < 1 << 18; i++) { vector<int> b(... |
// ==============================================================
// File generated by Vivado(TM) HLS - High-Level Synthesis from C, C++ and SystemC
// Version: 2017.1
// Copyright (C) 1986-2017 Xilinx, Inc. All Rights Reserved.
//
// ==============================================================
`timescale 1ns/1ps
... |
#include <bits/stdc++.h> using namespace std; int main() { long long n, m; cin >> n >> m; long long c[n], s[n]; for (int i = 0; i < n; i++) { cin >> c[i] >> s[i]; } long long dp[m + 1]; dp[m] = 0; for (int i = m - 1; i >= 0; i--) { dp[i] = m - i; for (int j = 0; j <... |
#include <bits/stdc++.h> using namespace std; const double eps = 1e-9; int main() { cout << fixed << setprecision(12); int n, k; cin >> n >> k; vector<vector<int>> y(n, vector<int>(k + 1)); for (auto &yi : y) for (auto &yij : yi) cin >> yij; vector<double> sum(n); for (int j = 0;... |
#include <bits/stdc++.h> using namespace std; const int N = 5500; char s[N]; int ans[N], dp[N][N]; int main() { scanf( %s , s + 1); int n = strlen(s + 1); for (int i = 1; i <= n; i++) { dp[i][i] = 1; ans[1]++; if (i < n && s[i] == s[i + 1]) { dp[i][i + 1] = 2; ans... |
#include <bits/stdc++.h> using namespace std; int N, Cnt = 0; double A[4005], C[4005], Ans = 0.0, Anx; double Abs(double x) { return x < 0 ? -x : x; } int main() { scanf( %d , &N); for (int i = 1; i <= 2 * N; i++) scanf( %lf , &A[i]), C[i] = A[i] - (int)A[i]; for (int i = 1; i <= 2 * N; i++) { ... |
// (c) Copyright 1995-2016 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 ... |
// (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 ... |
//////////////////////////////////////////////////////////////////////
//// ////
//// OR1200's generate PC ////
//// ////
//// This file is part of the OpenR... |
#include <bits/stdc++.h> using namespace std; bool debug = 0; int n, m, k; int dx[4] = {0, 1, 0, -1}, dy[4] = {1, 0, -1, 0}; string direc = RDLU ; long long ln, lk, lm; void etp(bool f = 0) { puts(f ? YES : NO ); exit(0); } void addmod(int &x, int y, int mod = 1000000007) { assert(y >=... |
/**
* 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 : Sun Apr 09 07:02:45 2017
// Host : GILAMONSTER running 64-bit major release (... |
#include <bits/stdc++.h> using namespace std; long long co[100]; int main() { long long a, l = 0; long long ans = 1; cin >> a; while (a > 1) { long long c = 0; for (int s = 2; s <= sqrt(a); s++) { if (a % s == 0) { a /= s, co[l] = s, l++, c = 1; break; ... |
#include <bits/stdc++.h> using namespace std; const long long maxn = 1e6 + 5; const long long mod = 1e9 + 7; const int inf = 0x7fffffff; int a[maxn]; int main() { int t; cin >> t; while (t--) { int r, g, b, w; cin >> r >> g >> b >> w; int f = 0; if (r % 2 == 1) f++; ... |
#include <bits/stdc++.h> using namespace std; int main() { long long t, T; cin >> t; for (T = 0; T < t; T++) { long long l, i; string s, s1, s2; cin >> s; l = s.size(); for (i = 0; i < l / 2; i++) { s1.push_back(s[i]); } for (i = l / 2; s[i] != 0 ; i++... |
#include <bits/stdc++.h> using namespace std; const int MAXN = 105000; const int INF = 2100000000; struct target { int mi_n[2], ma_x[2], z, n; }; struct point { int min, n, dot, d[2], fa, l, r; }; int n, m, root, now, txl, txr, tyl, tyr, ans[MAXN] = {0}; target rec[MAXN]; point t[MAXN]; vo... |
/**
* 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; string to_string(string s) { return + s + ; } template <typename T> string to_string(vector<T>); template <typename U, typename V> string to_string(pair<U, V> p) { return ( + to_string(p.first) + , + to_string(p.second) + ) ; } template <typ... |
`timescale 1ns / 1ps
////////////////////////////////////////////////////////////////////////////////
// Company:
// Engineer:
//
// Create Date: 22:44:56 05/08/2017
// Design Name: fifo
// Module Name: E:/University/AXI_SPI_IF/rtl/fifo_test_full.v
// Project Name: axi_spi_if
// Target Device:
// ... |
#include <bits/stdc++.h> using namespace std; template <class T> void show(const vector<T> &a) { for (T x : a) cout << x << ; cout << endl; } signed main() { long long tc; cin >> tc; while (tc--) { long long x, y, z; cin >> x >> y >> z; vector<long long> a(3); a[... |
`timescale 1ns / 1ps
////////////////////////////////////////////////////////////////////////////////
// Company: Cal Poly Pomona
// Engineer: Byron Phung
//
// Create Date: 13:34:32 04/27/2016
// Design Name: Search_4Comparators
// Module Name: D:/Documents/College/CalPolyPomona/SeniorProject/hardware-acce... |
// 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 : Sat May 27 21:33:31 2017
// Host : GILAMONSTER running 64-bit major release (... |
#include <bits/stdc++.h> using namespace std; int main() { ios::sync_with_stdio(false); int ar1[100], ar2[100]; memset(ar1, 0, sizeof(ar1)); memset(ar2, 0, sizeof(ar2)); string s1, s2; cin >> s1 >> s2; int t; cin >> t; vector<pair<pair<int, char>, pair<int, char> > > v(t); fo... |
#include <bits/stdc++.h> using namespace std; const int MAXN = 1000000; int a[300005], b[300005]; class SegmentTree { public: SegmentTree* left = nullptr; SegmentTree* right = nullptr; int start, end, val = 0, lazyadd = 0; SegmentTree(int s, int e) { start = s; end = e; if (... |
//*****************************************************************************
// DISCLAIMER OF LIABILITY
//
// This file contains proprietary and confidential information of
// Xilinx, Inc. ("Xilinx"), that is distributed under a license
// from Xilinx, and may be used, copied and/or disclosed only
// pursuant to the... |
#include <bits/stdc++.h> using namespace std; struct node { int x, id; } s[100101]; bool cmp(node a, node b) { return a.x < b.x; } int main() { int n, i, j, x; cin >> n; for (i = 0; i < n; i++) { cin >> s[i].x; s[i].id = i + 1; } sort(s, s + n, cmp); if (n % 2) x ... |
`timescale 1ns / 1ps
////////////////////////////////////////////////////////////////////////////////
// Company:
// Engineer:
//
// Create Date: 23:10:21 05/02/2015
// Design Name: barrel_shifter
// Module Name: D:/Projects/Xilinx/Shifter/test_barrel_shifter.v
// Project Name: Shifter
// Target Devi... |
/**
* 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> inline void in(int &MAGNUS) { scanf( %d , &MAGNUS); } inline void out(int MAGNUS) { printf( %d n , MAGNUS); } inline void in(int &MAGNUS, int &CLAR) { scanf( %d%d , &MAGNUS, &CLAR); } inline void out(int MAGNUS, int CLAR) { printf( %d %d n , MAGNUS, CLAR); } inline void inl(long long ... |
`include "../common/fpga_regs_common.v"
`include "../common/fpga_regs_standard.v"
module adc_interface
(input clock, input reset, input enable,
input wire [6:0] serial_addr, input wire [31:0] serial_data, input serial_strobe,
input wire [11:0] rx_a_a, input wire [11:0] rx_b_a, input wire [11:0] rx_a_b, input... |
// megafunction wizard: %ROM: 1-PORT%VBB%
// GENERATION: STANDARD
// VERSION: WM1.0
// MODULE: altsyncram
// ============================================================
// File Name: exam.v
// Megafunction Name(s):
// altsyncram
//
// Simulation Library Files(s):
// altera_mf
// ===============================... |
(************************************************************************)
(* v * The Coq Proof Assistant / The Coq Development Team *)
(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2010 *)
(* \VV/ **************************************************************)
(* // * Th... |
module top;
reg pass;
parameter [7:0] in = 8'b10100101;
reg [3:0] out;
initial begin
pass = 1'b1;
out = in[7:'dx];
if (out !== 4'bxxxx) begin
$display("FAILED: part select LSB is X, expected 4'bxxxx, got %b", out);
pass = 1'b0;
end
out = in['dx:0];
if (out !== 4'bxxxx) beg... |
/*
Copyright (C) 2016 Cedric Orban
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 program is distributed in the ho... |
// ========== Copyright Header Begin ==========================================
//
// OpenSPARC T1 Processor File: bw_clk_cclk_hdr_64x.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 ... |
#include <bits/stdc++.h> using namespace std; const int N = 1e5 + 5; int n, finans = 0; int a[N], ans[N], sieve[N], countprime[N]; vector<int> primes[N]; int32_t main() { ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); ; cin >> n; for (int i = 1; i <= n; i++) { cin >> a[i]; ... |
#include <bits/stdc++.h> using namespace std; char b[101]; char a[101][101]; int mark[101]; int main() { int n, m, s = 0; cin >> n >> m; for (int i = 1; i <= n; i++) { for (int j = 1; j <= m; j++) { cin >> a[i][j]; if (a[i][j] > b[j]) { b[j] = a[i][j]; } ... |
#include <bits/stdc++.h> using namespace std; char str[1000005]; int num[1000005]; int main() { int i, j, len, ans; while (scanf( %s , str) != EOF) { len = strlen(str); for (i = 0, j = len - 1; i < j; i++, j--) { swap(str[i], str[j]); } str[len] = 0 ; memset(num, 0... |
#include <bits/stdc++.h> using namespace std; signed main() { ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); ; long long int a, b, c, n; cin >> a >> b >> c >> n; if ((min(min(a, b), c) >= n) || (n - (a + b - c) < 1) || (min(a, b) < c)) return cout << -1, 0; co... |
#include <bits/stdc++.h> using namespace std; int k; string s; int main() { cin >> k; cin >> s; int n = s.length(); for (int i = 0; i < n; ++i) { if (s[i] == ? && s[n - i - 1] == ? ) { continue; } else if (s[i] == ? ) { s[i] = s[n - i - 1]; } else if (s[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... |
#include <bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); int n, i, k; cin >> n >> k; int a[n], c = 0; for (i = 0; i < n; i++) { cin >> a[i]; } sort(a, a + n); for (i = 0; i < n; i += 3) { if (a[i] <= 5 && a[i + 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... |
// megafunction wizard: %FIFO%VBB%
// GENERATION: STANDARD
// VERSION: WM1.0
// MODULE: scfifo
// ============================================================
// File Name: FIFO_ADC.v
// Megafunction Name(s):
// scfifo
//
// Simulation Library Files(s):
// altera_mf
// ==========================================... |
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; map<int, vector<pair<int, int> > > mp; int res[200], mini = INT_MAX; for (int i = 0; i < n; i++) { pair<int, int> p; scanf( %d%d , &p.first, &p.second); mp[p.first].push_back({p.second, i}); } i... |
#include <bits/stdc++.h> using namespace std; struct poi { int x, y; poi operator-(poi p) { return (poi){x - p.x, y - p.y}; } long long operator*(poi p) { return 1ll * x * p.y - 1ll * y * p.x; } } A[205], a[205]; bool cmp(poi x, poi y) { return x * y > 0; } bool turn(int x, int y, int z) { return ... |
// jaxa_hps_0_hps_io.v
// This file was auto-generated from altera_hps_io_hw.tcl. If you edit it your changes
// will probably be lost.
//
// Generated using ACDS version 17.1 593
`timescale 1 ps / 1 ps
module jaxa_hps_0_hps_io (
output wire [12:0] mem_a, // memory.mem_a
output wire [2:0] mem_ba, //... |
#include <bits/stdc++.h> using namespace std; static const int INF = 0x3f3f3f3f; static const long long INFL = 0x3f3f3f3f3f3f3f3fLL; vector<string> split(string s, string sep) { string act = ; vector<string> res; for (int c = 0; c < s.size(); c++) { bool split = false; for (int c2 = 0;... |
#include <bits/stdc++.h> using namespace std; namespace io { const int SI = 1 << 21 | 1; char IB[SI], *IS, *IT, OB[SI], *OS = OB, *OT = OS + SI - 1, c, ch[100]; int f, t; inline void flush() { fwrite(OB, 1, OS - OB, stdout), OS = OB; } inline void pc(char x) { *OS++ = x; if (OS == OT) flush(); }... |
/**
* 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... |
// $Id: c_fifo.v 1922 2010-04-15 03:47:49Z 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 source ... |
#include <bits/stdc++.h> const int N = 41; long long bin_p(long long a, long long b) { if (!b) return 1; if (b % 2 == 0) { long long cur = bin_p(a, b / 2); return cur * cur; } return a * bin_p(a, b - 1); } long long color[N]; std::vector<long long> g[N]; long long g1[N], cmpSz = ... |
/**
* 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 = 1e17 + 9; long long n, m; vector<int> num; long long dp[100009][2]; void solve(int tp) { multiset<int> s; multiset<int>::iterator it; if (tp == 0) { for (long long i = 1; i < (m + 1); ++i) { s.insert(num[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; using pii = pair<long long, long long>; using pil = pair<long long, long long>; using pli = pair<long long, long long>; using pll = pair<long long, long long>; using pdd = pair<long double, long double>; using vint = vector<long long>; using vll = vector<lon... |
//Legal Notice: (C)2006 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... |
/**
* 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... |
// A restricted 27x27 bit multiplier. (The restriction is that if the
// MSB bit of opa is set the three LSB bits of opa must be zero as we
// will otherwise get an overflow in the pre-adder portion of the DSP
// blocks.)
module mult_27x27
(input wire clk,
input wire [26:0] opa, opb,
output reg [53:0] res);
... |
/*
* 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 vi = vector<int>; using vvi = vector<vi>; using vvvi = vector<vvi>; using ll = long long; using vll = vector<ll>; using vvll = vector<vll>; using vvvll = vector<vvll>; using ull = unsigned long long; using vb = vector<bool>; using vvb = vector<vb... |
// -*- verilog -*-
// Copyright (c) 2012 Ben Reynwar
// Released under MIT License (see LICENSE.txt)
// A Message stream is a wire of width WIDTH.
// If the first bit is a '1' it is a header.
// The following LOG_MAX_PACKET_LENGTH bits give the
// number of WIDTH bit blocks in the packet.
module message_stream_combi... |
#include <bits/stdc++.h> constexpr auto Inf = 0X3F3F3F3F; using namespace std; namespace IO { inline long long read() { long long o = 0, f = 1; char c = getchar(); while (c < 0 || c > 9 ) { if (c == - ) f = -1; c = getchar(); } while (c > / && c < : ) { o = o * 10 + ... |
/**
* 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 G, typename H> struct triple { G first, second, T; triple(G x, G y, G z) : first(x), second(y), T(z) {} triple() : first(0), second(0), T(0) {} bool operator<(const triple<G, H> other) const { return first > other.first; } }; int... |
#include <bits/stdc++.h> #pragma GCC optimize( Ofast ) #pragma GCC optimize( unroll-loops ) #pragma GCC target( sse,sse2,sse3,ssse3,abm,mmx,tune=native ) using namespace std; long long gcd(long long i, long long j) { if (j == 0) return i; else return gcd(j, i % j); } template <typename... |
#include <bits/stdc++.h> struct V { int a, b; int wybor; }; std::vector<int> v[507]; V prev[507][507][2]; int odl[507][507][2]; bool odw[507][507][2]; std::queue<V> Q; int wynik[1000007][2]; int main() { int N, M; scanf( %d%d , &N, &M); int a, b; for (int i = 0; i < M; 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... |
module ARM_CU_ALU_TestBench4;
parameter sim_time = 750*2; // Num of Cycles * 2
reg MFC , Reset , Clk , MEMSTORE,MEMLOAD;
reg [31:0] MEMDAT;
wire MFA,READ_WRITE,WORD_BYTE;
wire [7:0] MEMADD;
//module ARM_CU_ALU( input MFC , Reset , Clk , MEMSTORE,MEMLOAD,MEMDAT, output MEMADD, MFA,READ_WRITE,WORD_BYTE);
ARM_CU_ALU 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 law... |
// megafunction wizard: %RAM: 1-PORT%
// GENERATION: STANDARD
// VERSION: WM1.0
// MODULE: altsyncram
// ============================================================
// File Name: cyclone3_dmem.v
// Megafunction Name(s):
// altsyncram
//
// Simulation Library Files(s):
// altera_mf
// ==========================... |
//*****************************************************************************
// (c) Copyright 2008-2009 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> int n, k, a, b, c, d; std::vector<int> first_path; std::vector<int> second_path; bool first_reversed = false; bool second_reversed = false; bool failed = false; void read() { scanf( %d %d n%d %d %d %d , &n, &k, &a, &b, &c, &d); --a; --b; --c; --d; first_pat... |
/*
* 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... |
/*
* BCH Encode/Decoder Modules
*
* Copyright 2014 - Russ Dill <>
* Distributed under 2-clause BSD license as contained in COPYING file.
*/
`timescale 1ns / 1ps
`include "bch_defs.vh"
/* Calculate syndromes for S_j for 1 .. 2t-1 */
module bch_syndrome #(
parameter [`BCH_PARAM_SZ-1:0] P = `BCH_SANE,
parameter B... |
//Legal Notice: (C)2018 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 mat[1005][1005]; int main() { int n; scanf( %d , &n); for (int i = (0); i < (n); i++) { for (int j = (0); j < (n); j++) { scanf( %d , &mat[i][j]); } } int akt = 0; for (int i = (0); i < (n); i++) akt = (akt + mat[i][i]) ... |
#include <bits/stdc++.h> using namespace std; const double PI = acos(-1.0); const int INF = 1000 * 1000 * 1000 + 7; const long long LINF = INF * (long long)INF; const int MAX = 3000 + 47; vector<int> g[MAX]; vector<int> S; int L[MAX]; int U[MAX]; queue<int> q; int D[MAX]; int n; void dfs(int v... |
#include <bits/stdc++.h> using namespace std; int N; int main() { cin >> N; long long int A[N + 1]; A[1] = 1; long long int currentFact = 1; for (int i = 2; i <= N; i++) { currentFact *= i; currentFact %= 998244353; A[i] = ((A[i - 1] * i) % 998244353 - i + currentFact) % 9982... |
#include <bits/stdc++.h> using namespace std; int main() { long long n, k, s; cin >> n >> k >> s; if (k > s || k * (n - 1) < s) { cout << NO n ; } else { cout << YES n ; long long h = 1; while (k--) { long long d = min(n - 1, s - k); s -= d; if (h - ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.