제출 #626217

#제출 시각아이디문제언어결과실행 시간메모리
626217Sasha008송신탑 (IOI22_towers)C++17
23 / 100
4051 ms1580 KiB
#include<bits/stdc++.h>
//#include "towers.h"
#pragma GCC optimize ("O3")
using namespace std;
#define el "\n"
#define se " "
#define ll long long
#define ld long double
#define ff first
#define ss second
#define pb push_back
const ll INF=1e18,ch=1e18;
int a,b,c,d,n,COST,t,last,ab,ba,n1,n2,fl1,fl2,o1,o2,flag,flag1,flag2,g,m,m1,m2,i,j,lr,f,k,l,r,y,o,p,mx=-ch,mx1=-ch,mx2=-ch,q,q1,q2,q3,q4,mn=ch,mn1=ch,mn2=ch,f1,f2,f3,pos,ans,sum,sz=1,MOD=1e9+7,zero=0,a1,b1,c1,val,sum1,cur,res,ans1,res1,kk,kkk,cnt,cnt1,fl;
int A[100005];
void init(int N, vector<int> H)
{
    n=N;
    for(i=1;i<=n;i++)
    {
        A[i]=H[i-1];
    }
}
int max_towers(int L, int R, int D)
{
    int ans=1;
    l=L;r=R;
    l++;r++;
    a=A[l];q=-1;
    for(i=l+1;i<=r;i++)
    {
        if (q==-1)
        {
            if (A[i]<=a) {a=A[i];continue;}
            if (a<=A[i]-D) {q=A[i];continue;}
        }
        else
        {
            if (A[i]<=q-D) {q=-1;a=A[i];ans++;continue;}
            if (A[i]>q) q=A[i];
        }
    }
    return ans;
}
//int main()
//{
//    ios_base::sync_with_stdio(0);
//    cin.tie(0);
//    cout.tie(0);
//    cin>>n;
//    for(i=1;i<=n;i++)
//    {
//        cin>>A[i];
//    }
//    cout<<max_towers(1, 5, 10);
//}
//
////7
////10 20 60 40 50 30 70

컴파일 시 표준 에러 (stderr) 메시지

towers.cpp:13:104: warning: overflow in conversion from 'long long int' to 'int' changes value from '-1000000000000000000' to '1486618624' [-Woverflow]
   13 | int a,b,c,d,n,COST,t,last,ab,ba,n1,n2,fl1,fl2,o1,o2,flag,flag1,flag2,g,m,m1,m2,i,j,lr,f,k,l,r,y,o,p,mx=-ch,mx1=-ch,mx2=-ch,q,q1,q2,q3,q4,mn=ch,mn1=ch,mn2=ch,f1,f2,f3,pos,ans,sum,sz=1,MOD=1e9+7,zero=0,a1,b1,c1,val,sum1,cur,res,ans1,res1,kk,kkk,cnt,cnt1,fl;
      |                                                                                                        ^~~
towers.cpp:13:112: warning: overflow in conversion from 'long long int' to 'int' changes value from '-1000000000000000000' to '1486618624' [-Woverflow]
   13 | int a,b,c,d,n,COST,t,last,ab,ba,n1,n2,fl1,fl2,o1,o2,flag,flag1,flag2,g,m,m1,m2,i,j,lr,f,k,l,r,y,o,p,mx=-ch,mx1=-ch,mx2=-ch,q,q1,q2,q3,q4,mn=ch,mn1=ch,mn2=ch,f1,f2,f3,pos,ans,sum,sz=1,MOD=1e9+7,zero=0,a1,b1,c1,val,sum1,cur,res,ans1,res1,kk,kkk,cnt,cnt1,fl;
      |                                                                                                                ^~~
towers.cpp:13:120: warning: overflow in conversion from 'long long int' to 'int' changes value from '-1000000000000000000' to '1486618624' [-Woverflow]
   13 | int a,b,c,d,n,COST,t,last,ab,ba,n1,n2,fl1,fl2,o1,o2,flag,flag1,flag2,g,m,m1,m2,i,j,lr,f,k,l,r,y,o,p,mx=-ch,mx1=-ch,mx2=-ch,q,q1,q2,q3,q4,mn=ch,mn1=ch,mn2=ch,f1,f2,f3,pos,ans,sum,sz=1,MOD=1e9+7,zero=0,a1,b1,c1,val,sum1,cur,res,ans1,res1,kk,kkk,cnt,cnt1,fl;
      |                                                                                                                        ^~~
towers.cpp:13:141: warning: overflow in conversion from 'long long int' to 'int' changes value from '1000000000000000000' to '-1486618624' [-Woverflow]
   13 | int a,b,c,d,n,COST,t,last,ab,ba,n1,n2,fl1,fl2,o1,o2,flag,flag1,flag2,g,m,m1,m2,i,j,lr,f,k,l,r,y,o,p,mx=-ch,mx1=-ch,mx2=-ch,q,q1,q2,q3,q4,mn=ch,mn1=ch,mn2=ch,f1,f2,f3,pos,ans,sum,sz=1,MOD=1e9+7,zero=0,a1,b1,c1,val,sum1,cur,res,ans1,res1,kk,kkk,cnt,cnt1,fl;
      |                                                                                                                                             ^~
towers.cpp:13:148: warning: overflow in conversion from 'long long int' to 'int' changes value from '1000000000000000000' to '-1486618624' [-Woverflow]
   13 | int a,b,c,d,n,COST,t,last,ab,ba,n1,n2,fl1,fl2,o1,o2,flag,flag1,flag2,g,m,m1,m2,i,j,lr,f,k,l,r,y,o,p,mx=-ch,mx1=-ch,mx2=-ch,q,q1,q2,q3,q4,mn=ch,mn1=ch,mn2=ch,f1,f2,f3,pos,ans,sum,sz=1,MOD=1e9+7,zero=0,a1,b1,c1,val,sum1,cur,res,ans1,res1,kk,kkk,cnt,cnt1,fl;
      |                                                                                                                                                    ^~
towers.cpp:13:155: warning: overflow in conversion from 'long long int' to 'int' changes value from '1000000000000000000' to '-1486618624' [-Woverflow]
   13 | int a,b,c,d,n,COST,t,last,ab,ba,n1,n2,fl1,fl2,o1,o2,flag,flag1,flag2,g,m,m1,m2,i,j,lr,f,k,l,r,y,o,p,mx=-ch,mx1=-ch,mx2=-ch,q,q1,q2,q3,q4,mn=ch,mn1=ch,mn2=ch,f1,f2,f3,pos,ans,sum,sz=1,MOD=1e9+7,zero=0,a1,b1,c1,val,sum1,cur,res,ans1,res1,kk,kkk,cnt,cnt1,fl;
      |                                                                                                                                                           ^~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...