Submission #570303

# Submission time Handle Problem Language Result Execution time Memory
570303 2022-05-29T07:54:59 Z 장태환(#8350) Inside information (BOI21_servers) C++17
0 / 100
248 ms 596 KB
#include <bits/stdc++.h>
//Announcing plan to get the test data is probably not a good idea
using namespace std;
int app[100100];
int main()
{
	int N, K;
	cin >> N >> K;
	int i;
	int c=1;
	for (i = 0; i < N + K - 1; i++)
	{
		char a;
		cin >> a;
		if (a == 'S')
		{
			int a, b;
			cin >> a >> b;
			app[a] = app[b] = 1;
			c++;
		}
		else if (a == 'Q')
		{
			int a, b;
			cin >> a >> b;
			if (b == 1 && app[a] || a == b || a == 1 && app[b])
				cout << "yes";
			else
				cout << "no";
		}
		else
		{
			int a;
			cin >> a;
			if (a == 1)
				cout << c << '\n';
			else
				cout << app[a] + 1 << '\n';
		}
	}
}

Compilation message

servers.cpp: In function 'int main()':
servers.cpp:26:15: warning: suggest parentheses around '&&' within '||' [-Wparentheses]
   26 |    if (b == 1 && app[a] || a == b || a == 1 && app[b])
      |        ~~~~~~~^~~~~~~~~
servers.cpp:26:45: warning: suggest parentheses around '&&' within '||' [-Wparentheses]
   26 |    if (b == 1 && app[a] || a == b || a == 1 && app[b])
      |                                      ~~~~~~~^~~~~~~~~
# Verdict Execution time Memory Grader output
1 Incorrect 192 ms 560 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 192 ms 560 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 220 ms 536 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 220 ms 536 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 212 ms 564 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 212 ms 564 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 248 ms 596 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 248 ms 596 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 194 ms 536 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 194 ms 536 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 209 ms 548 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 209 ms 548 KB Output isn't correct
2 Halted 0 ms 0 KB -