QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#393017#6326. Make Convex SequenceGiga_Cronos#Compile Error//C++231.4kb2024-04-18 03:16:372024-04-18 03:16:38

Judging History

你现在查看的是最新测评结果

  • [2024-04-18 03:16:38]
  • 评测
  • [2024-04-18 03:16:37]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define MAXN   ((ll)(1e5 + 5))
#define pb     push_back
#define sz     size
#define all(x) x.begin(), x.end()
#define vi vector<int>

int n;
vi a,b;

#define ii pair<int,int>
#define fs first
#define sc second

int cross(ii a,ii b){
    return a.fs*b.sc-a.sc*b.fs;
}


int tc(int  i,int j,int k){
    ii p1={j,b[j]};
    ii p2={k,b[k]};
    p1.fs-=i;
    p2.fs-=i;
    p1.sc-=b[i];
    p2.sc-=b[i];
    return cross(p1,p2);
}

void solve(){
    cin>>n;

    for(int i=0;i<n;i++){
        int x;cin>>x;
        a.pb(x);
    }
    
    for(int i=0;i<n;i++){
        int x;cin>>x;
        b.pb(x);
    }

    vi v;
    for(int i=0;i<n;i++){
        if(!v.sz()){ 
            v.pb(i);
            continue;
        }
        while(v.sz()>=2 && tc(v[v.sz()-2],v[v.sz()-1],i)<0){
            v.pop_back();
        }
        v.pb(i);
    }
    bool can=true;

    for(int i=1;i<v.sz();i++){
        for(int j=v[i-1]+1;j<v[i];j++){
            if(   (a[j]*(v[i]-v[i-1])) > (((v[i]-v[i-1]) * b[v[i-1]] + j * (b[v[i]]-b[v[i-1]]))  )){
                can=false;
            }
            
        }
    }

    if(can){
        cout<<"YES";
    }else{
        cout<<"NO";
    }

}

int32_t main() {
	ios_base::sync_with_stdio(0);
	cin.tie(0);
    solve();
	return 0;
}
asdasdasd

Details

answer.code:81:1: error: ‘asdasdasd’ does not name a type
   81 | asdasdasd
      | ^~~~~~~~~