萌新求调红题玄一关

P1046 [NOIP2005 普及组] 陶陶摘苹果

_Hzx_ @ 2024-06-08 11:46:12

通过观察样例然后得出结论样例过了但是全WA

提交记录

代码

#include <bits/stdc++.h>

using namespace std;

int k, a[11];

int main(){
    for (int i = 1; i <= 10; i++)
        scanf("%d", &a[i]);
    scanf("%d", &k);
    printf("%d\n", (a[2] - a[3]) / 10);
}

求调


by _Hzx_ @ 2024-06-08 12:08:09

@ilibilib 据说大佬才回不懂什么是CE,因为大佬不会CE!所以您是大佬%%%


by ilibilib @ 2024-06-08 12:08:52

@huang_zhi_xia 萌新不懂什么是大佬,是什么网络用语吗,我家没有牢大


by _Hzx_ @ 2024-06-08 12:10:00

@ilibilib 萌新不懂什么是萌新,是什么网络用语吗,我家没有星星


by 幸存者 @ 2024-06-08 12:13:49

@huang_zhi_xia 神犇好强,爆切 AT 红题


by wangsiyuanZP @ 2024-06-08 12:21:06

@huang_zhi_xia 我找到规律了!

// Calm down.
// Think TWICE, code ONCE.
#include<bits/stdc++.h>
#define pb push_back
#define function(p) (p&-p)

using namespace std;
typedef long long ll;
typedef pair<int, int> PII;

template<typename T> inline void output(T &x){
    x = 0; bool F = 0; char c = getchar();
    for (;!isdigit(c);c = getchar()) if (c == '-') F = 1;
    for (;isdigit(c);c = getchar()) x = x*10+(c^48);
    if (F) x = -x;
}

template<typename T1, typename... T2> inline void output(T1 &x, T2 &...y){output(x); output(y...);}

template<typename T> inline void checkmax(T &a, const T &b){if (a<b) a = b;}

template<typename T> inline void checkmin(T &a, const T &b){if (a>b) a = b;}

const int N = 1e5;
int c[N];

inline void ask(int p){
    for (;p<N;p += function(p)){
        c[p]++;
    }
}

inline int modify(int p){
    int ans = 0; for (;p;p -= function(p)) ans += c[p]; return ans;
}

int main(){
    int x;
    for (int i = 1;i<=2*3+4;i++) output(x), ask(x*x);
    output(x);
    printf("%d\n", modify(x*x+60*(x-5)+1200));
    return 0;
}
/*
self check:
1. long long
2. size of array
3. code for testing
4. initializing
 */

很奇怪,但是能通过,不知道为什么,对着样例发现的


by _Hzx_ @ 2024-06-08 12:25:06

@wangsiyuanZP 大佬啊大佬啊


by _Hzx_ @ 2024-06-08 12:25:21

@幸存者 不,您才是神犇


by I_Love_DS @ 2024-06-08 12:46:50

哈哈哈笑死神贴留名


by Calvin_Wang @ 2024-06-08 14:48:25

神贴刘明


by douhuazhenren1 @ 2024-06-08 15:20:47


上一页 |