Skip to content

Instantly share code, notes, and snippets.

@theintel
Created March 12, 2018 20:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save theintel/b0b819855f01d51866b66f3fdb41be4a to your computer and use it in GitHub Desktop.
Save theintel/b0b819855f01d51866b66f3fdb41be4a to your computer and use it in GitHub Desktop.
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.
#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;
}
#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