> For the complete documentation index, see [llms.txt](https://wenbo-notes.gitbook.io/coding/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://wenbo-notes.gitbook.io/coding/kattis/easy/attendance.md).

# Attendance

## Question

{% embed url="<https://open.kattis.com/problems/attendance2>" %}

## Solution

### Idea

This question is an array manipulation problem. The idea is easy:

1. First Iteration is to mark the attendance: we start from the second entry and if encounter "Present!", mark the previous name as `present`.
2. Second Iteration is to print the absence: we start from the first entry and if the name is not "Present!" and its absence is false, print out the absent student's name.

But the implementation may depends individually. Personally, I used `struct` in C to solve it.&#x20;

{% code lineNumbers="true" %}

```c
typedef struct student {
  char *name;
  bool present;
} student;

```

{% endcode %}

### Code

{% @github-files/github-code-block url="<https://github.com/mendax1234/Coding-Problems/blob/main/kattis/attendance2/attendance2.c>" %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://wenbo-notes.gitbook.io/coding/kattis/easy/attendance.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
