Created
November 5, 2013 14:20
-
-
Save taikoubou/7319691 to your computer and use it in GitHub Desktop.
JOI非公式難易度表 レベル1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0510 | |
#include<cstdio> | |
int main(){ | |
int s=0,t=0; | |
int tmp[4]; | |
scanf("%d %d %d %d",&tmp[0],&tmp[1],&tmp[2],&tmp[3]); | |
for(int i=0;i<4;i++){ | |
s += tmp[i]; | |
} | |
scanf("%d %d %d %d",&tmp[0],&tmp[1],&tmp[2],&tmp[3]); | |
for(int i=0;i<4;i++){ | |
t += tmp[i]; | |
} | |
if(s < t){ | |
printf("%d\n",t); | |
} | |
else{ | |
printf("%d\n",s); | |
} | |
return 0; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0521 | |
#include<cstdio> | |
int main(){ | |
int money; | |
int dat[] = {500,100,50,10,5,1}; | |
while(1){ | |
scanf("%d",&money); | |
if(money == 0)break; | |
int fishing = 1000-money; | |
int cnt = 0; | |
for(int i=0;i<6;++i){ | |
if(fishing < 0)break; | |
int tmp = fishing/dat[i]; | |
fishing -= tmp * dat[i]; | |
cnt += tmp; | |
} | |
printf("%d\n",cnt); | |
} | |
return 0; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0532 | |
#include<cstdio> | |
#include<cmath> | |
using namespace std; | |
int main(){ | |
int ih,im,is; | |
int oh,om,os; | |
int ah,am,as; | |
for(int i=0;i<3;++i){ | |
scanf("%d %d %d %d %d %d",&ih,&im,&is,&oh,&om,&os); | |
ah = oh-ih; | |
if(om-im < 0){ | |
am = 60-abs(om-im); | |
ah--; | |
} | |
else{ | |
am = om-im; | |
} | |
if(os-is < 0){ | |
as = 60-abs(os-is); | |
if(am-1 < 0){ | |
am = 59; | |
ah--; | |
} | |
else{ | |
am--; | |
} | |
} | |
else{ | |
as = os-is; | |
} | |
printf("%d %d %d\n",ah,am,as); | |
} | |
return 0; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0543 | |
#include<cstdio> | |
int main(){ | |
int total; | |
while(1){ | |
scanf("%d",&total); | |
if(total == 0)break; | |
int sum = 0; | |
for(int i=0;i<9;i++){ | |
int tmp; | |
scanf("%d",&tmp); | |
sum += tmp; | |
} | |
printf("%d\n",total-sum); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0554 | |
#include<cstdio> | |
int main(){ | |
int sum = 0; | |
for(int i=0;i<4;i++){ | |
int temp; | |
scanf("%d",&temp); | |
sum += temp; | |
} | |
printf("%d\n%d\n",sum/60,sum%60); | |
return 0; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0565 | |
#include<cstdio> | |
int main(){ | |
int min_ps=30000,min_j=30000,temp; | |
for(int i=0;i<5;i++){ | |
scanf("%d",&temp); | |
if(min_ps > temp && i < 3){ | |
min_ps = temp; | |
} | |
else if(min_j > temp){ | |
min_j = temp; | |
} | |
} | |
printf("%d\n",min_ps+min_j-50); | |
return 0; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0576 | |
#include<cstdio> | |
#include<algorithm> | |
using namespace std; | |
int main(){ | |
int l,a,b,c,d; | |
scanf("%d%d%d%d%d",&l,&a,&b,&c,&d); | |
int ans = l; | |
ans = min(ans,l-(a+c-1)/c); | |
ans = min(ans,l-(b+d-1)/d); | |
printf("%d\n",ans); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment