답안 #386962

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
386962 2021-04-07T16:56:14 Z FatihSolak Nuclearia (CEOI15_nuclearia) C++17
0 / 100
189 ms 876 KB
#include <bits/stdc++.h>
using namespace std;
int main(){
    #ifdef Local
    freopen("in.txt","r",stdin);
    freopen("out.txt","w",stdout);
    #endif
    bool swp = 0;
    int w,h;
    scanf("%d %d",&w,&h);
    if(w < h){
        swp = 1;
        swap(w,h);
    }
    long long arr[h+5][w+5];
    long long pre[h+5][w+5];
    /*
    for(int i=0;i<h+5;i++){
        for(int j = 0;j<2*h+w+5;j++){
            arr[i][j] = pre[i][j] = 0;
        }
    }*/    
    int n;
    scanf("%d ",&n);
    for(int i=0;i<n;i++){
        int x,y,a,b;
        scanf("%d %d %d %d",&x,&y,&a,&b);
        if(swp)swap(x,y);
        //x += 2*h;
        for(int i=1;i<=h;i++){
            /*
            int dif = abs(y-i);
            if(dif * b >= a)continue;
 
            arr[i][max(1,x-dif+1)] -= b;
            arr[i][max(1,x-((a+b-1)/b))] += b;
            arr[i][max(1,x-((a+b-1)/b))] += a - b*(x - max(1,x-((a+b-1)/b)) + 1);
            arr[i][max(1,x-((a+b-1)/b)) + 1] -= a - b*(x - max(1,x-((a+b-1)/b)) + 1);
 
            arr[i][min(w+2*h+1,x+dif+1)] -= b;
            arr[i][min(w+2*h+1,x+((a+b-1)/b)+1)] += b;
            arr[i][min(w+2*h+1,x+((a+b-1)/b))] += (b - a%b)%b;
            arr[i][min(w+2*h+1,x+((a+b-1)/b)+1)] -= (b - a%b)%b;*/
        }
    }
    /*
    for(int i=1;i<=h;i++){
        for(int j=1;j<=w+2*h;j++){
            arr[i][j] += arr[i][j-1];
        }
        for(int j=1;j<=w+2*h;j++){
            arr[i][j] += arr[i][j-1];
        }
    }
    for(int i=1;i<=h;i++){
        for(int j=2*h+1;j<=w+2*h;j++){
            pre[i][j] = pre[i-1][j] + pre[i][j-1] - pre[i-1][j-1]+arr[i][j];
        }
    }*/
    int q;
    scanf("%d",&q);
    while(q--){
        int x1,y1,x2,y2;
        scanf("%d %d %d %d",&x1,&y1,&x2,&y2);
        if(!swp)swap(x1,y1),swap(x2,y2);
        /*
        y1 += 2*h;
        y2 += 2*h;
        long double cnt = (x2-x1+1) * (y2 -y1+1);
        long long x = ((pre[x2][y2] - pre[x2][y1-1] - pre[x1 -1][y2] + pre[x1-1][y1-1])/cnt + 0.5);*/
        printf("%lld\n",0);
        
    }
}

Compilation message

nuclearia.cpp: In function 'int main()':
nuclearia.cpp:71:20: warning: format '%lld' expects argument of type 'long long int', but argument 2 has type 'int' [-Wformat=]
   71 |         printf("%lld\n",0);
      |                 ~~~^    ~
      |                    |    |
      |                    |    int
      |                    long long int
      |                 %d
nuclearia.cpp:15:15: warning: unused variable 'arr' [-Wunused-variable]
   15 |     long long arr[h+5][w+5];
      |               ^~~
nuclearia.cpp:16:15: warning: unused variable 'pre' [-Wunused-variable]
   16 |     long long pre[h+5][w+5];
      |               ^~~
nuclearia.cpp:10:10: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   10 |     scanf("%d %d",&w,&h);
      |     ~~~~~^~~~~~~~~~~~~~~
nuclearia.cpp:24:10: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   24 |     scanf("%d ",&n);
      |     ~~~~~^~~~~~~~~~
nuclearia.cpp:27:14: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   27 |         scanf("%d %d %d %d",&x,&y,&a,&b);
      |         ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
nuclearia.cpp:61:10: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   61 |     scanf("%d",&q);
      |     ~~~~~^~~~~~~~~
nuclearia.cpp:64:14: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   64 |         scanf("%d %d %d %d",&x1,&y1,&x2,&y2);
      |         ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 384 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 364 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 364 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 364 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 103 ms 876 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 95 ms 748 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 92 ms 736 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 99 ms 748 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 180 ms 748 KB Output isn't correct
# 결과 실행 시간 메모리 Grader output
1 Incorrect 177 ms 748 KB Output isn't correct
# 결과 실행 시간 메모리 Grader output
1 Incorrect 189 ms 748 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 169 ms 748 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 171 ms 752 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 163 ms 748 KB Output isn't correct
2 Halted 0 ms 0 KB -