Submission #3899408


Source Code Expand

#include<stdio.h>
#include<string.h>
#include<stdlib.h>
#include<stdbool.h>
#include<time.h>
#define inf 1072114514
#define llinf 4154118101919364364
#define mod 1000000007
#define pi 3.1415926535897932384
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 nHr(int a,int b){return nCr(a+b-1,b);}
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;}
int dsum(int x){int r=0;while(x){r+=(x%10);x/=10;}return r;}
int dsumb(int x,int b){int r=0;while(x){r+=(x%b);x/=b;}return r;}
int sankaku(int x){return ((1+x)*x)/2;}
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 llnHr(long long a,long long b){return llnCr(a+b-1,b);}
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;}
long long lldsum(long long x){long long r=0;while(x){r+=(x%10);x/=10;}return r;}
long long lldsumb(long long x,long long b){long long r=0;while(x){r+=(x%b);x/=b;}return r;}
long long llsankaku(long long x){return ((1+x)*x)/2;}
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 strsortfncsj(const void *a,const void *b){return strcmp((char *)a,(char *)b);}
int strsortfnckj(const void *a,const void *b){return strcmp((char *)b,(char *)a);}
void shuffledget(int x[],int n){
    srand(time(0));
    int i,b[524288],p,c;
    for(i=0;i<n;i++){
        b[i]=i;
    }
    for(i=n;i>=1;i--){
        p=rand()%i;
        c=b[i-1];b[i-1]=b[p];b[p]=c;
    }
    for(i=0;i<n;i++){
        scanf("%d",&x[b[i]]);
    }
}
long long ackermann(long long m,long long n){
  if(m==0){return n+1;}
  if(m==1){return n+2;}
  if(m==2){return 2*n+3;}
  if(m==3){return llpow(2,n+3)-3;}
}
int main()
{
  int n,k,i,j;
  char s[128][128]={0};
  scanf("%d%d",&n,&k);
  for(i=0;i<n;i++){scanf("%s",s[i]);}
  qsort(s,n,sizeof(s[0]),strsortfnckj);
  for(i=0;i<n;i++){printf("%s",s[i]);}
  printf("\n");
  return 0;
}

Submission Info

Submission Time
Task B - String Sorting
User wwz
Language C (GCC 5.4.1)
Score 100
Code Size 4038 Byte
Status AC
Exec Time 1 ms
Memory 252 KB

Compile Error

./Main.c:13: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:14: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:20: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:27: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 ‘shuffledget’:
./Main.c:60:9: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result]
         scanf("%d",&x[b[i]]);
         ^
./Main.c: In function ‘main’:
./Main.c:73:3: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result]
   scanf("%d%d",&n,&k);
   ^
./Main.c:74:20: warning: ignor...

Judge Result

Set Name All
Score / Max Score 100 / 100
Status
AC × 43
Set Name Test Cases
All 00_sample_1, 00_sample_2, 10_max_06, 10_max_07, 10_max_08, 10_max_09, 10_max_10, 10_min_00, 10_min_01, 10_min_02, 10_min_03, 10_min_04, 10_min_05, 10_rand_11, 10_rand_12, 10_rand_13, 10_rand_14, 10_rand_15, 10_rand_16, 10_rand_17, 10_rand_18, 10_rand_19, 10_rand_20, 10_rand_21, 10_rand_22, 10_rand_23, 10_rand_24, 10_rand_25, 10_rand_26, 10_rand_27, 10_rand_28, 10_rand_29, 10_rand_30, 10_rand_31, 10_rand_32, 10_rand_33, 10_rand_34, 10_rand_35, 10_rand_36, 10_rand_37, 10_rand_38, 10_rand_39, 10_rand_40
Case Name Status Exec Time Memory
00_sample_1 AC 1 ms 128 KB
00_sample_2 AC 1 ms 128 KB
10_max_06 AC 1 ms 128 KB
10_max_07 AC 1 ms 128 KB
10_max_08 AC 1 ms 252 KB
10_max_09 AC 1 ms 128 KB
10_max_10 AC 1 ms 128 KB
10_min_00 AC 1 ms 128 KB
10_min_01 AC 1 ms 128 KB
10_min_02 AC 1 ms 128 KB
10_min_03 AC 1 ms 128 KB
10_min_04 AC 1 ms 128 KB
10_min_05 AC 1 ms 128 KB
10_rand_11 AC 1 ms 128 KB
10_rand_12 AC 1 ms 128 KB
10_rand_13 AC 1 ms 128 KB
10_rand_14 AC 1 ms 128 KB
10_rand_15 AC 1 ms 128 KB
10_rand_16 AC 1 ms 252 KB
10_rand_17 AC 1 ms 128 KB
10_rand_18 AC 1 ms 128 KB
10_rand_19 AC 1 ms 128 KB
10_rand_20 AC 1 ms 252 KB
10_rand_21 AC 1 ms 128 KB
10_rand_22 AC 1 ms 128 KB
10_rand_23 AC 1 ms 128 KB
10_rand_24 AC 1 ms 128 KB
10_rand_25 AC 1 ms 128 KB
10_rand_26 AC 1 ms 128 KB
10_rand_27 AC 1 ms 128 KB
10_rand_28 AC 1 ms 128 KB
10_rand_29 AC 1 ms 128 KB
10_rand_30 AC 1 ms 128 KB
10_rand_31 AC 1 ms 128 KB
10_rand_32 AC 1 ms 128 KB
10_rand_33 AC 1 ms 252 KB
10_rand_34 AC 1 ms 128 KB
10_rand_35 AC 1 ms 128 KB
10_rand_36 AC 1 ms 128 KB
10_rand_37 AC 1 ms 128 KB
10_rand_38 AC 1 ms 128 KB
10_rand_39 AC 1 ms 128 KB
10_rand_40 AC 1 ms 128 KB