답안 #1010140

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1010140 2024-06-28T11:18:02 Z AliHasanli Palindromes (info1cup18_palindromes) C++17
100 / 100
292 ms 9884 KB
#include<bits/stdc++.h>
using namespace std;
long long n,d,ans;
bool check(int a)
{
    int b=a,c=0;
    while(b)c=c*10+b%10,b/=10;
    return c==a;
}
int main()
{
    scanf("%d",&n);
    while(n--)
        {cin>>d;ans+=check(d)*d;}
    cout<<ans;
}

Compilation message

palindromes.cpp: In function 'int main()':
palindromes.cpp:12:13: warning: format '%d' expects argument of type 'int*', but argument 2 has type 'long long int*' [-Wformat=]
   12 |     scanf("%d",&n);
      |            ~^  ~~
      |             |  |
      |             |  long long int*
      |             int*
      |            %lld
palindromes.cpp:12:10: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   12 |     scanf("%d",&n);
      |     ~~~~~^~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 348 KB Output is correct
2 Correct 4 ms 448 KB Output is correct
3 Correct 138 ms 5012 KB Output is correct
4 Correct 189 ms 7572 KB Output is correct
5 Correct 252 ms 9880 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 432 KB Output is correct
2 Correct 1 ms 348 KB Output is correct
3 Correct 49 ms 1620 KB Output is correct
4 Correct 106 ms 3212 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 432 KB Output is correct
2 Correct 1 ms 348 KB Output is correct
3 Correct 49 ms 1620 KB Output is correct
4 Correct 106 ms 3212 KB Output is correct
5 Correct 1 ms 348 KB Output is correct
6 Correct 3 ms 348 KB Output is correct
7 Correct 93 ms 3212 KB Output is correct
8 Correct 120 ms 3988 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 348 KB Output is correct
2 Correct 4 ms 448 KB Output is correct
3 Correct 138 ms 5012 KB Output is correct
4 Correct 189 ms 7572 KB Output is correct
5 Correct 252 ms 9880 KB Output is correct
6 Correct 1 ms 432 KB Output is correct
7 Correct 1 ms 348 KB Output is correct
8 Correct 49 ms 1620 KB Output is correct
9 Correct 106 ms 3212 KB Output is correct
10 Correct 1 ms 348 KB Output is correct
11 Correct 3 ms 348 KB Output is correct
12 Correct 93 ms 3212 KB Output is correct
13 Correct 120 ms 3988 KB Output is correct
14 Correct 0 ms 348 KB Output is correct
15 Correct 9 ms 716 KB Output is correct
16 Correct 106 ms 4180 KB Output is correct
17 Correct 222 ms 9040 KB Output is correct
18 Correct 245 ms 9868 KB Output is correct
19 Correct 292 ms 9884 KB Output is correct
20 Correct 284 ms 9884 KB Output is correct