Submission #1612708


Source Code Expand

//set many funcs
#include<stdio.h>
#include<string.h>
#include<stdlib.h>
#define inf 1072114514
#define llinf 1145141919810364364
#define mod 1000000007

int max(int a,int b){if(a>b){return a;}return b;}
int min(int a,int b){if(a<b){return a;}return b;}
int zt(int a,int b){return max(a,b)-min(a,b);}
int round(int a,int b){if((a%b)*2 >= b){return (a/b)+1;}return a/b;}
int ceil(int a,int b){if(a%b==0){return a/b;}return (a/b)+1;}
int gcd(int a,int b){int c;while(b!=0){c=a%b;a=b;b=c;}return a;}
int lcm(int a,int b){int c=gcd(a,b);a/=c;return a*b;}
int nCr(int a,int b){int i,r=1;for(i=1;i<=b;i++){r*=(a+1-i);r/=i;}return r;}
int fact(int a){int i,r=1;for(i=1;i<=a;i++){r*=i;}return r;}
int pow(int a,int b){int i,r=1;for(i=1;i<=b;i++){r*=a;}return r;}
long long llmax(long long a,long long b){if(a>b){return a;}return b;}
long long llmin(long long a,long long b){if(a<b){return a;}return b;}
long long llzt(long long a,long long b){return llmax(a,b)-llmin(a,b);}
long long llround(long long a,long long b){if((a%b)*2 >= b){return (a/b)+1;}return a/b;}
long long llceil(long long a,long long b){if(a%b==0){return a/b;}return (a/b)+1;}
long long llgcd(long long a,long long b){long long c;while(b!=0){c=a%b;a=b;b=c;}return a;}
long long lllcm(long long a,long long b){long long c=llgcd(a,b);a/=c;return a*b;}
long long llnCr(long long a,long long b){long long i,r=1;for(i=1;i<=b;i++){r*=(a+1-i);r/=i;}return r;}
long long llfact(long long a){long long i,r=1;for(i=1;i<=a;i++){r*=i;}return r;}
long long llpow(long long a,long long b){long long i,r=1;for(i=1;i<=b;i++){r*=a;}return r;}
double dbmax(double a,double b){if(a>b){return a;}return b;}
double dbmin(double a,double b){if(a<b){return a;}return b;}
double dbzt(double a,double b){return dbmax(a,b)-dbmin(a,b);}
int sortfncsj(const void *a,const void *b){if(*(int *)a>*(int *)b){return 1;}if(*(int *)a==*(int *)b){return 0;}return -1;}
int sortfnckj(const void *a,const void *b){if(*(int *)a<*(int *)b){return 1;}if(*(int *)a==*(int *)b){return 0;}return -1;}
int llsortfncsj(const void *a,const void *b){if(*(long long *)a>*(long long *)b){return 1;}if(*(long long *)a==*(long long *)b){return 0;}return -1;}
int llsortfnckj(const void *a,const void *b){if(*(long long *)a<*(long long *)b){return 1;}if(*(long long *)a==*(long long *)b){return 0;}return -1;}
int dbsortfncsj(const void *a,const void *b){if(*(double *)a>*(double *)b){return 1;}if(*(double *)a==*(double *)b){return 0;}return -1;}
int dbsortfnckj(const void *a,const void *b){if(*(double *)a<*(double *)b){return 1;}if(*(double *)a==*(double *)b){return 0;}return -1;}

int main(void){
    int n,i,a,b,d,r=0;
    char s[8];
    scanf("%d%d%d",&n,&a,&b);
    for(i = 1;i <= n;i++){
        scanf("%s%d",s,&d);
        if(d<a){d=a;}
        if(d>b){d=b;}
        if(s[0]=='E'){r+=d;}else{r-=d;}
    }
    if(r==0){printf("0\n");}
    else if(r>0){printf("East %d\n",r);}
    else{printf("West %d\n",-r);}
    return 0;
}

Submission Info

Submission Time
Task B - 双子とスイカ割り
User physics0523
Language C (GCC 5.4.1)
Score 100
Code Size 2995 Byte
Status AC
Exec Time 1 ms
Memory 128 KB

Compile Error

./Main.c:12:5: warning: conflicting types for built-in function ‘round’
 int round(int a,int b){if((a%b)*2 >= b){return (a/b)+1;}return a/b;}
     ^
./Main.c:13:5: warning: conflicting types for built-in function ‘ceil’
 int ceil(int a,int b){if(a%b==0){return a/b;}return (a/b)+1;}
     ^
./Main.c:18:5: warning: conflicting types for built-in function ‘pow’
 int pow(int a,int b){int i,r=1;for(i=1;i<=b;i++){r*=a;}return r;}
     ^
./Main.c:22:11: warning: conflicting types for built-in function ‘llround’
 long long llround(long long a,long long b){if((a%b)*2 >= b){return (a/b)+1;}return a/b;}
           ^
./Main.c: In function ‘main’:
./Main.c:42:5: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result]
     scanf("%d%d%d",&n,&a,&b);
     ^
./Main.c:44:9: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result]
         scanf("%s%d",s,&d);
         ^

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 100 / 100
Status
AC × 3
AC × 36
Set Name Test Cases
Sample sample-01.txt, sample-02.txt, sample-03.txt
All sample-01.txt, sample-02.txt, sample-03.txt, test-01.txt, test-02.txt, test-03.txt, test-04.txt, test-05.txt, test-06.txt, test-07.txt, test-08.txt, test-09.txt, test-10.txt, test-11.txt, test-12.txt, test-13.txt, test-14.txt, test-15.txt, test-16.txt, test-17.txt, test-18.txt, test-19.txt, test-20.txt, test-21.txt, test-22.txt, test-23.txt, test-24.txt, test-25.txt, test-26.txt, test-27.txt, test-28.txt, test-29.txt, test-30.txt, sample-01.txt, sample-02.txt, sample-03.txt
Case Name Status Exec Time Memory
sample-01.txt AC 0 ms 128 KB
sample-02.txt AC 1 ms 128 KB
sample-03.txt AC 0 ms 128 KB
test-01.txt AC 1 ms 128 KB
test-02.txt AC 1 ms 128 KB
test-03.txt AC 1 ms 128 KB
test-04.txt AC 1 ms 128 KB
test-05.txt AC 1 ms 128 KB
test-06.txt AC 1 ms 128 KB
test-07.txt AC 1 ms 128 KB
test-08.txt AC 1 ms 128 KB
test-09.txt AC 1 ms 128 KB
test-10.txt AC 1 ms 128 KB
test-11.txt AC 1 ms 128 KB
test-12.txt AC 1 ms 128 KB
test-13.txt AC 1 ms 128 KB
test-14.txt AC 1 ms 128 KB
test-15.txt AC 1 ms 128 KB
test-16.txt AC 1 ms 128 KB
test-17.txt AC 1 ms 128 KB
test-18.txt AC 1 ms 128 KB
test-19.txt AC 1 ms 128 KB
test-20.txt AC 1 ms 128 KB
test-21.txt AC 1 ms 128 KB
test-22.txt AC 1 ms 128 KB
test-23.txt AC 1 ms 128 KB
test-24.txt AC 1 ms 128 KB
test-25.txt AC 1 ms 128 KB
test-26.txt AC 1 ms 128 KB
test-27.txt AC 1 ms 128 KB
test-28.txt AC 1 ms 128 KB
test-29.txt AC 1 ms 128 KB
test-30.txt AC 1 ms 128 KB