text stringlengths 59 71.4k |
|---|
// DESCRIPTION: Verilator: Verilog Test module
//
// This file ONLY is placed into the Public Domain, for any use,
// without warranty, 2014 by Wilson Snyder.
`define checkh(gotv,expv) do if ((gotv) !== (expv)) begin $write("%%Error: %s:%0d: got='h%x exp='h%x\n", `__FILE__,`__LINE__, (gotv), (expv)); fail='1; end whi... |
#include <bits/stdc++.h> using namespace std; int m, n, x, y; int ABS(int x) { return (x < 0) ? (-x) : (x); } int main() { scanf( %d%d%d%d , &m, &x, &n, &y); if (m > n) { swap(m, n); swap(x, y); } int d = ABS(x - y); long long ans = 1 + m + n; for (int i = 1; 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 law... |
#include <bits/stdc++.h> using namespace std; int main() { string a, b; int n; cin >> n >> a >> b; int ans = 0; for (int i = 0; i < n - 1; i++) { if (a[i] != b[i]) { if (a[i] == 1 ) { if (a[i + 1] == 0 && a[i + 1] != b[i + 1]) { a[i] = 0 ; a[i ... |
// Copyright 1986-2014 Xilinx, Inc. All Rights Reserved.
// --------------------------------------------------------------------------------
// Tool Version: Vivado v.2014.1 (lin64) Build 881834 Fri Apr 4 14:00:25 MDT 2014
// Date : Thu May 22 13:06:25 2014
// Host : macbook running 64-bit Arch Linux
// ... |
module top;
reg pass;
reg signed [7:0] neg = -2;
reg signed [7:0] m1 = -1;
reg signed [7:0] zero = 0;
reg signed [7:0] one = 1;
reg signed [7:0] pos = 2;
reg signed [7:0] pose = 2;
reg signed [7:0] poso = 3;
reg signed [7:0] res;
initial begin
pass = 1'b1;
#1;
/* Positive exponent. *... |
// MBT 7/7/2016
//
// This module implements a FIFO that takes in a multiplexed stream
// on one end, and provides demultiplexed access on the other.
//
// Each stream is guaranteed to have els_p worth of storage.
//
// The shared version of this module shares the storage for the fifos.
// This is useful when the rate ... |
module divider(divident,divisor,quotient);
input wire [31:0] divident;
input wire [31:0] divisor;
output reg [31:0] quotient;
reg [47:0]tmpDivident;
reg [23:0]tmpDivisor;
reg [47:0]tmpQuotient;
reg [47:0] remainder;
reg [8:0]exponent;
reg [8:0]tmp;
reg error;
integer i; // 整数,用于计数
always @(divident o... |
#include <bits/stdc++.h> using namespace std; const int Maxn = 1000 * 100 + 10; int m[Maxn], c[Maxn], eatd[Maxn]; int ans; int INF = 1000 * 1000 * 10 + 10; int main() { int N, M, y; cin >> N >> M >> y >> y; for (int i = 0; i < N; i++) cin >> m[i]; c[0] = -INF; c[M + 1] = INF; for (in... |
#include <bits/stdc++.h> const int MNN = 2e3 + 1; using namespace std; int n, b[MNN][MNN], mx; bool used[MNN]; int main() { cin >> n; for (int i = 1; i <= n; i++) { for (int j = 1; j <= n; j++) { cin >> b[i][j]; } } for (int i = 1; i <= n; i++) { for (int j = 1; j <= ... |
module partsel_test001(input [2:0] idx, input [31:0] data, output [3:0] slice_up, slice_down);
wire [5:0] offset = idx << 2;
assign slice_up = data[offset +: 4];
assign slice_down = data[offset + 3 -: 4];
endmodule
module partsel_test002 (
input clk, rst,
input [7:0] a,
input [0:7] b,
input [1:0] s,
output [7: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... |
/**
* 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 law... |
#include <bits/stdc++.h> using namespace std; const int maxn = (int)1e6 + 100; const long long inf = (1ll << 60); const int mod2 = (int)998244353; const int mod = (int)1e9 + 7; int n, m; vector<long long> b; vector<long long> c; void add(long long x) { for (int i = 0; i < b.size(); i++) { if... |
#include <bits/stdc++.h> using namespace std; void task(); int main() { srand(time(0)); ios_base::sync_with_stdio(0); task(); return 0; } const int INF = 0x3f3f3f3f; const int N = 1e6 + 10; const int M = 1e5 + 10; struct SufAutomaton { struct State { int len; int link; ... |
module ADT7310P16LS32L (
(* intersynth_port="Reset_n_i" *)
input Reset_n_i,
(* intersynth_port="Clk_i" *)
input Clk_i,
(* intersynth_port="ReconfModuleIn_s", intersynth_conntype="Bit" *)
input Enable_i,
(* intersynth_port="ReconfModuleIRQs_s", intersynth_conntype="Bit" *)
output CpuIntr_o,
(* inte... |
#include <bits/stdc++.h> #pragma GCC optimize( O3 ) #pragma GCC target( sse4 ) using namespace std; template <class T> T gcd(T a, T b) { return ((b == 0) ? a : gcd(b, a % b)); } int main() { ios_base::sync_with_stdio(false); cin.tie(0); int n, x; cin >> n >> x; n %= 6; for (int... |
#include <bits/stdc++.h> using namespace std; const int N = 502; pair<int, pair<int, int> > dp[N][N]; int a[N]; int b[N]; map<int, int> a_val_to_pos; int main() { int n, m; cin >> n; for (int i = 0; i < n; ++i) cin >> a[i]; cin >> m; for (int i = 0; i < m; ++i) cin >> b[i]; 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 N = (1e6) + 1, M = (1e7) + 1; int n, k, a[N], dp[M]; bool check(int x) { fill(dp + 1, dp + M, 0); for (int i = x; i <= (1e7); i++) dp[i] = max(dp[i >> 1] + dp[i + 1 >> 1], 1); long long sum = 0; for (int i = 0; i < n; i++) sum += dp[a[i]]; ... |
// DESCRIPTION: Verilator: Verilog Test module
//
// This file ONLY is placed into the Public Domain, for any use,
// without warranty, 2012 by Wilson Snyder.
module t (/*AUTOARG*/
// Inputs
clk
);
input clk;
integer cyc=0;
wire one = '1;
wire z0 = 'z;
wire z1 = 'z;
wire z2 = 'z;
w... |
// (c) Copyright 2008 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... |
#include <bits/stdc++.h> using namespace std; int dp[55][35555], n, m, a[35555], las[35555], pre[35555], now; struct LT { int mx, lazy; } tr[517171]; void U(int x) { tr[x].mx = max(tr[x << 1].mx, tr[x << 1 | 1].mx); } void D(int x) { tr[x << 1].lazy += tr[x].lazy; tr[x << 1].mx += tr[x].lazy; ... |
//////////////////////////////////////////////////////////////////////
//// ////
//// OR1200's Tick Timer ////
//// ////
//// This file is part of the OpenR... |
#include <bits/stdc++.h> using namespace std; const long double eps = 1e-12; pair<long long, long long> save[200005]; long long cnt[50]; int main(void) { long long n; cin >> n; if (n & 1) { char ch; while (cin >> ch) ; cout << no ; return 0; } for (long lon... |
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; if (n == 1) { cout << -1 << endl; return 0; } cout << n << << n + 1 << << n * (n + 1) << endl; return 0; } |
`timescale 1 ps / 1 ps
module ov7670_marker_tracker_ip_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... |
`timescale 1ns / 1ps
//////////////////////////////////////////////////////////////////////////////////
// Company:
// Engineer: Wojtek Gumua
//
// Create Date: 20:36:30 05/11/2015
// Design Name:
// Module Name: bounding_box
// Project Name:
// Target Devices:
// Tool versions:
// Description:
//
// Dep... |
// ==============================================================
// 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 ... |
#include <bits/stdc++.h> using namespace std; template <typename T, class F = function<T(const T&, const T&)>> class SparseTable { public: int n; vector<vector<T>> sp; F func; SparseTable(const vector<T>& a, const F& f) : func(f) { n = static_cast<int>(a.size()); int max_log = 32 - ... |
/**
* 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() { int n, t, d, k; cin >> n >> t >> k >> d; int a; a = (d + t) / t; if (a * k < n) cout << YES ; if (a * k >= n) cout << NO ; } |
/*
F-PA unit (FPU arithmetic)
document: 12-006370-01-4A
unit: F-PA2-1
pages: 2-29..2-48
*/
module fpa(
input clk_sys,
input strob_fp,
input strobb_fp,
// sheet 1
input [0:15] w,
input taa,
// sheet 2
output t_1,
input t_1_d,
input m_1_d,
input tab,
input clockta,
input clocktb,
input clocktc,... |
module xilinx_decoder #(
parameter T = 3,
parameter DATA_BITS = 5,
parameter BITS = 1,
parameter SYN_REG_RATIO = 1,
parameter ERR_REG_RATIO = 1,
parameter SYN_PIPELINE_STAGES = 0,
parameter ERR_PIPELINE_STAGES = 0,
parameter ACCUM = 1
) (
input [BITS-1:0] data_in,
input clk_in,
input start_in,
output [BITS-... |
#include <bits/stdc++.h> using namespace std; const int N = 4e5 + 5; struct Edge { int to, nxt; } e[N * 2]; int n, head[N], cntE, siz[N], f[N][2]; int ans[N], g[N], mxpt[N], pos[N]; inline void add(int u, int v) { e[++cntE] = (Edge){v, head[u]}; head[u] = cntE; } void dfs1(int u, int fa) {... |
#include <bits/stdc++.h> using namespace std; const int MM = 1e9 + 7; const double eps = 1e-8; const int MAXN = 2e6 + 10; int n, m; int a[MAXN], Q[MAXN], cnt[MAXN], ans[MAXN]; int f[MAXN]; void prework() {} void read() {} int gao(int k) { if (f[k] != -1) return f[k]; int ret = 0; int now... |
#include <bits/stdc++.h> using namespace std; const int MAXN = 200100; int n, b; queue<pair<int, int> > q; long long ans[MAXN]; int main() { scanf( %d%d , &n, &b); long long available = 0; memset(ans, 0xff, sizeof ans); for (int i = 0, t, d; i < n; ++i) { scanf( %d%d , &t, &d); w... |
module led_controller
(
input clk,
input reset_n,
input test_panel_select_n,
input [31:0] chunk_data,
input [3:0] chunk_addr,
input chunk_write_enable,
input [3:0] row_addr,
input [1:0] panel_addr,
output serial_clk,
output latch_enabl... |
#include <bits/stdc++.h> using namespace std; const long long maxn = 4e5 + 1; struct dak { long long val, pos; }; long long l[maxn], r[maxn]; long long pre[maxn], pre2[maxn]; vector<dak> p; vector<pair<long long, long long> > v; vector<pair<long long, long long> > qr; long long n, m, q; long l... |
/*
Distributed under the MIT license.
Copyright (c) 2016 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... |
/**
* 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 fibfsm (clk, n, out);
parameter w = 32;
input [w-1:0] n;
input clk;
output [w-1:0] out;
reg [1:0] state, nstate;
reg [w-1:0] a, b, i;
wire [w-1:0] s, inci;
parameter S0 = 2'b00;
parameter S1 = 2'b01;
parameter S2 = 2'b10;
assign s = a + b;
assign out ... |
// megafunction wizard: %ROM: 1-PORT%
// GENERATION: STANDARD
// VERSION: WM1.0
// MODULE: altsyncram
// ============================================================
// File Name: Grid.v
// Megafunction Name(s):
// altsyncram
//
// Simulation Library Files(s):
// altera_mf
// ===================================... |
`timescale 1ns / 1ps
module VGAInterface(
input CLK, //Clock signal of 25MHz
output REFRESH, //gives trigger when display was refreshed
input [7:0] COLOUR_IN, //colour comes that should be displayd
output reg [7:0] COLOUR_OUT, //colour goes that was modified to produce colour_in at the rigth m... |
// "and_template_tree_reverse.v"
// @vcs-flags@ -P pli.tab
`timescale 1ps / 1ps
`include "standard-reverse.v-wrap"
//-----------------------------------------------------------------------------
module timeunit;
initial $timeformat(-9,1," ns",9);
endmodule
module TOP;
reg a, b, c, d;
wire j, k, z;
initial
begi... |
/**
* 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 r[100005], g[100005], b[100005], nr, ng, nb, pos; long long ans = 9e18; long long calc(long long a, long long b, long long c) { long long temp = (a - b) * (a - b) + (a - c) * (a - c) + (b - c) * (b - c); return temp; } int bsearch(int a[], int len, i... |
#include <bits/stdc++.h> using namespace std; const int inf = 0x3f3f3f3f; const int maxn = 125; const int maxm = 305; const int mod = 20090717; vector<int> v; int main() { long long x; scanf( %lld , &x); while (x > 0) v.push_back(x % 2), x /= 2; while (v.size() < 6) v.push_back(0); lon... |
// ***************************************************************************
// ***************************************************************************
// Copyright 2013(c) Analog Devices, Inc.
//
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without modification,
// ar... |
/**
* 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; #define lp(i,a,n) for(i=a;i<n;i++) #define ld(i,a,n) for(i=n-1;i>=a;i--) #define ll long long #define dd double #define mod 10000007 #define inf 1e18 #define inp(t) cin>>t; while(t--) int main(){ int t; ios::sync_with_stdio(false); inp(t){ ll 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 law... |
#include <bits/stdc++.h> using namespace std; const int N = 2e5 + 5; int n, m; struct Query { int l, r, x; Query() {} Query(int ll, int rr, int xx) { l = ll, r = rr, x = xx; } }; vector<Query> q[N]; int lson[N], rson[N]; void init() { int cnt = 0, p = 1; for (int i = 1; i < N; ++i) {... |
//////////////////////////////////////////////////////////////////////////////////
// InterChannelSyndromeBuffer.v for Cosmos OpenSSD
// Copyright (c) 2015 Hanyang University ENC Lab.
// Contributed by Jinwoo Jeong <>
// Ilyong Jung <>
// Yong Ho Song <>
//
// This file is part of Cosmos O... |
#include <bits/stdc++.h> using namespace std; inline int read() { int nm = 0, fh = 1; char c = getchar(); for (; !isdigit(c); c = getchar()) if (c == - ) fh = -1; for (; isdigit(c); c = getchar()) nm = nm * 10 + c - 0 ; return nm * fh; } int b, n, a[200020], ans; int main() { b... |
#include <bits/stdc++.h> using namespace std; int main() { int n, a; cin >> n >> a; if (a & 1) cout << (a / 2 + 1); else { a = n - a; cout << a / 2 + 1; } return 0; } |
#include <bits/stdc++.h> using namespace std; const double eps = 1e-8; const int inf = 0x3f3f3f3f; const int Minf = 0x7f7f7f7f; const long long INF = 0x3f3f3f3f3f3f3f3fll; const long long MINF = 0x7f7f7f7f7f7f7f7fll; const int N = 2e5 + 50; vector<int> t[N]; int dfn[N], rig[N]; int fa[N][20], dep[N]... |
/**
* Copyright 2020 The SkyWater PDK Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable la... |
// ========== Copyright Header Begin ==========================================
//
// OpenSPARC T1 Processor File: sparc_ifu_lru4.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 an... |
/**
* 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() { int n; cin >> n; cout << (n <= 2 ? n : n % 2 ? (long long)n * (n - 1) * (n - 2) : n % 3 ? (long long)n * (n - 1) * (n - 3) : (long long)(n - 1) * (n - 2) * (n - 3)) << n ; return 0; ... |
#include <bits/stdc++.h> using namespace std; int main(int argc, char const *argv[]) { int k[3]; scanf( %d%d%d , k, k + 1, k + 2); sort(k, k + 3); if (k[0] == 1) printf( YES n ); else if (k[0] == 2) { if (k[1] == 2) printf( YES n ); else if (k[1] == 4 && k[2] == 4) ... |
#include <bits/stdc++.h> using namespace std; const int maxn = 1e6 + 10; namespace StrAlgo { vector<int> Kmp(string s) { int n = (int(s.size())); vector<int> ans(n + 1); for (int i = 2; i <= n; i++) { ans[i] = ans[i - 1]; while (ans[i] > 0 && s[ans[i]] != s[i - 1]) ans[i] = ans[ans[i]]; ... |
/*
* Copyright 2020 The SkyWater PDK Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law... |
/*
* 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: %ROM: 1-PORT%
// GENERATION: STANDARD
// VERSION: WM1.0
// MODULE: altsyncram
// ============================================================
// File Name: bg3_new.v
// Megafunction Name(s):
// altsyncram
//
// Simulation Library Files(s):
// altera_mf
// ================================... |
/*
* Copyright (c) 2000 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)
* ... |
/*
* 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; string a[] = { zero , one , two , three , four , five , six , seven , eight , nine }; string b[] = { ten , twenty , thirty , forty , fifty , sixty , seventy , eighty , ninety }; string c[] = { eleven , twelve ,... |
`timescale 1ns / 1ps
////////////////////////////////////////////////////////////////////////////////
// Company:
// Engineer:
//
// Create Date: 11:21:12 05/11/2016
// Design Name: ROM_B
// Module Name: Y:/TEOCOA/EXPR7/TESTROM.v
// Project Name: EXPR7
// Target Device:
// Tool versions:
// Des... |
#include <bits/stdc++.h> using std::abs; using std::bitset; using std::cerr; using std::cin; using std::copy; using std::cout; using std::endl; using std::fill; using std::fixed; using std::greater; using std::lower_bound; using std::map; using std::max; using std::min; using std::next_per... |
#include <bits/stdc++.h> using namespace std; const int inf = 0x3f3f3f3f; const long long llinf = 0x3f3f3f3f3f3f3f3f; template <typename INint> inline void IN(INint &first) { first = 0; int f = 1; char c; cin.get(c); while (c < 0 || c > 9 ) { if (c == - ) f = -1; cin.get(c)... |
module lab5iram1B(CLK, RESET, ADDR, Q);
input CLK;
input RESET;
input [7:0] ADDR;
output [15:0] Q;
reg [15:0] mem[0:127]; // instruction memory with 16 bit entries
wire [6:0] saddr;
integer i;
assign saddr = ADDR[7:1];
assign Q = mem[saddr];
/*
Multiply lower 4 ... |
#include <bits/stdc++.h> using namespace std; const int maxn = 100005; const int INF = 1 << 30; const double eps = 1e-6; const int mod = 1000000007; string s; void getVal(int& a, int& b, char x) { a = b = -1; for (int i = 0; i < s.size(); i++) { if (s[i] != x) continue; if (a == -1) a ... |
#include <bits/stdc++.h> using namespace std; int a, s, d[100002], f, g, h, j, k, l, i, n, m; string x; int main() { cin >> n; for (i = 0; i < n; i++) { cin >> d[i]; } for (i = 0; i < n; i++) { scanf( n ); getline(cin, x); for (a = 0; a < x.size(); a++) { if (x[a... |
/**
* 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; long long n, sav, mn = 1e9; struct point { long long x, y, uz; } p[2005]; string s; int det(point A, point B, point C) { if (A.x * B.y + A.y * C.x + B.x * C.y - A.x * C.y - A.y * B.x - B.y * C.x < 0) return -1; return 1; } int main() { ... |
// 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 : Thu May 25 15:17:13 2017
// Host : GILAMONSTER running 64-bit major release (... |
#include <bits/stdc++.h> int a[52], b[52]; int main() { int x, max, k, n, m, i, j, c1; scanf( %d , &n); for (i = 0; i < n; i++) { scanf( %d , &a[i]); } scanf( %d , &m); for (i = 0; i < m; i++) { scanf( %d , &b[i]); } max = 0; for (i = 0; i < m; i++) { for (j = 0... |
#include <bits/stdc++.h> using namespace std; const int MAXN = 4010; const int MAXT = 1 << 15; int N, P, Q; vector<pair<int, int> > qu[MAXT]; vector<pair<int, int> > items[2 * MAXT]; int ans[MAXT]; void update(int a, int b, pair<int, int> v, int cur = 1, int lt = 0, int rt = MAXT) { if... |
/**
* 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; struct point { int x, y, z; double dist(point& p) { return sqrt((double)((p.x - x) * (p.x - x) + (p.y - y) * (p.y - y) + (p.z - z) * (p.z - z))); } }; int N; point P[5005]; double solve() { double res = 1e10; ... |
#include <bits/stdc++.h> using namespace std; const int mx = 2e5 + 10; long long int x[mx], y[mx]; int ord[mx]; int hs[mx], h = 0; vector<int> g[mx]; int ans[mx]; int cross(int a, int o, int b) { long long int l = (x[o] - x[a]) * (y[o] - y[b]) * y[a] * x[b]; long long int r = (y[o] - y[a]) * (x[... |
#include <bits/stdc++.h> using namespace std; template <class T> using vc = vector<T>; template <class T> using vvc = vc<vc<T>>; template <class T> void mkuni(vector<T>& v) { sort(v.begin(), v.end()); v.erase(unique(v.begin(), v.end()), v.end()); } template <class T> void print(T x, int suc ... |
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; if (n % 2 == 0) { cout << NO ; } else { cout << YES n ; int i = 1; int a[2 * n]; for (int j = 0; j < n; j++) { a[j] = i; if (j % 2 == 0) { a[j + n] = i + 1; ... |
// ========== Copyright Header Begin ==========================================
//
// OpenSPARC T1 Processor File: spu_maexp.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 and/or
... |
/**
* 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 law... |
// -------------------------------------------------------------
//
// Generated Architecture Declaration for rtl of inst_ee_e
//
// Generated
// by: wig
// on: Mon Mar 22 13:27:59 2004
// cmd: H:\work\mix_new\mix\mix_0.pl -strip -nodelta ../../mde_tests.xls
//
// !!! Do not edit this file! Autogenerated by MIX !!... |
`timescale 1ns / 1ps
// Name: WcaRegisterBus.v
//
// Copyright(c) 2013 Loctronix Corporation
// http://www.loctronix.com
//
// 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 v... |
/*
* 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 N = 3000010; const int inf = 1e9 + 1; int n, k, a[N], b[N]; bool check(long long x) { long long s = 0; for (int i = 1; i <= n; i++) { long long tmp = b[i] - a[i] * x; if (tmp < 0) { s -= tmp; } if (s > k) return fa... |
/**
* 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 long long base1 = 131; const long long base2 = 233; const long long mod1 = 998244353; const long long mod2 = 1e9 + 7; const long long MaxN = 1e6 + 50; template <class t> inline void read(t &s) { s = 0; register long long f = 1; register char c = getchar(); wh... |
// megafunction wizard: %LPM_FIFO+%VBB%
// GENERATION: STANDARD
// VERSION: WM1.0
// MODULE: scfifo
// ============================================================
// File Name: fifo_144x128.v
// Megafunction Name(s):
// scfifo
// ============================================================
// **********... |
#include <bits/stdc++.h> using namespace std; using ll = long long; using vi = vector<int>; void solve() { int n; cin >> n; vector<int> v(n); for (int i = 0; i < n; i++) { cin >> v[i]; } if (count(v.begin(), v.end(), 1) == 1) { cout << 0 << endl; return; } int s... |
#include <bits/stdc++.h> using namespace std; int n, l, top, tmp, m, c[12]; bool opt[12][11][1 << 13]; void Search(int t, int v, int sum, int u, int i) { if (v < 0) return; if (sum >= v) opt[t][sum - v][u | (1 << t)] = 1; if (i >= t) return; if (((u >> i) & 1) == 1 && c[i] + 1 < c[t]) Sear... |
//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 associate... |
/*
* 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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.