Submission #867274

# Submission time Handle Problem Language Result Execution time Memory
867274 2023-10-28T04:50:49 Z Sir_Ahmed_Imran Nuclearia (CEOI15_nuclearia) C++17
0 / 100
1000 ms 11236 KB
                              ///~~~LOTA~~~///
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define li long int
#define ld long double
#define append push_back
#define add insert
#define nl "\n"
#define ff first
#define ss second
#define pii pair<int,int>
#define pic pair<int,char>
#define all(x) (x).begin(),(x).end()
#define sum(a) accumulate(all(a),0)
#define L0TA ios_base::sync_with_stdio(false);cin.tie(NULL)
#define terminator main
#define MAXN 2500001
int n,m;
void solve1(){
    ld x,y;
    int a[n+1];
    int o,p,q,r,s,t;
    cin>>o;
    while(o--){
        cin>>p>>q>>r>>s;
        for(int i=1;i<=n;i++){
            t=i;
            q=abs(p-i);
            q=max(0,r-q*s);
            while(t<=n){
                a[t]+=q;
                t+=t&(-t);
            }
        }
    }
    cin>>o;
    while(o--){
        cin>>p>>r>>q>>s;
        x=0;
        y=(q-p+1);
        while(q){
            x+=a[q];
            q-=q&(-q);
        }
        p--;
        while(p){
            x-=a[p];
            p-=p&(-p);
        }
        cout<<round(x/y)<<nl;
    }
}
void solve2(){

}
void solve(){
    cin>>n>>m;
    if(m==1) solve1();
    else solve2();
}
int terminator(){
    L0TA;
    solve();
    return 0;
}
# Verdict Execution time Memory Grader output
1 Execution timed out 1026 ms 10072 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1029 ms 10072 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 344 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 488 ms 11236 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1058 ms 4340 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1062 ms 10076 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1075 ms 10076 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 344 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -