about summary refs log tree commit diff
path: root/others/volume1/040.pas
diff options
context:
space:
mode:
authorRaphael McSinyx <vn.mcsinyx@gmail.com>2017-02-13 10:29:05 +0700
committerRaphael McSinyx <vn.mcsinyx@gmail.com>2017-02-13 10:29:05 +0700
commitac0a1ea7dabaee1b986927efb25e94a3a091fff5 (patch)
tree5765f412d59d73303c2ec981da4c4e1ef073bb99 /others/volume1/040.pas
parent36461ea5c65fcdf7169abdb39549ef53a15d4f03 (diff)
downloadcp-ac0a1ea7dabaee1b986927efb25e94a3a091fff5.tar.gz
Update others/volume1
Diffstat (limited to 'others/volume1/040.pas')
-rw-r--r--others/volume1/040.pas27
1 files changed, 27 insertions, 0 deletions
diff --git a/others/volume1/040.pas b/others/volume1/040.pas
new file mode 100644
index 0000000..919304c
--- /dev/null
+++ b/others/volume1/040.pas
@@ -0,0 +1,27 @@
+var
+  n, i, c: int16;
+  x, a, b: int32;
+  s: array of boolean;
+
+begin
+  c := 0;
+  readln(n, x);
+  setlength(s, n);
+  for i := 0 to n - 1 do
+    s[i] := false;
+  for i := 0 to n - 1 do
+    begin
+      readln(a, b);
+      if (a <= x) and
+         (x <= b) then
+        begin
+          inc(c);
+          s[i] := true
+        end
+    end;
+  writeln(c);
+  for i := 0 to n - 1 do
+    if s[i] then
+      write(i + 1, ' ');
+  writeln
+end.