답안 #106609

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
106609 2019-04-19T08:34:05 Z Fasho Zamjena (COCI18_zamjena) C++14
14 / 70
3 ms 612 KB
#include <bits/stdc++.h>
#define N 1000005
#define ll long long int 	
#define MP make_pair
#define pb push_back
#define ppb pop_back
#define sp " "
#define endl "\n"
#define fi first
#define se second
#define ii pair<int,int>
#define lli pair<ll,ll>
#define fast cin.tie(0);cout.tie(0);ios_base::sync_with_stdio(false)
#define fast2 freopen ("myfile.in","r",stdin);freopen ("myfile.out","w",stdout);
#define mod 1000000007
#define fs(x,y) for(int i=1;i<=y;i++) cin>>x[i]
#define fo(i,x,y) for(int i=x;i<=y;i++)
using namespace std;

ll n,m,a[N],b[N],sum,k;

char s[N];

ll check(char a)
{
	if(a<='z' && a>='a')
		return -1;
	else
		return a-'0';
}

int main()
{
	fast;
	cin>>n;
	fo(i,1,n)
	{
		cin>>s+1;
		a[i]=check(s[1]);
	}
	fo(i,1,n)
	{
		cin>>s+1;
		b[i]=check(s[1]);
		if(b[i]>-1 && a[i]>-1 && b[i]!=a[i])
			k=1;
	}
	// fo(i,1,n)
	// 	cout<<a[i]<<sp;
	// 	cout<<endl;
	// fo(i,1,n)
	// 	cout<<b[i]<<sp;
	// 	cout<<endl;
	if(k)
		cout<<"NE";
	else
	cout<<"DA";

}

Compilation message

zamjena.cpp: In function 'int main()':
zamjena.cpp:38:9: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
   cin>>s+1;
        ~^~
zamjena.cpp:43:9: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
   cin>>s+1;
        ~^~
# 결과 실행 시간 메모리 Grader output
1 Correct 3 ms 384 KB Output is correct
2 Correct 3 ms 384 KB Output is correct
3 Correct 2 ms 384 KB Output is correct
4 Correct 2 ms 384 KB Output is correct
5 Correct 3 ms 512 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 384 KB Output is correct
2 Incorrect 3 ms 384 KB Output isn't correct
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 3 ms 384 KB Output is correct
2 Correct 2 ms 384 KB Output is correct
3 Incorrect 2 ms 384 KB Output isn't correct
4 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 384 KB Output is correct
2 Correct 3 ms 384 KB Output is correct
3 Incorrect 3 ms 512 KB Output isn't correct
4 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 3 ms 612 KB Output isn't correct
2 Halted 0 ms 0 KB -