답안 #906642

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
906642 2024-01-14T16:00:42 Z iloveroseanne Trol (COCI19_trol) C++14
30 / 50
1 ms 500 KB
/// PARK CHAEYOUNG IS MY LOVE
/// Author: Ngo Ba Van
/// roses_are_rosie
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define fi first
#define se second
#define MASK(i) (1LL<<i)
#define BIT(x,i) (x&MASK(i))
#define ONBIT(x,i) (x|MASK(i))
#define OFFBIT(x,i) (x&~MASK(i))
#define COUNT(x) (__builtin_popcount(x))
#define RVAN1102 signed main()
using ii=pair<int,int>;
const ll N=2e5+5,M=1e9+7;
ll n,m,res;
ll tinh(ll n)
{
    ll k=n/9;
    ll ans=k*45;
    n%=9;
    for (int i=1;i<=n;i++)
    ans+=i;
    return ans;
}
void nhap()
{
    cin>>n;
    for (int i=1;i<=n;i++)
    {
        int l,r;
        cin>>l>>r;
        cout<<tinh(r)-tinh(l-1)<<"\n";
    }
}
RVAN1102 {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
#define task ""
#define task "a"
if(fopen(task".inp","r"))
{
    freopen(task".inp","r",stdin);
    freopen(task".out","w",stdout);
}
int t=1;
//cin>>t;
while (t--)
nhap();
}

Compilation message

trol.cpp:41: warning: "task" redefined
   41 | #define task "a"
      | 
trol.cpp:40: note: this is the location of the previous definition
   40 | #define task ""
      | 
trol.cpp: In function 'int main()':
trol.cpp:44:12: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   44 |     freopen(task".inp","r",stdin);
      |     ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
trol.cpp:45:12: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   45 |     freopen(task".out","w",stdout);
      |     ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 348 KB Output is correct
2 Correct 1 ms 348 KB Output is correct
3 Incorrect 1 ms 456 KB Output isn't correct
4 Correct 1 ms 500 KB Output is correct
5 Incorrect 1 ms 348 KB Output isn't correct