제출 #741608

#제출 시각아이디문제언어결과실행 시간메모리
741608jongjipIntercastellar (JOI22_ho_t1)C11
35 / 100
2067 ms7212 KiB
#include <stdio.h> #define max(a, b) (((a)>(b))?(a):(b)) #define _CRT_SECURE_NO_WARNINGS #pragma warning(disable: 4996) unsigned long long a[1020406]; unsigned long long x[1020406]; unsigned long long aa[1020406]; int main() { int n,q,j; unsigned long long count = 0; scanf("%d", &n); for (int i = 0; i < n; i++) { scanf("%lld", &a[i]); } scanf("%d", &q); for (int i = 0; i < q; i++) { scanf("%lld", &x[i]); } for (int i = 0; i < n; i++) { unsigned long long temp = 1; aa[i] = 1; while (a[i] % 2 == 0) { a[i] = a[i] / 2; temp*=2; } count = count + temp; aa[i] = count; } for (int i = 0; i < q; i++) { j = 0; while (x[i] > aa[j]) { j++; } printf("%llu \n",a[j]); } }

컴파일 시 표준 에러 (stderr) 메시지

Main.c:5: warning: ignoring '#pragma warning ' [-Wunknown-pragmas]
    5 | #pragma warning(disable: 4996)
      | 
Main.c: In function 'main':
Main.c:14:5: warning: ignoring return value of 'scanf' declared with attribute 'warn_unused_result' [-Wunused-result]
   14 |     scanf("%d", &n);
      |     ^~~~~~~~~~~~~~~
Main.c:16:9: warning: ignoring return value of 'scanf' declared with attribute 'warn_unused_result' [-Wunused-result]
   16 |         scanf("%lld", &a[i]);
      |         ^~~~~~~~~~~~~~~~~~~~
Main.c:18:5: warning: ignoring return value of 'scanf' declared with attribute 'warn_unused_result' [-Wunused-result]
   18 |     scanf("%d", &q);
      |     ^~~~~~~~~~~~~~~
Main.c:20:9: warning: ignoring return value of 'scanf' declared with attribute 'warn_unused_result' [-Wunused-result]
   20 |         scanf("%lld", &x[i]);
      |         ^~~~~~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...