孩子,我无敌了(2.0版,67行)
2025-03-02 18:37:50
发布于:辽宁
未成年码将请在成年码王的陪同下观看,否则会引起“bushi”(确信)
#include <bits/stdc++.h>
using namespace std;
#define ll long long
const int N = 1010;
int RAND_1(ll a,ll b){
ll n = a + b;
return n;
}
int RAND_2(string a, string b, int n[500], int m[500], int ans[501]){
for(int i = 0; i < a.size(); i++)
n[i] = a[a.size() - i - 1] - '0';
for(int i = 0; i < b.size(); i++)
m[i] = b[b.size() - i - 1] - '0';
int len_maxn = max(a.size(), b.size()) + 1;
for(int i = 0; i < len_maxn; i++)
{
ans[i] = n[i] + m[i] + ans[i];
if(ans[i] > 9)
{
ans[i + 1]++;
ans[i] = ans[i] % 10;
}
}
while(ans[len_maxn - 1] == 0 && len_maxn > 0) len_maxn--;
for(int i = len_maxn - 1; i >= 0; i--) cout << ans[i];
return 0;
}
int RAND_3(ll a, ll b){
ll ans = 0;
for(int i = 0; i < a; i ++ ) {
ans ++;
}
for(int i = 0; i < b; i ++ ) {
ans ++;
}
return ans;
}
int n[1010], m[1010],c[1010];
int main(){
srand(time(0));
ll a , b;
string z , y;
int x;
x = 1 + rand() % 3;
if(x == 1){
cin >> a >> b;
int ans = RAND_1(a,b);
cout << ans;
}
if(x == 2){
cin >> z >> y;
RAND_2(z , y , n , m, c);
}
if(x == 3){
cin >> a >> b;
int ans = RAND_3(a, b);
cout << ans;
}
return 0;
}
同样是可以过得好吧
看完的点个赞吧!!!!!!!!!!!!!
全部评论 34
a, b = map(int, input().split()) c = 0 d = 'a' e = "b" f = 0.0 g = None h = True i = False j = [] k = {} m = set() def n(o): pass class p: def __init__(): pass def q(r): pass s = c + 1 t = s ** 2 print(a + b) # Useless variable declarations var1 = "useless" var2 = 12345 var3 = [1, 2, 3, 4, 5] var4 = {'key': 'value'} var5 = (1, 2, 3) var6 = set([1, 2, 3]) var7 = 3.14159 var8 = False var9 = None var10 = "more useless text" # Meaningless calculations calc1 = a * b - c calc2 = var2 % 10 calc3 = t / s calc4 = calc1 + calc2 - calc3 calc5 = var7 * 2 calc6 = calc5 ** 0.5 calc7 = len(var3) + len(var4) calc8 = sum(var3) / len(var3) calc9 = var2 // 100 calc10 = calc4 * calc6 + calc7 # Empty functions def func1(): pass def func2(param1): pass def func3(param2, param3=0): return param2 + param3 def func4(): return None def func5(x, y, z): pass def func6(): return "nothing" def func7(a, b, c, d): pass def func8(): return 0 def func9(): return [] def func10(): return {} # Useless class definitions class UselessClass1: def __init__(self): self.value = 0 def method1(self): pass def method2(self, x): return x * 2 class UselessClass2: def __init__(self, name): self.name = name def greet(self): return f"Hello, {self.name}" def double(self, num): return num * 2 class UselessClass3: def __init__(self): self.data = [] def add(self, item): self.data.append(item) def clear(self): self.data = [] # More meaningless operations result1 = func3(5, 10) result2 = UselessClass2("test").greet() result3 = var3[2] * var5[1] result4 = result1 + result3 result5 = var4.get('key', 'default') result6 = len(var10) - len(var1) result7 = bool(var8) or bool(var9) result8 = var6.union(set([4, 5, 6])) result9 = result4 / result6 if result6 != 0 else 0
2025-05-05 来自 北京
4点赞!投币!一键三连!
2024-06-09 来自 辽宁
4不了一点
2024-06-09 来自 辽宁
3加个#include <cmath>
2024-11-03 来自 广东
0吐s了,只能帮你帮到这了:
#include<iostream>
#include <algorithm>
#include <bits/stdc++.h>
#include <math.h>
#include <cmath>
#include<string>
#include<cstring>
#include<list>
#include<map>
#include<queue>
#include<iterator>
#include<stack>2024-11-03 来自 广东
0
999
2024-08-18 来自 河北
2看完的点个赞吧!!!!!!!!!!!!!
2024-06-09 来自 辽宁
2# include <bits/stdc++.h> typedef unsigned long long ull; #define LL long long \ #define u1 u << 1 \ #define u2 u1 | 1 \ #define ef ((l + r) >> 1)\ using namespace std ; int r() { short f = 1; int x = 0; char c; c = getchar(); while (c < '0' || c > '9') { if (c == '-') { f = -1; } c = getchar(); } while (c >= '0' && c <= '9') { x = (x << 1) + (x << 3) + (c ^ (3 << 4)); c = getchar(); } return x * f; } void w(int x) { if(x == 0) { putchar('0'); return; } w(x / 10); char aaa = 'A'; aaa += (x % 10); putchar(aaa); return; } const int N = 1e5 + 3; struct Node{ LL sum; LL tag; }; int n, m; LL a[N]; Node seg[N << 2]; void pushup(int u) { int aaa = seg[u1].sum; aaa += seg[u2].sum; seg[u].sum = aaa; } void pushdown(int u, int l, int r) { LL &x = seg[u].tag; seg[u1].tag += x; seg[u2].tag += x; int mid = ef; LL aaa = mid - l + 1; LL aaa1 = r - mid; seg[u1].sum += 1ll * aaa * x; seg[u2].sum += 1ll * aaa1 * x; seg[u].tag = 0; } void build(int u, int l, int r) { if (l == r) { seg[u].sum = a[l]; seg[u].tag = 0; return; } int mid = ef; build(u1, l, mid); build(u2, mid + 1, r); pushup(u); } void modify(int u, int l, int r, int ql, int qr, int x) { if(l == ql && r == qr) { int aaa = r - l + 1; seg[u].tag += x; seg[u].sum += 1ll * aaa * x; return; } pushdown(u, l, r); int mid = ef; if(qr <= mid) { modify(u1, l, mid, ql, qr, x); } else if(ql > mid) { modify(u2, mid + 1, r, ql, qr, x); } else { modify(u1, l, mid, ql, mid, x); modify(u2, mid + 1, r, mid + 1, qr, x); } pushup(u); } LL query(int u, int l, int r, int ql, int qr) { if (l == ql && r == qr) { return seg[
2025-04-06 来自 江西
1u].sum; } pushdown(u, l, r); int mid = ef; if (qr <= mid) { return query(u1, l, mid, ql, qr); } else if (ql > mid) { return query(u2, mid + 1, r, ql, qr); } else { int aaa = query(u1, l, mid, ql, mid); aaa += query(u2, mid + 1, r, mid + 1, qr); return aaa; } } int dfs(int a, int b) { if (b == 0) { return a; } int aaa = dfs(a, b - 1); aaa ++; return aaa; } const int e3 = 1000; int main ( ) { int a, b; a = r(); b = r(); build(1, 1, e3); modify(1, 1, e3, 1, 1, a); modify(1, 1, e3, 2, 2, b); int aaa = query(1, 1, e3, 1, 2), aaa1 = dfs(a, b); if(aaa == aaa1) { int l = aaa, r = aaa1; int mid = ef; cout << ef; } cout << " "; cout << endl; return 0; }
2025-04-06 来自 江西
0共行(
2025-04-06 来自 江西
0
不久i是高精度吗?
2024-08-21 来自 上海
1不光是高精度哦亲~
2024-08-21 来自 辽宁
1
孩纸,你无敌了
2024-07-28 来自 浙江
1so?
2024-07-15 来自 浙江
1yiuwaellyouk?
2024-08-21 来自 广东
1
wdlhz
2024-07-14 来自 广东
16啊
2024-06-11 来自 广东
1再顶
2024-06-09 来自 辽宁
1顶
2024-06-09 来自 辽宁
1顶
2024-08-18 来自 浙江
1
昨天 来自 广东
0//一颗资瓷区间加、区间翻转、区间求和的Splay
#include <bits/stdc++.h>
#define ll long long
#define N 100000
using namespace std;
int sz[N], rev[N], tag[N], sum[N], ch[N][2], fa[N], val[N];
int n, m, rt, x;
void push_up(int x){
sz[x] = sz[ch[x][0]] + sz[ch[x][1]] + 1;
sum[x] = sum[ch[x][1]] + sum[ch[x][0]] + val[x];
}
void push_down(int x){
if(rev[x]){
swap(ch[x][0], ch[x][1]);
if(ch[x][1]) rev[ch[x][1]] ^= 1;
if(ch[x][0]) rev[ch[x][0]] ^= 1;
rev[x] = 0;
}
if(tag[x]){
if(ch[x][1]) tag[ch[x][1]] += tag[x], sum[ch[x][1]] += tag[x];
if(ch[x][0]) tag[ch[x][0]] += tag[x], sum[ch[x][0]] += tag[x];
tag[x] = 0;
}
}
void rotate(int x, int &k){
int y = fa[x], z = fa[fa[x]];
int kind = ch[y][1] == x;
if(y == k) k = x;
else ch[z][ch[z][1]==y] = x;
fa[x] = z; fa[y] = x; fa[ch[x][!kind]] = y;
ch[y][kind] = ch[x][!kind]; ch[x][!kind] = y;
push_up(y); push_up(x);
}
void splay(int x, int &k){
while(x != k){
int y = fa[x], z = fa[fa[x]];
if(y != k) if(ch[y][1] == x ^ ch[z][1] == y) rotate(x, k);
else rotate(y, k);
rotate(x, k);
}
}
int kth(int x, int k){
push_down(x);
int r = sz[ch[x][0]]+1;
if(k == r) return x;
if(k < r) return kth(ch[x][0], k);
else return kth(ch[x][1], k-r);
}
void split(int l, int r){
int x = kth(rt, l), y = kth(rt, r+2);
splay(x, rt); splay(y, ch[rt][1]);
}
void rever(int l, int r){
split(l, r);
rev[ch[ch[rt][1]][0]] ^= 1;
}
void add(int l, int r, int v){
split(l, r);
tag[ch[ch[rt][1]][0]] += v;
val[ch[ch[rt][1]][0]] += v;
push_up(ch[ch[rt][1]][0]);
}
int build(int l, int r, int f){
if(l > r) return 0;
if(l == r){
fa[l] = f;
sz[l] = 1;
return l;
}
int mid = l + r >> 1;
ch[mid][0] = build(l, mid-1, mid);
ch[mid][1] = build(mid+1, r, mid);
fa[mid] = f;
push_up(mid);
return mid;
}
int asksum(int l, int r){
split(l, r);
return sum[ch[ch[rt][1]][0]];
}
int main(){
//总共两个数
n = 2;
rt = build(1, n+2, 0);//建树
for(int i = 1; i <= n; i++){
scanf("%d", &x);
add(i, i, x);//区间加
}
rever(1, n);//区间翻转
printf("%d\n", asksum(1, n));//区间求和
return 0;
}2025-05-23 来自 浙江
0我只能帮你到这了!
#include<bits/stdc++.h>
using namespace std;
int main(){
int a,b;
cin>>a>>b;
cout <<a+b;
return 0;
}2025-03-30 来自 河北
0卧槽,牛逼!
2025-03-02 来自 北京
0大佬教一教我
2025-02-23 来自 四川
0#include <bits/stdc++.h>
using namespace std;
char A[100005], B[100005];
struct node{
short a[100005] = {0};
int len = 0, f = 1;
void _init(char *A){
len = strlen(A);
for(int i = 0; i < len; i++){
a[len - i] = A[i] - '0';
}
}
void print(){
for(int i = len; i >= 1; i--) cout << a[i];//倒序输出
}
node cpy(node a, int dst){//除法的靠右对齐函数
node tmp;
tmp.f = a.f, tmp.len = a.len + dst - 1;
for(int i = 1; i <= a.len; i++){
tmp.a[i + dst - 1] = a.a[i];
}return tmp;
}
bool operator > (node &b){
if(len > b.len) return 1;//比较长度
if(len < b.len) return 0;
for(int i = len; i >= 1; i--){
if(a[i] > b.a[i]) return 1;//逐位比较
if(a[i] < b.a[i]) return 0;
}return 0;
}
bool operator < (node &b){
if(len > b.len) return 0;//比较长度
if(len < b.len) return 1;
for(int i = len; i >= 1; i--){
if(a[i] > b.a[i]) return 0;//逐位比较
if(a[i] < b.a[i]) return 1;
}return 0;
}
bool operator <= (node &b){
return !(*this > b);
}
bool operator >= (node &b){
return !(*this < b);
}
node operator + (node &b){//加法
node c;
c.len = max(len, b.len);
for(int i = 1; i <= c.len; i++){
c.a[i] += a[i] + b.a[i];
if(c.a[i] >= 10) c.a[i + 1], c.a[i] -= 10;//进位
}if(c.a[c.len + 1]) c.len;
while(c.a[c.len] == 0 && c.len > 1) c.len--;
return c;
}
node operator - (node &b){//减法
node c;
if(b > *this){//处理负数情况
swap(*this, b);
c.f = -1;
}
c.len = len;
for(int i = 1; i <= len; i++){
c.a[i] += a[i] - b.a[i];
if(c.a[i] < 0) c.a[i + 1]--, c.a[i] += 10;//借位
}while(c.a[c.len] == 0 && c.len > 1) c.len--;
return c;
}
node operator * (node &b){//乘法
node c;
c.len = len + b.len;
for(int i = 1; i <= len; i++){
int x = 0;
for(int j = 1; j <= b.len; j++){
int weishu = i + j - 1;
c.a[weishu] += x + a[i] * b.a[j];
x = c.a[weishu] / 10;
c.a[weishu] %= 10;
}c.a[i + b.len] = x;
}while(c.a[c.len] == 0 && c.len > 1) c.len--;
return c;
}
node operator / (node &b){//除法(难度突增!)
node c;
if(*this < b) return c;
c.len = len - b.len + 1;
for(int i = c.len; i >= 1; i--){
node tmp = cpy(b, i);//右对齐
while(*this >= tmp){//不断相减
c.a[i]++;
*this -= tmp;
}
}while(c.a[c.len] =2025-02-06 来自 浙江
0#include <cctype>
#include <cerrno>
#include <cfloat>
#include <ciso646>
#include <climits>
#include <clocale>
#include <cmath>
#include <csetjmp>
#include <csignal>
#include <cstdarg>
#include <cstddef>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <ccomplex>
#include <cfenv>
#include <cinttypes>
#include <cstdalign>
#include <cstdbool>
#include <cstdint>
#include <ctgmath>
#include <cwchar>
#include <cwctype>
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>
#include <array>
#include <atomic>
#include <chrono>
#include <condition_variable>
#include <forward_list>
#include <future>
#include <initializer_list>
#include <mutex>
#include <random>
#include <ratio>
#include <regex>
#include <scoped_allocator>
#include <system_error>
#include <thread>
#include <tuple>
#include <typeindex>
#include <type_traits>
#include <unordered_map>
#include <bits/stdc++.h>
#include <unordered_set>
using namespace std;
char A[100005], B[100005];
struct node{
short a[100005] = {0};
int len = 0, f = 1;
void _init(char *A){
len = strlen(A);
for(int i = 0; i < len; i++){
a[len - i] = A[i] - '0';
}
}
void print(){
for(int i = len; i >= 1; i--) cout << a[i];//倒序输出
}
node cpy(node a, int dst){//除法的靠右对齐函数
node tmp;
tmp.f = a.f, tmp.len = a.len + dst - 1;
for(int i = 1; i <= a.len; i++){
tmp.a[i + dst - 1] = a.a[i];
}return tmp;
}
bool operator > (node &b){
if(len > b.len) return 1;//比较长度
if(len < b.len) return 0;
for(int i = l2025-02-06 来自 浙江
0for(int i = len; i >= 1; i--){
if(a[i] > b.a[i]) return 0;//逐位比较
if(a[i] < b.a[i]) return 1;
}return 0;
}
bool operator <= (node &b){
return !(*this > b);
}
bool operator >= (node &b){
return !(*this < b);
}
node operator + (node &b){//加法
node c;
c.len = max(len, b.len);
for(int i = 1; i <= c.len; i++){
c.a[i] += a[i] + b.a[i];
if(c.a[i] >= 10) c.a[i + 1], c.a[i] -= 10;//进位
}if(c.a[c.len + 1]) c.len;
while(c.a[c.len] == 0 && c.len > 1) c.len--;
return c;
}
node operator - (node &b){//减法
node c;
if(b > *this){//处理负数情况
swap(*this, b);
c.f = -1;
}
c.len = len;
for(int i = 1; i <= len; i++){
c.a[i] += a[i] - b.a[i];
if(c.a[i] < 0) c.a[i + 1]--, c.a[i] += 10;//借位
}while(c.a[c.len] == 0 && c.len > 1) c.len--;
return c;
}
node operator * (node &b){//乘法
node c;
c.len = len + b.len;
for(int i = 1; i <= len; i++){
int x = 0;
for(int j = 1; j <= b.len; j++){
int weishu = i + j - 1;
c.a[weishu] += x + a[i] * b.a[j];
x = c.a[weishu] / 10;
c.a[weishu] %= 10;
}c.a[i + b.len] = x;
}while(c.a[c.len] == 0 && c.len > 1) c.len--;
return c;
}
node operator / (node &b){//除法(难度突增!)
node c;
if(*this < b) return c;
c.len = len - b.len + 1;
for(int i = c.len; i >= 1; i--){
node tmp = cpy(b, i);//右对齐
while(*this >= tmp){//不断相减
c.a[i]++;
*this -= tmp;
}
}while(c.a[c.len] == 0 && c.len > 1) c.len--;
return c;
}node operator % (node &b){//取余
if(*this < b) return *this;
int len = len - b.len + 1;
for(int i = len; i >= 1; i--){
node tmp = cpy(b, i);
while(*this >= tmp){
*this -= tmp;
}
}return *this;
}
node operator ^ (node &b){//乘方
node null;
null.f = -1;
if(b.len > 18) return null;//太大了
node tmp;
tmp.len = tmp.a[1] = 1;
long long t = 0;
for(int i = b.len; i >= 1; i--){//处理成long long
t = t * 10 + b.a[i];
}
while(t){
if(t & 1){
if(len + tmp.len > 1e6) return null;//太大了
tmp *= *this;//乘
}
if(len + len > 1e6) return null;
*this *= *this, t >>= 1;//自乘
}return tmp;
}
void operator += (node &b){
*this = *this + b;
}
void operator -= (node &b){
*this = *this - b;
}
void operator *= (node &b){
*this = *t2025-02-06 来自 浙江
0
#include<iostream> #include<string> #include<vector> using namespace std; string x,y; vector<int> a,b,c; vector<int> add(vector<int> a,vector<int> b){ if(a.size()>b.size()) return add(b,a); int t,x=0; vector<int> c; for(int i=0;i<a.size();i++){ t=a[i]+b[i]+x; c.push_back(t%10); x=t/10; } for(int i=a.size();i<b.size();i++){ t=b[i]+x; c.push_back(t%10); x=t/10; } if(x) c.push_back(x); return c; } void print(vector<int> a){ while(!a.empty()){ cout<<a.back(); a.pop_back(); } return; } int main(){ cin>>x>>y; for(int i=x.size()-1;i>=0;i--) a.push_back(x[i]-'0'); for(int i=y.size()-1;i>=0;i--) b.push_back(y[i]-'0'); c=add(a,b); print(c); return 0; }
2025-01-12 来自 上海
0
有帮助,赞一个