Submission #50686510


Source Code Expand

Copy
#include <iostream>
#include <map>
using namespace std;
using ui = unsigned int;
int main()
{
ui n, q;
cin >> n >> q;
map<ui, map<ui, bool>> ff;
ui t, a, b;
for (; q--;)
{
cin >> t >> a >> b;
if (t == 1)
ff[a][b] = true;
else if (t == 2)
ff[a][b] = false;
else if (t == 3)
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#include <iostream>
#include <map>

using namespace std;
using ui = unsigned int;

int main()
{
  ui n, q;
  cin >> n >> q;

  map<ui, map<ui, bool>> ff;
  ui t, a, b;
  for (; q--;)
  {
    cin >> t >> a >> b;
    if (t == 1)
      ff[a][b] = true;
    else if (t == 2)
      ff[a][b] = false;
    else if (t == 3)
      cout << (ff[a][b] && ff[b][a] ? "Yes" : "No") << endl;
  }

  return 0;
}

Submission Info

Submission Time
Task C - FF
User michimani
Language C++ 20 (Clang 16.0.6)
Score 300
Code Size 420 Byte
Status AC
Exec Time 374 ms
Memory 26228 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 300 / 300
Status
AC × 3
AC × 17
Set Name Test Cases
Sample 00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt
All 00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt, 01_small_sns_03.txt, 01_small_sns_04.txt, 01_small_sns_05.txt, 01_small_sns_06.txt, 02_random_07.txt, 02_random_08.txt, 03_max_09.txt, 03_max_10.txt, 04_large_sns_11.txt, 04_large_sns_12.txt, 04_large_sns_13.txt, 05_handmade_14.txt, 05_handmade_15.txt, 05_handmade_16.txt
Case Name Status Exec Time Memory
00_sample_00.txt AC 1 ms 3496 KB
00_sample_01.txt AC 1 ms 3544 KB
00_sample_02.txt AC 1 ms 3496 KB
01_small_sns_03.txt AC 1 ms 3500 KB
01_small_sns_04.txt AC 124 ms 3464 KB
01_small_sns_05.txt AC 165 ms 5400 KB
01_small_sns_06.txt AC 131 ms 3416 KB
02_random_07.txt AC 19 ms 5484 KB
02_random_08.txt AC 133 ms 15660 KB
03_max_09.txt AC 319 ms 26228 KB
03_max_10.txt AC 306 ms 21180 KB
04_large_sns_11.txt AC 184 ms 19260 KB
04_large_sns_12.txt AC 107 ms 11944 KB
04_large_sns_13.txt AC 217 ms 13464 KB
05_handmade_14.txt AC 319 ms 17116 KB
05_handmade_15.txt AC 374 ms 12732 KB
05_handmade_16.txt AC 278 ms 8148 KB


2025-04-02 (Wed)
03:26:28 +00:00