Compare commits
2
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3f62e35eb0
|
||
|
|
f9af40293e
|
No files matched your search
@@ -0,0 +1,152 @@
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
int main()
|
||||
{
|
||||
int array[26];
|
||||
int time = 0;
|
||||
char problem;
|
||||
char RightOrWrong[10];
|
||||
int sum = 0;
|
||||
int solved = 0;
|
||||
int is_solved[26];
|
||||
|
||||
for (int i = 0 ; i < 26; i++){
|
||||
is_solved[i] = 0;
|
||||
}
|
||||
|
||||
for(int i = 0; i < 26; i++)
|
||||
{
|
||||
array[i] = 0;
|
||||
}
|
||||
|
||||
while(scanf("%d %c %s", &time, &problem, &RightOrWrong) == 3 && time != -1){
|
||||
|
||||
|
||||
switch (problem){
|
||||
case 'A':
|
||||
if (strcmp(RightOrWrong, "wrong")==0){
|
||||
array[0] += 20;
|
||||
}else{
|
||||
array[0] += time;
|
||||
solved += 1;
|
||||
is_solved[0] = 1;
|
||||
}
|
||||
break;
|
||||
case 'B':
|
||||
if (strcmp(RightOrWrong, "wrong")==0){
|
||||
array[1] += 20;
|
||||
}else{
|
||||
array[1] += time;
|
||||
solved += 1;
|
||||
is_solved[1] = 1;
|
||||
|
||||
}
|
||||
break;
|
||||
case 'C':
|
||||
if (strcmp(RightOrWrong, "wrong")==0){
|
||||
array[2] += 20;
|
||||
}else{
|
||||
array[2] += time;
|
||||
solved += 1;
|
||||
is_solved[2] = 1;
|
||||
|
||||
}
|
||||
break;
|
||||
case 'D':
|
||||
if (strcmp(RightOrWrong, "wrong")==0){
|
||||
array[3] += 20;
|
||||
}else{
|
||||
array[3] += time;
|
||||
solved += 1;
|
||||
is_solved[3] = 1;
|
||||
|
||||
}
|
||||
break;
|
||||
case 'E':
|
||||
if (strcmp(RightOrWrong, "wrong")==0){
|
||||
array[4] += 20;
|
||||
}else{
|
||||
array[4] += time;
|
||||
solved += 1;
|
||||
is_solved[4] = 1;
|
||||
|
||||
}
|
||||
break;
|
||||
case 'F':
|
||||
if (strcmp(RightOrWrong, "wrong")==0){
|
||||
array[5] += 20;
|
||||
}else{
|
||||
array[5] += time;
|
||||
solved += 1;
|
||||
is_solved[5] = 1;
|
||||
|
||||
}
|
||||
break;
|
||||
case 'G':
|
||||
if (strcmp(RightOrWrong, "wrong")==0){
|
||||
array[6] += 20;
|
||||
}else{
|
||||
array[6] += time;
|
||||
solved += 1;
|
||||
is_solved[6] = 1;
|
||||
|
||||
}
|
||||
break;
|
||||
case 'H':
|
||||
if (strcmp(RightOrWrong, "wrong")==0){
|
||||
array[7] += 20;
|
||||
}else{
|
||||
array[7] += time;
|
||||
solved += 1;
|
||||
is_solved[7] = 1;
|
||||
|
||||
}
|
||||
break;
|
||||
case 'I':
|
||||
if (strcmp(RightOrWrong, "wrong")==0){
|
||||
array[8] += 20;
|
||||
}else{
|
||||
array[8] += time;
|
||||
solved += 1;
|
||||
is_solved[8] = 1;
|
||||
|
||||
}
|
||||
break;
|
||||
case 'J':
|
||||
if (strcmp(RightOrWrong, "wrong")==0){
|
||||
array[9] += 20;
|
||||
}else{
|
||||
array[9] += time;
|
||||
solved += 1;
|
||||
is_solved[9] = 1;
|
||||
|
||||
}
|
||||
break;
|
||||
case 'K':
|
||||
if (strcmp(RightOrWrong, "wrong")==0){
|
||||
array[10] += 20;
|
||||
}else{
|
||||
array[10] += time;
|
||||
solved += 1;
|
||||
is_solved[10] = 1;
|
||||
|
||||
}
|
||||
break;
|
||||
default:
|
||||
return 0;
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
for(int i = 0; i <= 26; i++)
|
||||
{
|
||||
if(is_solved[i]==1){
|
||||
sum += array[i];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
printf("%d %d", solved, sum);
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
package com.kattis.ncpc26.pf;
|
||||
|
||||
public class B {
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
package com.kattis.ncpc26.pf;
|
||||
|
||||
public class D {
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
package com.kattis.ncpc26.pf;
|
||||
|
||||
public class E {
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
package com.kattis.ncpc26.pf;
|
||||
|
||||
public class F {
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
package com.kattis.ncpc26.pf;
|
||||
|
||||
public class G {
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
package com.kattis.ncpc26.pf;
|
||||
|
||||
public class I {
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
import sys
|
||||
|
||||
l = 0
|
||||
r = 1001
|
||||
m = 500
|
||||
temp = m
|
||||
|
||||
for i in range(10):
|
||||
print(m)
|
||||
sys.stdout.flush()
|
||||
|
||||
term = input()
|
||||
|
||||
if term == "correct":
|
||||
exit()
|
||||
elif term == "lower":
|
||||
temp = m
|
||||
m = (l + m) // 2
|
||||
r = temp
|
||||
else:
|
||||
temp = m
|
||||
m = (m + r) // 2
|
||||
l = temp
|
||||
@@ -0,0 +1,12 @@
|
||||
ball = 1
|
||||
|
||||
for i in range(5):
|
||||
j = int(input())
|
||||
k = int(input())
|
||||
|
||||
if j == ball:
|
||||
ball = k
|
||||
elif k == ball:
|
||||
ball = j
|
||||
|
||||
print(ball)
|
||||
Reference in new issue
Block a user