답안 #908102

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
908102 2024-01-16T07:56:13 Z ibm2006 Segway (COI19_segway) C++17
0 / 100
2 ms 12632 KB
#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
ll n,i,j,k,l,r,x,y,z,w,s,t,a[1100000],b[1100000],c[1100000],d[1100000],chk[1100000],tt[1100000],q,m,ans[1100000];
int main()
{
    scanf("%lld",&n);
    for(i=1;i<=n;i++)
    {
        scanf("%lld %lld %lld",&x,&y,&z);
        a[i]=x;
        b[i]=y;
        c[i]=z;
    }
    scanf("%lld",&m);
    scanf("%lld",&x);
    for(i=1;i<=n;i++)
    {
        if(x<=100)
        {
            d[i]=x*a[i];
            continue;
        }
        if(x<=200)
        {
            d[i]=100*a[i]+(x-100)*b[i];
            continue;
        }
        d[i]=100*a[i]+100*b[i]+(x-200)*c[i];
    }
    for(i=1;i<=n;i++)
    {
        chk[d[i]]++;
    }
    for(i=30001;i>=0;i--)
    {
        tt[i]=s%20;
        s+=chk[i];
    }
    for(i=1;i<=n;i++)
    {
        for(j=0;j<300;j++)
        {
            if(q>0)
            {
                ans[i]++;
                q--;
                continue;
            }
            if(j==x)
            {
                q=tt[d[i]];
                q--;
                ans[i]++;
                continue;
            }
            if(j<100)
                ans[i]+=a[i];
            else if(j<200)
                ans[i]+=b[i];
            else
                ans[i]+=c[i];
        }
    }
    for(i=1;i<=n;i++)
        printf("%lld\n",ans[i]);
}

Compilation message

segway.cpp: In function 'int main()':
segway.cpp:7:10: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
    7 |     scanf("%lld",&n);
      |     ~~~~~^~~~~~~~~~~
segway.cpp:10:14: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   10 |         scanf("%lld %lld %lld",&x,&y,&z);
      |         ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
segway.cpp:15:10: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   15 |     scanf("%lld",&m);
      |     ~~~~~^~~~~~~~~~~
segway.cpp:16:10: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   16 |     scanf("%lld",&x);
      |     ~~~~~^~~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Incorrect 2 ms 12632 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 2 ms 12632 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 2 ms 12632 KB Output isn't correct
2 Halted 0 ms 0 KB -