Source_Code
stringlengths
69
484k
IR_Original
stringlengths
2.05k
17.9M
#include <stdio.h> #include <string.h> #include <math.h> #include <stdlib.h> int main(){ long long int x,count=0,ans=0; scanf("%ld",&x); ans = 2 * (x / 11); if(x % 11 == 0){ printf("%lld",ans); return 0; } if(x % 11 > 6){ printf("%lld",ans+2); return 0; } ...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_357480/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_357480/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_add...
#include<stdio.h> void ashi(int p0[2],int p1[2],int p2[2],double *x,double *y){ int x1=p1[0]-p0[0],x2=p2[0]-p0[0],y1=p1[1]-p0[1],y2=p2[1]-p0[1]; *x=1.0*(x1*x2+y1*y2)/(x1*x1+y1*y1)*x1+p0[0]; *y=1.0*(x1*x2+y1*y2)/(x1*x1+y1*y1)*y1+p0[1]; } int main(){ int p[3][2],n; double x,y; for(n=0;n<4;n++)scanf("%d",&p[n/...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_357523/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_357523/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_add...
#include <stdio.h> #include <stdlib.h> struct horieyui { int value, count; }; int cmp_int(const void* x, const void* y) { int a = *(const int*)x, b = *(const int*)y; return a < b ? -1 : a > b; } int cmp_horieyui(const void* x, const void* y) { int a = ((const struct horieyui*)x)->count, b = ((const struct horiey...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_357567/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_357567/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" %struct.horieyui = type { i...
#include<stdio.h> int main() { int t,i,j,b[101]; scanf("%d",&t); for(i=0;i<t;i++){ for(int k=0;k<101;k++){ b[k]=0; } int n,a,flag=0,num=0; scanf("%d",&n); for(j=0;j<n;j++){ scanf("%d",&a); b[a]++; } for(int k=1;k<101;k++){ num+=b[k]; if(num==n)break; if(b[k]!=0){ flag=1; }else ...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_35761/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_35761/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr ...
#include <stdio.h> int main(){ int N; char s[5010]; scanf("%d",&N);scanf("%s",s); int i,j,k,len=0; int cnt = 0; for(i=0;i<=N-1-len;i++){ for(j=i+len; j<=N-len;j++) { cnt = 0; for(k=0; i+k < j && j+k < N; k++){ if(s[i+k]==s[j+k])cnt++; else break; } if(len <cnt) len = cnt; } } p...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_357653/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_357653/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_add...
#include <stdio.h> void shuffle(int* fuda,int p,int c,int n){ int i; for (i=0; i<n; i++) { if (*(fuda+i)<p+c) { if (*(fuda+i)<p) { *(fuda+i)+=c; } else { *(fuda+i)-=(p-1); } } } }; int main(){ while (1) { int n...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_357697/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_357697/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_add...
#include <stdio.h> #include <stdlib.h> int yama[51]; void init_yama(int n){ int i,j; for(i=n,j=1;j<=n;i--,j++){ yama[j] = i; } return; } void cut(int p, int c){ int temp[50]; int i,j; for(i=1,j=0;i<=p-1;i++,j++){ temp[j]=yama[i]; } for(i=p,j=1;j<=c;i++,j++){ yama[j]=yama[i]; } for(i=c+1,j=0;j<p-1;...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_357747/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_357747/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @yama = dso_local local_unn...
/* be careful of cases "p=1" */ #include <stdio.h> #define N_MAX (50+1) /* ---------------------------------------------------------------------------- */ /* if no cards exist under the card "N", list[N] = 0. * otherwise, list[N] is value of the card just under "N". * list[0] indicates value of the card on the top...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_357804/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_357804/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @next = dso_local local_unn...
#include <stdio.h> #define REP(i,n,m) for(i=n;i<m;i++) #define rep(i,n) REP(i,0,n) int h,w; int mt[26][4]; //[i][0]:¶’[ [1]:‰E’[ [2]:ã’[ [3]:‰º’[ int used[26]; char t[54][54]; //(a+'A') ‚Ì•¶Žš‚ª (b+'B') ‚Ì•¶Žš‚æ‚è‘O‚É‚ ‚é‚©‚Ì”»’è //‚»‚Ì”»’è‚Æ“¯Žž‚É, a ‚ª’·•ûŒ`‚Å‚ ‚é‚©‚à”»’è‚·‚é int isFront(int a,int b){ int i,j; ...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_357855/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_357855/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @mt = dso_local local_unnam...
#include<stdio.h> #include<stdlib.h> struct abc{ int fr; int to; int c; }; int compare_int(const void *a,const void *b){ struct abc A=*(struct abc*)a; struct abc B=*(struct abc*)b; return A.fr-B.fr; } long long ans[200000]; struct abc ab[400000]; int list[200000],m; int f[200000]={0}; int dfs(int now,in...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_357899/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_357899/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" %struct.abc = type { i32, i...
#define _CRT_SECURE_NO_WARNINGS #include<stdio.h> #include<stdlib.h> #include<string.h> void LCS(char *x, char *y){ int m = strlen(x+1); int n = strlen(y+1); int i, j, **c; c = malloc(sizeof(int)*(2205)); for (i = 0; i <= m; i++) c[i] = malloc(sizeof(int)*(2205)); for (i = 0; i <= m; i++){ for (j = 0; j ...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_357949/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_357949/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_add...
#include <stdio.h> int pit_range(int n, int h[n], int *left, int *right) { for(int i = 1; i < n; i++) if(h[i - 1] < h[i]) { *right = i; for(int j = *right - 1; j >= 0; j--) if(h[j] >= h[i]) { *left = j + 1; return 1; } *left = 0; return 1; } return 0; } int pit_size(int n, int h[n]...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_35802/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_35802/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr ...
#include <stdio.h> #include <string.h> #define xyMAX 1001 #define qMAX 151 char x[xyMAX],y[xyMAX]; int lcs(char x[],char y[]){ int a,b,i,j; int c[xyMAX][xyMAX]; a = strlen(x); b = strlen(y); for(i=1; i<=a; i++) c[i][0] = 0; for(j=1; j<=b; j++) c[0][j] = 0; for(i=1; i<=a; i++){ for(j=1; j<=b; j++...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_358063/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_358063/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_add...
#include <stdio.h> #include <string.h> #define Length 1000 int LSCLength(char *,char*); int main(){ int i; int n; int match; char X[Length]; char Y[Length]; scanf("%d",&n); for(i=0;i<n;i++){ scanf("%s %s",X+1,Y+1); match = LSCLength(X ,Y); printf("%d\n",match); } return 0; } int LSC...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_358113/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_358113/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_add...
#include<stdio.h> #include<stdlib.h> #include<string.h> int max(int a, int b); int lcs( char *, char *, int, int); int main(){ char x[1001], y[1001]; int m, n, t, k, i; scanf("%d", &k); for(i = 0;i < k;i++){ scanf("%s %s", x, y); m = strlen(x); n = strlen(y); t = lcs( x, y, m, n ); pri...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_358157/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_358157/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_add...
#include <stdio.h> #include <string.h> int main(void){ int times,m,n,i,j,c[1001][1001]; char x[1001], y[1001]; scanf("%d",&times); while(times--){ scanf("%s",x); scanf("%s",y); m = strlen(x); n = strlen(y); for(i=1; i<=m; i++){ c[i][0] = 0; } for(j=0; j<=n; j++){ c[0]...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_358214/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_358214/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_add...
#include <stdio.h> #include <string.h> #define MAX 1001 int main() { int m, n, Number; int i, j; int A[MAX], B[MAX]; char x[MAX], y[MAX]; char XX; scanf("%d ", &Number); while (Number--) { scanf("%s %s ", x, y); m = strlen(x); n = strlen(y); for (i = 0; i < n+1; i++) { B[i] = A[i] = 0; } fo...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_358265/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_358265/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_add...
#include <stdio.h> #include <string.h> struct data { char x[1001], y[1001]; }; struct data a[150]; int LCS(char*,char*); int max(int, int); int main() { int q, i, c[150]; scanf("%d",&q); for(i = 0; i < q; i++) { scanf("%s %s",a[i].x,a[i].y); c[i] = LCS(a[i].x,a[i].y); } for(i = 0; i ...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_358308/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_358308/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" %struct.data = type { [1001...
#include <stdio.h> #include <string.h> #define N 1000 void cm(char a[] , char b[]); int max(int a , int b); int c[N+1][N+1]; int main() { char a[N]; char b[N]; int i , n; scanf("%d",&n); for(i = 1; i <= n; i++) { scanf("%s%s",a+1,b+1); a[0]=b[0]= ' '; cm(a,b); } } int max(int a , int b) { if(a < b)retu...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_358351/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_358351/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_add...
#include<stdio.h> #include<string.h> int lcs(char *x, char *y){ int c[1001][1001],i,j; int numberx = strlen(x)+1; int numbery = strlen(y)+1; int maxl=0,max=0; for(i=1;i<numberx;i++){ for(j=1;j<numbery;j++){ if(x[i-1]==y[j-1]) c[i][j]=c[i-1][j-1]+1; ...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_358401/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_358401/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_add...
#include<stdio.h> #include<string.h> int main(){ int t,x,y,len,r=0,u=0,l=0,d=0,flag1=0,flag2=0; char s[100010]; scanf("%d",&t); for(int i =0;i<t;i++){ int r=0,u=0,l=0,d=0,flag1=0,flag2=0; scanf("%d %d",&x,&y); scanf("%s",s); for(int x=0;s[x];x++){ if(s[x]=='L'...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_35846/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_35846/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr ...
#include <stdio.h> #include <string.h> int LCS(int,int); char X[1001],Y[1001]; int main(){ int n,i,j,len1,len2,result; scanf("%d", &n); for(i=0;i<n;i++){ scanf("%s",X); scanf("%s",Y); len1=strlen(X); len2=strlen(Y); //result=LCS(len1,len2); printf("%d\n",LCS(len1,len2)); } return 0; } ...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_358502/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_358502/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_add...
#include<stdio.h> int main(){ int n,k=0,i; for(i=0;i<5;i++){ scanf("%d",&n); if(n<40)n=40; k+=n; } printf("%d\n",k/5); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_358546/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_358546/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_add...
#include <stdio.h> int main(void) { int n[5]; int sa = 0; int i; for(i=0;i<5;i++) { scanf("%d",&n[i]); if(n[i]<40) n[i] = 40; sa += n[i]; } printf("%d\n",sa/=5); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_358597/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_358597/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_add...
#include <stdio.h> int main(void) { // your code goes here int t; scanf("%d",&t); while(t--) { int x,y,i=0,cu=0,cd=0,cr=0,cl=0; scanf("%d%d\n",&x,&y); char in[100001]; while(1) { scanf("%c",&in[i]); if(in[i]=='\n' || in[i]=='\0') break; if(in[i]=='U')cu...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_35864/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_35864/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr ...
#include <stdio.h> #include <string.h> int main() { int t[5], i, sum = 0; for (i = 0;i < 5;i++) { scanf("%d", &t[i]); if (t[i] < 40)t[i]=40; sum += t[i]; } printf("%d\n", sum / 5); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_358683/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_358683/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_add...
#include<stdio.h> int main(void) { int a,b,c,d,e,sum,aum,bum; sum=0; aum=0; bum=0; scanf("%d",&a); scanf("%d",&b); scanf("%d",&c); scanf("%d",&d); scanf("%d",&e); if(a<40){ sum=sum+40; } if(a>=40){ aum=aum+a; } if(b<40){ sum=sum+40; } if(b>=40){ aum=aum+b; } if(c<40){ sum=sum+40; } if(c>=4...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_358726/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_358726/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_add...
#include<stdio.h> int fun(int x,int y) { int a[10000]; int i,j,k,nx,ny,n=0; nx=x; ny=y; int cha; for(i=0;i<x;i++) scanf("%d",&a[i]); for(j=0;j<y;j++) { for(i=0;i<x-1;i++) { if(a[i]<a[i+1]){ a[i]++; break; } } if(i==x-1) { n++; break; } } if(n==0) printf("%d\n",i+1); el...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_35877/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_35877/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr ...
#include <stdio.h> int main(void){ int A1; int A2; int A3; scanf("%d %d %d",&A1,&A2,&A3); if(A1 <= A2 && A2 <= A3){ printf("%d",(A2 - A1) + (A3 - A2)); } else if(A1 <= A3 && A3 <= A2){ printf("%d",(A3 - A1) + (A2 - A3)); } else if(A2 <= A1 && A1 <= A3){ printf("%d",(A1 - A2) ...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_358834/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_358834/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_add...
#include <stdio.h> #include <stdlib.h> int maxi(int a,int b,int c); int mini(int a,int b,int c); int main(void){ int a,b,c; int max,min; scanf("%d %d %d",&a,&b,&c); max=maxi(a,b,c); min=mini(a,b,c); printf("%d\n",abs(max-min)); return 0; } int maxi(int a,int b,int c){ int max; max=a; if(b>=max){max=b...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_358878/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_358878/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_add...
#include<stdio.h> int main() { int n[3],i,j; for(i=0;i<3;i++) scanf("%d",&n[i]); for(i=0;i<3;i++) for(j=i;j<3;j++) { if(n[i]<n[j]) { int temp=n[i]; n[i]=n[j]; n[j]=temp; } } // printf("%d %d %d",a[0],a[1],a[2]); int res=(n[0...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_358920/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_358920/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_add...
#include<stdio.h> int main() { int a[3],i,j,res=0; for(i=0;i<3;i++) scanf("%d",&a[i]); for(i=0;i<2;i++) { for(j=i+1;j<3;j++) { if(a[i]>a[j]) { int temp = a[i]; a[i]=a[j]; a[j] = temp; } } } res = a[1]-a[0]; res = res+(a[2]-a[1]); printf("%d\n",res); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_358979/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_358979/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_add...
#include<stdio.h> int main(void){ int a[3]; int i,j,tmp,max; int s[3]; for(i=0;i<3;i++){ if(scanf("%d",&a[i]) == 1); } for(i=0;i<3;i++){ for(j=i+1;j<3;j++){ if(a[i]<a[j]){ tmp = a[i]; a[i] = a[j]; a[j] = tmp; } } ...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_359028/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_359028/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_add...
#include <stdio.h> #include <stdlib.h> #include <math.h> #include <time.h> int max(int a, int b){ if(a > b){ return a; }else{ return b; } } int min(int a, int b){ if(a < b){ return a; }else{ return b; } } int main(){ int a, b, c; scanf("%d%d%d", &a, ...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_359086/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_359086/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_add...
#include<stdio.h> int main(void){ char map[110][110]={{0}}; int x,y,i,j,k,sun; scanf("%d %d",&y,&x); for(i=0;i<y;i++){ for(j=0;j<x;j++){ scanf(" %c",&map[j][i]); } } for(i=0;i<y;i++){ for(j=0;j<x;j++){ sun=0; for(k=j;k>=0;k--){ ...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_359143/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_359143/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_add...
#include <stdio.h> int M,N; char hata[1000][1001],niko[2][3],tmp[4] = "JOI"; int check(int y,int x){ int i,j; if(x < 0 || y < 0 || y+1 >= M || x+1 >= N) return 0; for(i = 0;i < 2;i++){ for(j = 0;j < 2;j++){ if(hata[y+i][x+j] != niko[i][j]){ return 0; } } } return 1; } int main(void) { int ...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_359194/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_359194/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @tmp = dso_local local_unna...
#include <stdio.h> #include <string.h> int main(void) { int n, k; scanf("%d %d", &n, &k); int data[n]; for (int i = 0; i < n; i++) { data[i] = 0; } int d; for (int i = 0; i < k; i++) { scanf("%d", &d); for (int j = 0; j < d; j++) { int ...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_359237/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_359237/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_add...
#include <stdio.h> int main() { int n,k,i,j,temp,snack; scanf("%d %d",&n,&k); int snukes[n]; for(i=0;i<n;i++) snukes[i]=1; for(i=0;i<k;i++) { scanf("%d",&temp); for(j=0;j<temp;j++) { scanf("%d",&snack); snukes[snack-1]=0; } } ...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_359288/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_359288/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_add...
#include<stdio.h> int main() { int i; int j; int N; int K; int OKASHI[101]; int OKASHI_dare[1000]; int OKASHI_kazu; int tmp_dare[1000]; int count=0; for(i=1;i<N+1;i++){ OKASHI[i]=0; tmp_dare[i]=0; } scanf("%d %d",&N,&K); for(i=1;i<K+1;i++){ scanf("%d",&OKASHI_kazu); for(j=1;j<OKASHI_kazu+1;j++){ scanf("%d ",&tm...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_359330/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_359330/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_add...
#include<stdio.h> #include<string.h> int main() { int n, k, i, j, a[101] = { 0 },num=0,m,q; scanf("%d%d", &n, &k); for (i = 0; i < k; i++) { scanf("%d", &m); for (j = 0; j < m; j++) { scanf("%d", &q); a[q] = 1; } } for (i = 0; i <= 100; i++) { num += a[i]; } printf("%d", n - num); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_359374/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_359374/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_add...
#include<stdio.h> int main(void){ int N,K,di,i,j,A,sum=0; scanf("%d %d",&N,&K); int S[N]; for(i=0;i<N;i++){ S[i]=0; } for(i=1;i<=K;i++){ scanf("%d",&di); for(j=0;j<di;j++){ scanf("%d",&A); S[A-1]=S[A-1]+1; } } for(i=0;i<N;i++){ if(S[i]==0){ sum=sum+1; } } printf("%d\n",sum); return 0; } ...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_359424/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_359424/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_add...
#include<stdio.h> int main(void) { int n,k; scanf("%d%d",&n,&k); int a[n]; int d,tmp; int count = 0; for(int i=0; i<n; i++){ a[i]=0; } for(int i=1; i<=k; i++){ scanf("%d",&d); for(int j=1; j<=d; j++){ scanf("%d",&tmp); a[tmp-1]++; } } for(int i=0; i<n; i++){ if(a...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_359468/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_359468/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_add...
#include<stdio.h> int main(){ int n,k; scanf("%d %d",&n,&k); int arr[n]; int i=0; while(i<n){ arr[i]=0;i++; } int t=k; while(t--){ int d; scanf("%d",&d); while(d--){ int l; scanf("%d",&l); arr[l-1]++; } }int...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_359510/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_359510/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_add...
#include <stdio.h> int main(void) { int X, A, B; int N; int i; int asumikana; if (scanf("%d%d%d", &X, &A, &B) != 3) return 1; asumikana = X; if (scanf("%d", &N) != 1) return 1; for (i = 0; i < N; i++) { char S[16]; if (scanf("%15s", S) != 1) return 1; switch (S[0]) { case 'n': asumikana += A; break; ...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_359561/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_359561/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_add...
#include<stdio.h> #include<stdlib.h> #include<string.h> typedef struct node{ int key; struct node *next,*prev; }*NodePointer; NodePointer tamesi; NodePointer listSearch(int key){ NodePointer cur=tamesi->next; while(cur != tamesi ){ //if ( cur == tamesi ) break; if(cur->key==key) re...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_359604/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_359604/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" %struct.node = type { i32, ...
#include<stdio.h> #include<stdlib.h> #include<string.h> struct node{ unsigned int key; struct node *next; struct node *prev; }; typedef struct node * NodePointer; NodePointer nil; NodePointer listSearch( int key ) { NodePointer cur = nil->next; while( cur != nil && cur->key != key ) { cur = cur->next; } re...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_359655/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_359655/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" %struct.node = type { i32, ...
#include <stdio.h> #include <string.h> #include <stdlib.h> #define N 2000000 struct node { int key; struct node *next; struct node *prev; }; struct node *head = NULL; struct node *last = NULL; struct node *current = NULL; int isEmpty(){ return head == NULL; } int length(){ int length = 0; stru...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_359699/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_359699/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" %struct.node = type { i32, ...
#include <stdio.h> #include <string.h> #include <stdlib.h> struct Node{ int x; struct Node *prev; struct Node *next; }; void insert(int); void delete(int); void deleteFirst(); void deleteLast(); void display(); void release(); struct Node head; int main(void){ int n; char input[20]; int inputx; head....
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_359749/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_359749/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" %struct.Node = type { i32, ...
#include<stdio.h> #include<stdlib.h> int main(){ int m, n, i, j, t, count1, count2, max, maxi; scanf("%d", &t); while(t--){ int **a, *row, *col; count1=0; count2=0; scanf("%d%d", &m, &n); row=(int *)malloc(m*sizeof(int)); col=(int *)malloc(n*sizeof(int)); ...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_3598/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_3598/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr co...
#include <stdio.h> #include <stdlib.h> #include <string.h> struct node{ int key; struct node *next; struct node *prev; }; typedef struct node * NodePointer; NodePointer nil; void insert(int keydata){ NodePointer x; x = malloc(sizeof(struct node)); x->key = keydata; x->next = nil->n...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_359842/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_359842/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" %struct.node = type { i32, ...
#include <string.h> #include <stdio.h> #include <stdlib.h> struct Node { int key; struct Node *prev; struct Node *next; }; struct Node *note; void insert(int key) { struct Node *x = (struct Node *)malloc(sizeof(struct Node)); x->key = key; note->next->prev = x; x->next = note->next; ...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_359893/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_359893/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" %struct.Node = type { i32, ...
#include <stdio.h> #include <stdlib.h> #include <string.h> struct Node { int key; struct Node *next, *prev; }; struct Node *nil; // リストの初期化 void init() { nil = (struct Node *)malloc(sizeof(struct Node)); nil->prev = nil; nil->next = nil; } void insert(int key) { struct Node *x = (struct Node *)malloc(si...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_359936/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_359936/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" %struct.Node = type { i32, ...
#include<stdio.h> #include<stdlib.h> #include<string.h> struct node{ unsigned int key; struct node *next; struct node *prev; }; typedef struct node * NodePointer; NodePointer nil; NodePointer listSearch(int key){ /* your code */ } void init(){ nil = malloc(sizeof(struct node)); nil->next = nil; nil->...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_359987/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_359987/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" %struct.node = type { i32, ...
#include<stdio.h> #include<stdlib.h> #include<string.h> struct node{ unsigned int key; struct node *next; struct node *prev; }; typedef struct node * NodePointer; NodePointer nil; NodePointer listSearch(int key){ NodePointer cur = nil->next; while (cur != nil){ if (key == cur->key){ ...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_360035/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_360035/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" %struct.node = type { i32, ...
#include<stdio.h> #include<stdlib.h> #include<string.h> typedef struct node{ int num; struct node *left; struct node *right; }node; node * makenode(int x){ node *new=malloc(sizeof(node)); new->right=NULL; new->left=NULL; new->num=x; return new; } int main(){ int n,i,x; char com[13]; node *front=NULL; ...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_360079/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_360079/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" %struct.node = type { i32, ...
#include <stdio.h> int p,q; int a[9999999]; int main() { int n; scanf("%d",&n); while(n--){ char st[99]; scanf("%s",st); if(st[0]=='i')scanf("%d",a+q++); else if(st[6]==0){ int t; scanf("%d",&t); for(int idx=q-1;idx>=p;idx--)if(a[idx]==t){ a[idx]=-1; break; } }else if(st[6]=='F')wh...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_360121/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_360121/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_add...
#include<stdio.h> #include<stdlib.h> struct node{int n;struct node *np,*pp;}; struct node *fp=NULL,*ep,*n,*nfp,*nep; int N,t,a; char cmd[15]; void del(struct node*dp) { struct node *nnp=dp->np; struct node *npp=dp->pp; npp->np=nnp; nnp->pp=npp; free(dp); } int main() { scanf("%d\n",&N); for(;N--;) { scanf("...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_360165/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_360165/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" %struct.node = type { i32, ...
#include <stdio.h> #include <string.h> #include <stdlib.h> struct node{ unsigned int key; struct node *next; struct node *prev; }; typedef struct node * NodePointer; NodePointer nil; NodePointer listSearch(int key){ /* your code */ NodePointer cur = nil->next; while( cur != nil && cur->key != key ){ cur...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_360208/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_360208/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" %struct.node = type { i32, ...
#include<stdio.h> #include<stdlib.h> #include<string.h> struct node{ int key; struct node *next; struct node *prev; }; typedef struct node * NodePointer; void insert(int); NodePointer listSearch(int); NodePointer make1node(); void deleteNode(NodePointer); void deleteFirst(); void deleteLast(); void delete(int)...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_360251/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_360251/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" %struct.node = type { i32, ...
#include<stdio.h> #include<stdlib.h> #include<string.h> struct node{ unsigned int key; struct node *next; struct node *prev; }; typedef struct node * NodePointer; NodePointer nil; NodePointer listSearch(int key){ /* your code */ struct node *cur=nil->next; while(cur!=nil && cur->key!=key){ cur=cur->next...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_360295/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_360295/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" %struct.node = type { i32, ...
#include <stdio.h> #include <stdlib.h> #include <string.h> struct node{ unsigned int key; struct node *next; struct node *prev; }; typedef struct node * NodePointer; NodePointer nil; NodePointer listSearch(int key){ NodePointer cur = nil->next; while(cur != nil && cur->key != key) { cur = cur->next; } ...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_360338/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_360338/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" %struct.node = type { i32, ...
#include <stdio.h> #include <stdlib.h> #include <string.h> typedef struct _Node { int key; struct _Node *next, *prev; } Node; Node *nil; Node* listSearch(int key) { Node *cur = nil->next; while(cur != nil && cur->key != key) { cur = cur->next; } return cur; } void init(void) { nil = (Node *)malloc...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_360389/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_360389/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" %struct._Node = type { i32,...
#include<stdio.h> #include<stdlib.h> #include<string.h> struct Node{ int key; struct Node *next,*prev; }; struct Node *nil; struct Node* listSearch(int key){ struct Node *cur=nil->next; while(cur != nil && cur->key != key){ cur = cur->next; } return cur; } void init(){ nil=(struct Node *)malloc(siz...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_360431/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_360431/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" %struct.Node = type { i32, ...
#include<stdio.h> #include<stdlib.h> #include<string.h> struct node{ unsigned int key; struct node *next; struct node *prev; }; typedef struct node * NodePointer; NodePointer nil; NodePointer listSearch(int key){ NodePointer cur= nil->next; while(cur!=nil && cur->key!=key){ cur=cur->next; } return...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_360475/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_360475/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" %struct.node = type { i32, ...
#include <stdio.h> #include <stdlib.h> typedef struct Node { int x; struct Node *prev; struct Node *next; } Node; Node *head, *tail; void dump() { int l = 0; Node *p = head; while (p != NULL) { if (l == 0) printf("%d", p->x); else printf(" %d", p->x); ++l; p = p->next; } printf("\n"...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_360518/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_360518/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" %struct.Node = type { i32, ...
#include<stdio.h> #include<stdlib.h> #include<string.h> struct node{ struct node *prev; struct node *next; long key; }; typedef struct node * NP; NP MN(long); void IN(NP); void DN(NP); void FI(long); NP dummy; int main(){ long int val,i,n; char op[12]; NP roop; scanf("%ld",&n); dummy = MN(0); f...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_360561/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_360561/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" %struct.node = type { ptr, ...
#include <stdio.h> int main(void) { int d_num,now_d; int n; int height[100]; int i; int u_max,d_max; int now; scanf("%d",&d_num); for(now_d=0;now_d<d_num;now_d++) { scanf("%d",&n); for(i=0;i<n;i++)scanf("%d",&height[i]); u_max=d_max=0; for(i=1;i<n;i++) { if(height[i]>height[i-1]) { now=height[i]...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_360611/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_360611/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_add...
#include <stdio.h> #define N 100001 typedef struct{ int parent; int left; int right; } Node; void getDepth(int,int); int depth[N]; Node T[N]; int main(){ int i,j,u,n,deg,id,k,sibling ,left,x,right,r; scanf("%d",&n); for(i = 0; i < n; i++){ T[i].parent = -1; T[i].left = -1; T[i]....
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_360655/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_360655/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" %struct.Node = type { i32, ...
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ /* * File: main.c * Author: Ivan * * Created on July 9, 2018, 3:45 PM */ #include <stdio.h> #include <stdlib.h> #define MAX 1...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_360699/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_360699/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" %struct.Node = type { i32, ...
#include <stdio.h> #include <stdlib.h> struct Node{ int depth; int p;//parent int l,r; } ; struct Node *tree; int main(){ int i,j,n,d,id,c,a,x,y; scanf("%d",&n); tree = malloc(sizeof(struct Node)*n); for(i=0;i<n;i++){ tree[i].p = tree[i].l = tree[i].r = -1; } for(i=0;i<n;i++){ scan...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_360749/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_360749/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" %struct.Node = type { i32, ...
#include <stdio.h> #define MAX 100005 #define NIL -1 typedef struct { int p, l, r;} Node; Node T[MAX]; int n, D[MAX]; void print(int u) { int i,c; printf("node %d: ",u); printf("parent = %d, ",T[u].p); printf("depth = %d, ",D[u]); if( T[u].p == NIL ) printf("root, "); else if( T[u].l == NIL ) printf("l...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_360806/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_360806/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" %struct.Node = type { i32, ...
#include <stdio.h> #include <string.h> #define N 131072 typedef struct { int parent; int child; int sibling; int depth; } node_t; void dfs(node_t *array, int id, int d) { int child; if (id == -1) return; array[id].depth = d; for (child = array[id].child; child != -1; child = array[child].sibling...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_360879/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_360879/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" %struct.node_t = type { i32...
#include <stdio.h> #define N 100000 #define NIL -1 typedef struct node{ int id; //??????????????? int k; //??????????????° int left; //??????????????????????????????????????? int sibling; //left???????????????????????£????????????(??????) int parent; //??? int depth; //??????????????±??? ...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_360936/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_360936/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" %struct.node = type { i32, ...
#include<stdio.h> #include<stdlib.h> #include <string.h> #define MAX 100001 typedef struct { int parentno; int depth; char type[20]; int *children; int degree; } node ; node x[MAX]; int countDepth(node y, int depth){ if(y.parentno == -1) return depth; return countDepth(x[y.parentno],depth+1); } int...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_360987/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_360987/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" %struct.node = type { i32, ...
#include <stdio.h> #include <stdlib.h> typedef struct node{ int p; int right; int left; }Node; Node *node,tmp; int main(){ int n,i,j,l,c,k,id,tmpP,depth,r; //in scanf("%d",&n); node = malloc(sizeof(Node)*n); //initialize for(i=0;i<n;i++){ node[i].p = -1; node[i].right = -1;...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_361036/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_361036/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" %struct.node = type { i32, ...
#include<stdio.h> #define N 100000 #define NIL -1 struct Node{ int p, l, r; }; struct Node T[N]; int n, H, D[N]; int getDepth(int); void print(int); int main(){ int i, j, d, v, c, l; scanf("%d", &n); for ( i = 0; i < n; i++ ){ T[i].p = NIL; T[i].l = NIL; T[i].r = NIL; } for ( i = 0; i ...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_361087/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_361087/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" %struct.Node = type { i32, ...
#include<stdio.h> int main() { int t,j; scanf("%d",&t); for(j=0;j<t;j++) { long long x,y,n,m,p; scanf("%lld %lld %lld",&x,&y,&n); m=n/x; p=m*x+y; if(p<=n) printf("%lld\n",p); else { m=m-1; ...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_36113/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_36113/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr ...
#include <stdio.h> #define MAX 100005 #define NIL -1 typedef struct { int p, l, r;} Node; Node T[MAX]; int n, D[MAX]; void print(int u) { int i,c; printf("node %d: ",u); printf("parent = %d, ",T[u].p); printf("depth = %d, ",D[u]); if( T[u].p == NIL ) printf("root, "); else if( T[u].l == NIL ) printf("l...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_361173/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_361173/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" %struct.Node = type { i32, ...
/* left-child,right-sibling representation */ #include<stdio.h> #include<stdlib.h> typedef struct{ int p; //parent int l; //left_child int r; //right_sibling }Node; int main(void){ int now_id,depth_cnt,n,k,c; int i,j; Node *node; scanf("%d",&n); node=(Node*)malloc(n*sizeof(Node)); for(i=0;i<n;i++){ no...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_361223/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_361223/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" %struct.Node = type { i32, ...
#include <stdio.h> typedef struct { int p,l,r; } Node; Node Tree[100000]; int dep(int); int PrintChild(int); void Print(int); int main() { int n; int i=0,j; int c,id,k; int pre; scanf("%d",&n); while(i<n){ Tree[i].p = -1; Tree[i].l = -1; Tree[i].r = -1; i++; } i...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_361267/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_361267/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" %struct.Node = type { i32, ...
#include<stdio.h> int x,y,n,c; int main() { int t; scanf("%d",&t); while(t--){ scanf("%d%d%d",&x,&y,&n); c=(n/x)*x+y; while(c>n) c-=x; printf("%d\n",c); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_36131/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_36131/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr ...
#include<stdio.h> #define MAX 100005 #define NIL -1 void print(int); struct Node { int p,l,r; }; struct Node Tree[MAX]; int depth(int,int); int Depth[MAX]; int main(){ int h,i,j,nu,dep,c,l,r; scanf("%d",&h); for(i=0;i<h;i++){ Tree[i].p = Tree[i].l = Tree[i].r = NIL; } for(i=0;i<h;i++){ ...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_361353/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_361353/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" %struct.Node = type { i32, ...
#include <stdio.h> typedef struct{ int parent; int depth; int l,r; }Node; Node node[100001]; int rec(int,int); int main(){ int n,k; int id,c,l,r,a; int i,j; scanf("%d",&n); for(i=0;i<n;i++){ node[i].parent = node[i].l = node[i].r = -1; } for(i=0;i<n;i++){ scan...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_361397/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_361397/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" %struct.Node = type { i32, ...
#include <stdio.h> int main(void) { // your code goes here int t; scanf("%d",&t); while(t--) { int x,y,n,p,r,q; scanf("%d%d%d",&x,&y,&n); p=n/x; r=n%x; if(r>=y) { q = p*x+y; } else { q=(p-1)*x+y; } printf("%d\n",q); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_36144/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_36144/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr ...
#include<stdio.h> #define MAX 100005 #define NIL -1 typedef struct{ int parent; int left; int right; }node; node T[MAX]; int n, D[MAX]; void print(int u){ int i, c; printf("node %d: ", u); printf("parent = %d, ", T[u].parent); printf("depth = %d, ", D[u]); if(T[u].parent==NIL){ ...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_361483/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_361483/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" %struct.node = type { i32, ...
#include <stdio.h> #define MAX (100000 + 2) #define NIL (-1) struct node { int parent; int left_child; int right_brother; }; struct node T[MAX]; int D[MAX]; int get_depth(int id) { int depth = 0; while (T[id].parent != NIL) { id = T[id].parent; ...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_361526/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_361526/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" %struct.node = type { i32, ...
#include <stdio.h> int main() { int x,y,n,t,k; int i,j; scanf("%d",&t); for (i=0;i<t;i++) { scanf("%d %d %d",&x,&y,&n); k = n/x; k = k*x+y; if (k>n) k-=x; printf("%d\n",k); } }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_36157/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_36157/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr ...
#include<stdio.h> #define MAX 100005 #define NIL -1 struct Node_struct{int p, l, r;}; /*p: (parent), l: (left child), r:(right sibling)*/ typedef struct Node_struct Node; Node T[MAX]; int D[MAX]; void print(int u){ int i, c; printf("node %d: parent = %d, depth = %d, ", u, T[u].p, D[u]); if(T[u].p==NIL) prin...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_361612/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_361612/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" %struct.Node_struct = type ...
#include<stdio.h> struct Node_struct{int id, par, dep, child, sib;}; typedef struct Node_struct Node; Node node[200000]; void dfs(int pos, int dep){ node[pos].dep = dep; if(node[pos].child != -1) dfs(node[pos].child, dep + 1); if(node[pos].sib != -1) dfs(node[pos].sib, dep); } void prChilds(int pos, int init){...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_361663/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_361663/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" %struct.Node_struct = type ...
#include<stdio.h> #define MAX 100005 #define NIL -1 struct Node { int p, l, r; }; struct Node T[MAX]; int n, D[MAX]; void print(int u){ int i, c; printf("node %d: parent = %d, depth = %d, ", u, T[u].p, D[u]); if (T[u].p == NIL){ printf("root, "); } else if (T[u].l == NIL){ printf("leaf, "); } else...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_361706/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_361706/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" %struct.Node = type { i32, ...
#include <stdio.h> #include <string.h> int main() { char a[50]={0},b[50]={0}; int result=0,i,j,count; scanf("%s",a); scanf("%s",b); for(i=strlen(a)-strlen(b)+1;i>=0;i--) { count=0; for (j=i;j<strlen(b)+i;j++) { if (a[j]==b[j-i]||a[j]=='?') { ...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_361793/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_361793/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_add...
#include <stdio.h> #include <string.h> int main () { char s[51],t[51]; scanf("%s",s); scanf("%s",t); int slen = strlen(s),tlen = strlen(t),sp = slen; for(int i = slen - tlen;i >= 0;i--) { int check = 0; for(int j = 0;j < tlen;j++) { if(s[i + j] != t[j] && s[i+j] != '?') { check = 1; break; } } ...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_361836/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_361836/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_add...
#include<stdio.h> int rr(long long int x,long long int y,long long int n){ long long int p; p=n%x; if(p==y){ printf("%lld\n",n); return 0;} if(p<y){ printf("%lld\n",((n-x)+y-p)); return 0; } if(p>y){ printf("%lld\n",(n-p+y)); return 0; } } int main(){ long long int t; scanf("%lld",&t); while(t--){ long ...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_36188/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_36188/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr ...
#include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <string.h> #define SIZE 2000000 int main() { static int A[SIZE]; int H=0; int i, l, largest, tmp, n; static char com[21], buf[20]; buf[19]='\n'; char outbuf[4096]; int outlen=0; char *p; do { fgets(com, 20, stdin); if (*com ...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_361922/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_361922/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @main.A = internal unnamed_...
#include<stdio.h> int R=1,C=1,H[2000010],N[2000010]; int hyouka(int a,int b){ if(C<b)return 1; if(C<a||b==0)return 0; return N[H[a]]>N[H[b]]?1:0; } void hin(int a){ int i=C++; for(N[H[0]=R]=a;hyouka(0,i/2);i/=2)H[i]=H[i/2]; H[i]=R++; } int hout(){ int rt=H[1],i,j,k=H[--C]; for(i=1;hyouka(i,C);i=j)H[i]=H...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_361988/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_361988/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @R = dso_local local_unname...
#include <stdio.h> #define error -1 int size=0,list[2000000]; int parent(int i){ return i/2; } int Left(int i){ return 2*i; } int Right(int i){ return 2*i+1; } void maxHeapify(int i){ int left,right,largest,key; left=Left(i); right=Right(i); if(left<=size && list[left]>list[i]) larges...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_362037/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_362037/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @size = dso_local local_unn...
#include <stdio.h> #define N 2000000 #define INF (1<<30) int A[N+1], n; int parent(int i){ return i/2; } int left(int i){ return 2*i; } int right(int i){ return 2*i + 1; } void maxHeapify(int i){ int l, r, largest, temp; l = left(i); r = right(i); if(l <= n && A[l] > A[i]) largest = l; else large...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_362080/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_362080/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @n = dso_local local_unname...
#include<stdio.h> int main() { int n; scanf("%d", &n); if (n % 2 == 0) { int ans = 1; while (n > 0) { ans *= 2; n -= 2; } printf("%d\n", ans); } else printf("0\n"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_36216/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_36216/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr ...
#include<stdio.h> #include<stdlib.h> int R=1,C=1,H[2000010]={0},N[2000010]={2100000000}; void hin(int a){ int i=C++; for(N[R]=a;a>N[H[i/2]];i/=2) H[i]=H[i/2]; H[i]=R++; } int hout(){ int rt=H[1],nt=1,i=0,k=H[--C]; while(nt-i){ H[i=nt]=k; if(i*2 <C&&N[ k ]<N[H[i*2 ]]) H[i]=H[nt=i*2 ]; i...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_362224/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_362224/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @R = dso_local local_unname...
#include <stdio.h> int h=0,aa[2000000000]; void mh(int i){ int l,r,big,t; l = i*2; r = i*2 + 1; if(l<=h && aa[l]>aa[i])big = l; else big = i; if(r<=h && aa[r] > aa[big])big = r; if(big!=i){ t=aa[i]; aa[i]=aa[big]; aa[big]=t; mh(big); } } /* void bmh(void){ int i; for(i=h/2;1<=i...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_362275/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_362275/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @h = dso_local local_unname...