Submission #570309

# Submission time Handle Problem Language Result Execution time Memory
570309 2022-05-29T08:01:18 Z 장태환(#8350) Inside information (BOI21_servers) C++17
2.5 / 100
284 ms 1484 KB
#include <bits/stdc++.h>
//Announcing plan to get the test data is probably not a good idea
using namespace std;
int app[120100];
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] = c++;
		}
		else if (a == 'Q')
		{
			int a, b;
			cin >> a >> b;
			if (b == 1 && app[a] || a == b || a == 1 && app[b]||app[a]&&app[b]&&app[a]>app[b])
				cout << "yes";
			else
				cout << "no";
			cout << '\n';
		}
		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:25:15: warning: suggest parentheses around '&&' within '||' [-Wparentheses]
   25 |    if (b == 1 && app[a] || a == b || a == 1 && app[b]||app[a]&&app[b]&&app[a]>app[b])
      |        ~~~~~~~^~~~~~~~~
servers.cpp:25:45: warning: suggest parentheses around '&&' within '||' [-Wparentheses]
   25 |    if (b == 1 && app[a] || a == b || a == 1 && app[b]||app[a]&&app[b]&&app[a]>app[b])
      |                                      ~~~~~~~^~~~~~~~~
servers.cpp:25:70: warning: suggest parentheses around '&&' within '||' [-Wparentheses]
   25 |    if (b == 1 && app[a] || a == b || a == 1 && app[b]||app[a]&&app[b]&&app[a]>app[b])
      |                                                        ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Incorrect 207 ms 632 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 207 ms 632 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 196 ms 740 KB Output is correct
2 Correct 284 ms 1244 KB Output is correct
3 Correct 284 ms 1484 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 196 ms 740 KB Output is correct
2 Correct 284 ms 1244 KB Output is correct
3 Correct 284 ms 1484 KB Output is correct
4 Incorrect 200 ms 880 KB Extra information in the output file
5 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 214 ms 620 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 214 ms 620 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 194 ms 684 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 194 ms 684 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 202 ms 732 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 202 ms 732 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 196 ms 588 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 196 ms 588 KB Output isn't correct
2 Halted 0 ms 0 KB -