Source_Code
stringlengths
69
484k
IR_Original
stringlengths
2.05k
17.9M
#include<stdio.h> #include<math.h> int main() { int i, j, k; int n, m, h, g, a, b, c, d, l, r; int f = 0; int w; int aa[110000]; int bb[110000]; scanf("%d", &n); for (i = 0;i < n;i++) { scanf("%d", &aa[i]); } i = 0; bb[i] = 0; f = 0; w = 0; for (j = i;w < n;j++) { if (j < n) { } else { j = ...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_120023/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_120023/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 <stdbool.h> int main() { int n = 0, k = 0; scanf("%d %d\n", &n, &k); int raw[n+1]; char s[n+2]; fgets(s, n+2, stdin); int len_raw = 0; char c = 0; int i = 0; while (i < n) { raw[len_raw] = 0; while (...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_120067/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_120067/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 a,b,i; scanf("%d%d",&a,&b); for(i=0;a<=b;i++) { a=3*a; b=2*b; } printf("%d\n",i); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_12011/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_12011/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> char s[9]; char aa[9][9]={"SUN","MON","TUE","WED","THU","FRI","SAT"}; int main(){ scanf("%s",s); for(int i=0;i<7;i++)if(strcmp(aa[i],s)==0)printf("%d",7-i); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_120160/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_120160/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" @aa = dso_local global [9 x...
#include <stdio.h> int main(void){ char day[4]; int i; scanf("%s",day); if(day[0]=='S'){ if(day[1]=='U'){ i=7; }else{ i=1; } }else if(day[0]=='M'){ i=6; }else if(day[0]=='T'){ if(day[1]=='U'){ i=5; }else{ i=3; } }else if(day[0]=='W'){ i=4; }else{ i=2; } printf("%d",i); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_120225/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_120225/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<math.h> int main(void) { char day[5]; char week0[5] = "SUN" ; char week1[5] = "MON"; char week2[5] = "TUE"; char week3[5] = "WED"; char week4[5] = "THU"; char week5[5] = "FRI"; char week6[5] = "SAT"; scanf("%s", day); if (strncmp(day, week0, 3) == 0) pr...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_120276/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_120276/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" @__const.main.week0 = priva...
#include<stdio.h> int main(void) { char s[5]; scanf("%s",s); if(s[0]=='S' && s[1]=='U' && s[2] =='N') printf("%d",7); if(s[0]=='M' && s[1]=='O' && s[2] =='N') printf("%d",6); if(s[0]=='T' && s[1]=='U' && s[2] =='E') printf("%d",5); if(s[0]=='W' && s[1]=='E' && s[2] =='...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_120326/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_120326/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 i; char str1[3],str[7][4]={"SUN","MON","TUE","WED","THU","FRI","SAT"}; scanf("%s",str1); for(i=0;i<7;i++) { if(strcmp(str1,str[i])==0) break; } printf("%d",7-i); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_120377/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_120377/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" @__const.main.str = private...
#include<stdio.h> int main() { int i=0,a,b; scanf("%d%d",&a,&b); while(a<=b){ i++; a*=3; b*=2; } printf("%d",i); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_12042/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_12042/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,gap,stu[1000],result=0,i,j; while(1){ result=1000000; scanf("%d",&n); if(n == 0) break; for(i = 0; i < n; i++) scanf("%d",&stu[i]); for(i = 0; i < n-1; i++){ for(j = i+1; j < n; j++){ gap=stu[i]-stu[j]; if(gap < 0) gap *= -1; if(result > g...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_120470/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_120470/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<math.h> int main(void) { char nc[11]; scanf("%s",nc); int nlen; nlen = strlen(nc); int s=0,n=0,i,j; for(i=0;i<nlen;i++){ s += (nc[i]-'0'); n += (nc[i]-'0')*pow(10,(nlen-i)-1); } if(n%s==0) printf("Yes\n"); else printf("No\n"); return ...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_120520/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_120520/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 k, x; int sum = 0; scanf("%d", &k); x = k; while (k != 0){ if(k != 10){ sum = sum + k%10; k = k/10; } else { sum = sum + 1; k = 0; } } if (x%sum == 0){ printf("%s\n", "Yes"); }...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_120564/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_120564/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,purna,nadu,priya; scanf("%d",&nadu); n=nadu; priya=0; while(n!=0){ purna=n%10; n=n/10; priya=priya+purna;} if(nadu%priya==0){ printf("Yes\n");} else{ printf("No\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_120607/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_120607/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 m,i,n,sum; scanf("%d",&n); m = n; while(n){ sum += n%10; n = n/10; } //printf("%d ",sum); if(m%sum==0){ printf("Yes\n"); }else{ printf("No\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_120658/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_120658/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,sum=0,n1; scanf("%d",&n);n1=n; while(n1!=0){sum=sum+(n1%10);n1=n1/10;} if(n%sum==0){printf("Yes\n");}else{printf("No\n");} return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_120700/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_120700/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> #define LINE_BUF_SIZE 1024 int line_sum(char s[]) { int n = 0; while (*s != '\n') { n += (int)*s++ - 48; } return n; } int main() { char line[LINE_BUF_SIZE]; int n; if (fgets(line, sizeof(line), stdin) != NULL) { ...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_120744/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_120744/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(){ int n,k,s,i; scanf("%d",&n); s=0; k=n; for(i=0;i<11;i++){ s=s+n%10; n=n/10; } if(k%s==0) printf("Yes"); else printf("No"); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_120795/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_120795/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, n2, sn=0; scanf("%d", &n); n2 = n; while(n2){ sn += n2 % 10; n2 /= 10; } if(n % sn == 0) printf("Yes\n"); else printf("No\n"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_120838/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_120838/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) { int N, S = 0; scanf("%d", &N); for (int i = N; i > 0; i /= 10) S += i % 10; if (N % S == 0) printf("Yes\n"); else printf("No\n"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_120881/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_120881/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) { long n,m,k; scanf("%ld %ld %ld", &n, &m, &k); long a[n],b[m]; for (long i = 0; i < n; i++) { scanf("%ld", &a[i]); } for (long i = 0; i < m; i++) { scanf("%ld", &b[i]); } long sum_a[n],sum_b[m]; sum_a[0] = a[0]; for (long i = 1; i < n; i++) { sum_a[i]...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_120946/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_120946/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 main() { int n,b,a,max,i; scanf("%d%d%d",&n,&b,&a); max=a; int seg[n]; for (i=0;i<n;scanf("%d",&seg[i++])); for (i=0;i<n;i++) { if (seg[i]==0&&a>0) a--; else if (seg[i]==0&&a==0&&b>0) b--; else if (seg[i]==1&&b>0&&a<max) ...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_12099/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_12099/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 <math.h> #include <string.h> #define ll long long #define rep(i,l,r) for(ll i=(l);i<(r);i++) #define max(p,q) ((p)>(q)?(p):(q)) #define min(p,q) ((p)<(q)?(p):(q)) #define abs(p) ((p)>=(0)?(p):(-(p))) int cmp(const void *a, const void *b); int main(void){ ll N, ANS=300...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_121031/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_121031/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 <limits.h> #include <math.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <time.h> // 内部定数 #define D_HUMAN_MAX 300000 // 最大人数 // 内部変数 static char sc1Human[D_HUMAN_MAX + 5]; // 人 static int siHCnt; // 人数 static int si1W[D_HUMAN_MAX + 5]; // 西側の西向きの人数 sta...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_121075/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_121075/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" @si1W = internal unnamed_ad...
#include<stdio.h> #include<stdlib.h> #define N 100005 long long fun(long long [],long long ); int cmp(const void *,const void *); int cmp(const void *a,const void *b) { return *(int *)a-*(int *)b; } long long fun(long long a[],long long n) { long long i; long long cnt[3]={0},t=0; qsort(a,n,sizeof(a[i]),...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_121118/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_121118/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 compare_int(const void *a, const void *b) { return *(int*)b - *(int*)a; } int main(){ int n,i,c=0; long long int a,b,data[100000]={0}; scanf("%d",&n); for(i=0;i<n;i++){ scanf("%lld",&data[i]); } qsort(data, n, sizeof(long long int), compare_int); for(i=0;i<n;i...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_121161/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_121161/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 <stdbool.h> #include <stdio.h> #include <string.h> #define S 100 int my_min(int a, int b) { if (a >= b) { return b; } else { return a; } } int main(void) { int k, n; char c, s[S+2]; // +2 for newline and null bool is_same_char, has_same_odd_char; fgets(s, S+1, st...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_121204/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_121204/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<stdlib.h> #define NEW(p,n){p=malloc((n)*sizeof(p[0]));if(p==NULL){printf("not enough memory\n");exit(1);};} //pの型の変数n個の要素分のメモリを確保し、そのアドレスをpに代入するマクロ #define MAX(a, b) ((a) > (b) ? (a) : (b)) #define MIN(a, b) ((a) < (b) ? (a) : (b)) /* //S[0]から始まる文字列の長さを求める関数 int string_len(char* str){ ...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_121248/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_121248/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" @ans = dso_local local_unna...
#include <stdio.h> int check753(int s){ int n,seven=0,five=0,three=0; while(seven==0||five==0||three==0){ if(s==0) return 0; n=s%10; s/=10; if(n==7){ seven=1; }else if(n==5){ five=1; }else if(n==3){ three=1; } } ...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_121299/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_121299/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]=""; int i=0; scanf("%s",s); if(s[0]==s[1]&&s[2]==s[3]){ if(s[0]==s[2]&&s[0]==s[3]) puts("No"); else puts("Yes"); } else if(s[0]==s[2]&&s[1]==s[3]){ if(s[0]==s[1]&&s[0]==s[3]) puts("No"); else puts("Yes"); } else if(s[0]==s[3]&&s[1]==s[2]){ ...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_121341/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_121341/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]; scanf("%s", &s); if (s[0] == s[1] && s[0] != s[2] && s[2] == s[3]) puts("Yes"); else if (s[0] == s[2] && s[0] != s[1] && s[1] == s[3]) puts("Yes"); else if (s[0] == s[3] && s[0] != s[1] && s[1] == s[2]) puts("Yes"); else puts("No"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_121385/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_121385/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[4]; scanf("%s",a); int i,j,c=0; for(i=0;i<4;i++) for(j=i+1;j<4;j++) { if(a[i]==a[j]) c++; } if(c==2) printf("Yes"); else printf("No"); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_121428/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_121428/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){ char s[10]; int i,j,count; scanf("%s",s); for(i=0;i<strlen(s);i++){ count = 0; for(j=0;j<strlen(s);j++){ if(s[i]==s[j]) count++; } if(count!=2){ printf("No\n"); return 0; } } printf("Yes\n"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_121471/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_121471/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 cnt = 0; char s[10]; rewind(stdin); scanf("%s",s); if(s[0]==s[1]){ cnt++; } if(s[0]==s[2]){ cnt++; } if(s[0]==s[3]){ cnt++; } if(s[1]==s[2]){ cnt++; } if(s[1]==s[3]){ cnt++; } if(s[2]==s[3]){ cnt++; ...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_121521/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_121521/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<stdlib.h> int compare_int(const void *a, const void *b) { return *(int*)a - *(int*)b; } int main(){ int i,j,k; int A[4]; char S[5]; scanf("%s",S); for(i=0;i<4;i++) A[i] = (int)S[i]; qsort(A,4,sizeof(int),compare_int); if(A[0] == A[1] && A[2] == A[3] && A[1] != A[2]) ...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_121565/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_121565/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[4]; scanf("%s", s); for (int i = 0; i < 3; i++){ for (int j = 0; j < 3 - i; j++){ if(s[j] > s[j + 1]){ int tmp = s[j]; s[j] = s[j + 1]; s[j + 1] = tmp; } //printf("%s\n", s);...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_121622/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_121622/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 in[5]; scanf("%s", in); char a = in[0]; char b = 0; for(int i = 0; i < 4; i++){ if(a != in[i]){ b = in[i]; break; } } if(b == 0){ printf("No\n"); return 0; } int c1 = 0, c2 = 0; for(int i = 0; i < 4; i++){ if(a == in[i])c1++; if(b == in[i])c2++; } i...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_121680/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_121680/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[4]; scanf("%s",s); int i,c[27]={0}; for(i=0;i<4;i++)c[s[i]-'A']++; for(i=0;i<27;i++){ if(c[i]==2||c[i]==0); else { puts("No"); return 0; } } puts("Yes"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_121723/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_121723/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 p[200010]={0}; int d[200010]={0}; int S[200010];//サイズ用配列 未実験 int Top(int a){ for(;p[a]-a;a=p[a]); return a; } int Find(int a,int b){ int n,r; for(r=Top(a);p[a]!=a;a=n){ n=p[a]; p[a]=r; } for(r=Top(b);p[b]!=b;b=n){ n=p[b]; p[b]=r; } return a-b?1:0; } void Union(int a...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_121767/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_121767/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" @p = dso_local local_unname...
#include<stdio.h> #include<memory.h> int vec[2000]; int tmp[2000]; int gcd(int a, int b) { if (a == b) return b; else if (b > a) return gcd(a, b - a); else return gcd(b, a - b); } int main() { int n, temp, min = 9999, swi; int oc = 0; scanf("%d", &n); for (int i = 0; i < n; i++) { scanf("%d", &vec[i]); i...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_12181/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_12181/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> long gcd(long a, long b) { if (a % b == 0){ return b; } gcd(b, a % b); } int main(void) { long a, b, c, g; while (scanf("%ld %ld", &a, &b) != EOF){ if (a < b){ c = a; a = b; b = c; } g = gcd(a, b); printf("%ld", g)...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_121853/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_121853/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 gcd(int a, int b); int main(void) { int a, b; while (scanf("%d %d", &a, &b) != EOF){ printf("%d %d\n", gcd(a, b), a / gcd(a, b) * b); } return (0); } int gcd(int a, int b) { int tmp, tmp2; if (a < b){ tmp = a; a = b; b = tmp; } while (a % b != 0){ tmp2 = b; b = a % ...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_121897/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_121897/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; int i,l[1000005]; scanf("%d",&n); for(i=0;i<n;i++) scanf("%d",&l[i]); int killed=l[n-1]; if(l[n-1]>=n-1 || n==1) { printf("1\n"); return 0; } int x=l[n-1]; int w=0; for(i=n-2;i>=0;i--) { // if(x-w>=i+1) // { // killed+=i+1; // break; // } if(x-w==0) { ...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_12194/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_12194/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> // printf(), scanf() int gcd(int a, int b) { if (b == 0) return a; return gcd(b, a % b); } int main(int argc, char** argv) { int a, b; while (scanf("%d %d", &a, &b) != EOF) { int g = gcd(a, b); int l = (a / g) * b; printf("%d %d\n", g, l); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_121983/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_121983/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, d; int aa, bb; while(scanf("%d %d",&a, &b)!= EOF) { aa = a; bb = b; if(a>b) { for(;;) { d = a % b; if(d==0) break; a = b; b = d; } d = aa/b*bb; printf("%d %d\n",b,d); } else { for(;;) ...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_122032/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_122032/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){ long a, b, r, A, B; while(scanf("%ld %ld", &a, &b) != EOF){ A = a; B = b; if(b > a){ a = B; b = A; } r = a % b; while(r != 0){ a = b; b = r; r = a % b; } printf("%ld %ld\n", b, A * B / b)...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_122076/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_122076/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 here! long a,b,r,x; while(scanf("%ld %ld\n",&a,&b)!=EOF){ r=a*b; for( ;b!=0;){ x=a%b; a=b; b=x; } printf("%ld %ld\n",a,r/a); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_122119/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_122119/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 gcd(int m, int n){ int r; if(m >= n){ while(m % n != 0){ r = m % n; m = n; n = r; } return (n); } else{ while(n % m != 0){ r = n % m; n = m; m = r; } return (m); } } int lcm(int x, int y){ int j; j = x / gcd(x ,y) * y; return (j); } int main(void) { i...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_122177/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_122177/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(){ long int a,b,z,aa,bb; for(;;){ if(scanf("%ld",&a)==EOF){break;} scanf("%ld",&b); aa=a; bb=b; if(a>b){ z=a; a=b; b=z; } while(a%b!=0){ z=a%b; a=b; b=z; } printf("%d %d\n",b,aa/b*bb); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_122227/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_122227/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() { long a, b, z, a1, b2, lcm, temp; while(scanf("%ld %ld", &a, &b)!=EOF){ a1=a+1; b2=b+1; while((z = a % b)!= 0){ a = b; b = z; } printf("%ld ", b); temp=(b2-1)/b; lcm=(a1-1)*temp; printf("%ld\n", lcm); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_122270/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_122270/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,b,x,y,temp,maxa,mina; while(scanf("%d %d",&a,&b)!=EOF){ x=a; y=b; while(x!=0){ if(x<y){ temp=y; y=x; x=temp; } x=x%y; } maxa=y; mina=(a/maxa)*b; printf("%d %d\n",maxa,mina); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_122328/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_122328/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 main(void) { int x,y,data,lcm; double cpx,cpy; while(scanf("%d %d",&x,&y) != EOF){ cpx = x,cpy = y; if (x < y){ data = x,x = y,y = data; } while(y != 0){ x = x % y; data = x,x = y,y = data; } if (cpx >= 1000000){ lcm = (((cpx / 1000000) * cpy) / x) ...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_122379/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_122379/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 gcd(int x,int y) { if(y==0) return x; else return gcd(y,x%y); } int main() { int x,y; while(scanf("%d %d",&x,&y) != EOF) printf("%d %d\n",gcd(x,y),x/gcd(x,y)*y); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_122429/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_122429/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,b; scanf("%d %d",&a,&b); double c=a,d=b; printf("%d %d %f\n",a/b,a%b,c/d); return(0); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_122522/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_122522/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; int d, r; double f; scanf("%d %d", &a, &b); d = a / b; r = a % b; f = (1.0 * a) / (1.0 * b); printf("%d %d %f\n", d, r, f); return (0); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_122566/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_122566/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,d,r; double f1; scanf("%d %d",&a,&b); d = a/b; r = a%b; f1 = 1.00000*a/b; printf("%d %d %.5lf\n",d,r,f1); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_122609/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_122609/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,m,i,j,count; scanf("%d%d",&n,&m); char arr[n][m]; for(i=0;i<n;i++) for(j=0;j<m;j++) //i,j arr[i][j] = '.'; count =0; for( i=0;i<n;i++) { if( i & 1) { if( count % 2) arr[i][...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_12271/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_12271/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 a,b; scanf("%d %d",&a,&b); printf("%d %d %lf",a/b,a%b,(double)a/b); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_122753/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_122753/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; int b; double z; scanf("%d %d", &a, &b); z = 1.0 * a / b; printf("%d %d %.5f\n", a / b, a % b, z); return (0); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_122803/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_122803/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, d, r; double f; scanf("%d %d", &a, &b); d = a / b; r = a % b; f = 1.0 * a / b; printf("%d %d %.5lf\n", d, r, f); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_122854/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_122854/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[17],t[]="CODEFESTIVAL2016"; int i,ans=0; scanf("%s",s); for(i=0;i<16;i++){ if(s[i]!=t[i]) ans++; } printf("%d",ans); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_122919/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_122919/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=0,i; char s[32],t[32]="CODEFESTIVAL2016"; scanf("%s",s); for(i=0;i<=15;i++){ if(s[i]!=t[i]){a++;} } printf("%d\n",a); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_122962/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_122962/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,b,c,d; scanf("%d%d%d%d",&a,&b,&c,&d); if(a+b+c+d==21 && a*b*c*d==252){ printf("YES"); }else{ printf("NO"); } }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_123011/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_123011/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 s[3],i; for(i=0;i<=3;i++){ scanf("%d",&s[i]); } if(s[0]==1||s[1]==1||s[2]==1||s[3]==1){ if(s[0]==9||s[1]==9||s[2]==9||s[3]==9){ if(s[0]==7||s[1]==7||s[2]==7||s[3]==7){ if(s[0]==4||s[1]==4||s[2]==4||s[3]==4){ printf("YES"); } ...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_123055/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_123055/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 <sys/time.h> #define N 100000 unsigned int X; void srand_() { struct timeval tv; gettimeofday(&tv, NULL); X = tv.tv_sec ^ tv.tv_usec; } int rand_() { return (X *= 3) >> 1; } int *oj[N], oo[N]; void link(int i, int j) { int o = oo[i]++; if (o >= 2 && (o & o -...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_123099/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_123099/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.timeval = type { i6...
#define _CRT_SECURE_NO_WARNINGS #include<stdio.h> #include<string.h> int main() { /* int n, m; scanf("%d%d", &n, &m); printf("%d", (n - 1)*(m - 1)); */ /* char s[200],o[10]; int l,i; s[0] = '\0'; o[0] = '\0'; scanf("%s", s); l = strlen(s); sprintf(o, "%c%d%c", s[0], l-2,s[l-1]); printf("%s", o); */ ...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_123141/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_123141/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> #include <stdlib.h> #include <math.h> #include <string.h> #include <stdbool.h> typedef long long LL; typedef long double Lf; #define in (void)scanf #define Rep(i,a,n)for(int i=(int)(a);i<(int)(n);i++) //#define Rep(i,a,n)for(LL i=(LL)(a);i<(LL)(n);i++) #define rep(i,n)...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_123185/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_123185/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.fac = type { i64, i...
#include <string.h> #include <stdio.h> typedef long long ll; #define rep(i,n) for(int i=0; i<(int)(n); i++) int main() { int a,b,ans,cnt=0; char s[1001],t[1001]; scanf("%s", s); scanf("%s", t); a=strlen(s); b=strlen(t); ans=b; rep(i,a-b+1){ cnt=0; rep(j,b){ if (s[i+j]!=t[j]) ...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_123228/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_123228/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[1010], t[1010]; scanf("%s %s", s, t); int i, j, count = 0, high = 0; for(j = 0; j <= (strlen(s) - strlen(t)); j++){ for(i = j; i < (strlen(t) + j); i++){ if(s[i] == t[i - j]){ count++; } } if(count >= high){ high =...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_123271/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_123271/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[1000],t[1000]; scanf("%s",s); int ls=strlen(s); scanf("%s",t); int lt=strlen(t); int a[ls-lt+1]; for(int i=0;i<(ls-lt+1);i++){ a[i]=0; } for(int i=0;i<(ls-lt+1);i++){ for(int j=0;j<lt;j++){ if(s[i+j...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_123314/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_123314/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[101]; int i; scanf("%s",S); for(i=0;S[i]!='\0';i++){ S[i]='x'; } printf("%s\n",S); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_123358/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_123358/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 inputS[101]; scanf("%s", inputS); // Get length of an inputed string long len = strlen(inputS); // Change every letter in string into 'x' for (int i = 0; i < len; i++) { inputS[i] = 'x'; } printf("%s \n", inputS); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_123400/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_123400/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 len,i; char S[100]; scanf("%s",&S); len=strlen(S); for(i=0;i<len;i++) { printf("x"); } }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_123444/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_123444/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[100]; int i, x; scanf("%s", S); for(i=0; i<101; i++){ if(S[i]=='\0')break; S[i]='x'; } printf("%s", S); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_123488/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_123488/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 i; scanf("%s",s); for(i=0;s[i]!='\0';i++){ s[i]='x'; } printf("%s\n",s); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_123530/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_123530/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<math.h> #include<stdlib.h> int main() { char s[103]; int i; scanf("%s",s); int len=strlen(s); for(i=0; i<len; i++) { s[i]='x'; } printf("%s\n",s); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_123574/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_123574/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[101]; int i = 0; scanf("%s", S); while(S[i] != '\0') { S[i] = 'x'; i++; } printf("%s\n", S); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_123617/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_123617/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...
/****************************************************************************** Welcome to GDB Online. GDB online is an online compiler and debugger tool for C, C++, Python, PHP, Ruby, C#, VB, Perl, Swift, Prolog, Javascript, Pascal, HTML, CSS, JS Code, Compile, Run and Debug online from anywhere in world. *********...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_123660/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_123660/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){ char S[101]; int a; scanf("%s",S); a=strlen(S); for(int i=0;i<a;i++){ printf("x"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_123710/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_123710/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 <math.h> int main(void){ int i; char s[102]; int l; scanf("%s",s); l=strlen(s); for(i=0;i<l;i++){ printf("x"); } printf("\n"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_123754/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_123754/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, B; int coins; scanf("%d %d", &A, &B); if(A > B){ coins = A; A--; } else { coins = B; B--; } if(A > B){ coins += A; } else { coins += B; } printf("%d\n", coins); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_123804/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_123804/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; scanf("%d %d", &a, &b); int answer = 0; for (int i = 0; i < 2; i++) { if (a >= b) { answer += a; a--; } else { answer += b; b--; } } printf("%d\n", answer); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_123848/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_123848/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,max=0,i; scanf("%d",&a); scanf("%d",&b); for(i=0;i<2;i++){ if(a>=b){ max=a+max; a=a-1; }else if(b>a){ max=b+max; b=b-1; } } printf("%d\n",max); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_123941/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_123941/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,ans; scanf("%d %d",&a,&b); if(a>b){ ans = 2*a - 1; }else if(a<b){ ans = 2*b - 1; }else{ ans = a+b; } printf("%d\n",ans); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_123985/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_123985/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; scanf("%d",&a); scanf("%d",&b); if(a==b) printf("%d",a+b); if(a>b) printf("%d",a+a-1); if(a<b) printf("%d",b+b-1); return 0;}
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_124027/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_124027/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; int sum = 0; scanf("%d %d",&a,&b); if(a > b){ sum = sum + a; a = a - 1; }else{ sum = sum + b; b = b - 1; } if(a > b){ sum = sum + a; a = a - 1; }else{ sum = sum + b; b = b - 1; } printf("%d",sum); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_124070/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_124070/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,b; scanf("%d %d",&a,&b); if(a==b){ printf("%d",a*2); }else if(a>b){ printf("%d",2*a-1); }else{ printf("%d",2*b-1); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_124113/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_124113/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=0; scanf("%d%d",&a,&b); while(d<2){ if(a>b){ c = c+a; a--; } else { c = c+b; b--; } d++; } printf("%d\n",c); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_124157/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_124157/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,b; scanf("%d %d",&a,&b); if(a>b) printf("%d\n",2*a-1); else if(a==b) printf("%d\n",2*a); else printf("%d\n",2*b-1); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_124207/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_124207/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, B, ans; scanf("%d %d", &A, &B); if (A >= B + 1) { ans = 2 * A -1; } else if (A <= B - 1) { ans = 2 * B - 1; } else if (A == B) { ans = 2 * A; } printf("%d\n", ans); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_124250/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_124250/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,b; scanf("%d%d",&a,&b); if(a>=b){ if(a-1>b)printf("%d\n",a*2-1); else printf("%d\n",a+b); }else{ if(b-1>a)printf("%d\n",b*2-1); else printf("%d\n",a+b); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_124294/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_124294/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; scanf("%d %d",&a,&b); if(a > b){ a = a + a - 1; printf("%d",a); } else if(a < b){ b = b + b - 1; printf("%d",b); } else{ printf("%d",(a + b)); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_124337/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_124337/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; scanf("%d %d", &a, &b); if (a > b) printf("%d\n", 2 * a - 1); else if (b > a) printf("%d\n", 2 * b - 1); else printf("%d\n", a + b); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_124380/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_124380/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 Words { char word[31]; int page[100]; } WORDS; WORDS wordArray[100]; WORDS* printMinWord(WORDS*); WORDS* printMinPage(WORDS*); int main() { char tempWord[31]; int tempPage; int wordCnt; int pageCnt; int inputC...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_124423/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_124423/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.Words = type { [31 ...
// AOJ 2769: 28 // 2018.1.6 bal4u@uu #include <stdio.h> #include <math.h> #define HASHSIZ 1500019 typedef struct { long long p; char k; } HASH; HASH hash[HASHSIZ+2], *hashend = hash+HASHSIZ; int lookup(long long n) { HASH *p = hash + (int)(n % HASHSIZ); while (p->p) { if (p->p == n) return p->k; if (++p == has...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_124474/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_124474/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.HASH = type { i64, ...
#include <stdio.h> int main(void) { int p,q; int i,j,k; int result[100]; int amari[100]; while(scanf("%d%d",&p,&q)==2) { amari[0]=p; for(i=0;i<100;i++) { result[i]=(p*10)/q; p=(p*10)%q; amari[i+1]=p; if(p==0) { for(j=0;j<=i;j++)printf("%d",result[j]); putchar('\n'); break; } for(...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_124524/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_124524/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 max(int a,int b){ if(a > b){ return a; } return b; } int main(void){ char s[3010], t[3010]; scanf("%s", s); scanf("%s", t); int N, M; N = strlen(s); M = strlen(t); int dp[N+1][M+1]; for (int i = 0; i <= N; i++) { for (int j = 0; j <= M; j++) {...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_124575/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_124575/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> #define M 1000000007 static inline int gcd(unsigned s, unsigned t) { int r; if (t == 0) return s; for ( ;(r = s % t) != 0; s = t, t = r); return t; } static inline long inverse(unsigned long a) { long x = 1, g = a % M, v = 0, w = M, s, t, q; while (w != 0) { q ...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_124618/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_124618/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 s,b,copy; int i,j; int a[200]; scanf("%d%d",&s,&b); for(i=0;i<s;i++){ scanf("%d",&a[i]); } for(i=1;i<=b;i++){ for(j=0;j<s-1;j++){ if(a[j]%i>a[j+1]%i){ copy=a[j]; a[j]=a[j+1]; a[j+1]=copy; } } } for(i=0;i<s;i++){ printf("%d\n",a[i]); } return 0; ...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_124661/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_124661/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 MIN(int a,int b){return a<b?a:b;} int main(){ int n,m,i,j,k,d[110][110],a[1010],b[1010],c[1010]; for(i=0;i<110*110;i++)d[i/110][i%110]=1e9; for(i=0;i<110;i++)d[i][i]=0; scanf("%d %d",&n,&m); for(i=0;i<m;i++){ scanf("%d %d %d",&a[i],&b[i],&c[i]); d[a[i]][b[i]]=d[b[i]][a[i]]=c[i]; ...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_124711/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_124711/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 infinity 2000000000 int main() { int N; int A1[50], A2[50]; int ASum1[50] = {0}, ASum2[50] = {0}; int Cross1 = infinity, Cross2 = infinity; int B[50]; scanf("%d", &N); int i; for (i = 0; i < N - 1; i++) { scanf("%d", &A1[i]); ASum1[i] = A1[i...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_12482/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_12482/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 ...