답안 #959861

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
959861 2024-04-09T08:47:47 Z ramalzaher Bliskost (COI23_bliskost) C++14
0 / 100
1 ms 344 KB
#include <bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
using namespace std;
//typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update > ordered_set ;
#define int long long
#define F first
#define S second
#define rep(i , j , n ) for(int i = j ;i < n; i++ )
#define FOR(i , n ) rep(i ,0 , n )
#define sz size()
#define pb push_back
#define all(x) x.begin() , x.end()
#define vi vector<int>
#define yes cout<<"YES\n";
#define no cout<<"NO\n";
#define cans cout<<ans<<endl;
#define forx(i, x) for(auto i : x)
#define fast
#define pii pair<int ,int >
#define endl "\n"
#define sp ' '
const int N = 300 ;
const int inf = 1e15 ;
//int rec(int a , int b , int c, int d ){
//if(a+b+c+d == 0 )
//return 1 ;
//int ans = 0 ;
//if( ((a%2)^(2 * ( b%2 ) ) ^( 3 * (c%2 ) ) ^(4 * ( d%2 ) )) == 0   ) {
//ans = 1 ;
//}
// if(a)ans += rec(0 , b , c , d ) ;
// if(b)ans += rec(a , 0 , c , d ) ;
// if(c)ans += rec(a , b , 0 , d ) ;
// if(d)ans += rec(a , b , c , 0 ) ;
// return ans ;
//
//}

main()
{
int n  , q ; cin>> n >> q ;
string s  , s1  ;cin>> s >> s1 ;
FOR(i , n-1 ) {
    if(s1[i] > s[i]){
int temp = s1[i]-s[i] ;
    s[i]= char(s[i]+temp) ;
    s[i+1] = char(s[i+1]+temp) ;
    }else if(s1[i]!=s[i]){
        int temp = s[i]-s1[i] ;
    s[i] = char( (s[i]-temp) ) ;
    s[i+1] = char( ( s[i+1]-temp) )  ;


    }
//cout<<s<<endl;
}
//cout<<s<<endl ;
if(s==s1)cout<<"da\n"; else cout<<"ne\n";
    while (q--) {
        int p; char a; cin>>p>>a;
if(s==s1)cout<<"da\n"; else cout<<"ne\n";

    }


return 0 ;
}

Compilation message

Main.cpp:39:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   39 | main()
      | ^~~~
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 344 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 344 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 344 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 344 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 344 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 344 KB Output isn't correct
2 Halted 0 ms 0 KB -