Source_Code
stringlengths
69
484k
IR_Original
stringlengths
2.05k
17.9M
#include <stdio.h> #define max(a,b) ((a)>(b)?(a):(b)) int main() { long n,i,a[3006],b[3006],c[3006],f[3006][2]; scanf("%ld",&n); for(i=1;i<=n;i++) scanf("%ld",a+i); for(i=1;i<=n;i++) scanf("%ld",b+i); for(i=1;i<=n;i++) scanf("%ld",c+i); f[n][0]=0; f[n][1]=-2000000000; for(i=n-1;i>=1;i--){ f[i][0]=max(f[i+1][1...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_1861/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_1861/source.c" target datalayout = "e-m:e-p270: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 A[1000000], n; int binarySearch(int key) { int left = 0; int right = n; int mid; while (left < right) { mid = (left + right) / 2; if (key == A[mid]) return 1; if (key > A[mid]) left = mid + 1; else if (key < A[mid]) right = mid; } return 0;...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_186157/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_186157/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @n = dso_local global i32 0...
#include <stdio.h> #include <string.h> #include <math.h> #include <stdlib.h> int main() { int t,n,ll,c,kk; char a[1000],b[1000]; scanf("%d",&n); scanf("%s",a); int k=0,i,m=1; for(i=0;i<strlen(a);i++){ b[k++]=a[i]; i+=m; m++; } b[k]='\0'; printf("%s",b); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_18620/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_18620/source.c" target datalayout = "e-m:e-p270: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 <stdlib.h> #include <math.h> int main(void){ char s[100]; int i,n,flag=0; scanf("%s",s); n=strlen(s); for(i=0; i<n/2; i++){ if(s[i]!=s[n-i-1])flag=1; } for(i=0; i<(n-1)/4; i++){ if(s[i]!=s[(n-3)/2-i])flag=1; else if(s[i+...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_186250/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_186250/source.c" target datalayout = "e-m:e-p270: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 palin,i,flag=0; scanf("%s",s); int n=strlen(s); //nos limites do for eu poderia colocar apenas <,mas teria q tirar o -1. for(i=0;i <= ((n -1)/2)-1 ;++i){ if(s[i]!=s[((n-1)/2)-1 - i]){ //comparando o primeiro com o ultimmo ...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_186294/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_186294/source.c" target datalayout = "e-m:e-p270: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 a[100]; int i, n, k; scanf("%s",a); n = strlen(a); for(i=0; i<n-1-i; i++){ if(a[i] != a[n-1-i]){ puts("No"); return 0; } } n = (n-1)/2; for(i=0; i<n-1-i; i++){ if(a[i] != a[n-1-i]){ puts("No"); return 0; } } puts("Yes"); retu...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_186351/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_186351/source.c" target datalayout = "e-m:e-p270: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, res=0; int n,m; char s[99] = {}; int flag = 1; // scanf("%d %d", &n, &m); scanf("%s", s); n = 0; while(s[n] != 0){ n++; } m = n / 2; for(i =0;i<m;i++){ if(s[i] != s[m+1+i]){ printf("No"); flag = ...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_186401/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_186401/source.c" target datalayout = "e-m:e-p270: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 mod(int a){ return (a>0)?a:-a; } int main(){ int x,y,z,t1,t2,t3,e,w; scanf("%d %d %d %d %d %d",&x,&y,&z,&t1,&t2,&t3); w=mod(x-y)*t1; e=(mod(x-z)+mod(x-y))*t2+3*t3; if(w<e) printf("NO"); else printf("YES"); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_18646/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_18646/source.c" target datalayout = "e-m:e-p270: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 x,y; do{ scanf("%d %d",&x,&y); if(x != 0 || y != 0){ if(x<y || x==y) printf("%d %d\n",x,y); else printf("%d %d\n",y,x); } }while(x!=0||y!=0); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_186502/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_186502/source.c" target datalayout = "e-m:e-p270: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; int x[10000], y[10000]; for (i = 0; i > -1; ++i) { scanf("%d %d", &x[i], &y[i]); if (x[i] == 0 && y[i] == 0) { break; } } int j; for (j = 0; j < i; ++j) { if (x[j] < y[j]) { printf("%d %d\n", x[j], y[j]); } else { pri...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_186546/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_186546/source.c" target datalayout = "e-m:e-p270: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, z, t1, t2, t3; scanf("%d%d%d%d%d%d", &x, &y, &z, &t1, &t2, &t3); if (abs(x - z) * t2 + 3 * t3 + abs(x - y) * t2 <= abs(x - y) * t1) { printf("YES\n"); } else { printf("NO\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_18659/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_18659/source.c" target datalayout = "e-m:e-p270: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 x , y; while (1) { scanf("%d %d",&x,&y); if ( x == 0 && y == 0 ) break; if ( x <= y ) { printf("%d %d\n",x,y); } else { printf("%d %d\n",y,x); } } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_186632/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_186632/source.c" target datalayout = "e-m:e-p270: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> int main() { int i,x,y; int max,min; i=1; while(i==1){ scanf("%d %d",&x,&y); if(x==0){ if(y==0){ break; } else{ max=y; min=x; printf("%d %d\n",min,max); } } else if(x>y){ max=x; min=y; printf("%d %d\n",min,max); } else{ max=y; ...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_186690/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_186690/source.c" target datalayout = "e-m:e-p270: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 x,y,i; for (i = 1; ; i++) { scanf("%d %d", &x,&y); if (x == 0 && y == 0) break; if(x<y){ printf("%d %d\n",x,y); } else{ printf("%d %d\n",y,x); } } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_186733/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_186733/source.c" target datalayout = "e-m:e-p270: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,a,b,hoge; for (i=0;;i++) { scanf("%d %d",&a,&b); if(a>b) { hoge =a; a = b; b = hoge; } if(a != 0 || b != 0) printf("%d %d\n",a,b); else break; } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_186784/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_186784/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_add...
#include<stdio.h> int main(void){ int x,y,i,t; for(i = 1;;i++){ scanf("%d %d",&x,&y); if(x == 0 && y == 0){ break; } if(x > y){ t = x; x = y; y = t; } printf("%d %d\n",x,y); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_186834/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_186834/source.c" target datalayout = "e-m:e-p270: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; while(1){ scanf("%d %d",&a,&b); if(a==0&&b==0){break;} if (a<b) printf("%d %d\n",a,b); else printf("%d %d\n",b,a); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_186878/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_186878/source.c" target datalayout = "e-m:e-p270: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() { unsigned long long power,i,n; power=1; scanf("%llu",&n); for(i=1;i<=n;i++){ power*=i; power=power%1000000007; } printf("%llu\n",power); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_186920/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_186920/source.c" target datalayout = "e-m:e-p270: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; long int p = 1; int mod = 1000000007; scanf("%d",&N); for(int i=1;i<=N;i++){ p = (p*i) % mod; } printf("%d",p); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_186964/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_186964/source.c" target datalayout = "e-m:e-p270: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 long int N; scanf("%lld", &N); long long int i, mod = 0; long long int ans = 1; for(i = 0; i < N; i++){ mod = ans % 1000000007; ans = mod * ((i + 1) % 1000000007); while(ans >= 1000000007){ ans = ans % 1000000007; if(ans < 1000000007){ break; ...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_187006/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_187006/source.c" target datalayout = "e-m:e-p270: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 stairs=0; int elevator=0; int stairs_time(int x,int y,int t1) { stairs= abs(x-y)*t1; return stairs; } int elevator_time(int x,int y,int z,int t2,int t3) { int lift_position=abs(x-z); int lift_time=lift_position*t2; int destination=abs(x-y); ...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_18705/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_18705/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @stairs = dso_local local_unn...
#include <stdio.h> #include <math.h> int main() { long long num; int n,i; while(scanf("%d",&n)!=EOF) { num=1; for(i=1;i<=n;i++) { num=num*i; num=num%(long long)(1e9+7); } printf("%lld\n",num); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_187093/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_187093/source.c" target datalayout = "e-m:e-p270: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 d 1*/ #define out (1000000000+7) int main() { int i; int input=0; unsigned long long power=1; scanf("%d", &input); for(i=1;i<=input;i++) { power=(unsigned long long)(power*i); power=power%out; #ifdef d ...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_187136/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_187136/source.c" target datalayout = "e-m:e-p270: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 x,y,el,st,el_co,el_pl,dif,dif2; int st_res,el_res; while(scanf("%d %d %d %d %d %d",&x,&y,&el_pl,&st,&el,&el_co) != EOF) { if(x > y) dif = x - y; else dif = y - x; st_res = dif*st; ...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_18718/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_18718/source.c" target datalayout = "e-m:e-p270: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 n,k,s,a[100000],i,j,l; scanf("%d %d %d",&n,&k,&s); for(i=0;i<k;i++) a[i]=s; if(s<1000000000) for(i=k;i<n;i++) a[i]=s+1; else for(i=k;i<n;i++) a[i]=1; for(i=0;i<n;i++) printf("%d ",a[i]); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_187237/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_187237/source.c" target datalayout = "e-m:e-p270: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> int main(){ double r; double S,L; scanf("%lf",&r); S = r * r * M_PI; L = 2 * r * M_PI; printf("%lf %lf\n",S,L); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_187288/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_187288/source.c" target datalayout = "e-m:e-p270: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> int main(void) { double r; scanf("%lf", &r); printf("%.6f %.6f\n", r * r * M_PI, 2 * r * M_PI); return (0); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_187338/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_187338/source.c" target datalayout = "e-m:e-p270: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){ double a,b,c,f = 3.141592653589; scanf("%lf",&a); b = a*a*f; c = 2*a*f; printf("%f %f\n",b,c); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_187381/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_187381/source.c" target datalayout = "e-m:e-p270: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, const char * argv[]) { double r,a,c; scanf("%lf",&r); a=(r*r)*3.141592653589; c=2*3.141592653589*r; printf("%lf %lf\n",a,c); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_187424/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_187424/source.c" target datalayout = "e-m:e-p270: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) { double r; double p = 3.141592653589; double area, d; scanf("%lf", &r); area = r * r * p; d = 2 * r * p; printf("%f %f\n", area, d); return (0); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_187468/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_187468/source.c" target datalayout = "e-m:e-p270: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(){ double r,a=3.141592653589; scanf("%lf",&r); printf("%f %f\n",r*r*a,2*r*a); return (0); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_187518/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_187518/source.c" target datalayout = "e-m:e-p270: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> int main() { double r; double l; double s; scanf("%lf",&r); s = r * r * M_PI; l = 2 * r * M_PI; printf("%f %f\n",s,l); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_187569/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_187569/source.c" target datalayout = "e-m:e-p270: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 PI 3.14159265359 int main(){ double r; scanf("%lf",&r); printf("%lf %lf\n",r*r*PI ,2*r*PI); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_187626/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_187626/source.c" target datalayout = "e-m:e-p270: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 <string.h> #include <limits.h> long long gcd(long long a,long long b) { return b?gcd(b,a%b):a; } long long lcm(long long a,long long b) { return a/gcd(a,b)*b; } long long qpowmod(long long a,long long b,long long c) { long long res,t; res...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_18767/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_18767/source.c" target datalayout = "e-m:e-p270: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 f(char x){if(x!='a') x='a'; else x='b'; return x;} char g(char d){ if(d!='z') d='z'; else d='y'; return d; } int main(){ int t,b,c; char a[50]; scanf("%d",&t); while(t--){ scanf("%s",a); b=strlen(a); c=0; while(c<=b-1){ printf("%c",f(a[c])); c=c+1; if(c>b-1...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_18772/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_18772/source.c" target datalayout = "e-m:e-p270: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 Q, H, S, D; long long N, L[4]; scanf("%d%d%d%d%lld", &Q, &H, &S, &D, &N); L[3] = N / 2LL; L[2] = (N % 2LL); L[0] = 0LL; L[1] = 0LL; if (Q*8 < D) { L[0] += L[3]*8LL; L[3] = 0LL; } else if (H*4 < D) { L[1] += L[3]*4LL; L[3] = 0LL; } else if (S*2 < D) { L[2] += L...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_187763/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_187763/source.c" target datalayout = "e-m:e-p270: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 MAX(a,b) (a > b) ? a : b #define MIN(a,b) (a < b) ? a : b const int inf = 1000000000; // 10^9 int main(){ int x,a[100000];scanf("%d",&x); int on = 0; for(int i = 0;i < x;i++)scanf("%d",&a[i]); for(int i = 1;i <= x;i++){ if(a[on] == 2...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_187806/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_187806/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @inf = dso_local local_unna...
#include<stdio.h> int main(void) { int i,j; int n,tmp,kaisu; scanf("%d",&n); int a[n]; for(i=0;i<n;i++) scanf("%d",&a[i]); kaisu = 0; tmp = a[0]; for(i=1;i<n;i++){ kaisu++; if(tmp==2){ ...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_187893/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_187893/source.c" target datalayout = "e-m:e-p270: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,i,j,c=1,a[100010];scanf("%d", &n);for(i=1;i<=n;i++)scanf("%d",&a[i]);for(j=a[1];j!=2;c++){j=a[j];if(c>n){printf("-1");return 0;}}printf("%d",c);return 0;}
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_187943/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_187943/source.c" target datalayout = "e-m:e-p270: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; const ll MOD = 1000000007; ll fact[112345] = {1}; ll bit[112345]; int str[112345]; int main(){ for(int i = 1; i < 112345; ++i) fact[i] = fact[i - 1] * i % MOD; for(;;){ int n; scanf("%d", &n); if(!n) return 0; for(int i = 0; i < n; ++i) str[i] = i; int r; scanf...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_187987/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_187987/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @MOD = dso_local local_unna...
#include <stdio.h> #include <stdlib.h> typedef struct Bomb{ int map[8][8]; } BOMB; void Input(BOMB *); void explode(BOMB *); int x_cnt, y_cnt; int main() { int input_times, input_cnt; BOMB Bomb[50]; int x, y; scanf("%d", &input_times); for(input_cnt = 0; input_cnt < input_times; input_cnt++){ Input(&Bomb[...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_188029/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_188029/source.c" target datalayout = "e-m:e-p270: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.Bomb = type { [8 x ...
#include<stdio.h> #include<stdlib.h> #include<string.h> typedef struct binaryHeap{ void *h; size_t heapSize; size_t maxSize; size_t size; int (*cmp)(const void *,const void *); } heap; heap* newHeap(const size_t size,int (*cmpF)(const void *,const void *)){ const size_t maxSize=1; heap *res=(heap *)mall...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_188087/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_188087/source.c" target datalayout = "e-m:e-p270: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.binaryHeap = type {...
#include<stdio.h> #include<stdlib.h> #include<string.h> #include<math.h> int main(){ int n; scanf("%d",&n); while(n--){ char num[51]; scanf("%s",num); int i=0; while(num[i]!='\0') i++; int a=0; while(i-a){ if(a%2==0){ if(num[a]=='a') num[a]='b'; else num[a]='a'; }else{ if(num[a]=='z')...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_18813/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_18813/source.c" target datalayout = "e-m:e-p270: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 (){ // DECLARAÇÕES int N,T; int c,t; int custo = 1000; int i = 0; // INSTRUÇÕES scanf ("%d %d",&N,&T); for (int aux = 0; aux < N; aux++){ scanf ("%d %d",&c,&t); if (t <= T){ i = 1; if (c < custo) custo = c; } } if ( i == 1) printf ("%d\n",custo...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_188180/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_188180/source.c" target datalayout = "e-m:e-p270: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 , T , c , t; int count = 0; int min_cost = 1000; scanf("%d %d", &N , &T); for(int i = 0 ; i < N ; i++){ scanf("%d %d", &c , &t); if(t <= T){ min_cost = (c < min_cost) ? c : min_cost; }else{ count++; } } if(count == N){ puts("TLE...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_188230/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_188230/source.c" target datalayout = "e-m:e-p270: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> typedef struct { int c; int t; } smart; int comp( const void *c1, const void *c2 ) { smart test1 = *(smart *)c1; smart test2 = *(smart *)c2; int tmp1 = test1.c; /* b を基準とする */ int tmp2 = test2.c; return tmp1 - tmp2; } int main(){ int i,j,k; int N,T; scanf("...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_188274/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_188274/source.c" target datalayout = "e-m:e-p270: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.smart = type { i32,...
#include<stdio.h> #include<string.h> int main(){ int N,T; scanf("%d%d",&N,&T); int c[N],t[N]; for(int i = 0;i < N;i++){ scanf("%d%d",&c[i],&t[i]); } int overTc[N]; int j = 0; for(int i = 0;i < N;i++){ if(t[i] <= T){ overTc[j] = c[i]; j++; ...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_188317/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_188317/source.c" target datalayout = "e-m:e-p270: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,T; int c,t; int ans=10000; scanf("%d%d",&n,&T); for(int i=0;i<n;++i){ scanf("%d%d",&c,&t); if(t<=T&&c<ans){ ans=c; } } if(ans==10000)printf("TLE"); else printf("%d",ans); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_188360/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_188360/source.c" target datalayout = "e-m:e-p270: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,T; int c,t,ans,min_c=1005; int main(){ scanf("%d %d ",&n,&T); for(int i=1;i<=n;i++){ scanf("%d %d",&c,&t); if(t<=T){ ans=1; if(c<min_c){ min_c=c; } } } if(ans==1) printf("%d",min_c); else printf("TLE"); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_188403/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_188403/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @min_c = dso_local local_un...
#include <stdio.h> #include <stdlib.h> #define SIZE 320 #define NUM 320 typedef struct { int t, h; long long num; } edge; int main() { int i, N, M, u, w, *adj[100001], deg[100001] = {}, q[100001] = {}; long long *block[100001] = {}; edge e[200001]; scanf("%d %d", &N, &M); for (i = 0; i < N - 1; i++) { scanf...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_188454/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_188454/source.c" target datalayout = "e-m:e-p270: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.edge = type { i32, ...
#include<stdio.h> #include<string.h> #define Max(x,y) ((x>y)?x:y) long long t[100005],ans; int m,len[100005]; long long func(int n){ long long x=0; if(len[n]==0)return t[n]; if(len[n]>len[n-1] && len[n]>len[n+1]){ if(len[n-1]==0)x=Max(x,t[n-1]); if(len[n+1]==0)x=Max(x,t[n+1]); } else if(len[n-1]<len[n] && len...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_188548/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_188548/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @len = dso_local global [10...
#include <stdio.h> int main() { int a,b,h,A; scanf("%d", &a); scanf("%d", &b); scanf("%d", &h); A = (a+b) * (h/2); printf("%d\n",A); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_188599/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_188599/source.c" target datalayout = "e-m:e-p270: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, h; scanf("%d%d%d", &a, &b, &h); printf("%d\n", (a+b)*h/2); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_188649/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_188649/source.c" target datalayout = "e-m:e-p270: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> int main(){ int i,x,t,bekci=0,a[100]={1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51, 1, 2, 1, 14, 1, 2, 2, 14, 1, 6, 1, 4, 2, 2, 1, 52, 2, 5, 1, 5, 1, 15, 2, 13, 2, 2, 1, 13, 1, 2, 4, 267, 1, 4, 1, 5, 1, 4, 1, 50, 1, 2, 3, 4, 1, 6,...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_1887/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_1887/source.c" target datalayout = "e-m:e-p270: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.a = private unnam...
#include <stdio.h> int main (void) { int a,b,h,s; char str[8]; fgets(str,sizeof(str),stdin); sscanf(str,"%d",&a); fgets(str,sizeof(str),stdin); sscanf(str,"%d",&b); fgets(str,sizeof(str),stdin); sscanf(str,"%d",&h); s = (a + b) * h / 2; printf("%d",s); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_188757/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_188757/source.c" target datalayout = "e-m:e-p270: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() { int test,n,i; char str[50]; scanf("%d",&test); while(test--) { scanf("%s",str); for(i=0;i<strlen(str);i++) { if((i+1)%2!=0 && str[i]=='a') { printf("b"); } else i...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_18880/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_18880/source.c" target datalayout = "e-m:e-p270: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 a,b,h; scanf("%d%d%d",&a,&b,&h); printf("%d\n",(a+b)*h/2); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_188850/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_188850/source.c" target datalayout = "e-m:e-p270: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, h; scanf("%d %d %d", &a, &b, &h); printf("%d\n", (a + b) * h / 2); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_188900/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_188900/source.c" target datalayout = "e-m:e-p270: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, h; scanf("%d", &a); scanf("%d", &b); scanf("%d", &h); printf("%d\n", (a+b)*h/2); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_188951/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_188951/source.c" target datalayout = "e-m:e-p270: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, h, S; scanf("%d\n%d\n%d", &a, &b, &h); S = (a+b)*h/2; printf("%d\n", S); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_189000/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_189000/source.c" target datalayout = "e-m:e-p270: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 <stddef.h> #include <stdio.h> #include <stdlib.h> #include <time.h> // I/O int get_uint() { int n = 0; int c = getchar_unlocked(); if(c < 48 || 57 < c) return c; while(47 < c && c < 58) n = 10 * n + (c & 0xf), c = getchar_unlocked(); return n; } void put_uint(int n) { if(!n) { ...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_189044/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_189044/source.c" target datalayout = "e-m:e-p270: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._IO_FILE = type { i...
// AOJ ALDS1_13_B 8 Puzzle // 2018.5.8 bal4u #include <stdio.h> typedef unsigned char uchar; #define HASHSIZ 543217 typedef struct { unsigned s; char x, v; } HASH; HASH hash[HASHSIZ+3], *hashend = hash+HASHSIZ; int lookup(unsigned s, int x) { long long t = ((long long)x << 32) + s; HASH *hp = hash + (int)(t % HAS...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_189088/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_189088/source.c" target datalayout = "e-m:e-p270: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 { i32, ...
#include <stdio.h> #include <stdlib.h> int A[10]; int fa[10]={1,1,2,6,24,120,720,5040,40320}; int DP[362880]; void swap(int i,int j){ int t=A[i]; A[i]=A[j]; A[j]=t; } int F(){ int ans=0,b=0; for(int i=8;i>=0;i--){ ans+=__builtin_popcount(b&((1<<A[i])-1))*fa[8-i]; b|=1<<A[i]; } return ans; } voi...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_189130/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_189130/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @fa = dso_local local_unnam...
#include<stdio.h> #include<stdlib.h> #define N 3 #define LIMIT 100 #define TRUE 1 #define FALSE 0 #define NIL -1 typedef struct{ int map[N*N]; int space,MD; }PUZZLE; int dx[4]={0,-1,0,1}; int dy[4]={1,0,-1,0}; char vector[4]={'r','u','l','d'}; int limit,path[LIMIT]; int MDT[N*N][N*N]; PUZZLE status,in; int getHe...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_189181/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_189181/source.c" target datalayout = "e-m:e-p270: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.PUZZLE = type { [9 ...
#include<stdio.h> #include<string.h> #define N 3 #define LIM 32 #define HN 362897 struct dep{ int depth,key; }; int ans[N][N]={ {1,2,3}, {4,5,6}, {7,8,0} }; int min = LIM; struct dep h[HN]; int hash1(int k) { return k % HN; } int hash2(int k) { return 1 + k%(HN-1); } int hash(int k, int i) { return (...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_189224/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_189224/source.c" target datalayout = "e-m:e-p270: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.dep = type { i32, i...
#include<stdio.h> int main(){ int a,b; int w,n; int x=0; int z=0; scanf("%d",&w); int tate[30]={0}; for(x=1;x<=w;x++){ tate[x-1]=x; } scanf("%d",&n); for(x=0;x<n;x++){ scanf("%d,%d",&a,&b); z=tate[a-1]; tate[a-1]=tate[b-1]; tate[b-1]=z; } for(x=0;x<w;x++){ printf("%d\n",...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_189268/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_189268/source.c" target datalayout = "e-m:e-p270: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 numlane,numdata,i,swap; int lane[30]; int data[2]; scanf("%d",&numlane); scanf("%d",&numdata); for(i = 0; i < numlane; i++){ lane[i] = i + 1; } for(i = 0; i < numdata; i++){ scanf("%d,%d",&data[0],&data[1]); swap = lane[data[0] - 1]; lane[d...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_189310/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_189310/source.c" target datalayout = "e-m:e-p270: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 swap(a, b) {int tmp;tmp = a;a=b;b=tmp;} int main(){ int amida[31]; int w,n; int a,b; int i; scanf("%d %d", &w, &n); for(i = 1;i <=w;i++) amida[i]=i; for(i = 0;i < n;i++){ scanf("%d,%d",&a,&b); swap(amida[a], amida[b]); } for(i = 1;i <=w; i++){ printf("%d\n",amida[i]); } ret...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_189361/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_189361/source.c" target datalayout = "e-m:e-p270: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 swape(int *a,int *b) { int temp; temp = *a; *a = *b; *b = temp; } int main() { int w, n; int a, b; scanf("%d",&w); scanf("%d", &n); int vertical[31]; for (int i = 0;i <= w;i++) { vertical[i] = i; } while (n--) { scanf("%d,%d", &a, &b); swape(&vertical[a], &vertical[b]); } ...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_189411/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_189411/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_add...
#include<stdio.h> int main(void) { int x,y,a,b,i,num[30],t; scanf("%d",&y); scanf("%d",&x); for(i=0;i<y;i++) { num[i]=i+1; } for(i=0;i<x;i++) { scanf("%d,%d",&a,&b); t=num[a-1]; num[a-1]=num[b-1]; num[b-1]=t; } for(i=0;i<y;i++) { printf("%d...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_189477/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_189477/source.c" target datalayout = "e-m:e-p270: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...
/****************************************************************************** Online C Compiler. Code, Compile, Run and Debug C program online. Write your code in this editor and press "Run" button to compile and execute it. ***********************************************...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_18952/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_18952/source.c" target datalayout = "e-m:e-p270: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> void swap(int *a,int *b){ int temp=*a; *a=*b; *b=temp; } int main(void){ int w,n,i,m,k; int *a; scanf("%d", &w); a=calloc(w,sizeof(int)); for(i=0;i<w;i++) a[i]=i+1; scanf("%d", &n); for(i=0;i<n;i++){ scanf("%d,%d", &m,&k); swap(&a[m-1],&a[k-1]); }; for(i=0;i<w;i+...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_189563/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_189563/source.c" target datalayout = "e-m:e-p270: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 w,n,a[100],b[100],l[100],i,j,m; scanf("%d %d",&w,&n); for(i=0;i<w;i++){ l[i]=i+1; } for(i=0;i<n;i++){ scanf("%d,%d",&a[i],&b[i]); } for(i=0;i<n;i++){ m=l[b[i]-1]; l[b[i]-1]=l[a[i]-1]; l[a[i]-1]=m; } for(i=0;i<w;i++){ printf("%d\n",l[i])...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_189606/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_189606/source.c" target datalayout = "e-m:e-p270: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<stdbool.h> bool isPalin(char str[]) { int o=strlen(str); for(int i=0;i<o/2;i++) { if(str[i]!=str[o-i-1]) { return false; } } return true; } int mxLength(char str[]) { int l=strlen(str); int p=str[0]; int i=1; for(i...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_18965/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_18965/source.c" target datalayout = "e-m:e-p270: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,b,x,y;scanf("%lld%lld%lld%lld",&a,&b,&x,&y); int fl=0; if(x%y==0) fl=1; long long int GCD = 0; long long int x1=x,y1=y; while (y1 != 0) { GCD = y1; y1 = x1 % y1; x1 = GCD; } x=x/GCD; y=y/GCD; // printf("%lld\n",GCD); // printf("%lld %lld\n",x,y); a ...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_18970/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_18970/source.c" target datalayout = "e-m:e-p270: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 abs(int n) { if (n > 0) return (n); return (n * -1); } int max(int a, int b) { a = abs(a); b = abs(b); if (a > b) return (a); return (b); } int main(void) { int i; int n; int x[3], y[3]; int t[2]; int sum; scanf(...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_189743/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_189743/source.c" target datalayout = "e-m:e-p270: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 M 1000000007 unsigned long power(unsigned long x, unsigned long n) { if (n == 0) { return 1; } unsigned long res = power(x*x%M, n/2); if (n % 2 != 0) { res = res * x % M; } return res; } int main(void) { int m, n; scanf("%d %d", &m, &n); printf("%ld\n", power(m,...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_189794/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_189794/source.c" target datalayout = "e-m:e-p270: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_MATH_DEFINES #include <stdio.h> #include <stdlib.h> #include <string.h> #include <math.h> #define ABS(x) ( (x)>0 ? x : -(x) ) #define MIN(x,y) ( (x) < (y) ? (x) : (y) ) #define MAX(x,y) ( (x) > (y) ? (x) : (y) ) #define MOD 1000000007 void swap(int* a, int* b) { int tmp; tmp = *a; *a = *b; *b = tmp;...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_189837/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_189837/source.c" target datalayout = "e-m:e-p270: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 rep(i,l,r)for(int i=(l);i<(r);i++) #define max(p,q)((p)>(q)?(p):(q)) int n; char b[3][2][2][3]; int progress(char s[][2][3]){ int flag=1; while(flag){ rep(i,0,20)rep(j,0,2)rep(k,0,2)if(s[i][j][k]=='*'&&(i==0||s[i-1][j][k]=='#'))flag=0; if(flag)rep(i,0,20)rep(j,0,2)rep(k,0,2)if(s[i][j][k...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_189888/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_189888/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @b = dso_local global [3 x ...
#include <stdio.h> #include <stdint.h> #define MOD_NUM 1000000007 enum {A = 0, G, C, T}; static uint32_t N; static uint64_t memo[100][4][4][4]; static uint64_t mvld[100][4][4][4]; int isOK(int *last4) { for(int i = 0; i < 4; i++) { int chk [4]; for(int j = 0; j < 4; j++) { chk[j] = last4[j]; } ...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_189930/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_189930/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @mvld = internal unnamed_ad...
#include<stdio.h> int main(){ int a,b; scanf("%d%d",&a,&b); printf("%d\n",(a+b)/2); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_189981/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_189981/source.c" target datalayout = "e-m:e-p270: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; scanf("%d %d",&a,&b); c=(a+b)/2; printf("%d\n",c); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_190022/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_190022/source.c" target datalayout = "e-m:e-p270: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; scanf("%d %d",&a,&b); c=a+b; c=c/2; printf("%d\n",c); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_190066/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_190066/source.c" target datalayout = "e-m:e-p270: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 MAX_N 101000 #define SWAP( a, b ) do { int tmp; tmp = a; a = b; b = tmp; } while( 0 ) int isPrime[ MAX_N + 1 ] = { 0, 0, 1 }; void insertionSort( int *, int ); void quickSort( int *, int ); void quickSort_body( int *, int, int ); int median( int, int, int ); int main( ...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_190109/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_190109/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @isPrime = dso_local local_...
#include<stdio.h> #include<stdlib.h> int compare(const void *a,const void *b){ return *(long*)a - *(long*)b; } int main(){ long n = 0; long k = 0; long a[200000] = {}; long i = 0; long hoge[200000] = {}; long hozon = 0; long hogecnt = 0; long sum = 0; long hogem = 0; scanf("%lu %lu",&n,&k); fo...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_190152/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_190152/source.c" target datalayout = "e-m:e-p270: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,x[100]; int count=0; scanf("%d",&n); for(int i=0;i<n;i++){ scanf("%d",&(x[i])); } for(int j=0;j<n-1;j++){ if(x[j]==x[j+1]){ x[j+1]=n+1; count++; } } printf("%d\n",count); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_190196/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_190196/source.c" target datalayout = "e-m:e-p270: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[101],i,n,j=0; scanf("%d",&n); for(i=0;i<n;i++){ scanf("%d",&a[i]); } for(i=0;i<n;i++){ if(a[i]==a[i+1]){ a[i+1]=0; j=j+1; } } printf("%d\n",j); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_190239/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_190239/source.c" target datalayout = "e-m:e-p270: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 ll long long #define rep(i,a,N) for(ll i=(a);i<(N);i++) #define INF ((1LL<<62)-(1LL<<31)) #define max(p,q) ((p)>(q)?(p):(q)) #define min(p,q) ((p)<(q)?(p):(q)) int n; int x[20],y[20],p[20]; ...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_190282/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_190282/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @n = dso_local global i32 0...
#include <stdio.h> #include <stdlib.h> #include <string.h> typedef struct CELL{ long key; int count; struct CELL *next; } data; int insert(long hash,long key); int search(long hash,long key); data *h[100005]; long delete=0; int main(void){ int N,i,n; long a[100005]; char str[1100000],*p; data *t; ...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_190325/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_190325/source.c" target datalayout = "e-m:e-p270: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.CELL = type { i64, ...
#include <stdio.h> #include <stdlib.h> #include <string.h> #include <math.h> int int_sort(const void *a, const void *b){ if(*(int *)a < *(int *)b){ return -1; }else if(*(int *)a == *(int *)b){ return 0; } return 1; } int main(void){ int n, *s, i, c=0, m=0, sum=0; scanf("%d",&n); s = malloc(sizeof...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_190369/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_190369/source.c" target datalayout = "e-m:e-p270: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 int long long typedef struct { int N; int *u; int *u_rank; }union_find; union_find *make_union_find(int N){ int i; union_find *uf = (union_find *)malloc(sizeof(union_find)); uf->N = N; uf->u = (int *)malloc(sizeof(int) * N); uf->u_rank = (int *)malloc(sizeof(int)...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_190411/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_190411/source.c" target datalayout = "e-m:e-p270: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.union_find = type {...
#include<stdio.h> int main() { int a,b,x,k; scanf("%d%d",&a,&b); x=(a+b); if(x%2==0) { k=x/2; printf("%d\n",k); } else { printf("IMPOSSIBLE\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_190455/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_190455/source.c" target datalayout = "e-m:e-p270: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<stdbool.h> #include<time.h> #include<math.h> #include<assert.h> #define inf 1072114514 #define llinf 4154118101919364364 #define mod 1000000007 #define pi 3.1415926535897932384 int max(int a,int b){if(a>b){return a;}return b;} int min(int a,int b){if(a<b)...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_190505/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_190505/source.c" target datalayout = "e-m:e-p270: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; scanf("%ld%ld",&a,&b); if((a+b)%2==0) printf("%ld\n",(a+b)/2); else printf("IMPOSSIBLE\n"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_190563/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_190563/source.c" target datalayout = "e-m:e-p270: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) % 2) { printf("IMPOSSIBLE\n"); } else { printf("%d\n", (a + b) / 2); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_190606/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_190606/source.c" target datalayout = "e-m:e-p270: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 c[100001]; scanf("%s",&c); int i,j,l=0,r=0,u=0,d=0; for(i=0;c[i];i++); if(i%2) { printf("-1"); } else { for(j=0;j<i;j++) { if(c[j]=='L') l++; else if(c[j]=='R') r++; ...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_19065/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_19065/source.c" target datalayout = "e-m:e-p270: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 main() { long long int A,B,K; scanf("%lld%lld",&A,&B); K=(A+B)/2; if (abs(A-K) == abs(B-K)) printf("%lld\n",K); else { printf("IMPOSSIBLE\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_190693/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_190693/source.c" target datalayout = "e-m:e-p270: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) % 2 == 1 ) { printf("IMPOSSIBLE\n"); } else { printf("%d\n", (a + b) / 2); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_190736/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_190736/source.c" target datalayout = "e-m:e-p270: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)%2==0) printf("%d",(a+b)/2); else printf("IMPOSSIBLE"); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_190794/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_190794/source.c" target datalayout = "e-m:e-p270: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,k; c = 0; d = 0; scanf("%d %d", &a, &b); for(int i = 0; i < 1000000000; i++) { c = a - i; d = b - i; if (c<0){ c = -1 * c; } if (d<0) { d = -1 * d; } if (c == d) { k = i; printf("%d", k); return 0; bre...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_190844/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_190844/source.c" target datalayout = "e-m:e-p270: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...