/##.c
Created
March 12, 2018 20:35
Simplified C template for contest programming. There are two versions: #.c for problems without testcases and ##.c for problems with testcases. Additionally, there's a basic timer to get the execution time.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include"stdio.h" | |
#include"string.h" | |
#include"math.h" | |
#include"stdlib.h" | |
#include"ctype.h" | |
#include"limits.h" | |
#include"time.h" | |
#include"stdbool.h" | |
#define ll long long | |
/* | |
int qualitysort(const void *a, const void *b) | |
{ | |
if(*(ll *)a > *(ll *)b) | |
return 1; | |
if(*(ll *)a < *(ll *)b) | |
return -1; | |
return 0; | |
} | |
*/ | |
int main() //for problems with testcases | |
{ | |
clock_t lnh=clock(); | |
int t,d=1; | |
scanf("%d",&t); | |
while(t--) | |
{ | |
ll n,c=0,i,j; | |
scanf("%lld",&n); | |
//ll a[n]; | |
//for(i=0;i<n;scanf("%lld",&a[i++])); | |
//qsort(a,n,sizeof(ll),qualitysort); | |
//for(i=0;i<n;i++) | |
printf("Case %d: ",d++); | |
printf("%lld",c); | |
printf("\n"); | |
} | |
clock_t cls=clock(); | |
//printf("Execution Time: %fms\n",(double)((cls-lnh)*1000)/CLOCKS_PER_SEC); | |
return 0; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include"stdio.h" | |
#include"string.h" | |
#include"math.h" | |
#include"stdlib.h" | |
#include"ctype.h" | |
#include"limits.h" | |
#include"time.h" | |
#include"stdbool.h" | |
#define ll long long | |
/* | |
int qualitysort(const void *a, const void *b) | |
{ | |
if(*(ll *)a > *(ll *)b) | |
return 1; | |
if(*(ll *)a < *(ll *)b) | |
return -1; | |
return 0; | |
} | |
*/ | |
int main() //for problems free of testcases :) | |
{ | |
clock_t lnh=clock(); | |
ll n,c=0,i,j; | |
scanf("%lld",&n); | |
//ll a[n]; | |
//for(i=0;i<n;scanf("%lld",&a[i++])); | |
//qsort(a,n,sizeof(ll),qualitysort); | |
//for(i=0;i<n;i++) | |
printf("%lld",c); | |
printf("\n"); | |
clock_t cls=clock(); | |
//printf("Execution Time: %fms\n",(double)((cls-lnh)*1000)/CLOCKS_PER_SEC); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment