답안 #363368

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
363368 2021-02-05T18:11:40 Z mosiashvililuka Cat (info1cup19_cat) C++14
3.75 / 100
379 ms 1132 KB
#include<bits/stdc++.h>
using namespace std;
int a,b,c,d,e,i,j,ii,jj,zx,xc,t,tes,f[200009],boo,pi,k[200009];
pair <int, int> p[3000009];
int main(){
	//ios_base::sync_with_stdio(false),cin.tie(0),cout.tie(0);
	//cin>>tes;
	scanf("%d\n",&tes);
	for(t=1; t<=tes; t++){
		//cin>>a;
		if(t!=tes) scanf("%d\n",&a); else scanf("%d",&a);
		for(i=1; i<=a; i++){
			//cin>>f[i];
			if(i==a) scanf("%d",&f[i]); else scanf("%d ",&f[i]);
		}
		
		boo=0;
		for(i=1; i<=a/2; i++){
			j=a-i+1;
			if(f[i]+f[j]!=a+1){
				boo=1;
				break;
			}
		}
		if(boo==0){
			printf("%d 0\n",a);
		}else{
			printf("-1\n");
		}
	}
	return 0;
}

Compilation message

cat.cpp: In function 'int main()':
cat.cpp:8:7: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
    8 |  scanf("%d\n",&tes);
      |  ~~~~~^~~~~~~~~~~~~
cat.cpp:11:19: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   11 |   if(t!=tes) scanf("%d\n",&a); else scanf("%d",&a);
      |              ~~~~~^~~~~~~~~~~
cat.cpp:11:42: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   11 |   if(t!=tes) scanf("%d\n",&a); else scanf("%d",&a);
      |                                     ~~~~~^~~~~~~~~
cat.cpp:14:18: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   14 |    if(i==a) scanf("%d",&f[i]); else scanf("%d ",&f[i]);
      |             ~~~~~^~~~~~~~~~~~
cat.cpp:14:42: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   14 |    if(i==a) scanf("%d",&f[i]); else scanf("%d ",&f[i]);
      |                                     ~~~~~^~~~~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Incorrect 5 ms 364 KB Wrong answer
# 결과 실행 시간 메모리 Grader output
1 Correct 21 ms 364 KB Correctly distinguished between possibility and impossibility
2 Correct 20 ms 364 KB Correctly distinguished between possibility and impossibility
# 결과 실행 시간 메모리 Grader output
1 Incorrect 5 ms 364 KB Wrong answer
# 결과 실행 시간 메모리 Grader output
1 Correct 21 ms 364 KB Correctly distinguished between possibility and impossibility
2 Correct 20 ms 364 KB Correctly distinguished between possibility and impossibility
3 Correct 374 ms 748 KB Correctly distinguished between possibility and impossibility
4 Correct 378 ms 1004 KB Correctly distinguished between possibility and impossibility
5 Correct 379 ms 1132 KB Correctly distinguished between possibility and impossibility
# 결과 실행 시간 메모리 Grader output
1 Incorrect 5 ms 364 KB Wrong answer