Code Submission Evaluation System Login

HIIT Open 2018

Start:2018-05-26 11:00:00
End:2018-05-26 16:00:00
 

Tasks | Messages | Scoreboard | Statistics


CSES - HIIT Open 2018 - Results
History
2018-05-26 15:59:55
2018-05-26 15:59:35
2018-05-26 15:58:39
2018-05-26 15:58:18
2018-05-26 15:57:50
2018-05-26 15:56:41
2018-05-26 15:56:20
2018-05-26 15:55:33
2018-05-26 15:55:21
2018-05-26 15:54:56
2018-05-26 15:54:14
2018-05-26 15:53:49
2018-05-26 15:53:22
2018-05-26 15:53:02
2018-05-26 15:52:35
2018-05-26 15:52:14
2018-05-26 15:51:30
2018-05-26 15:50:43
2018-05-26 15:49:21
2018-05-26 15:48:47
2018-05-26 15:48:17
2018-05-26 15:47:53
2018-05-26 15:47:26
2018-05-26 15:46:54
2018-05-26 15:46:05
2018-05-26 15:45:39
2018-05-26 15:45:21
2018-05-26 15:44:18
2018-05-26 15:42:24
2018-05-26 15:41:47
2018-05-26 15:41:23
2018-05-26 15:40:59
2018-05-26 15:40:26
2018-05-26 15:40:02
2018-05-26 15:39:26
2018-05-26 15:37:15
2018-05-26 15:28:04
Task:Euclidean Geometry
Sender:Puhi~
Submission time:2018-05-26 15:59:55
Language:C++
Status:READY
Result:RUNTIME ERROR

Test results

testverdicttime (s)
#1RUNTIME ERROR0.07 / 1.00details
#2WRONG ANSWER0.59 / 1.00details
#3WRONG ANSWER0.64 / 1.00details
#4RUNTIME ERROR0.34 / 1.00details
#5RUNTIME ERROR0.29 / 1.00details
#6WRONG ANSWER0.63 / 1.00details
#7WRONG ANSWER0.62 / 1.00details
#8RUNTIME ERROR0.30 / 1.00details

Compiler report

input/code.cpp: In function 'void solvaa()':
input/code.cpp:74:27: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
         for (int i = 0; i < normals.size(); i++) {
                         ~~^~~~~~~~~~~~~~~~
input/code.cpp:85:19: warning: division by zero [-Wdiv-by-zero]
         cout << 1 / 0;
                 ~~^~~

Code

#include <iostream>
#include <vector>
#include <cmath>

using namespace std;


bool image[110][110];

bool is_edge(int ox, int oy) {
    if (!image[ox][oy]) {
        return false;
    }
    
    for (int x = -1; x <= 1; x++) {
        for (int y = -1; y <= 1; y++) {
            if (!image[ox+x][oy+y]) { return true; }
        }
    }
    
    return false;
}

float normal(int ox, int oy) {
    
    float dx = 0;
    float dy = 0;
    
    for (int x = -4; x <= 4; x++) {
        for (int y = -4; y <= 4; y++) {
            if (x == 0 && y == 0) {continue;}
            if (image[ox+x][oy+y]) {
                float l = sqrt(x*x + y*y);
                if (l > 4) { continue; }
                float nx = x / l;
                float ny = y / l;
                dx += nx;
                dy += ny;
            }
        }
    }
    //cout << dy << ' ' << dx << endl;
    //cout << dy << ' ' << dx << ' ' << atan2(dy, dx) << endl;
    return atan2(dy, dx);
}

void solvaa() {
    for (int x = 0; x < 100; x++) {
        for (int y = 0; y < 100; y++) {
            char tmp;
            cin >> tmp;
            image[x+5][y+5] = ('1' == tmp);
        }
    }
    
    vector<float> normals;
    
    for (int x = 0; x < 100; x++) {
        for (int y = 0; y < 100; y++) {
            if (is_edge(x+5, y+5)) {
                normals.push_back(normal(x+5,y+5));
            }
        }
    }
    
    int sivut = 0;
    
    float pi = 3.141592;

    float vs = 0.01;
    
    for (float dir = -3*pi; dir < 3*pi; dir += vs/10) {
        int count = 0;
        for (int i = 0; i < normals.size(); i++) {
            if(abs(dir-normals[i]) < vs/2) { count++; }
        }
        
        if (count > 10) {
            sivut++;
            dir += 0.4;
        }
    }
    
    if(sivut > 4){
        cout << 1 / 0;
    }
    
    /*if(sivut < 3){
        cout << *(int*)0;
    }*/
    
    cout << sivut << endl;
}

int main() {
    int t;
    cin >> t;
    for (int i = 0; i < t; i++) {
        solvaa();
    }
}

Test details

Test 1

Verdict: RUNTIME ERROR

input
100
000000000000000000000000000000...
000000000000000000000000000000...
000000000000000000000000000000...
000000000000000000000000000000...
000000000000000000000000000000...
000000000000000000000000000000...
000000000000000000000000000000...
000000000000000000000000000000...
000000000000000000000000000000...
000000000000000000000000000000...
view   save

correct output
3
3
3
3
4
4
4
4
3
4
4
3
3
4
4
4
3
4
3
4
...
view   save

user output
2
3
1
3
4
4
3
4
3
view   save

Test 2

Verdict: WRONG ANSWER

input
100
000000000000000000000000000000...
000000000000000000000000000000...
000000000000000000000000000000...
000000000000000000000000000000...
000000000000000000000000000000...
000000000000000000000000000000...
000000000000000000000000000000...
000000000000000000000000000000...
000000000000000000000000000000...
000000000000000000000000000000...
view   save

correct output
3
4
4
4
3
3
3
4
3
4
4
4
3
3
3
4
4
4
3
4
...
view   save

user output
1
3
4
4
2
3
3
3
3
4
4
4
3
3
3
4
3
4
2
4
...
view   save

Test 3

Verdict: WRONG ANSWER

input
100
000000000000000000000000000000...
000000000000000000000000000000...
000000000000000000000000000000...
000000000000000000000000000000...
000000000000000000000000000000...
000000000000000000000000000000...
000000000000000000000000000000...
000000000000000000000000000000...
000000000000000000000000000000...
000000000000000000000000000000...
view   save

correct output
3
3
3
3
4
3
3
4
4
3
4
4
3
4
3
3
3
4
4
3
...
view   save

user output
3
3
3
3
4
3
3
4
4
3
3
3
3
4
3
2
3
3
3
3
...
view   save

Test 4

Verdict: RUNTIME ERROR

input
100
000000000000000000000000000000...
000000000000000000000000000000...
000000000000000000000000000000...
000000000000000000000000000000...
000000000000000000000000000000...
000000000000000000000000000000...
000000000000000000000000000000...
000000000000000000000000000000...
000000000000000000000000000000...
000000000000000000000000000000...
view   save

correct output
3
3
3
4
3
4
4
4
3
3
3
4
4
4
4
3
3
3
4
3
...
view   save

user output
3
3
3
3
3
3
3
4
2
3
3
4
4
4
4
3
3
3
4
3
...
view   save

Test 5

Verdict: RUNTIME ERROR

input
100
000000000000000000000000000000...
000000000000000000000000000000...
000000000000000000000000000000...
000000000000000000000000000000...
000000000000000000000000000000...
000000000000000000000000000000...
000000000000000000000000000000...
000000000000000000000000000000...
000000000000000000000000000000...
000000000000000000000000000000...
view   save

correct output
3
4
3
3
4
3
3
4
3
3
4
4
4
3
3
4
4
3
4
4
...
view   save

user output
3
4
0
3
4
3
3
4
3
3
4
3
3
3
3
4
4
3
4
4
...
view   save

Test 6

Verdict: WRONG ANSWER

input
100
000000000000000000000000000000...
000000000000000000000000000000...
000000000000000000000000000000...
000000000000000000000000000000...
000000000000000000000000000000...
000000000000000000000000000000...
000000000000000000000000000000...
000000000000000000000000000000...
000000000000000000000000000000...
000000000000000000000000000000...
view   save

correct output
4
3
4
4
4
3
4
4
3
3
4
3
3
4
4
3
4
3
4
3
...
view   save

user output
4
3
3
4
4
1
4
4
3
3
4
3
4
4
4
3
4
3
4
3
...
view   save

Test 7

Verdict: WRONG ANSWER

input
100
000000000000000000000000000000...
000000000000000000000000000000...
000000000000000000000000000000...
000000000000000000000000000000...
000000000000000000000000000000...
000000000000000000000000000000...
000000000000000000000000000000...
000000000000000000000000001000...
000000000000000000000000001110...
000000000000000000000000001111...
view   save

correct output
4
4
3
3
3
3
3
3
3
3
3
3
3
3
3
4
3
4
4
3
...
view   save

user output
4
4
3
3
3
1
3
3
3
3
3
2
3
3
3
4
3
2
4
3
...
view   save

Test 8

Verdict: RUNTIME ERROR

input
100
000000000000000000000000000000...
000000000000000000000000000000...
000000000000000000000000000000...
000000000000000000000000000000...
000000000000000000000000000000...
000000000000000000000000000000...
000000000000000000000000000000...
000000000000000000000000000000...
000000000000000000000000000000...
000000000000000000000000000000...
view   save

correct output
3
3
3
3
3
4
3
4
4
4
3
3
3
4
3
3
4
3
3
3
...
view   save

user output
3
3
3
3
3
4
3
4
4
4
3
3
3
3
3
3
4
3
2
3
...
view   save