猫史档案馆


蒟蒻OIer1048576

蒟蒻OIer1048576

Lv.1

只是喜欢Python而已……徒弟:程序侯

获赞:206收藏:39浏览:2002作品收藏:29

签名:只是喜欢Python而已…… 徒弟:程序侯

回复帖子评论
上一页56 页 / 共 60下一页

【APP工匠V1.1.0版本更新】作品可以发布到社区啦! 中回复

7th

2021-07-29T15:32:24 点赞:0

【APP工匠主题创作系列】第三期——“奥林匹克运动会选手” & 关于多人协作声明 中回复

奥林匹克信息竞赛竞赛生请求出战

2021-08-07T18:58:28 点赞:1

【关于神射手事件】辩论,站队和阴谋论 中回复

建议证明

2021-08-07T18:59:46 点赞:2

【关于神射手事件】辩论,站队和阴谋论 中回复

这就是官方在阴谋论帖子里讲阴谋论吧

2021-08-10T19:46:19 点赞:0

证明哥德喵猜想(第一章) 中回复

请穷举2 ~ 无穷大的所有偶数【doge】

2021-08-13T11:00:18 点赞:0

我在社区的知名度 中回复

35

2021-08-14T12:39:19 点赞:0

如何在社区证明自己是大佬? 中回复

#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
const int maxn = 500005;
int arr[maxn], n, m, yuan[maxn], cf[maxn];
int lowbit(int m) {
	return m & (-m);
}
void add(int i, int k) {
	while (i <= n) {
		arr[i] += k;
		i += lowbit(i);
	}
}
int qzh(int b) {
	int ans = 0;
	while (b > 0) {
		ans += arr[b];
		b -= lowbit(b);
	}
	return ans;
}
int main() {
	cin >> n >> m;
	for (int i = 1; i <= n; ++i) {
		int a; cin >> yuan[i];
		cf[i] = yuan[i] - yuan[i - 1];
		add(i, cf[i]);
	}
	for (int i = 1; i <= m; ++i) {
		int a;
		cin >> a;
		if (a == 1) {
			int b, c, d;
			cin >> b >> c >> d;
			add(c+1,-d);
			add(b,  d);
		}
		else {
			int b; cin >> b;
			cout << qzh(b) << "我会代码";
		}
	}
}

2021-08-14T12:42:10 点赞:0

【“教程贴”】【前方高能】“多维杯”蒟蒻Au记 #2 Problem C & D 中回复

第一期传送门:

黑曜石  黑曜石  黑曜石  黑曜石

黑曜石                          黑曜石

黑曜石                          黑曜石

黑曜石                          黑曜石

黑曜石  黑曜石  黑曜石  黑曜石

 

https://shequ.codemao.cn/community/389035

 

2021-08-14T13:02:32 点赞:0

如何在社区证明自己是大佬? 中回复

#include <bits/stdc++.h>
using namespace std;
vector<int> graph[100010];
int tim[100010] , zst[100010] , v[100010] , s[100010] , gltm , st , A[100010] , m , n , a , b;
void tj(int i){
    v[i]=1;s[++st]=i;A[i]=i;
    tim[i]=zst[i]=(++gltm);
    for (int j : graph[i]) 
        if (!tim[j]) tj(j),zst[i]=min(zst[j],zst[i]),A[i]=max(A[i],A[j]);
        else if (v[j]) zst[i]=min(zst[i],tim[j]),A[i]=max(A[i],A[j]);
        else A[i]=max(A[i],A[j]);
    int it;
    if (tim[i] == zst[i]) do {
        it = s[st--];
        A[it] = max(A[it],A[i]);
        v[it] = 0;
    } while (it != i);
}
int main(){
    cin>>m>>n;
    for (int i = 1 ; i <= n ; ++ i) cin>>a>>b,graph[a].push_back(b);
    for (int i = 1 ; i <= m ; ++ i) if (!tim[i]) tj(i);
    for (int i = 1 ; i <= m ; ++ i) cout << A[i] << "我会代码";
    
}

2021-08-14T13:04:38 点赞:0

如何在社区证明自己是大佬? 中回复

#include <bits/stdc++.h>
#define ll long long
using namespace std;
struct line{int l;int r;}toen[120]={};int en[240]={},cf[10010]={},qzh[10010]={};
int main(){
    int n,m,ans,k=0;
    cin>>n>>m;
    n++;
    ans=n;
    for(int i=1;i<=m;++i){
        cin >> toen[i].l >> toen[i].r;
        toen[i].l++;
        toen[i].r+=2;
        en[++k]=toen[i].l;
        en[++k]=toen[i].r;
    }
    en[++k]=1;en[++k]=n+1;
    sort(en+1,en+k+1);
    int len = unique(en+1,en+k+1)-en-1;
    for(int i=1;i<=m;++i){
        toen[i].l = lower_bound(en+1,en+len+1,toen[i].l)-en;
        toen[i].r = lower_bound(en+1,en+len+1,toen[i].r)-en;
        cf[toen[i].l]++;
        cf[toen[i].r]--;
    }
    for(int i=1;i<=n;++i){
        qzh[i]=qzh[i-1]+cf[i];
        if(en[i]!=0)
//        cout<<en[i]<<":"<<qzh[i]<<"\n";
        if(qzh[i]!=0)ans-=en[i+1]-en[i];
    }
    cout<<ans<<"我会代码";
}

2021-08-14T13:18:31 点赞:0

如何在社区证明自己是大佬? 中回复

#include <iostream>
#include <map>
#include <vector>
#include <queue>
using namespace std;
vector<int> graph[200050], fgraph[200050];
long long magic[200050], pt[200050], dp[200050], v[200050];
int n, r;
void spfa() {
	queue<int> q;
	for (int i = 1; i <= n; ++i) q.push(i), v[i] = 1, dp[i] = magic[i];
	while (!q.empty()) {
		int u = q.front(); q.pop(); v[u] = 0;
		long long temp = pt[u];
		for (int i : graph[u]) temp += dp[i];
		if (temp >= dp[u]) continue;
		dp[u] = temp;
		for (int i : fgraph[u]) {
			if (!v[i]) {
				v[i] = 1;
				q.push(i);
			}
		}
	}
}
int main() {
	cin >> n;
	for (int i = 1; i <= n; ++i) {
		cin >> pt[i] >> magic[i] >> r;
		while (r--) {
			int a;
			cin >> a;
			graph[i].push_back(a);
			fgraph[a].push_back(i);
		}
	}
	spfa();
	cout << dp[1]<<"我会die码";
}

2021-08-14T13:22:39 点赞:0

不会Python、C++的人见识都不大【狗头】【滑稽】 中回复

kittenYYDS!(yyds = 永远的shi)

2021-08-14T13:27:08 点赞:1

【“教程贴”】【前方高能】“多维杯”蒟蒻Au记 #2 Problem C & D 中回复

顶 

2021-08-14T13:32:29 点赞:0

我的知名度(doge) 中回复

333

2021-08-16T07:59:58 点赞:0

不会Python、C++的人见识都不大【狗头】【滑稽】 中回复

kitten喵

2021-08-16T11:42:53 点赞:0

唯爱赛事-“WA-2021(试运行)” 中回复

WA杯,你在诅咒什么?

2021-08-16T13:06:37 点赞:1

DSOI #1 预告 蒟蒻与大佬的争夺 中回复

出题人(1048576)不参与排名

 

2021-08-17T08:23:23 点赞:0

DSOI #1 预告 蒟蒻与大佬的争夺 中回复

顶 

2021-08-17T11:05:57 点赞:0

DSOI #1 预告 蒟蒻与大佬的争夺 中回复

单调队列

2021-08-17T15:00:39 点赞:0

DSOI #1 预告 蒟蒻与大佬的争夺 中回复

qpwsjr

2021-08-17T21:14:42 点赞:0

DSOI #1 预告 蒟蒻与大佬的争夺 中回复

顶 

2021-08-18T08:43:13 点赞:0

DSOI #1 预告 蒟蒻与大佬的争夺 中回复

顶 

2021-08-18T09:59:59 点赞:0

DSOI #1 预告 蒟蒻与大佬的争夺 中回复

Div.4出题完毕 正在填写数据!

2021-08-18T13:35:30 点赞:0

Pythonic有更新 中回复

考古

2021-08-19T08:10:50 点赞:0

Pythonic有更新 中回复

/ۡۙۨۙۤۢ۠ۢۚۨۨ۠ۖۚ۫ۘۙۙۡۡۤۖۧۖۛۨ/ۡۙۨۙۤۢ۠ۢۚۨۨ۠ۖۚ۫ۘۙۙۡۡۤۖۧۖۛۨ/ۡۙۨۙۤۢ۠ۢۚۨۨ۠ۖۚ۫ۘۙۙۡۡۤۖۧۖۛۨ/ۡۙۨۙۤۢ۠ۢۚۨۨ۠ۖۚ۫ۘۙۙۡۡۤۖۧۖۛۨ/ۡۙۨۙۤۢ۠ۢۚۨۨ۠ۖۚ۫ۘۙۙۡۡۤۖۧۖۛۨ/ۡۙۨۙۤۢ۠ۢۚۨۨ۠ۖۚ۫ۘۙۙۡۡۤۖۧۖۛۨ/ۡۙۨۙۤۢ۠ۢۚۨۨ۠ۖۚ۫ۘۙۙۡۡۤۖۧۖۛۨ/ۡۙۨۙۤۢ۠ۢۚۨۨ۠ۖۚ۫ۘۙۙۡۡۤۖۧۖۛۨ/ۡۙۨۙۤۢ۠ۢۚۨۨ۠ۖۚ۫ۘۙۙۡۡۤۖۧۖۛۨ/ۡۙۨۙۤۢ۠ۢۚۨۨ۠ۖۚ۫ۘۙۙۡۡۤۖۧۖۛۨ/ۡۙۨۙۤۢ۠ۢۚۨۨ۠ۖۚ۫ۘۙۙۡۡۤۖۧۖۛۨ/ۡۙۨۙۤۢ۠ۢۚۨۨ۠ۖۚ۫ۘۙۙۡۡۤۖۧۖۛۨ/ۡۙۨۙۤۢ۠ۢۚۨۨ۠ۖۚ۫ۘۙۙۡۡۤۖۧۖۛۨ/ۡۙۨۙۤۢ۠ۢۚۨۨ۠ۖۚ۫ۘۙۙۡۡۤۖۧۖۛۨ/ۡۙۨۙۤۢ۠ۢۚۨۨ۠ۖۚ۫ۘۙۙۡۡۤۖۧۖۛۨ/ۡۙۨۙۤۢ۠ۢۚۨۨ۠ۖۚ۫ۘۙۙۡۡۤۖۧۖۛۨ/ۡۙۨۙۤۢ۠ۢۚۨۨ۠ۖۚ۫ۘۙۙۡۡۤۖۧۖۛۨ/ۡۙۨۙۤۢ۠ۢۚۨۨ۠ۖۚ۫ۘۙۙۡۡۤۖۧۖۛۨ/ۡۙۨۙۤۢ۠ۢۚۨۨ۠ۖۚ۫ۘۙۙۡۡۤۖۧۖۛۨ/ۡۙۨۙۤۢ۠ۢۚۨۨ۠ۖۚ۫ۘۙۙۡۡۤۖۧۖۛۨ/ۡۙۨۙۤۢ۠ۢۚۨۨ۠ۖۚ۫ۘۙۙۡۡۤۖۧۖۛۨ/ۡۙۨۙۤۢ۠ۢۚۨۨ۠ۖۚ۫ۘۙۙۡۡۤۖۧۖۛۨ/ۡۙۨۙۤۢ۠ۢۚۨۨ۠ۖۚ۫ۘۙۙۡۡۤۖۧۖۛۨ

2021-08-19T08:13:43 点赞:0

[征集令]大数? 中回复

ddd

2021-08-19T08:28:18 点赞:0

【Python作品分享】计算器 中回复

from tkinter import *
import easygui
import math
w = Tk()
equation,final = StringVar(),StringVar()
def func_set(name):
    a = easygui.integerbox("数1?")
    b = easygui.integerbox("数2?")
    equation.set(f"{name}("+equation.get()+f"{a},{b})")
def lcm(x, y):
    return x*y//gcd(x,y)
def gcd(x, y):
    喵aller = x if x < y else y
    hcf = [i for i in range(1,喵aller+1) if x % i == 0 and y % i == 0][-1]
    return hcf
def num(n):
    equation.set(equation.get() + str(n))
sin,cos,tan = lambda n: math.sin(math.radians(n)),lambda n: math.cos(math.radians(n)),lambda n: math.tan(math.radians(n))
sinh,cosh,tanh = math.sin,math.cos,math.tan
asin,acos,atan = math.asin,math.acos,math.atan
deg,rad,sqrt = math.degrees,math.radians,math.sqrt
binary,october,hexadecimal = lambda n: bin(n)[2:],lambda n: oct(n)[2:],lambda n: hex(n)[2:]
ln,log,log2 = math.log,math.log10,math.log2
π,e,fact = math.pi,math.e,math.factorial
decimal_fraction = lambda n: n - int(n)
def ce():
    equation.set('')
    final.set('')
def calculate():
    try:
        final.set(f"={str(eval(equation.get().replace('×','*').replace('÷','/').replace('^','**').replace('mod','%')))}")
    except Exception:
        easygui.exceptionbox()
        ce()
def function(name):
    equation.set(name + '(' + equation.get() + ')')
w.geometry('1500x1000')
Button(w, text=0, command=lambda: num(0), width=7, height=2, font=('Arial',20)).grid(row=1,column=0)
Button(w, text=1, command=lambda: num(1), width=7, height=2, font=('Arial',20)).grid(row=1,column=1)
Button(w, text=2, command=lambda: num(2), width=7, height=2, font=('Arial',20)).grid(row=1,column=2)
Button(w, text=3, command=lambda: num(3), width=7, height=2, font=('Arial',20)).grid(row=2,column=0)
Button(w, text=4, command=lambda: num(4), width=7, height=2, font=('Arial',20)).grid(row=2,column=1)
Button(w, text=5, command=lambda: num(5), width=7, height=2, font=('Arial',20)).grid(row=2,column=2)
Button(w, text=6, command=lambda: num(6), width=7, height=2, font=('Arial',20)).grid(row=3,column=0)
Button(w, text=7, command=lambda: num(7), width=7, height=2, font=('Arial',20)).grid(row=3,column=1)
Button(w, text=8, command=lambda: num(8), width=7, height=2, font=('Arial',20)).grid(row=3,column=2)
Button(w, text=9, command=lambda: num(9), width=7, height=2, font=('Arial',20)).grid(row=4,column=1)
Button(w, text='.', command=lambda: num('.'), width=7, height=2, font=('Arial',20)).grid(row=5,column=3)
Button(w, text='+', command=lambda: num('+'), width=7, height=2, font=('Arial',20)).grid(row=1, column=3)
Button(w, text='-', command=lambda: num('-'), width=7, height=2, font=('Arial',20)).grid(row=2, column=3)
Button(w, text='×', command=lambda: num('×'), width=7, height=2, font=('Arial',20)).grid(row=3, column=3)
Button(w, text='÷', command=lambda: num('÷'), width=7, height=2, font=('Arial',20)).grid(row=4, column=3)
Button(w, text='^', command=lambda: num('^'), width=7, height=2, font=('Arial',20)).grid(row=4, column=2)
Button(w, text='(', command=lambda: num('('), width=7, height=2, font=('Arial',20)).grid(row=5, column=1)
Button(w, text=')', command=lambda: num(')'), width=7, height=2, font=('Arial',20)).grid(row=5, column=2)
Button(w, text='阶乘', command=lambda: function('fact'), width=7, height=2, font=('Arial',20)).grid(row=5, column=0)
Button(w, text='sin(角度)', command=lambda: function('sin'), width=7, height=2, font=('Arial',20)).grid(row=6, column=0)
Button(w, text='cos(角度)', command=lambda: function('cos'), width=7, height=2, font=('Arial',20)).grid(row=6, column=1)
Button(w, text='tan(角度)', command=lambda: function('tan'), width=7, height=2, font=('Arial',20)).grid(row=6, column=2)
Button(w, text='sin(弧度)', command=lambda: function('sinh'), width=7, height=2, font=('Arial',20)).grid(row=7, column=0)
Button(w, text='cos(弧度)', command=lambda: function('cosh'), width=7, height=2, font=('Arial',20)).grid(row=7, column=1)
Button(w, text='tan(弧度)', command=lambda: function('tanh'), width=7, height=2, font=('Arial',20)).grid(row=7, column=2)
Button(w, text='asin', command=lambda: function('asin'), width=7, height=2, font=('Arial',20)).grid(row=8, column=0)
Button(w, text='acos', command=lambda: function('acos'), width=7, height=2, font=('Arial',20)).grid(row=8, column=1)
Button(w, text='atan', command=lambda: function('atan'), width=7, height=2, font=('Arial',20)).grid(row=8, column=2)
Button(w, text='平方根', command=lambda: function('sqrt'), width=7, height=2, font=('Arial',20)).grid(row=10, column=0)
Button(w, text='弧度-角度', command=lambda: function('deg'), width=7, height=2, font=('Arial',20)).grid(row=9, column=0)
Button(w, text='角度-弧度', command=lambda: function('rad'), width=7, height=2, font=('Arial',20)).grid(row=9, column=1)
Button(w, text='绝对值', command=lambda: function('abs'), width=7, height=2, font=('Arial',20)).grid(row=9, column=2)
Button(w, text='二进制', command=lambda: function('binary'), width=7, height=2, font=('Arial',20)).grid(row=10, column=1)
Button(w, text='八进制', command=lambda: function('october'), width=7, height=2, font=('Arial',20)).grid(row=10, column=2)
Button(w, text='十六进制', command=lambda: function('hexadecimal'), width=7, height=2, font=('Arial',20)).grid(row=10, column=3)
Button(w, text='log2', command=lambda: function('log2'), width=7, height=2, font=('Arial',20)).grid(row=1, column=4)
Button(w, text='log10', command=lambda: function('log'), width=7, height=2, font=('Arial',20)).grid(row=1, column=5)
Button(w, text='ln', command=lambda: function('ln'), width=7, height=2, font=('Arial',20)).grid(row=1, column=6)
Button(w, text='π', command=lambda: num('π'), width=7, height=2, font=('Arial',20)).grid(row=2, column=6)
Button(w, text='e', command=lambda: num('e'), width=7, height=2, font=('Arial',20)).grid(row=2, column=4)
Button(w, text='CE', command=ce, width=7, height=2, font=('Arial',20)).grid(row=3, column=5)
Button(w, text='取余', command=lambda: num(' mod '), width=7, height=2, font=('Arial',20)).grid(row=1, column=7)
Button(w, text='取整', command=lambda: function('int'), width=7, height=2, font=('Arial',20)).grid(row=2, column=7)
Button(w, text='取小', command=lambda: function('decimal_fraction'), width=7, height=2, font=('Arial',20)).grid(row=2, column=5)
Button(w, text='←', command=lambda: equation.set(equation.get()[:-1]), width=7, height=2, font=('Arial',20)).grid(row=2, column=6)
Button(w, text='=', command=calculate, width=7, height=2, font=('Arial',20)).grid(row=4,column=0)
Button(w, text='最小公倍数', command=lambda: func_set('lcm'), width=7, height=2, font=('Arial',20)).grid(row=3,column=4)
Button(w, text='最大公约数', command=lambda: func_set('gcd'), width=7, height=2, font=('Arial',20)).grid(row=3,column=5)

Label(w, textvar=final, font=('Arial',30)).grid(row=0,column=6)
Label(w, textvar=equation, font=('Arial',30)).grid(row=0,column=2)
w.title('计算器')
w.mainloop()

2021-08-19T09:21:29 点赞:0

编程猫……你为什么……变了……[tv_doge] 中回复

分12

2021-08-19T10:49:30 点赞:0

满汉全席乛v乛 中回复

imgsrc="https://static.codemao.cn/emoji/codemao/%E7%BC%96%E7%A8%8B%E7%8C%AB_%E6%90%93%E5%A4%B4.gif"alt="emotion_编程猫_搓头"

2021-08-20T21:03:42 点赞:0

从图形化编程向Python进阶,你需要几步? 中回复

 

没有!!!我倒是报名了csp-j 2021!!!

2021-08-21T08:25:22 点赞:0