Source_Code
stringlengths
69
484k
IR_Original
stringlengths
2.05k
17.9M
#pragma region kyopuro_templates #include<stdio.h> #include<stdlib.h> #include<math.h> #include<string.h> #include<stdbool.h> #include<assert.h> #include<time.h> #include<ctype.h> typedef long long ll; typedef long double ld; #define rep(i,l,r)for(ll i=(l);i<(r);i++) #define repp(i,l,r,k)for(ll i=(l);i<(r);i+=(k)) #def...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_353664/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_353664/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_AVL_set = type...
#include<stdio.h> int main (void){ int a,b,c; scanf("%d%d%d",&a,&b,&c); if((a==1&&b==1)||c==1)printf("Open\n"); else printf("Close\n"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_353707/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_353707/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...
#define _CRT_SECURE_NO_WARNINGS ////#define _USE_MATH_DEFINES #include<stdio.h> //#include<stdlib.h> //#include<math.h> //#include<string.h> //#include<time.h> #define P(type,x) fprintf(stdout,"%"#type"\n",x) int main() { int a,b,c; fscanf(stdin, "%d%d%d", &a, &b, &c); if (c || (a&&b)) puts("Open"); else puts("Clo...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_353765/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_353765/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" @stdin = external local_unn...
#include<stdio.h> int main(void) { int b1,b2,b3; scanf("%d %d %d",&b1,&b2,&b3); if(b1==1 && b2==0 && b3==0) { printf("Close\n"); } if(b1==0 && b2==1 && b3==0) { printf("Close\n"); } if(b1==1 && b2==1 && b3==0) { printf("Open\n"); } if(b1==0 && b2==0 && b3==1) { printf("Open\n"); } if(b1==0 && b2==0 &...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_353815/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_353815/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 b1,b2,b3; scanf("%d %d %d",&b1,&b2,&b3); if(b1==1 && b2 ==0 && b3==0) puts("Close"); if(b1==0 && b2 ==1 && b3==0) puts("Close"); if(b1==1 && b2 ==1 && b3==0) puts("Open"); if(b1==0 && b2 ==0 && b3==1) puts("Open"); if(b1==0 && b2 ==0 && b3==0) puts("Close"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_353866/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_353866/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 <float.h> #include <limits.h> #include <math.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <time.h> // 内部定数 #define D_STR_MAX 200005 // 最大文字列数 #define D_STR_LEN 10 // 文字列長 // 内部変数 static FILE *szpFpI; // 入力 static char sc2Str[D_STR_MAX][D_STR_LEN + 5]; ...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_353923/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_353923/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...
#define _CRT_SECURE_NO_WARNINGS #include <stdio.h> int main(void) { int n; int max = 0; int a[2][100]; int i, j; int sum[2] = { 0 }; int sum0; scanf("%d", &n); for (i = 0; i < 2; ++i){ for (j = 0; j < n; ++j){ scanf("%d", &a[i][j]); sum[i] += a[i][j]; } } sum0 = a[0][0] + sum[1]; for (i = 0; i < n;...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_353989/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_353989/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[200001]; int i,n,a,b; scanf("%s",s); n=strlen(s); for(i=0;i<n;i++) if(s[i]=='A'){ a=i; break; } for(i=0;i<n;i++) if(s[i]=='Z'){ b=i; } printf("%d",b-a+1); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_354052/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_354052/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 <stdbool.h> int main(void) { char s[300000]; int strat_a=0; int strat_z=0; bool flag = true; fgets(s, sizeof(s), stdin); for (int i=0; s[i] != '\n'; i++) { if (s[i] == 'A' && flag == true) { strat_a = i; flag = false; } if (s[i] == 'Z' && flag == false) ...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_354096/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_354096/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" @stdin = external local_unn...
#include <stdio.h> #include <string.h> int main(void) { char s[210000]; scanf("%s",s); int n=(int)strlen(s); int A=0; int Z=0; for(int i=0;i<n;i++){ if(s[i]=='A'){ A=i; break; } } for(int i=n-1;i>=0;i--){ if(s[i]=='Z'){ Z=i; ...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_354146/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_354146/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> struct zxf { long next[2]; long ans; }a[1000005]={{0},0}; long tot=0,b[1005]={0},tmp[1005]={0},x[1005][1005]={0},lenth[1005]={0},flag,t=0,hash[1005]={0},std[1005]={0}; void quick(long l,long r) { long i,j,t,tmp; i=l; j=r+1; t=(l+r)/2; while(i<j) { while(i<j && b[i]<b[t...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_35419/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_35419/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.zxf = type { [2 x i64...
#include <stdio.h> #define MAX 1004 int main(void) { int i; int vez[MAX]; int n; int maximum = 0; int pocet = 0; scanf("%d\n", &n); for (i = 0; i < MAX; i++){ vez[i] = 0; } int buf; for (i = 0; i < n; i++){ scanf("%d ", &buf); if (vez[buf] == 0){ pocet++; } ve...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_35424/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_35424/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> #include <math.h> #include <stdlib.h> int main(){ char s[200001]; int i,j; scanf("%s",s); for(i=0;i<strlen(s);i++){ if(s[i]=='A') break; } for(j=strlen(s)-1;j>=0;j--){ if(s[j]=='Z') break; } printf("%d\n",j-i+1); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_354283/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_354283/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[101]; scanf("%s", s); int cnt = 0; int l = strlen(s); for (int i = 0; i < l / 2; i++) { //printf("%c %c\n", s[i], s[l - i - 1]); if (s[i] != s[l - i - 1]) { cnt++; } } printf("%d", cnt); ...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_354326/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_354326/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> char s[101]; int main() { scanf("%s", s); int res=0; int n=strlen(s); for (int i=0;i<n;i++) { if(s[i]!=s[n-1-i]) res++; } printf("%d\n",res/2); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_354391/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_354391/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...
/* ABC146-B Takatan */ #include<stdio.h> #include<string.h> int main(void){ char string[101]; int count, length, i; count = 0; scanf( "%s" , string); length = strlen(string); for(i=0; i < length/2; i++){ if(string[i]!=string[length-1-i]){ count++; } } pri...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_354434/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_354434/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[10010]; int Len; int Cnt = 0; int Check; int Try; scanf("%s", S); Len = strlen(S); Check = Len % 2; if (Check == 0) { Try = Len / 2; } else { Try = (Len - 1) / 2 ; } for (int i = 0; i != Try; i++) { if (S[i] != S[Len - 1 - i]) { Cnt = C...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_354478/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_354478/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> char s[101]; int main(void) { scanf("%s", s); int res = 0; int n = strlen(s); for (int i = 0; i < n; i++) { if (s[i] != s[n - 1 - i]) res++; } printf("%d\n", res / 2); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_354520/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_354520/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 S[100]; int c = 0, n = 0; scanf("%s", S); while (S[n] != 0) { n++; } for (int i = 0; i < n / 2; i++) { if (S[i] != S[n - i-1]) c++; } printf("%d", c); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_354579/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_354579/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[101]; int ret, chg_num, len, i; ret = scanf("%s", S); len = strlen( S ); chg_num = 0; for ( i=0;i<len/2;i++ ) { if ( S[i] != S[len-i-1] ) chg_num++; } printf("%d\n", chg_num); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_354621/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_354621/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> #define mem(x,y) (x*)malloc(sizeof(x)*(y)); typedef struct _star { struct _star* more; struct _star* less; int x; int y; } star; int search(int x,int y,star* tree) { fprintf(stderr,"%d %d\n",x,y); while(1) { if(x == tree->x && y == tree->y) retur...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_354665/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_354665/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._star = type { ptr,...
#include<stdio.h> int main() { int n,ara[50],i,j,s=0,t=0; scanf("%d",&n); for(i=0;i<n;i++) { scanf("%d",&ara[i]); } for(i=0;i<n;i++) { if(i+1!=ara[i]) s++; else continue; } if(s>2) printf("NO\n"); else printf("YES\n"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_354715/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_354715/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,flag=0,i; scanf("%d",&n); int a[n],number[n]; if(2<=n<=50){ for(i=0;i<n;i++) { scanf("%d",&a[i]); number[i]=i+1; if(a[i]!=number[i]){ flag++; } } ...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_354759/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_354759/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; scanf("%d",&n); int p[n],i,cnt=0; for(i=0;i<n;i++){ scanf("%d",&p[i]); } for(i=0;i<n;i++){ if(p[i]!=i+1){ cnt++; } } if(cnt<3){ printf("YES\n"); }else{ printf("NO\n"); } return 0; ...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_354801/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_354801/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,p[51],t,i,j; scanf("%d", &n); for(i=1; i<=n; i++) scanf("%d", &p[i]); for(i=1; i<n; i++) { if(i!=p[i]) { for(j=i+1; j<=n; j++) { if(i==p[j]) { t=p[i]; p[i]=p[j]; p[j]=t; break; } } break; } } for(i=1; i<=n; i++) { if(i...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_354845/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_354845/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, p[51], a, b = 0; scanf("%d", &n); for(a = 1; a <= n; a++){ scanf("%d", &p[a]); } for(a = 1; a <= n; a++){ if(p[a] != a){ b++; } } if(b == 0 || b == 2){ printf("YES"); }else{ printf("NO"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_354889/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_354889/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, N,count=0; scanf("%d",&N); int a[50]; for (i=0;i<N;i=i+1){ scanf("%d",&a[i]);} for (i=0;i<N;i=i+1){ if(a[i]==i+1) {count=count+1; }} if(count>=N-2){ printf("YES"); } else{printf("NO"); } }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_354946/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_354946/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 N,M; int main() { int i; scanf("%d %d",&N,&M); if(M<10){ for(i=1 ; i<=N ; i++) printf("%d",M); puts(""); } if(N==1 && M==10) { printf("-1\n"); return 0; } if(M==10){ printf("1"); for(i=2 ; i<=N ; i++) printf("0"); puts(""); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_35499/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_35499/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> typedef struct{ int index; int value; } Diff; int main() { int N,i; scanf("%d", &N); int p[N],diffnum=0; Diff diff[N]; for(i=0;i<N;i++){ scanf("%d", &p[i]); if(p[i]!=i+1){ diff[diffnum].index=i; diff[diffnum].value=p[i]; diffnum++; } } if(diffnum==0){ ...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_355031/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_355031/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.Diff = type { i32, ...
#include <stdio.h> int main(void){ int N, p[55], c, i; scanf("%d", &N); c=0; for (i=1; i<=N; i++) { scanf("%d", &p[i]); if (p[i]==i) c++; } if (c==N || c==N-2) printf("YES"); else printf("NO"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_355075/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_355075/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[4][4]={}; int B[101]={}; int i=0,j=0,N=0,num=0,BOOL=0; for(i=1;i<=3;i++){ for(j=1;j<=3;j++){ scanf("%d",&A[i][j]); } } scanf("%d",&N); for(i=1;i<=N;i++){ scanf("%d",&B[i]); } for(num=1;num<=N;num++) {for(i=1;i<=3;i++) {for(j=1;j<=3;j++) { if(A[i][j]==B[nu...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_355118/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_355118/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 bingo[3][3],i,j,k,l; for(i=0;i<3;i++){ for(j=0;j<3;j++){ scanf("%d",&bingo[i][j]); } } scanf("%d",&l); int num[l]; for(i=0;i<l;i++){ scanf("%d",&num[i]); } for(i=0;i<3;i++){ for(j=0;j<3;j++){ for(k=0;k<l;k++){ if(bingo[i][j]==num[...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_355169/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_355169/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 <limits.h> #include <string.h> #define ll long long int int main(void) { int grid[3][3]; for (int i=0; i<3; i++) { for (int j=0; j<3; j++) scanf("%d",&grid[i][j]); } int count = 0; int N; scanf("%d",&N); ...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_355211/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_355211/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<math.h> #include <string.h> int main() { int i, j, k; long long int l = 0; int m, g = 0, n, q, b; int f = 0; int a[5][5]; scanf("%d %d %d", &a[1][1], &a[1][2], &a[1][3]); scanf("%d %d %d", &a[2][1], &a[2][2], &a[2][3]); scanf("%d %d %d", &a[3][1], &a[3][2], &a[3][3]); scanf("%d",...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_355305/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_355305/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> #include <math.h> int acs(const void *a, const void *b) { return *(int*)a - *(int*)b; } /* 1,2,3,4.. */ int des(const void *a, const void *b) { return *(int*)b - *(int*)a; } /* 8,7,6,5.. */ int cmp_char(const void *a, const void *b) { return *(char*)a -...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_355349/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_355349/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[9] = {0}; int n; int b = 0; for(int i=0; i<9; i++){ scanf("%d", &a[i]); } scanf("%d", &n); for(int j=0; j<n; j++){ scanf("%d", &b); for(int k=0; k<9; k++){ if(a[k] == b){ a[k] = 0; } } } if(a[0]+a[1]+a[2] == 0 || a[3]+a[4]+a[5] == 0 || a[6]+a[7]+a[8] ==...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_355392/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_355392/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...
#define __USE_MINGW_ANSI_STDIO 0 #include <stdio.h> static inline void swap(int *a, int *b) { int tmp = *a; *a = *b; *b = tmp; return; } int solve(int n, int m) { // WLOG n < m if (n > m) { swap(&n, &m); } // if (n == 0) { return 0; } else if (n == 1) { return m / 3 + (m % 3 != 0); } else if (n == 2)...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_35545/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_35545/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() {long long int a; float b; scanf("%lld %f",&a,&b); printf("%lld\n",(a*(int)(100*b+0.5))/100); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_355493/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_355493/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 <stdlib.h> #include <string.h> #include <math.h> #include <stdio.h> int compare(const void *a,const void *b){ if(*(long long *)a>*(long long *)b)return 1; return -1; } int main(int argc, const char * argv[]) { unsigned long long a; scanf("%llu",&a); char b[5]; scanf("%s",b); unsigne...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_355536/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_355536/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 T; long long u, v; long long x, y; scanf("%d", &T); while (T--) { scanf("%I64d %I64d", &u, &v); x = u * u; y = -v * v; printf("%I64d %I64d\n", x, y); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_35558/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_35558/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> typedef long long ll; int main() { ll a; int d = 1; ll ans = 0; char b[5]; scanf("%lld%s", &a, b); int nb[3]; nb[0] = b[3] - '0'; nb[1] = b[2] - '0'; nb[2] = b[0] - '0'; for (int i = 0; i < 3; i++) { ans += nb[i] * a * d; d *= 10; } printf("%lld\n", ans / 100); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_355622/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_355622/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> #include<math.h> #define FOR(n) for(int i=0;i<n;i++) #define FORJ(n) for(int j=0;j<n;j++) #define PRN(n) printf("%d\n",n) #define PRF(n) printf("%lf\n",n) #define PRL(n) printf("%lld\n",n) #define PRS(s) printf("%s\n",s) #define PRC(c) printf("%c",c) #define mod 1...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_355666/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_355666/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(){ char a,b,c,d,e,f; scanf("%c%c%c%c%c%c",&a,&b,&c,&d,&e,&f); if((c == d && e == f)&&(a != b)) { printf("Yes"); } else{ printf("No"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_355723/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_355723/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 count = 0; char S[6]; scanf("%s",S); if(S[2] == S[3] && S[4] == S[5]){ printf("Yes\n"); } else { printf("No\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_355767/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_355767/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 x[500000]; scanf("%s",x); int len = strlen(x); int a[26]; for(int i=0;i<26;i++) a[i]=0; for(int i=0;i<len;i++){ int val = (int)x[i]-97; int flag=0; for(int x=0;x<val;x++){ if(a[x]){ flag=1; break; } } a[val]=1; if(flag) printf("Ann\...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_35581/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_35581/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() { char s[6]; scanf("%s",&s); if(s[2]==s[3] && s[4]==s[5]){ printf("Yes");} else printf("No"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_355853/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_355853/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(){ char n[7]; scanf("%s",n); if(n[2]==n[3] && n[4]==n[5]){ printf("Yes\n"); } else{ printf("No\n"); } }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_355910/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_355910/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(){ char s[6]; scanf("%s",s); if(s[2]==s[3] && s[4]==s[5]){ printf("Yes"); }else printf("No"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_355954/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_355954/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 text[6]; scanf("%s",&text); if(text[2] == text[3] && text[4] == text[5]) printf("Yes"); else printf("No"); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_356003/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_356003/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 S[5]; scanf("%s", S); if(S[2] == S[3] && S[4] == S[5]){ printf("Yes"); }else{ printf("No"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_356047/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_356047/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() { char s[10]; int i=0; scanf("%s",s); if(s[2]==s[3]&&s[4]==s[5]) printf("Yes\n"); else printf("No\n"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_356104/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_356104/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> int main(void) { char S[6]; scanf("%s",S); if(S[2]==S[3] && S[4]==S[5]){ puts("Yes"); } else{ puts("No"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_356148/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_356148/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 argc, char const *argv[]) { char s[6]; scanf("%s",s); int a=2; int b=3; int c=4; int d=5; if( s[a]==s[b] && s[c]==s[d]){ printf("Yes\n"); } else{ printf("No\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_356199/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_356199/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(){ char str[7]; scanf("%s",&str); if(str[2]==str[3] && str[4]==str[5]){ printf("Yes\n"); } else{ printf("No\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_356256/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_356256/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 merge(long int arr[],long int l,long int m,long int r) ; void mergeSort(long int arr[], long int l,long int r) ; int main() { int t; scanf("%d",&t); while(t--) { int n; scanf("%d",&n); long long int as[n]; //long long int asr[n]; short bs[n]; for(int i =0;i<n;i++){ scanf("%...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_3563/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_3563/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> int main(){ char s[7]; scanf("%s",s); if((s[2]==s[3])&&(s[4]==s[5])){ printf("Yes\n"); return 0; } printf("No\n"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_356342/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_356342/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(){ char s[7]; scanf("%s",s); if(s[2]==s[3]&&s[4]==s[5]){ puts("Yes"); } else puts("No"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_356386/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_356386/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,i,j,s; for(;;){ scanf("%d",&n); if(n==0)break; int p=0; for(i=1;i<n;i++){ s=i; for(j=1;n>s;j++){ s += i+j; if(s==n)p++; } } printf("%d\n",p); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_356429/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_356429/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 query; int i,start,sum; int count; while(1) { scanf("%d",&query); if(query==0)break; count=0; start=0; sum=0; for(i=1;i<query;i++) { sum+=i; while(sum>query)sum-=start++; if(sum==query)count++; } printf("%d\n",count); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_356472/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_356472/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 i,j; int ymd[100][3], n, y3=590, date; scanf("%d", &n); for(i=0; i<n; i++) { for(j=0; j<3; j++) { scanf("%d", &ymd[i][j]); } } for(i=0;i<n;i++) { date = 0; date += ((ymd[i][0]-1)/3)*y3; switch(ymd[i][0]%3){ case 2: date += 195; ...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_356515/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_356515/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, y, m, d; int year_sum[1024] = {0}; int month_sum[16] = {0}; int sum = 0; int i; for(i = 1; i < 1024; i++) { if(i % 3 == 0) year_sum[i] = 20 * 10 + year_sum[i - 1]; else year_sum[i] = 20 * 5 + 19 * 5 + year_sum[i - 1]; } for(i = 1; i < 16; i++) { if(i % 2 ==...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_356580/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_356580/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> long long gcd(long long a,long long b){ return b ? gcd(b,a % b) : a; } int check(long long a,long long b,long long c,long long d){ if(a < b || d < b)return 0; if(c + 1 >= b)return 1; long long g = gcd(b,d); return (a - c - 1) / g - (a - b) / g <= 0; } int main() { int t; l...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_356638/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_356638/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...
/* AtCoder XXX 000 */ #include <stdio.h> int main(void){ unsigned long long n,k; unsigned long long i; unsigned long long cnt; scanf("%llu %llu",&n,&k); cnt=0; if(k==0) { printf("%llu\n",n*n); return 0; } for(i=1; i<=n; i++){ if(i>k) { cnt += (i-k)*(n-n%i)/i; ...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_356681/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_356681/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<math.h> typedef struct{ double x; double y; }vertex; void kock(int,vertex,vertex); int main() { int n; vertex p1={0,0},p2={100,0}; scanf("%d",&n); if(n > 6 || n < 0) return 0; printf("%.8lf %.8lf\n",p1.x,p1.y); kock(n,p1,p2); printf("%.8lf %.8lf\n",p2.x,p2.y); ...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_356724/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_356724/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> void koch(int n, double p1_x, double p1_y, double p2_x, double p2_y); int main() { int n; double p1[2], p2[2]; p1[0] = 0; p1[1] = 0; p2[0] = 100; p2[1] = 0; scanf("%d", &n); printf("%f %f\n", p1[0], p1[1]); koch(n, p1[0], p1[1], p2[0]...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_356768/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_356768/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 <math.h> typedef struct{ double x; double y; } Point; void kock(int,Point,Point); int main(){ int n; Point p1; Point p2; p1.x = 0.0; p1.y = 0.0; p2.x = 100.0; p2.y = 0.0; scanf("%d",&n); printf("%f %f\n",p1.x,p1.y); kock(n,p1,p2); printf("%f %f\n",p2.x,p2.y); ...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_356810/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_356810/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> #include <ctype.h> #include <math.h> //============================================================================ #define pred(x) ((x)-1) #define succ(x) ((x)+1) //============================================================================ //===============...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_356854/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_356854/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" @d = dso_local local_unname...
#include <stdio.h> #include <math.h> typedef struct { double x; double y; } point; int kock(int n, point p1, point p2) { point s, u, t; double rad = 60 * M_PI / 180; if (n == 0) return n; else { s.x = (2.0 * p1.x + 1.0 * p2.x) / 3.0; s.y = (2.0 * p1.y + 1.0 * p2.y) / 3.0; t.x = (1.0 * p1.x + ...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_356898/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_356898/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 <math.h> typedef struct{ double x; double y; }Point; void koch(int,Point,Point); int main ( void ){ int num; scanf("%d" , &num ); Point a = {0.0, 0.0}; Point b = {100.0, 0.0}; printf("%.8f %.8f\n" , a.x , a.y ); koch( num , a , b ); printf("%.8f %.8f\n" , b.x ...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_356940/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_356940/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> typedef struct a{ double x; double y; }Point; void koch(int,Point,Point); int main(){ Point p1,p2; int n; p1.x =0; p1.y = 0; p2.x =100; p2.y = 0; scanf("%d",&n); printf("%f %f\n",p1.x,p1.y); koch(n,p1,p2); printf("%f %f\n",p2.x,p2.y); return 0; } void koch(int n, Point p1...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_356999/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_356999/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 <math.h> #define ld long double typedef struct {ld x, y;} Vector; ld rad = 3.141592653589793 * 60.00000000 / 180.00000000; void koch(int d, Vector p1, Vector p2) { if (d == 0) return; Vector s, u, t; s.x = (2.0*p1.x + 1.0*p2.x) / 3.0; s.y = (2.0*p1.y + 1.0*p2.y) / 3.0; ...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_357048/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_357048/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.Vector = type { x86...
#include <stdio.h> #include <math.h> #define X 0 #define Y 1 void kock(int n,double p1[2],double p2[2]) { if(n==0)return; double s[2],t[2],u[2],cs,sn; s[X]=(2.0*p1[X]+p2[X])/3.0; s[Y]=(2.0*p1[Y]+p2[Y])/3.0; t[X]=(p1[X]+2.0*p2[X])/3.0; t[Y]=(p1[Y]+2.0*p2[Y])/3.0; sn=sqrt(3)/2.0; cs=1.0/2.0; u[X]=(t[X]...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_357091/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_357091/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<math.h> typedef struct {double x, y;}Point; void koch(int, Point, Point); int main(){ Point a, b; int n; scanf("%d",&n); a.x=0; a.y=0; b.x=100; b.y=0; printf("%.8f %.8f\n",a.x,a.y); koch(n,a,b); printf("%.8f %.8f\n",b.x,b.y); return 0; } void koch(int n, Point a...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_357134/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_357134/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 <math.h> typedef struct { double x; double y; }xy; void kock(int,xy,xy); int main(){ xy p1 = {0.0, 0.0},p2 = {100.0, 0.0}; int n; scanf("%d",&n); if(n < 0 || n > 6)return 0; printf("%.8lf %.8lf\n",p1.x,p1.y); kock(n,p1,p2); printf("%.8lf %.8lf\n",p2.x,p2.y); ...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_357178/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_357178/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 <math.h> struct Point{double x , y;}; void koch(int n ,struct Point a ,struct Point b){ if(n == 0)return; struct Point s , t , u; double th = M_PI * 60.0 / 180.0; s.x = (2.0 * a.x + 1.0 * b.x) / 3.0; s.y = (2.0 * a.y + 1.0 * b.y) / 3.0; t.x = (1.0 * a.x + 2.0 * b.x) / 3.0; t.y =...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_357228/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_357228/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<math.h> typedef struct{ double x; double y; }POINT; void koch(int,POINT,POINT); int main(){ POINT a,b; int n; scanf("%d",&n); a.x = 0; a.y = 0; b.x = 100; b.y = 0; printf("%.8f %.8f\n",a.x,a.y); koch(n,a,b); printf("%.8f %.8f\n",b.x,b.y); return 0; } void koch(in...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_357271/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_357271/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<math.h> struct Point{double x,y;}; void koch(int n, struct Point a, struct Point b){ if(n == 0) return; struct Point s, t, u; double th = M_PI * 60.0 / 180.0; s.x = (2.0 * a.x + 1.0 * b.x) / 3.0; s.y = (2.0 * a.y + 1.0 * b.y) / 3.0; t.x = (1.0 * a.x + 2.0 * b.x) / 3.0; t.y = ...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_357336/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_357336/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 t; scanf("%d",&t); while(t--) { int n,flag=0; scanf("%d",&n); int a[n]; for(int i=0;i<n;i++) scanf("%d",&a[i]); for(int i=0;i<n;i++) { for(int j=i+1;j<n;j++) { if(a[i]>a[j]) { int h=a[i]; a[i]=a[j]; a[j]=h; } } } for(int i=0;i<n-...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_35738/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_35738/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 asc(const void* a, const void* b) { return *(int*)b - *(int*)a; } int main() { int n; int i, j; int count[30]; int a[30]; char c[102]; int x; int max; for (;;) { scanf("%d", &n); if (n == 0) return 0; for (i = 0; i < n; i++) { scanf("%c", &c[i]); if (c...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_357422/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_357422/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> typedef long long ll; int main(){ ll x; scanf("%lld",&x); ll ans; if(x%11ll==0ll){ ans=x/11ll; ans*=2ll; } else{ ans=x/11ll; ans*=2ll; x%=11ll; if(x<=6ll){ ans+=1ll; } else{ ans+=2ll; } } printf("%lld\n",ans); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_357473/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_357473/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...
//(5)6565656ってくりかえす #include <stdio.h> int main(void){ unsigned long long int x,ans,rui; scanf("%lld",&x); ans=0; ans=x/11; ans*=2; rui=(ans/2)*11; if(x-rui>=1 && x-rui<=6){ ans+=1; }else if(x-rui>=7){ ans+=2; } printf("%lld\n",ans); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_357516/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_357516/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> void merge(long long int arr[],long long int l,long long int m,long long int r) { long long int i, j, k; long long int n1 = m - l + 1; long long int n2 = r - m; /* create temp arrays */ int L[n1], R[n2]; /* Copy data to temp arrays L[] and R[] ...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_35756/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_35756/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> //nonZeroを昇順にソート マージソート long int tmp[200000]; void mergeSort(long int x[], int left, int right) { long int mid, i, j, k; if (left >= right) return; mid = (left+right)/2; mergeSort(x, left, mid); mergeSort(x, mid+1, right); for (i = left; i <= mid; i++) tmp[i] = x[i]; for (i = mid ...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_357602/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_357602/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> int min(int a, int b) { if (a < b) { return a; } else { return b; } } int max(int a, int b) { if (a > b) { return a; } else { return b; } } int dp[5005][5005]; int main() { int N; char S[5005]; scanf("%d",&N); scanf("%s",S); int i, j; for (i = N - 1; i >= 0; i--) { for (j = N - ...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_357646/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_357646/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,test,n,arr1[51],arr2[51],min1=1000000001,min2=1000000001; long long int move=0; scanf("%d",&test); while(test--) { scanf("%d",&n); for(i=0;i<n;i++) { scanf("%d",&arr1[i]); if(min1>arr1[i]) ...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_35769/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_35769/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() { long long int t,i,n,mo,mc,m,cd,od; scanf("%lld",&t); while(t>0) { m=0; scanf("%lld",&n); long long int c[n],o[n]; for(i=0; i<n; i++) { scanf("%lld",&c[i]); } for(i=0; i<n; i++) { ...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_35774/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_35774/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 p[55],c[55]; int main(){ int i,j,n,r,x; while(1){ scanf("%d%d",&n,&r); if(n==0)break; for(i=0;i<r;i++)scanf("%d%d",&p[i],&c[i]); x=1; for(i=r-1;i>=0;i--){ if(x<=c[i]){ x=p[i]+x-1; }else if(c[i]<x && x<c[i]+p[i]){ x-=c[i]; } //printf(" %d\n",x); } printf("%d\n",n...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_357798/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_357798/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> char SS[101]; void Henkan(char); int main() { int i,j,n; char S[101]; scanf("%d",&n); for(i=0;i<n;i++){ scanf("%s",S); scanf("%s",SS); for(j=strlen(S)-1;j>=0;j--){ Henkan(S[j]); } printf("%s\n",SS); } return 0; } void Henkan(char SSS){ int i;...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_357840/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_357840/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> #include <stdlib.h> #include <assert.h> #define BUF_SIZE 30 int get_int2(int *a1, int *a2) { #ifdef BUF_SIZE char line[BUF_SIZE]; if(!fgets(line, BUF_SIZE, stdin)) return -1; sscanf(line, "%d %d", a1, a2); #else #error #endif return 0; } struct list { struct list *n...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_357891/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_357891/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.list = type { ptr, ...
#include <stdio.h> #include <string.h> char str1[1000],str2[1000]; int C[1001][1001]; void LongestCommonSub(){ int len1,len2,i,j,max=-1; len1=strlen(str1); len2=strlen(str2); for(i=0;i<=len1;i++) C[i][0]=0; for(j=0;j<=len2;j++) C[0][j]=0; for(i=1;i<=len1;i++){ for(j=1;j<=len2;j++){ if(st...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_357934/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_357934/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" @str1 = dso_local global [1...
#include<stdio.h> #include<string.h> int LCS(char *x, char *y){ int i, j, m, n, c[1002][1002]; m = strlen(x); n = strlen(y); for(i = 0; i <= m; i++){ for(j = 0; j <= n; j++){ if(i == 0 || j == 0) c[i][j] = 0; if(x[i] == y[j]) c[i+1][j+1] = c[i][j] + 1; ...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_358012/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_358012/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 LCSLength(char *,char *); int main(){ int q,i; char X[1000]; char Y[1000]; int LCS[150]; scanf("%d",&q); for(i=0;i<q;i++){ scanf("%s",X); scanf("%s",Y); LCS[i]=LCSLength(X,Y); } for(i=0;i<q;i++){ printf("%d\n",LCS[i]); } return 0; } int L...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_358056/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_358056/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> #define N 1001 void count(char *A,char *B){ int i,j,x[N][N]; for(i=0; i<N; i++){ for(j=0; j<N; j++){ x[i][j]=0; } } for(i=0; i<strlen(A); i++){ for(j=0; j<strlen(B); j++){ if(A[i]==B[j])x[i+1][j+1]=x[i][j]+1; else if(x[i...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_358106/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_358106/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 1010 #define max(a,b) ((a<b)?b:a) char s[MAX], t[MAX]; int dp[MAX][MAX]; int LCS() { int n = strlen(s); int m = strlen(t); memset(dp,0,sizeof dp); int i,j,maxi=0; for(i=0;i<n;i++) { for(j=0;j<m;j++) { if( i ) dp[i][j] = max(dp[i][j],dp[i-1][j...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_358207/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_358207/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" @s = dso_local global [1010...
#include<stdio.h> #include<string.h> #define SIZE 1001 int lcs(char* s1, char* s2){ int len1, len2; int c[SIZE][SIZE]; int i, j; int max=0; len1 = strlen(s1); len2 = strlen(s2); for(i=0;i<=len1;i++) for(j=0;j<=len2;j++) c[i][j]=0; for (int i = 0; i < len1; i++){ for (int j = 0; j < len2; j++){ ...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_358258/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_358258/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 N 1007 char X[N],Y[N]; int c[N][N]; int L[N]; int m,n; int LCSlength(char *,char *); int main(){ int i,j,num; scanf("%d",&num); for(i=0;i<num;i++){ scanf("%s",X+1); scanf("%s",Y+1); L[i] = LCSlength(X,Y); } for(i=0;i<num;i++){ prin...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_358300/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_358300/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 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_358344/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_358344/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> #include <stdlib.h> char str1[1001],str2[1001]; int c[1001][1001]; void LCSLength(int m,int n){ int i,j; for(i=1;i<=m;i++)c[i][0] = 0; for(j=0;j<=n;j++)c[0][j] = 0; for(i=1;i<=m;i++){ for(j=1;j<=n;j++){ if(str1[i-1] == str2[j-1]) c[i][j] = c[i-1][j-1] + 1; ...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_358395/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_358395/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" @c = dso_local local_unname...
#include <stdio.h> #include <string.h> #define MAX 1000 #define max(a,b) (a < b ? b : a) int main() { int Q, i, j, l1, l2, dp[MAX+1][MAX+1]; char X[MAX+1], Y[MAX+1]; scanf ( "%d", &Q ); while (Q--) { scanf ( "%s %s", X, Y ); l1 = strlen (X); l2 = strlen (Y); memset ( dp, 0, sizeof(dp) ); for ( i = 0 ; i...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_358445/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_358445/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> char s1[2000]; char s2[2000]; int LCS(int,int); int main(){ int sumstring; int i,j,k; scanf("%d",&sumstring); for(i = 0; i < sumstring; i++){ scanf("%s",s1); scanf("%s",s2); printf("%d\n",LCS(strlen(s1),strlen(s2))); } return 0; } int LCS(int length1, i...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_358496/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_358496/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...