Source_Code
stringlengths
69
484k
IR_Original
stringlengths
2.05k
17.9M
#include <stdio.h> int search(int A[], int n, int key) { int i = 0; A[n] = key; while(A[i] != key) i++; return i != n; } int main(void) { int i, n, A[10000+1], q, key, sum = 0; scanf("%d",&n); for(i=0; i<n; i++) scanf("%d", &A[i]); scanf("%d",&q); for(i=0; i<q; i++) { scanf("%d", &key); if(se...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_141466/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_141466/source.c" target datalayout = "e-m:e-p270:32:32-p271:32: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 m,n,i,sum = 0,j; int S[10000],Q[500]; scanf("%d",&m); for(i = 0;i < m;i++) { scanf("%d",&S[i]); } scanf("%d",&n); for(i = 0;i < n;i++) { scanf("%d",&Q[i]); } for(i = 0;i < n;i++) { for(j = 0;j < m;j++) ...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_141509/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_141509/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_add...
#include <stdio.h> #define N 10000 #define F 500 int main(){ int array1[N]; int array2[F]; int i,j,a,b,cnt=0; scanf("%d",&a); for(i=0;i<a;i++){ scanf("%d",&array1[i]); } scanf("%d",&b); for(i=0;i<b;i++){ scanf("%d",&array2[i]); } for(i=0;i<b;i++){ for(j=0;j<a;j++){ if(array2[i]...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_141552/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_141552/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_add...
#include<stdio.h> #define N 10000 int main(){ int a,b,i,j,key,A[N],B[N],count=0; scanf("%d",&a); for(i=0;i<a;i++) scanf("%d",&A[i]); scanf("%d",&b); for(i=0;i<b;i++){ scanf("%d",&B[i]); j=0; A[a]=B[i]; while(A[j]!=B[i]){ j++; if(j==a) break; } if(...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_141596/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_141596/source.c" target datalayout = "e-m:e-p270:32:32-p271:32: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 search(int S[],int n,int T){ int i=0; S[n]=T; while(S[i] != T)i++; return i != n; } int main(){ int i,n,q,T,C=0,S[10000+1]; scanf("%d",&n); for(i=0;i<n;i++)scanf("%d",&S[i]); scanf("%d",&q); for(i=0;i<q;i++){ scanf("%d",&T); if(search(S,n,T))C++; } print...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_141639/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_141639/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_add...
#include <stdio.h> #define N 10000 #define Q 501 int LinerSearch(int *, int *, int, int); int main() { int i, n, q, ans; int data1[N], data2[Q]; scanf("%d", &n); for (i = 0; i < n; i++) { scanf("%d", &data1[i]); } scanf("%d", &q); for (i = 0; i < q; i++) { scanf("%d", &data2[i]); } a...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_141682/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_141682/source.c" target datalayout = "e-m:e-p270:32:32-p271:32: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 linear(int *,int,int); int main(){ int i,j,n,q[100000],sum=0,s,t; scanf("%d",&n); for(i=0;i<n;i++){ scanf("%d",&q[i]); } scanf("%d",&s); for(i=0;i<s;i++){ scanf("%d",&t); sum+=linear(q,n,t); } printf("%d\n",sum); return 0; } int linear(int *q,int n,int t){ int j=0; q[n]=t; whil...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_141725/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_141725/source.c" target datalayout = "e-m:e-p270:32:32-p271:32: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 MAX_N 10000 int linear_search(int n, int key, int *S) { S[n] = key; int i = 0; while (S[i] != key) i++; if (i < n) return i; return -1; } int main(void) { int n, q; int S[MAX_N+1]; // 入力処理 scanf("%d", &n); for (int i = 0; i < n; i++) { scanf("%d ", &S[i]); ...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_141769/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_141769/source.c" target datalayout = "e-m:e-p270:32:32-p271:32: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 Notfound -1; int S_number, T_number; int S_array[100000], T_array[500]; int findlineserch(int ti); int main(void) { int ti; int return_find_or_not = 0; int overraycount = 0; scanf("%d", &S_number); for (int si = 0; si<S_number; si++) { scanf("%d", &S_array[si]); } scanf("%d", &...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_141811/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_141811/source.c" target datalayout = "e-m:e-p270:32:32-p271:32: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 LENn 10000 #define LENq 10000 int main(){ int n,s[LENn],q,t[LENq]; scanf("%d",&n); for(int i = 0; i < n; i++){ scanf("%d",&s[i]); } scanf("%d",&q); for(int i = 0; i < q; i++){ scanf("%d",&t[i]); } int cnt=0; for(int i = 0; i < q; i++){ for(int j = 0; j < n; j++){...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_141862/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_141862/source.c" target datalayout = "e-m:e-p270:32:32-p271:32: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[10001],b[501],c,d,i,j,e=0; scanf("%d\n",&c); for(i=0;i<c;i++){ scanf("%d ",&a[i]); } scanf("\n"); scanf("%d\n",&d); for(i=0;i<d;i++){ scanf("%d ",&b[i]); } scanf("\n"); for(i=0;i<d;i++){ for(j=0;j<c;j++){ if(b[i]==a[j]){ e++; break; } } } printf("%d\n",e); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_141905/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_141905/source.c" target datalayout = "e-m:e-p270:32:32-p271:32: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 linearSearch(int *,int *,int,int); int main(){ int s[10000]; int t[500]; int n,q,i,j; scanf("%d",&n); for(i=0;i<n;i++) scanf("%d",&s[i]); scanf("%d",&q); for(i=0;i<q;i++) scanf("%d",&t[i]); printf("%d\n",linearSearch(s,t,n,q)); return 0; } int linearSearch(int *s,int *t,int n,...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_141956/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_141956/source.c" target datalayout = "e-m:e-p270:32:32-p271:32: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 e[6],a,b,c,max,i; scanf("%d%d%d",&a,&b,&c); e[0]=a+(b*c); e[1]=a*(b+c); e[2]=a*b*c; e[3]=a+b+c; e[4]=(a+b)*c; e[5]=(a*b)+c; max=e[0]; for(i=1;i<=5;i++) {if(e[i]>max) max=e[i];} printf("%d",max); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_142/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_142/source.c" target datalayout = "e-m:e-p270:32:32-p271: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 cons...
#include <stdio.h> int main(void) { int n, q, i, j, l; int a[10000]; int b[500]; int c[500]; int k = 0; int v = 0; scanf("%d", &n); for(i = 0; i < n; i++) scanf("%d", &a[i]); scanf("%d", &q); for(i = 0; i < q; i++) scanf("%d", &b[i]); for(j = 0; j < n; j++) { for(i = 0; i < q; i++) { if(a...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_142041/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_142041/source.c" target datalayout = "e-m:e-p270:32:32-p271:32: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, x, N, K; scanf("%d", &N); scanf("%d", &K); for (i = 0, x = 1; i < N; i++) { if (x > K) x += K; else x *= 2; } printf("%d\n", x); fflush(stdout); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_142092/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_142092/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_add...
#include <stdio.h> int main(void) { int n , k ,ans = 1; scanf("%d %d",&n,&k); for(int i = 0; i < n;i ++){ if(ans*2<k+ans){ int c = ans; ans = 2*c; } else{ ans += k; } } printf("%d",ans); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_142135/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_142135/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_add...
#include <stdio.h> int main(){ int n, k; int valor = 1; scanf("%d%d", &n, &k); for (int i = 0; i < n; ++i){ if ((valor + k) >= (valor * 2)) valor *= 2; else valor += k; } printf("%d\n", valor); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_142179/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_142179/source.c" target datalayout = "e-m:e-p270:32:32-p271:32: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,num=1; scanf("%lld%lld", &x, &y); for (int i = 1; i <= x; i++) { if (num >= y) { num += y; } else { num += num; } } printf("%lld",num); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_142229/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_142229/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_add...
#include<stdio.h> int main(){ int n,k; int i; int a=1; scanf("%d %d",&n,&k); for(i=n;i>0;i--){ if(a*2<a+k){ a=a*2; }else{ a=a+k; } } printf("%d\n",a); return(0); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_142272/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_142272/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_add...
#include <stdio.h> int main(){ int n, k; int i; int now = 1; scanf("%d", &n); scanf("%d", &k); for(i=0;i<n;i++){ if (now < k){ now *= 2; }else{ now += k; } } printf("%d", now); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_142315/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_142315/source.c" target datalayout = "e-m:e-p270:32:32-p271:32: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 qsort_int(const void *a, const void *b) { return *(int *)a - *(int *)b; } int main(int argc, char *argv[]) { int n; int a[100000]; int log[100000][2]; scanf("%d", &n); for (int i = 0; i < n; i++) { scanf("%d", &a[i]); } qsort(a, n, ...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_142359/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_142359/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_add...
// Aizu 2286: Farey Sequence // 2017.9.23 bal4u@uu // ?????????????????¢??° ??(n)???????????????????????¬?????°??? Fn ????????°: //???????????(1)?????(2)???...+??(n) // ?????????, Fn(n) = Fn(n-1) + ??(n)???????????????Fn(0) = 1 #include <stdio.h> #define MAX 1000000 int phi[MAX+1]; // ??????????????¢??°?????? char...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_142401/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_142401/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @phi = dso_local local_unna...
#include<stdio.h> int main(){ int n,m,x,y,w,h,s,t,c; scanf("%d",&n); while(n--){ scanf("%d %d %d %d",&x,&y,&w,&h); scanf("%d",&m); c=0; while(m--){ scanf("%d %d",&s,&t); if(x<=s&&s<=x+w&&y<=t&&t<=y+h)c++; } printf("%d\n",c); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_142452/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_142452/source.c" target datalayout = "e-m:e-p270:32:32-p271:32: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 k2,k3,k5,k6,a,b,sum; scanf("%d%d%d%d",&k2,&k3,&k5,&k6); if(k2<k6){ if(k2<k5) b=k2; else b=k5; } else{ if(k6<k5) b=k6; else b=k5; } sum=b*256; k2=k2-b; if(k2<k3) a...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_14251/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_14251/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr ...
#include <stdio.h> int main(void) { int A1,A2,A3; scanf ("%d %d %d",&A1,&A2,&A3); if (A1+A2+A3>=22) printf ("bust");// Your code here! else printf ("win"); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_142553/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_142553/source.c" target datalayout = "e-m:e-p270:32:32-p271:32: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; scanf("%d %d %d",&a,&b,&c); if(a+b+c>=22) printf("bust\n"); else printf("win\n"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_142597/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_142597/source.c" target datalayout = "e-m:e-p270:32:32-p271:32: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 limit, i, count = 0, count1 = 0; scanf("%d" , &limit); char arr[limit + 1]; scanf("%s", arr); for(i = 0; arr[i] != '\0'; i++) {if(arr[i] == 'A') count++; if(arr[i] == 'D') count1++; } if(count > count1) printf(...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_14264/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_14264/source.c" target datalayout = "e-m:e-p270:32:32-p271: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,c,d; scanf("%d",&a); scanf("%d",&b); scanf("%d",&c); d = a + b +c; if (d >= 22){ printf("bust\n"); } else { printf("win\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_142683/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_142683/source.c" target datalayout = "e-m:e-p270:32:32-p271:32: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 a1,a2,a3; scanf("%d%d%d", &a1, &a2, &a3); { if ((a1+a2+a3)>=22) { printf("bust\n"); } else { printf("win\n"); } } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_142726/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_142726/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_add...
#include<stdio.h> int main() { int i,n,j; char s; while(scanf("%d",&n)!=EOF) { getchar(); i=0,j=0; while(n--) { s=getchar(); if(s=='A')i++; else j++; } if(i>j)printf("Anton\n"); else if(j>i)printf("Danik\n"); ...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_14277/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_14277/source.c" target datalayout = "e-m:e-p270:32:32-p271: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,i,sum=0,as=0; char nam[1000000]; scanf("%d",&n); for(i=1; i<=n+1; i++) { scanf("%c",&nam[i]); } for(i=1; i<=n+1; i++) { if(nam[i]=='A') sum++; if(nam[i]=='D') as++; } if(sum>as) print...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_14282/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_14282/source.c" target datalayout = "e-m:e-p270:32:32-p271: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 ...
#define _CRT_SECURE_NO_WARNINGS #include<stdio.h> int main(void){ int x, y, z; scanf("%d %d %d", &x, &y, &z); if (x + y + z >= 22) printf("bust\n"); else printf("win\n"); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_142863/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_142863/source.c" target datalayout = "e-m:e-p270:32:32-p271:32: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; scanf("%d %d %d",&a,&b,&c); if((a+b+c)>=22) printf("bust\n"); else printf("win\n"); return 0;}
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_142906/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_142906/source.c" target datalayout = "e-m:e-p270:32:32-p271:32: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 pl,i,j=0,m=0; char arr[100000]; scanf("%d",&pl); scanf("%s",&arr); for(i=0;i<pl;i++){ if(arr[i]=='A') j++; if(arr[i]=='D') m++; } if(j>m) printf("Anton\n"); if(j<m) printf("Danik\n"); ...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_14295/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_14295/source.c" target datalayout = "e-m:e-p270:32:32-p271: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 l,k,m,s=0; scanf("%d%d%d", &l, &k,&m); if(l+m+k>=22) printf("bust\n"); else printf("win\n"); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_142993/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_142993/source.c" target datalayout = "e-m:e-p270:32:32-p271:32: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 A1,A2,A3,sum=0; scanf("%d%d%d\n",&A1,&A2,&A3); sum= A1+A2+A3; if(sum>=22){ printf("bust"); } else{ printf("win"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_143042/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_143042/source.c" target datalayout = "e-m:e-p270:32:32-p271:32: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 input; int sum = 0; scanf("%d", &input); sum += input; scanf("%d", &input); sum += input; scanf("%d", &input); sum += input; if(sum >= 22){ printf("bust\n"); }else{ printf("win\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_143093/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_143093/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_add...
//set many funcs template //Ver.20190820 #include<stdio.h> #include<string.h> #include<stdlib.h> #include<stdbool.h> #include<time.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...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_143136/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_143136/source.c" target datalayout = "e-m:e-p270: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.sd = type { i32, i3...
#include<stdio.h> int main(){ int n,k; scanf("%d %d",&n,&k); int i,a[100]; for(i=0;i<n;i++){ scanf("%d",&a[i]); } int cnt=0,j,b[100],pd=1; for(i=0;i<n;i++){ pd=1; for(j=0;j<i;j++){ if(a[i]==a[j]){ pd=0; break; } } if(pd==1){ b[cnt]=i; cnt++; } } // printf("cnt=%d",cnt); ...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_14318/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_14318/source.c" target datalayout = "e-m:e-p270:32:32-p271: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 ...
//set many funcs template //Ver.20181228 #include<stdio.h> #include<string.h> #include<stdlib.h> #include<stdbool.h> #include<time.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){i...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_143251/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_143251/source.c" target datalayout = "e-m:e-p270:32:32-p271:32: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 h,w,k; scanf("%d %d %d", &h, &w, &k); char s[h][w+1]; for (int i = 0; i < h; i++) { scanf("%s", s[i]); } int cut[h][w]; int row[h]; int strawberry; int area = 1; for (int i = 0; i < h; i++) { strawberry = 0; for (int j = 0; j < w; j++) { if ...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_143352/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_143352/source.c" target datalayout = "e-m:e-p270:32:32-p271:32: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 x1, x2, x3, y1, y2, y3, r, xp, yp; double a, b, c; while(scanf("%lf %lf %lf %lf %lf %lf %lf %lf", &x1, &y1, &x2, &y2, &x3, &y3, &xp, &yp) != EOF){ a = (x3-x2)*(yp-y2)-(y3-y2)*(xp-x2); b = (x1-x3)*(yp-y3)-(y1-y3)*(xp-x3); c = (x2-x1)*(yp-y1)-...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_143396/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_143396/source.c" target datalayout = "e-m:e-p270:32:32-p271:32: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> double crossProduct(double *t,double *s){ return t[0]*s[1]-t[1]*s[0]; } int main(){ double a[2],b[2],c[2], p[2]; double ab[2],bc[2],ca[2]; double ap[2],bp[2],cp[2]; for(;scanf("%lf %lf %lf %lf %lf %lf %lf %lf",&a[0],&a[1],&b[0],&b[1],&c[0],&c[1],&p[0],&p[1])!=EOF;){ ab[0]=b[0]-a[0];ab[1]=b[1]-a...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_143446/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_143446/source.c" target datalayout = "e-m:e-p270:32:32-p271:32: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> double outerproduct(double xa, double ya, double xb, double yb){ return xa*yb-xb*ya; } int main() { double x[3], y[3], xp, yp, op1, op2, op3; while( EOF!=scanf("%lf %lf %lf %lf %lf %lf %lf %lf", &x[0], &y[0], &x[1], &y[1], &x[2], &y[2], &xp, &yp) ) { op1 = oute...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_143503/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_143503/source.c" target datalayout = "e-m:e-p270:32:32-p271:32: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 x[3], y[3], px, py; double s, s1, s2, s3; while (scanf("%lf %lf %lf %lf %lf %lf %lf %lf", x, y, x+1, y+1, x+2, y+2, &px, &py) != EOF) { s = ((x[1] - x[0]) * (y[2] - y[0]) - (y[1] - y[0]) * (x[2] - x[0])) / 2; s1 = ((x[1] - x[0]) * (py - y[0]) - (y[1] - y[0]) * (p...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_143547/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_143547/source.c" target datalayout = "e-m:e-p270:32:32-p271:32: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 <stdint.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <unistd.h> #include <math.h> #define P 1000000007 int comp(const void *a, const void *b){return *(int*)a-*(int*)b;} int main(void){ int n, m=0, i; scanf("%d", &n); for(i=0; i<n; i++){ int a; scanf("%d",...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_143590/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_143590/source.c" target datalayout = "e-m:e-p270:32:32-p271:32: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 BIG 2000000007 #define MOD 1000000007 typedef unsigned long long ull; typedef signed long long sll; #define N_MAX 100000 #define M_MAX 100000 typedef struct { int a; int b; } hw; const hw vector8[8] = { {-1, -1}, {-1, ...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_143633/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_143633/source.c" target datalayout = "e-m:e-p270: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.hw = type { i32, i3...
#include <stdio.h> int main(void) { int n,i,a,cnt; scanf("%d",&n); cnt = 0; for(i = 0;i < n;i++) { scanf("%d",&a); if (a % 2) { cnt++; } } printf("%s\n", cnt%2 ? "NO" : "YES"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_143677/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_143677/source.c" target datalayout = "e-m:e-p270:32:32-p271:32: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,a[100],x,j,sum=0; scanf("%d",&n); for(i=0;i<n;i++){ scanf("%d",&x); for(j=0;j<x;j++){ scanf("%d",&a[j]); sum=sum+a[j];} if((sum%x)!=0){ printf("%d\n",sum/x+1);} else{printf("%d\n",sum/x);} sum=0; } }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_14372/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_14372/source.c" target datalayout = "e-m:e-p270:32:32-p271: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 a[1005][6]; int main() { int n,i,fl1,fl2,flag=0,id,j; scanf("%d",&n); for(i=0;i<n;i++) { scanf("%s",a[i]); } for(i=0;i<n;i++) { fl1 = 0; fl2 = 0; if(flag==0) { for(j=0;j<strlen(a[i]);j++) { if(a[i][j]=='O' && fl1==0) { fl1 = 1; id = j; ...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_1438/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_1438/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr co...
#include <stdio.h> int main(){ int a,b; scanf("%d %d", &a, &b); int x = (a+b+1)/2; printf("%d", x); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_143842/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_143842/source.c" target datalayout = "e-m:e-p270:32:32-p271:32: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 x; int y; x = (double)(a+b)/2; y = (a+b)/2; if (x == y) { printf("%d\n", y); }else{ printf("%d\n", y+1); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_143893/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_143893/source.c" target datalayout = "e-m:e-p270:32:32-p271:32: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> #include<limits.h> int max(int a, int b){ return a >= b ? a : b; } int min(int a, int b){ return b >= a ? a : b; } int sei(int a){ return a>0 ? a : 0; } long int power(int a,int b){ long int count=1; for(int i=0;i<b;i++){ count *= 2...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_143943/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_143943/source.c" target datalayout = "e-m:e-p270:32:32-p271:32: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); printf("%d", (a + b + 1) / 2); return (0); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_143987/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_143987/source.c" target datalayout = "e-m:e-p270:32:32-p271:32: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)%2==0){ printf("%d",(a+b)/2);}else{ printf("%d",1+(a+b)/2);} return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_144036/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_144036/source.c" target datalayout = "e-m:e-p270:32:32-p271:32: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 <stdlib.h> int main() { float a, b,x; int c; scanf("%f %f", &a, &b); x=((b+a)/2); c=round(x); printf("%d",c); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_144087/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_144087/source.c" target datalayout = "e-m:e-p270:32:32-p271:32: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 t; scanf("%d\n",&t); while(t--){ long int l,r; scanf("%ld %ld\n",&l,&r); if(2*l>r) printf("-1 -1\n"); else printf("%ld %ld\n",l,2*l); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_14413/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_14413/source.c" target datalayout = "e-m:e-p270:32:32-p271: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 ...
// AOJ 0056: Goldbach's Conjecture // 2017.10.28 bal4u@uu #include <stdio.h> #include <stdlib.h> #define MAX 50000 #define SQRT 223 // sqrt(MAX) char table[MAX+1], *pmax = table+MAX; int combi[MAX+MAX] = {0,0,0,0,1,0}; int prime[5200], sz; int main() { int i, j; char buf[10]; char *p, *p2; int *q; for (p...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_144180/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_144180/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @table = dso_local global [...
#include<stdio.h> #include<math.h> int main() { int t; long l,r,i,j; scanf("%d",&t); long a[t],b[t]; for(i=0;i<t;i++) { scanf("%ld%ld",&l,&r); if(r>=2*l) {a[i]=l; b[i]=2*l;} else {a[i]=-1; b[i]=-1;} } for(i=0;i<t;i++) { printf("%d %d\n",a[i],b[i]); } }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_14426/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_14426/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr ...
#include <stdio.h> #include <string.h> #define MAX 100 int main(void) { char str[MAX]; int i, j; int length; while(scanf("%s", str) != EOF) { length = strlen(str); for(i=0; i<length; ++i) { if(str[i] == '@') { for(++i, j=0; j<str[i]-'0'; ++j) { printf("%c", str[i+1]); ...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_144302/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_144302/source.c" target datalayout = "e-m:e-p270:32:32-p271:32: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 <memory.h> #include <stdlib.h> int main(void) { int i; int k; int l; { char ch[1001]; { while(scanf("%s", ch)!= EOF) { for(i=0;ch[i]!='\0'; i++) { l=0; if(ch[i]=='@') { l=ch[i+1]-'0'; ...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_144346/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_144346/source.c" target datalayout = "e-m:e-p270:32:32-p271:32: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,j,k,a; char str[100]; while(scanf("%s",str)!=EOF){ for(i=0;str[i]!='\0';i++); for(j=0;j<i;j++){ if(str[j]=='@'){ switch(str[j+1]){ case'1':a=1;break; case'2':a=2;break; case'3':a=3;break; case'4':a=4;break; case'5':a=5;break; ...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_144397/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_144397/source.c" target datalayout = "e-m:e-p270:32:32-p271:32: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 parent[100005]; int isClear[100005]; void init(void) { for (int i = 0; i < 100005; i++) { parent[i] = -1; } } int root(int x) { if (parent[x] < 0) { return x; } return parent[x] = root(parent[x]); } void unite(int x, int y) { x = root(x); y = root(...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_144461/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_144461/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @parent = dso_local local_u...
//set many funcs template #include<stdio.h> #include<string.h> #include<stdlib.h> #include<stdbool.h> #include<time.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){return a...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_144634/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_144634/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_add...
#include <stdio.h> int main(int argc, char *argv[]) { char s[101]; long long k; scanf("%s", s); scanf("%lld", &k); long long i = 0; while(s[i] == '1'){ i++; } if(i >= k) printf("1\n"); else printf("%c\n", s[i]); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_144678/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_144678/source.c" target datalayout = "e-m:e-p270:32:32-p271:32: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[200]; unsigned long long k; int i; scanf("%s", s); scanf("%llu", &k); unsigned long long sum = 0; for (i = 0; i < strlen(s); i++) { if (s[i] == '1') { sum++; if (sum == k) { printf("1"); break; } } else { printf("%c", s[...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_144720/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_144720/source.c" target datalayout = "e-m:e-p270:32:32-p271:32: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> #include <limits.h> int q(const int *a,const int *b) { return *a-*b; } int main(void) { char s[101]; long k; int i; scanf("%s%ld",s,&k); if(k==1){ printf("%c",s[0]); return 0; } else{ ...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_144779/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_144779/source.c" target datalayout = "e-m:e-p270:32:32-p271:32: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 n, ntemp; scanf("%d", &n); int cnt = 0; while (pow(10, cnt) <= n) { cnt++; } int mysum = 0; ntemp = n; for (int i = cnt; i >= 1; i--) { int temp = ntemp / pow(10, i - 1); mysum += temp; ntemp -...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_144821/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_144821/source.c" target datalayout = "e-m:e-p270:32:32-p271:32: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,r,s=0; scanf("%d",&a); int b=a; while(a>0){ r=a%10; s=s+r; a=a/10; } if(b%s==0){ printf("Yes\n"); } else{ printf("No"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_144872/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_144872/source.c" target datalayout = "e-m:e-p270:32:32-p271:32: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 n,s=0; scanf("%ld",&n); for(long i=n;i;i/=10)s+=i%10; puts(n%s==0?"Yes":"No"); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_144915/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_144915/source.c" target datalayout = "e-m:e-p270:32:32-p271:32: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 n,ncpy;int sum=0; scanf("%ld",&n);ncpy=n; while(ncpy>0){ long tmp=ncpy%10; sum+=tmp; ncpy=(ncpy-tmp)/10; } if(n%sum==0)puts("Yes"); else puts("No"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_144959/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_144959/source.c" target datalayout = "e-m:e-p270:32:32-p271:32: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; int tmp; int sum = 0; scanf("%d", &n); tmp = n; for(int i = 0; i < 9; i++){ sum += tmp%10; tmp = tmp/10; } if(n % sum == 0){ printf("Yes\n"); }else{ printf("No\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_145015/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_145015/source.c" target datalayout = "e-m:e-p270:32:32-p271:32: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; while(scanf("%d",&a)!=EOF) { b=a;c=0; while(b) { c+=b%10; b=b/10; } if(a%c==0)printf("Yes\n"); else printf("No\n"); } }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_145059/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_145059/source.c" target datalayout = "e-m:e-p270:32:32-p271:32: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,max,min,s,a,j; while(scanf("%d",&n),n){ for(max=min=0;n--;){ for(j=s=0;j<5;j++){ scanf("%d",&a); s+=a; } if(max<s)max=s; if(min>s||min==0)min=s; } printf("%d %d\n",max,min); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_145101/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_145101/source.c" target datalayout = "e-m:e-p270:32:32-p271:32: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 num,s=0,temp,i,j,max,min; while (scanf("%d",&num)!=EOF&&num!=0) { for (i=0; i<num; i++) { s=0; for (j=0; j<5; j++) { scanf("%d",&temp); s+=temp; } if (i==0) { max=s,min...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_145145/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_145145/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_add...
/* ex 7_1 AtCoder Beginner Contest 108 B nk777 */ // ↑y // →x #include <stdio.h> // 頂点を返す構造体point typedef struct point{ int x_elem; int y_elem; }point; // ある頂点についてx軸、y軸について移動させた頂点を返す関数 // 求めたい点の2個前の点point_2before, 1個前の点point_1before point shift_point(point point_2before, point point_1before){ // 求めたい頂点...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_145189/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_145189/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_add...
#include <stdio.h> typedef struct point{ int x_elem; int y_elem; }point; // Solve by creating parallel vectors //!! Created parallel vector should have reversed direction // in order to follow anti-clockwise void shift_point(point or_point, point* sh_point, int dif_x, int dif_y){ sh_point -> x_elem = ...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_145231/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_145231/source.c" target datalayout = "e-m:e-p270: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.point = type { i32,...
typedef struct point{ int x_elem; int y_elem; }point; #include <stdio.h> int main(void) { point point[4], diff; scanf("%d %d %d %d", &point[0].x_elem, &point[0].y_elem, &point[1].x_elem, &point[1].y_elem); diff.x_elem = point[1].x_elem - point[0].x_elem; diff.y_elem = point[1].y_elem - point[0].y_el...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_145275/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_145275/source.c" target datalayout = "e-m:e-p270: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.point = type { i32,...
// AtCoder ABC108: B - Ruined Square // 2019.9.11 bal4u #include <stdio.h> typedef struct { int x, y; } PP; PP vadd(PP p1, PP p2) { PP r; r.x = p1.x + p2.x, r.y = p1.y + p2.y; return r; } PP vsub(PP p1, PP p2) { PP r; r.x = p1.x - p2.x, r.y = p1.y - p2.y; return r; } PP vmul(PP p1, PP p2) { PP r; r.x = p1.x * p2.x -...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_145325/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_145325/source.c" target datalayout = "e-m:e-p270: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.PP = type { i32, i3...
#include <stdio.h> int main() { int x1, y1, x2, y2, vx, vy, x3, y3, x4, y4; scanf("%d%d%d%d", &x1, &y1, &x2, &y2); vx = x2 - x1; vy = y2 - y1; x3 = x2 - vy; y3 = y2 + vx; x4 = x3 - vx; y4 = y3 - vy; printf("%d %d %d %d", x3, y3, x4, y4); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_145376/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_145376/source.c" target datalayout = "e-m:e-p270:32:32-p271:32: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() { int x1 = 0, x2 = 0, x3 = 0, x4 = 0, y1 = 0, y2 = 0, y3 = 0, y4 = 0, sub1, sub2; scanf("%d %d %d %d", &x1, &y1, &x2, &y2); //x2基準でx1から-90°回転でx3(どの場合も) //x1基準でx2から90°回転でx4(どの場合も) x3 = y1 - y2 + x2; y3 = x2 - x1 + y2; x4 = y1 - y2 + x1; y4 = x2 - x...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_145419/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_145419/source.c" target datalayout = "e-m:e-p270:32:32-p271:32: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 x[5]; int y[5]; int a, b; scanf("%d %d %d %d", &x[1], &y[1], &x[2], &y[2]); // if (y[1] < y[2]) { a = x[2] - x[1]; b = y[2] - y[1]; x[4] = x[1] - b; y[4] = y[1] + a; y[3] = y[2] + a; x[3] = x[2] - b; //} //else { //} printf("%d %d %d %d\n", x[3...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_145462/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_145462/source.c" target datalayout = "e-m:e-p270:32:32-p271:32: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 long n,b,r,re; scanf("%lld %lld %lld",&n,&b,&r); re = n / (b+r); if( n%(b+r) >= b ) printf("%lld",b*re + b); else printf("%lld", b*re + n%(b+r)); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_145512/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_145512/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_add...
#include<stdio.h> long long int min(long long int x,long long int y){ long long int ans; if(x<y){ ans=x; }else{ ans=y; } return ans; } int main(void){ long long int n,a,b; scanf("%lld %lld %lld",&n,&a,&b); long long int c=a+b; long long int ans=a*(n/c); ans+=min(n%c,a); printf("%lld\n",ans...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_145556/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_145556/source.c" target datalayout = "e-m:e-p270:32:32-p271:32: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 long int n,a,b,sum; scanf("%lld%lld%lld",&n,&a,&b); if(n%(a+b)>a) printf("%lld\n",n/(a+b)*a+a); else printf("%lld\n",n/(a+b)*a+n%(a+b)); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_145592/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_145592/source.c" target datalayout = "e-m:e-p270:32:32-p271:32: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) { long n,blue,red,amari,shou; scanf("%ld %ld %ld",&n,&blue,&red); amari=n%(blue+red); shou=n/(blue+red); if(amari<blue) {printf("%ld",shou*blue+amari);return(0);} printf("%ld",(shou+1)*blue);return(0); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_145635/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_145635/source.c" target datalayout = "e-m:e-p270:32:32-p271:32: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,a,b,sum; scanf("%ld %ld %ld", &n,&a,&b); sum = a+b; if(n%sum < a){ printf("%ld",a*(n/sum)+(n%sum)); }else{ printf("%ld",a*(n/sum)+a); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_145679/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_145679/source.c" target datalayout = "e-m:e-p270:32:32-p271:32: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 int n, a, b, div, mod, plus; if(scanf("%ld %ld %ld", &n, &a, &b) <= 0) { printf("fail"); } if (a == 0) { printf("%d", 0); return 0; } div = n / (a + b); mod = n % (a + b); plus = a > mod ? mod : a; printf("%lu", a * div + plus); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_145721/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_145721/source.c" target datalayout = "e-m:e-p270:32:32-p271:32: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<math.h> #define PI 3.141592653589793 #define MOD 1000000007 long int combination(long int n, long int r); //qsort用、昇順 int compare_int(const void *a, const void *b) { return *(int*)a-*(int*)b; } //qsort(data, 10, sizeof(int), compare_int) long int comb...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_145772/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_145772/source.c" target datalayout = "e-m:e-p270:32:32-p271:32: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 sort_t{ int X; int L; }sort; sort lr[100000]; int comp(const void *a, const void *b) { sort lr1 = *((sort *)a); sort lr2 = *((sort *)b); int v1 = lr1.X + lr1.L; int v2 = lr2.X + lr2.L; if (v1 > v2) { return 1; } else if (v1 < ...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_145822/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_145822/source.c" target datalayout = "e-m:e-p270: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.sort_t = type { i32...
#include <stdio.h> int main() { int x = 0; char s[5]; for (int i = 0; i < 4; i++) { scanf("%c", &s[i]); } for (int i = 0; i < 4; i++) { if (s[i] == '+') { x++; } else { x--; } } printf("%d", x); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_145866/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_145866/source.c" target datalayout = "e-m:e-p270:32:32-p271:32: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[4]; int count = 0; scanf("%s",S); for(int i=0;i<4;i++){ if(S[i]=='+'){ count++; } else{ count--; } } printf("%d\n",count); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_145938/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_145938/source.c" target datalayout = "e-m:e-p270:32:32-p271:32: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 ans = 0; char data[4]; scanf("%s",data); for(int i = 0;i < 4;i++){ if(data[i] == '+') ans++; else ans--; } printf("%d\n",ans); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_145989/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_145989/source.c" target datalayout = "e-m:e-p270:32:32-p271:32: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]; int i,count=0; scanf("%s",a); for(i=0;i<4;i++) { if(a[i]=='+') count++; else count--; } printf("%d",count); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_146038/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_146038/source.c" target datalayout = "e-m:e-p270:32:32-p271:32: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[4]; int num = 0; scanf("%s", s); for(int i=0; i<4; i++){ if(s[i] == '+'){ num++; }else if(s[i] == '-'){ num--; } } printf("%d\n",num); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_146089/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_146089/source.c" target datalayout = "e-m:e-p270:32:32-p271:32: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,f=0,ans=0; while(f!=4){ a=getchar(); if(a=='+'){ans++;} else ans--; f++; } printf("%d",ans); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_146131/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_146131/source.c" target datalayout = "e-m:e-p270:32:32-p271:32: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, num=0; char s[5]; scanf("%s", s); for(i=0; i<4; i++) { if(s[i]=='+') num++; else num--; } printf("%d", num); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_146175/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_146175/source.c" target datalayout = "e-m:e-p270:32:32-p271:32: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 h, m, s, cur_sec, remaining; while (scanf("%d%d%d", &h, &m, &s) == 3 && h != -1 && m != -1 && s != -1) { cur_sec = h * 3600 + m * 60 + s; remaining = 2 * 3600 - cur_sec; printf("%02d:%02d:%02d\n", remaining / 3600, ...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_146218/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_146218/source.c" target datalayout = "e-m:e-p270:32:32-p271:32: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; int d,e,f; int x,y,z; int s,t,u; scanf("%d %d %d",&a,&b,&c); while(a!=-1 && b!=-1 && c!=-1) { d=2; e=0; f=0; if((f-c)>=0) { z=f-c; } if((f-c)<0) { if(e!=0) { e=e-1; f=f+60; z=f-c; } if(e==0) { d=d-1; e=e+60; e=e-1; f...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_146276/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_146276/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_add...
#include<stdio.h> #include<stdlib.h> #include<string.h> int generate_open(int n, int open[10]) { int i; int j; if(n < 1 || n > 1023) { for(i = 0; i < 10; i += 1) { open[i] = 0; } return 0; } j = 512; for(i = 0; i < 10; i += 1) { open[i] = n / j; n -= open[i] * j; j /= 2; } return 0; } int eval_...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_146355/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_146355/source.c" target datalayout = "e-m:e-p270: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...