답안 #447043

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
447043 2021-07-24T09:47:52 Z dz001 마라톤 경주 (COCI14_utrka) C++11
80 / 80
49 ms 2508 KB
#include <bits/stdc++.h>
 
using namespace std;
 
#define pb push_back
#define fi first
#define se second
#define MOD 1000000007
 
typedef long long ll;

char ans[30];
int n;

signed main(){
	scanf("%d",&n);
	for(int i=0;i<n+n-1;++i){
		char s[30]; scanf("%s",&s);
		for(int j=0;j<strlen(s);++j)ans[j]^=s[j];
	}	
	printf("%s",ans);
	
#ifdef LOCAL
    cerr << "Time elapsed: " << 1.0 * clock() / CLOCKS_PER_SEC << "s.";
#endif
}

Compilation message

utrka.cpp: In function 'int main()':
utrka.cpp:18:23: warning: format '%s' expects argument of type 'char*', but argument 2 has type 'char (*)[30]' [-Wformat=]
   18 |   char s[30]; scanf("%s",&s);
      |                      ~^  ~~
      |                       |  |
      |                       |  char (*)[30]
      |                       char*
utrka.cpp:19:16: warning: comparison of integer expressions of different signedness: 'int' and 'size_t' {aka 'long unsigned int'} [-Wsign-compare]
   19 |   for(int j=0;j<strlen(s);++j)ans[j]^=s[j];
      |               ~^~~~~~~~~~
utrka.cpp:16:7: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   16 |  scanf("%d",&n);
      |  ~~~~~^~~~~~~~~
utrka.cpp:18:20: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   18 |   char s[30]; scanf("%s",&s);
      |               ~~~~~^~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 204 KB Output is correct
2 Correct 1 ms 292 KB Output is correct
3 Correct 1 ms 204 KB Output is correct
4 Correct 1 ms 204 KB Output is correct
5 Correct 1 ms 204 KB Output is correct
6 Correct 19 ms 1304 KB Output is correct
7 Correct 30 ms 1940 KB Output is correct
8 Correct 49 ms 2320 KB Output is correct
9 Correct 36 ms 2508 KB Output is correct
10 Correct 43 ms 2440 KB Output is correct