This file contains hidden or 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
#include <stdio.h> | |
#include <stdlib.h> | |
int main(void) { | |
int x, y, z; | |
scanf("%d%d%d", &x, &y, &z); | |
if(z >= abs(x - y)){ | |
if(x > y){ | |
printf("%d\n", (z - abs(x - y)) / 2 + x); |
This file contains hidden or 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
#include <stdio.h> | |
int main(void) { | |
int a, b, c; | |
scanf("%d%d%d", &a, &b, &c); | |
printf("%f\n", (double)a / b * c); | |
return 0; | |
} |
This file contains hidden or 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
#include <stdio.h> | |
int main(void) { | |
int i, flag = 1; | |
char s[400000]; | |
scanf("%s", s); | |
i = 0; | |
while(s[i] != 0){ |
This file contains hidden or 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
#include <stdio.h> | |
int main(void) { | |
int n; | |
int i, j; | |
scanf("%d", &n); | |
if(n == 1){ | |
printf("1\n"); |
This file contains hidden or 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
#include <stdio.h> | |
#include <stdlib.h> | |
int main(void) { | |
int a, b, c; | |
int ba, bc, ac; | |
scanf("%d%d%d", &a, &b, &c); | |
ba = abs(b - a); |
This file contains hidden or 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
#include <stdio.h> | |
int main(void) { | |
int x; | |
scanf("%d", &x); | |
if(x == 0 || x == 4 || x == 10){ | |
printf("Yes\n"); | |
} |
This file contains hidden or 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
#include <stdio.h> | |
int main(void) { | |
int x, n, m; | |
scanf("%d%d%d", &x, &n, &m); | |
int a[100001], b[100001]; | |
int i; | |
int flag_a = 0; | |
int flag_b = 0; |
This file contains hidden or 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
n, m = gets.split(' ') | |
b = gets.split(' ') | |
a = [''] | |
(1..n.to_i).each do |j| | |
a << gets.chop | |
end | |
if b[0] == "+" | |
(1..n.to_i).each do |j| | |
(1..m.to_i).each do |i| | |
printf "#{a[j].to_i + b[i].to_i}" |
This file contains hidden or 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
#include <stdio.h> | |
int main(void) { | |
char s[8]; | |
int i; | |
scanf("%s", s); | |
for(i = 1;i < 7;i++){ | |
if(s[i - 1] == 'a' && s[i] == 'o'){ | |
s[i - 1] = 'k'; |
This file contains hidden or 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
a = gets.split(' ') | |
a = a.map{|ai| ai.to_i}.sort | |
(0..a.size - 2).each do |i| | |
if a[i] + 1 != a[i + 1] | |
printf "No\n" | |
exit | |
end | |
end | |
printf "Yes\n" |