제출 #947292

#제출 시각아이디문제언어결과실행 시간메모리
947292Mer123haba456Bliskost (COI23_bliskost)C++14
100 / 100
236 ms16656 KiB
#include<bits/stdc++.h>
using namespace std;
typedef long long int lli;
typedef long double ld;
#define N lli(2e6)
#define MOD lli(1e9 + 7)
#define fast_io ios_base::sync_with_stdio(0); cin.tie(0);
#define heps(v) v.begin(),v.end()
typedef vector<lli> vlli;
typedef pair<lli,lli> plli;
typedef pair<lli,plli> pplli;
typedef vector<plli> vplli;
typedef vector<pplli> vpplli;
typedef map<lli,lli> mlli;

lli t,n,m,k;

string str;

vector<char> bir, ik;

lli topl = 0;

void kont(){
    if(topl % 26 == 0)
        printf("da\n");
    else
        printf("ne\n");
}

int main(){
    scanf("%d %d", &n, &t);
    for(lli i = 0;i<n;i++){
        char c;
        scanf(" %c",&c);
        bir.push_back(c);
    }
    for(lli i = 0;i<n;i++){
        char c;
        scanf(" %c",&c);
        ik.push_back(c);
        if((n - i) & 1)
            topl += ik[i] - bir[i];
        else
            topl -= ik[i] - bir[i];
    }
    kont();
    while(t--){
        char c;
        scanf("%d %c", &m, &c);
        m--;
        if((n - m)&1){
            topl -= ik[m] - bir[m];
            topl += ik[m] - c;
        }else{
            topl += ik[m] - bir[m];
            topl -= ik[m] - c;
        }
        bir[m] = c;
        kont();
    }
    
}

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

Main.cpp: In function 'int main()':
Main.cpp:32:13: warning: format '%d' expects argument of type 'int*', but argument 2 has type 'lli*' {aka 'long long int*'} [-Wformat=]
   32 |     scanf("%d %d", &n, &t);
      |            ~^      ~~
      |             |      |
      |             int*   lli* {aka long long int*}
      |            %lld
Main.cpp:32:16: warning: format '%d' expects argument of type 'int*', but argument 3 has type 'lli*' {aka 'long long int*'} [-Wformat=]
   32 |     scanf("%d %d", &n, &t);
      |               ~^       ~~
      |                |       |
      |                int*    lli* {aka long long int*}
      |               %lld
Main.cpp:50:17: warning: format '%d' expects argument of type 'int*', but argument 2 has type 'lli*' {aka 'long long int*'} [-Wformat=]
   50 |         scanf("%d %c", &m, &c);
      |                ~^      ~~
      |                 |      |
      |                 int*   lli* {aka long long int*}
      |                %lld
Main.cpp:32:10: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   32 |     scanf("%d %d", &n, &t);
      |     ~~~~~^~~~~~~~~~~~~~~~~
Main.cpp:35:14: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   35 |         scanf(" %c",&c);
      |         ~~~~~^~~~~~~~~~
Main.cpp:40:14: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   40 |         scanf(" %c",&c);
      |         ~~~~~^~~~~~~~~~
Main.cpp:50:14: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   50 |         scanf("%d %c", &m, &c);
      |         ~~~~~^~~~~~~~~~~~~~~~~
#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...
#Verdict Execution timeMemoryGrader output
Fetching results...