Language: C++


include <stdio.h>

#define MAX_N 100002

typedef struct { char *p; int tm; } Q;
Q que[(MAX_N<<1)+2]; int top, end;
char name[MAX_N][20];

char buf[20], *p;
int in()
{
	int n = 0;
	while (*p >= '0') n = 10*n + (*p++ & 0xf);
	p++;
	return n;
}

int main()
{
	int  n, q, tm, i;
	Q  t;

	fgets(p=buf, 20, stdin);
	n = in(), q = in();
	for (i = 0; i < n; i++) {
		fgets(p=name[i], 20, stdin);
		while (*p > ' ') p++; *p++ = 0;
		que[i].p = name[i], que[i].tm = in();
	}

	tm = 0, top = 0, end = n;
	while (top != end) {
		t = que[top]; if (++top == MAX_N) top = 0;
		if (t.tm <= q) {
			printf("%s %d\n", t.p, tm+t.tm);
			tm += t.tm;
		} else {
			t.tm -= q;
			que[end] = t; if (++end == MAX_N) end = 0;
			tm += q;
		}
	}
	return 0;
}




Compile Error Logs: 

 

ステータス 
Judge: 10/10 C CPU: 00:00 sec Memory: 4224 KB Length: 776 B 2018-04-30 11:09 
テストケースの判定結果 
Case # Verdict CPU Time Memory In Out Case Name 

Case #1 : Accepted 00:00 1972 39 35 testcase_00 
Case #2 : Accepted 00:00 2024 13 7 testcase_01 
Case #3 : Accepted 00:00 2100 20 16 testcase_02 
Case #4 : Accepted 00:00 2040 60 62 testcase_03 
Case #5 : Accepted 00:00 2028 990 1181 testcase_04 
Case #6 : Accepted 00:00 2044 989 1181 testcase_05 
Case #7 : Accepted 00:00 2036 992 1165 testcase_06 
Case #8 : Accepted 00:00 1980 991 1174 testcase_07 
Case #9 : Accepted 00:00 2412 10788 13767 testcase_08 
Case #10 : Accepted 00:00 4224 438916 631439 testcase_09 



 < prev |  /   | next >      

 

Judge Input #  (  | )  Judge Output #  (  | ) 


  

 



Compiler output:
a.cc:55:75: error: invalid digit "9" in octal constant
   55 | Judge: 10/10 C CPU: 00:00 sec Memory: 4224 KB Length: 776 B 2018-04-30 11:09
      |                                                                           ^~
a.cc:57:6: error: stray '#' in program
   57 | Case # Verdict CPU Time Memory In Out Case Name
      |      ^
a.cc:59:6: error: stray '#' in program
   59 | Case #1 : Accepted 00:00 1972 39 35 testcase_00
      |      ^
a.cc:60:6: error: stray '#' in program
   60 | Case #2 : Accepted 00:00 2024 13 7 testcase_01
      |      ^
a.cc:61:6: error: stray '#' in program
   61 | Case #3 : Accepted 00:00 2100 20 16 testcase_02
      |      ^
a.cc:62:6: error: stray '#' in program
   62 | Case #4 : Accepted 00:00 2040 60 62 testcase_03
      |      ^
a.cc:63:6: error: stray '#' in program
   63 | Case #5 : Accepted 00:00 2028 990 1181 testcase_04
      |      ^
a.cc:64:6: error: stray '#' in program
   64 | Case #6 : Accepted 00:00 2044 989 1181 testcase_05
      |      ^
a.cc:65:6: error: stray '#' in program
   65 | Case #7 : Accepted 00:00 2036 992 1165 testcase_06
      |      ^
a.cc:66:6: error: stray '#' in program
   66 | Case #8 : Accepted 00:00 1980 991 1174 testcase_07
      |      ^
a.cc:67:6: error: stray '#' in program
   67 | Case #9 : Accepted 00:00 2412 10788 13767 testcase_08
      |      ^
a.cc:68:6: error: stray '#' in program
   68 | Case #10 : Accepted 00:00 4224 438916 631439 testcase_09
      |      ^
a.cc:76:13: error: stray '#' in program
   76 | Judge Input #  (  | )  Judge Output #  (  | )
      |             ^
a.cc:76:37: error: stray '#' in program
   76 | Judge Input #  (  | )  Judge Output #  (  | )
      |                                     ^
a.cc:2:1: error: 'include' does not name a type
    2 | include <stdio.h>
      | ^~~~~~~
a.cc:6:37: error: 'Q' does not name a type
    6 | typedef struct { char *p; int tm; } Q;
      |                                     ^
a.cc:7:1: error: 'Q' does not name a type
    7 | Q que[(MAX_N<<1)+2]; int top, end;
      | ^
a.cc: In function 'int main()':
a.cc:22:9: error: 'Q' was not declared in this scope
   22 |         Q  t;
      |         ^
a.cc:24:26: error: 'stdin' was not declared in this scope
   24 |         fgets(p=buf, 20, stdin);
      |                          ^~~~~
a.cc:1:1: note: 'stdin' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
  +++ |+#include <cstdio>
    1 | 
a.cc:24:9: error: 'fgets' was not declared in this scope
   24 |         fgets(p=buf, 20, stdin);
      |         ^~~~~
a.cc:29:17: error: 'que' was not declared in this scope
   29 |                 que[i].p = name[i], que[i].tm = in();
      |                 ^~~
a.cc:34:17: error: 't' was not declared in this scope
   34 |                 t = que[top]; if (++top == MAX_N) top = 0;
      |                 ^
a.cc:34:21: error: 'que' was not declared in this scope
   34 |                 t = que[top]; if (++top == MAX_N) top = 0;
      |                     ^~~
a.cc:36:25: error: 'printf' was not declared in this scope
   36 |                         printf("%s %d\n", t.p, tm+t.tm);
      |                         ^~~~~~
a.cc:36:25: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
a.cc: At global scope:
a.cc:50:1: error: 'Compile' does not name a type
   50 | Compile Error Logs:
      | ^~~~~~~