제출 #104344

#제출 시각아이디문제언어결과실행 시간메모리
104344FashoZamjena (COCI18_zamjena)C++14
14 / 70
6 ms512 KiB
#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,ar[N],sum,k,mark[N]; int tut[N]; char s[N]; bool check() { for(int i=0;i<26;i++) { char a='a'+i; if(s[1]==a) return 0; } return 1; } ll f() { ll top=0; for(int i=1;i<=strlen(s+1);i++) { top=top*10; top+=s[i]-'0'; } return top; } int main() { fast; cin>>n; // for(int i=0;i<26;i++) // { // char a='a'+i; // cout<<a<<sp; // if(s[i]==a) // return 0; // } // cout<<endl; int flag=0; for(int i=1;i<=n;i++) { cin>>s+1; // cout<<check()<<sp; if(check()) mark[i]=f(); } // cout<<endl; fo(i,1,n) { cin>>s+1; // cout<<check()<<sp; if(check() && mark[i] && mark[i]!=f()) flag=1; } if(flag) cout<<"NE"; else cout<<"DA"; // int x='a'; // cout<<x; }

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

zamjena.cpp: In function 'long long int f()':
zamjena.cpp:41:15: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  for(int i=1;i<=strlen(s+1);i++)
              ~^~~~~~~~~~~~~
zamjena.cpp: In function 'int main()':
zamjena.cpp:64:9: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
   cin>>s+1;
        ~^~
zamjena.cpp:72:9: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
   cin>>s+1;
        ~^~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...